Numerical Solution of Ordinary
Differential Equations
Runge-Kutta Method
Numerical Computation
Class: BCS-7 (A, B, C, D)
Instructor: Dr. Tayyab Mahmood
Recall
To describe various numerical methods for the solution of ordinary differential
equations, we consider the general first order differential equation
dy
f ( x, y ),
dx
with initial condition
y ( x0 ) y0
and illustrate the theory with respect to this equation. The methods so developed can, in
general, be applied to the solution of systems of first-order equations, and will yield the
solution in one of the two forms:
i. A series for y in terms of powers of x, from which the value of y can be obtained by
direct substitution.
ii. A set of tabulated values of x and y.
The methods of Taylor and Picard belong to class (i), whereas those of Euler, Runge—Kutta,
etc., belong to class (ii)
(i) Taylor’s Series Method
We consider the differential equation
dy
f ( x, y ), y ( x0 ) y0
dx
If y(x) is the exact solution of above equation, then the Taylor's series for y(x) around x x0
is given by
( x x0 ) 2 '' ( x x0 )3 '''
y ( x) y ( x0 ) ( x x0 ) y ' ( x0 ) y ( x0 ) y ( x0 )
2! 3!
( x x0 ) 4 ( iv )
y ( x0 ) ...
4!
(ii) Picard’s Method of Successive Approximation
We consider the differential equation
dy
f ( x, y ), y ( x0 ) y0
dx
By integrating the above differential equation, we have found successive approximation
formula for n=0, 1, 2, 3…….
x
y ( n ) y0 f ( x, y ( n 1) )dx with y ( x0 ) y0 .
x0
(iii) Euler Method
We consider the differential equation
dy
f (t , y ), y (t0 ) y0
dt
Thus. we obtain in general, the solution of the given differential in the form of recurrence
relation
𝑦 = 𝑦 + ℎ𝑓(𝑡 , 𝑦 )
(iv) Modified Euler Method
Instead of approximating 𝑓(𝑡, 𝑦) by 𝑓(𝑡 , 𝑦 ), we now approximate the integral by means of
trapezoidal rule to obtain
( )
𝑓(𝑡 , 𝑦 ) + 𝑓 𝑡 , 𝑦
𝑦 =𝑦 +ℎ
2
We thus obtain the iteration formula
( )
𝑓(𝑡 , 𝑦 ) + 𝑓 𝑡 ,𝑦
𝑦 =𝑦 +ℎ
2
This is modified Euler’s method.
Runge-Kutta Method