You are on page 1of 5

CHAPTER 6

Numerical Methods for Ordinary Differential Equations


Numerical methods are becoming more and more important in engineering applications, simply
because of the difficulties encountered in finding exact analytical solutions but also, because of
the ease with which numerical techniques can be used in conjunction with modern high-speed
digital computers. Any ordinary differential equation can be replaced by a system of first-order
differential equations (which involve only first derivatives). It is described by
( ) ……………………….…………. (1)
The general solution of Eq. (1) can be obtained in two forms:
1. the values of y as a power series in independent variable x
2. as a set of tabulated values of x and y.
There are two categories of methods to solve ordinary differential equations:
1. One-step methods or single-step methods.
2. Step-by-step methods or marching methods.
Among the step-by-step methods or the single methods: Euler’s method, modified Euler’s
method, and Runge-Kutta methods of order two and four.

6.1 Euler’s Method

Consider the equation ( ) ( ) ( )

Let ( ) be the solution of ( )

Let ( ) ( ) ( ) …… be equidistant values of

In small interval, a curve is nearly a straight line; it is used in Euler’s Method.

Then equation of tangent line at ( ) is

( ) ( )

( )( ) ( ) * ( )+

This gives the - coordinate of any point on the tangent. Since the curve is approximated by the
tangent in the interval ( ) the value of on the curve corresponding to is given by
the value of in ( ) above.

Putting in (2), we have

( )

Similarly we can approximate the curve in the next interval ( ) by

1
( )

Repeating this process, we get

( )

( )

Example: Find an approximate value of at using Euler’s Method for


( ) ,

Solution: Since ,( ) and the initial condition is ( )

Taking , we get

Using the above formula we get

( ) ( ) ( )

( )

( ) ( ) ( )

( )

( ) ( ) ( )

( )

( ) ( ) ( )

( )

( ) ( ) ( )

Thus ( )

Exercises

1. Using Euler’s method, solve at from , ( ) ,take


Answer ( )
2. Using Euler’s method, solve at from , ( ) ,take
Answer ( )

2
6.2 Runge-Kutta Methods
Runge-Kutta (RK) methods achieve the accuracy of a Taylor series approach without
requiring the calculation of higher derivatives. Various types of Runge-Kutta methods are
classified according to their order. Those methods are particularly suitable incases when the
computation of higher order derivatives is difficult.
(i) Runge-Kutta Method of Order Two
In the Runge-Kutta method of order two, we consider up to the second derivative term in the
Taylor series expansion and then substitute the derivative terms with the appropriate function
values in the interval

For ( ) ( ) and interval length

The solution of first order differential equation is given by

[( ) ( ( ))]

If we set ( )

( )
Then [ ]

In general

[( ) ( ( ))] [ ]

Where ( ) and ( )

Example1: Use the second-order Runge-Kutta method with h = 0.1 to find 1, y2, for

( ) (Keep four decimal places in the calculations)

Solution: Given ( ) ( )

Using Second order Runge-Kutta method with h = 0.1, we have


( ) ( ) ( )

( ) ( ) ( )

( ) ( ) [ ] [ ]

( )
To find ( ) ( )

( ) ( ) ( )
3
( ) ( ) ( )

( ) ( ) [ ] [ ]

( ) ( )
Proceeding in this manner, show that

( ) ( )
( ) ( )

Exercise: Use the second-order Runge-Kutta method with h = 0.2, to find and for

( )

(ii) Runge-Kutta Method of Order Four


In the classical Runge-Kutta method of order four, the derivatives are evaluated at four points.
The local truncation error in the classical Runge-Kutta method of order four is O(h5).This
method gives a better accurate solution compared to second-order Runge-Kutta method,and is
given by
( )

where ( )

( )

( ) and ( )

For instance ( ) [ ]

Where ( )

( )

( )

( )

Example: Using Runge-Kutta Method of order four, solve ( ) for ,


take

Solution: Here ( ) and

4
First Iteration

( ) ( )

( ) ( )

( ) ( )

( ) ( )

( ) ( ) [ ]

[ ( ) ( ) ]

( )
Second Iteration

( ) ( )

( ) ( )

( ) ( )

( ) ( )

[ ]

[ ( ) ( ) ]

Exercise: Using fourth order Runge-Kutta Method compute ( ) and ( ) if

( )

You might also like