Professional Documents
Culture Documents
Numerical Solution of Ordinary DE
Numerical Solution of Ordinary DE
Numerical Solution of Ordinary DE
A number of numerical methods are available for the solution of 1st order differential equations of the form
Working rule of some methods to find the value of y for some values of x, where
1. Euler’s Method
yn yn1 hf x 0 n 1h, yn1 , n 1, 2, 3,...
dy dy
i.e. new y = old y + h . as f x , y given
dx dx
2. Modified Euler’s Method
new y = old y + hmean slope , [mean slope is explained in the example 2.]
Example 1. Using Euler’s Method, find an approximate value of y corresponding to x = 1, given that
dy
x y and y 1 when x 0 .
dx
Solution : We take n = 10 so that h = 0.1 [ If n is not given, you have to take the value of n in such a way that h
is very small ].
x y dy
xy dy
old y + h = new y
dx dx
1.0 3.18
dy y x
Exercise : Given that with initial condition y = 1 for x = 0. Find y for x =0.1 by Euler’s Method.
dx y x
Example 2. Using modified Euler’s Method, find an approximate value of y when x = 0.3, given that
dy
x y and y 1 when x 0 .
dx
Note : Modified Euler’s Method gives us better result(less error) than Euler’s Method.
Exercise : Using modified Euler’s Method, find an approximate value of y(0.4) [ i.e. y when x = 0.4], given that
Example 3. Apply Runge-Kutta method of fourth order to find an approximate value of y for x = 0.2 taking
dy
steps of 0.1, if x y2 , given that y = 1 when x = 0.
dx
Step 1. x0 = 0, y0 = 1, h = 0.1
Exercise :
dy y2 x2
1. Apply Runge-Kutta method of fourth order solve with y0 1 at x = 0.2, 0.4
dx y2 x2
[Ans- y(0.2) = 1.196 and y(0.4) = 1.3752.]
dy 2xy ex
2. Using Runge-Kutta method of fourth order solve for y at x= 1.2 and 1.4 from , given x0 = 1, y0
dx x 2 xex
=0. [Ans- y(1.2) = 0.1402 and y(1.4) = 0.2705.]
[Note : If in the question order is not given, you should follow Runge-Kutta method of fourth order.]