Professional Documents
Culture Documents
Unit VIII (Part B) Numerical Solutions For ODEs
Unit VIII (Part B) Numerical Solutions For ODEs
Many engineering problems can be modelled as ordinary differential equations. The solution of
these equations using numerical techniques is an important subject matter.
A simple ordinary differential equation
f l ( x , y) f ( x, y) k
d
Where f l ( x , y) f ( x, y )
dx
Example 1: f l ( x , y) 2e 2 x
The complete solution of this differential equation is
f ( x, y) e 2 x
Fig. 1 shows the plot of this.
0.8
0.6
0.4
0.2
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 1.1 1.2 1.3
One can solve this ODE using numerical techniques. One needs to keep in mind that numerical
solutions produce approximate solutions. There is always an error between true value and the
value computed through numerical methods.
The numerical methods used to solve ODEs are commonly referred Runge-Kutta Methods or RK
Methods. The various RK methods are
(i) RK Method of order 1
(ii) RK Method of order 2
(iii) RK Method of Order 3
Page | 1
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
f ( x0 h, y0 h) f ( x0 , y0 ) h f l ( x0 , y0 )
f l (x0 , y0) is the value of derivative at (x0 , y0)
Once f( x0+h, y0+h) is known one can compute f( x0+2h, y0+2h) as
f ( x0 2h, y0 2h) f ( x0 h, y0 h) h f l ( x0 h, y0 h)
Once f( x0+2h, y0+2h) is known we determine next value f( x0+3h, y0+3h) as
And f (1.2,1.2) f (0.8, 0.8) 0.4 f l (0.8, 0.8) 0.1596 0.4(0.4037 ) 0.3211
Page | 2
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
And f (0.8,0.8) f (0.6, 0.6) 0.2 f l (0.6, 0.6) 0.1521 0.2(0.6024) 0.03162
Now f l (0.8, 0.8) 2e 2(0.8) 2(0.2019) 0.4038
Page | 3
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
And f (0.3, 0.3) f (0.2, 0.2) 0.1 f / (0.2, 0.2) 0.6363 0.1(1.3406) 0.5022
And f (0.4, 0.4) f (0.3, 0.3) 0.1 f / (0.3, 0.3) 0.5022 0.1(1.0976) 0.3905
And f (0.5, 0.5) f (0.4, 0.4) 0.1 f / (0.4, 0.4) 0.3905 0.1(0.8986) 0.3006
And f (0.6,0.6) f (0.5, 0.5) 0.1 f / (0.5, 0.5) 0.3006 0.1(0.7358) 0.2270
And f (0.7, 0.7) f (0.6, 0.6) 0.1 f / (0.6, 0.6) 0.2270 0.1(0.6024) 0.1668
And f (0.8, 0.8) f (0.7, 0.7) 0.1 f / (0.7, 0.7) 0.1668 0.1(0.4932) 0.1175
Now f l (0.8, 0.8) 2e 2( 0.8) 2(0.2019) 0.4038
And f (0.9,0.9) f (0.8, 0.8) 0.1 f / (0.8, 0.8) 0.1175 0.1(0.4038) 0.07712
Page | 4
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
0.8
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5
-0.2
-0.4
-0.6
Page | 5
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
START
Set counter I =1
x =x0 y= y0
Compute f l ( x, y)
No Is I=n Yes
Stop
End
Page | 6
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
Page | 7
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
1 1
K 2 f l 0.8 (0.4) , 0.8 (0.4038)(0.4)
2 2
K 2 f l 1, 0.7192 2e 2(1) 2(0.1353) 0.2706
Page | 8
Unit VIII (Part B) Numerical Solutions of Ordinary Differential Equations
(Q.1) Explain the RK method of order 1. Write the algorithm and flow chart for this method.
(Q.2) Write algorithm, flowchart and computer program for RK methods of order 2, order 3 and
Orderv4.
(Q.3) Compute the solution of following ordinary differential equations.
5
(i) f l ( x, y ) 5e 2 x 0 f (0, 0) h 0.2
2
(ii) f l ( x, y) 4e 2 x 3 f (0, 0) 2 h 0.1
(iii) f l ( x, y) Sin 2 x ; where f(0,0)= -1 and h=π/4 rad
Page | 9