//************************************************************************** //function is f(x)=0.2xy //f(1)=1. //h = b-a/n, (1.0-1.5)/100 //Programmer: David R. Soto, //Dated: April 15, IRS day, 1995 //Approximation of f(1.5) for the solution of f'(x)=0.2xy, f(1)=1 //Euler method using h=0.1, k.a. method of tangent lines. //************************************************************************************************************* //#include #include //Preprocessor directive for cout output int n=500; //we can change the width of the intervals easier by placing the // n so that we have global scope. double a=1.0, b=1.5; // the with of our x-axis will be 0.5. double x1 = 1.0; //here, we declare and initialize X. double y1 = 1.0; // This is the initial value of the function. double func(double x, double y);//This is a function prototype, It is declared before the main // and used below. The procedure follows the main. //************************************the program enters main()**************************************** main() { float h; //Declaration of local variable of //type float used to hold the width h. h=(b-a)/n; printf("\n\nDemonstration of Euler method, used to calculate the approximation to some Func\n"); printf("the function is now changed to f(x)=0.2xy, and f(1)=1.\n"); printf("The interval size is:%16.10f\n", h); // cout<<"\n\nDemonstration of Euler method, used to calculate the approximation to\n"; // cout<<"the function is now changed to f(x)=0.2xy, and f(1)=1.\n"; // cout<< "The interval size is:" << h <