Scilab 1.1
Scilab 1.1
--> // Tutorial 8
--> y = 1;
-->
-->
--> y = 0;
-->
-->
--> //Q3.Using Taylor series, compute approximate value of y(0.1) for, dy/dx= x^2 + y, y(0)=1, Up to terms containing third order.
--> x0 = 0;
--> y0 = 1;
--> x = 0.1;
--> y3 = 2 + y2;
1.1055
-->
-->
--> //Q4.Apply Taylor series method up to 3rd order to solve dy/dx= x+y ,y(0)=2 Compute y(0.1).
--> //By Taylor Series Method for dy/dx = x + y , y(0) = 2
--> x0 = 0;
--> y0 = 2;
--> x = 0.1;
--> y1 = 0 + y0;
--> y2 = 1 + y1;
--> y3 = y2;
--> disp("The approximate value of y(0.1) upto 3rd order is :") ; disp(y_approx )
2.2155000
-->
-->
--> //Q5.Use Euler’s method with step size ℎ=0.1 to approximate solution of,dy/dx=x+y, y(0)=1,From x=0 to x=0.5.
--> x0 = 0;
--> y0 = 1;
--> h = 0.1;
--> n = 5;
> end
"0 1"
"0.1 1.1"
"0.2 1.22"
"0.3 1.362"
"0.4 1.5282"
"0.5 1.72102"
-->
-->
--> //Q6.Solve the following using Euler’s method with h=0.2 dy/dx = y−x,y(0)=2 Compute y(0.2) and y(0.4).
--> x = 0;
--> y = 2;
--> h = 0.2;
"0 2"
"0.2 2.4"
"0.4 2.92"
-->
-->
--> //Q7.Apply Runge-Kutta method to solve dy/dx=x+y, y(0)=1 Compute y(0.1) using step size ℎ = 0.1.
-->
--> y = 1;
--> h = 0.1;
-->
--> x_next = x + h;
1.1103417