/* prog6a.c -- Solve First Order ODE by RK2 Method Written Apr 19, 2001 by Eric Olson for Mathematics 483 For information see Section 4.4 in Numerical Analysis for Applied Mathematics, Science, and Engineering, by Greenspan and Casulli */ #include #include inline double F(double x,double y){ return y*sin(x); } inline double Y(double x){ return exp(1.0-cos(x)); } double RK2(double x0,double y,double xn,int n){ double h=(xn-x0)/n; int i; for(i=0;i