RUNGE-KUTTA 4th ORDER METHOD

INTERACTIVE E-BOOK

Ordinary Differential Equations

MAJOR

GENERAL

 On non Internet Explorer browsers, the equations may not show up.

As an alternative or if you prefer,

you can see the pdf version of the ebook instead

Title

An interactive e-book for illustrating Runge-Kutta 4th Order Method of solving ordinary differential equations

Creator

Autar K Kaw

Subject and Keywords

Runge-Kutta 4th Order Method, Ordinary Differential Equations, Mathcad, Maple, Mathematica, Matlab, Simulations.

Description

This is an interactive E-book for illustrating Runge-Kutta 4th Order Method for solving ordinary differential equations.  It includes links to examples, simulations in Mathcad, Maple, Mathematica, and Matlab for the algorithm, convergence, and a PowerPoint presentation.

Publisher

Holistic Numerical Methods Institute,

College of Engineering,

University of South Florida, Tampa, FL 33620-5350.

Contributors

Autar Kaw

Format

Text/HTML

Last Revised

May 4, 2006

Identifier

http://numericalmethods.eng.usf.edu/ebooks/runge4th_08ode_ebook.pdf

Language

English

Rights

http://numericalmethods.eng.usf.edu/rights.htm

 

Table of Contents

Background

           What are ordinary differential equations?          

           A Primer on Ordinary Differential Equations

           Runge-Kutta 4th Order Method for Ordinary Differential Equations

           PowerPoint presentation

Examples

            Example 1:  First order differential equation rewritten in dy/dx=f(x,y) form

            Example 2:  First order differential equation rewritten in dy/dx=f(x,y) form                               

            Example 3:  Heat Transfer Problem Solved Using Runge-Kutta 4th Order Method

Simulations

           Method [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

           Convergence [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

Multiple Choice Test

           Test your knowledge of Runge-Kutta 4th order method [HTML] [PDF] [DOC]

 

Back to TOC

Background

This is an example of how an instructor of a Numerical Methods course can develop an E-book on a single topic by using resources that are only available at the Holistic Numerical Methods Institute (HNMI) Website.

Although one of the primary advantages of a web-based resource is that one can use documents outside of its own domain, we are particularly using this example as a way to illustrate the holistic nature of the resources available at HNMI.   You are welcome to modify and edit this e-book to suit your purpose.

Using the textbook document written in MS Word 2000 as a foundation, it was made interactive within MS Word 2000 by putting bookmarks and hyperlinks to background information, PowerPoint presentations, Mathcad simulations, historical anecdotes, multiple choice tests, problem sets, etc.   Then the MS Word 2000 file was saved as a webpage and that is what you are about to read here.

 

 

Back to TOC

Runge-Kutta 4th Order Method for Ordinary Differential Equations

 

Runge-Kutta 4th order method is a numerical technique to solve ordinary differential equation of the form

           

So only first order ordinary differential equations can be solved by using Runge-Kutta 4th order method.  In other sections, we have discussed how Euler and Runge-Kutta methods are used to solve higher order ordinary differential equations or coupled (simultaneous) differential equations.

            How does one write a first order differential equation in the above form?

 

Back to TOC

Example 1

           

is rewritten as

           

In this case

           

Another example is given as follows

 

Back to TOC

Example 2

           

is rewritten as

           

In this case

           

Runge-Kutta 4th order method is based on the following

                                                                         (1)

where knowing the value of  at , we can find the value of y=yi+1 at , and

           

Equation (1) is equated to the first five terms of Taylor series

              (2)

Knowing that   and

                        (3)

Based on equating Equation (2) and Equation (3), one of the popular solutions used is

                                                                            (4)

                                                                                                              (5a)

                                                                                       (5b)

                                                                                       (5c)

                                                                                               (5d)

 

Simulation of Runge-Kutta 4th Order Method [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

Convergence of Runge-Kutta 4th Order Method [MAPLE] [MATHCAD] [MATHEMATICA] [MATLAB]

 

Back to TOC

Example 3

A ball at 1200K is allowed to cool down in air at an ambient temperature of 300K.  Assuming heat is lost only due to radiation, the differential equation for the temperature of the ball is given by

             

Find the temperature at  seconds using Runge-Kutta 4th order method.  Assume a step size of   seconds.

Solution

           

           

           

            For , ,

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

 is the approximate temperature at

           

           

For

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

           

 is the approximate temperature at

            =

           

Figure 1 compares the exact solution with the numerical solution using Runge-Kutta 4th order method step size of h=240.

 

 

 

 

Figure 1. Comparison of Runge-Kutta 4th order method with exact solution   for different step sizes

 

Table 1 and Figure 2 shows the effect of step size on the value of the calculated temperature at t=480 seconds.

 

Table 1.  Value of temperature at time, t=480s for different step sizes

 

Step size,

480

240

120

60

30

-90.278

594.91

646.16

647.54

647.57

737.85

52.660

1.4122

0.033626

0.00086900

113.94

8.1319

0.21807

0.0051926

0.00013419

 

 

 

 

 

 

 

 

 

Figure 2.  Effect of step size in Runge-Kutta 4th order method

 

In Figure 3, we are comparing the exact results with Euler’s method (Runge-Kutta 1st order method), Heun’s method (Runge-Kutta 2nd order method) and Runge-Kutta 4th order method.

 

Figure 3.  Comparison of Runge-Kutta methods of 1st, 2nd, and 4th order.

 

 

 

The formula described in this chapter was developed by Runge.  This formula is same as Simpson’s rd rule, if  is only a function of.  There are other versions of the fourth order method just like there are several versions of the second order methods.  Formula developed by Kutta is

                                                                           (6)

where

                                                                                                            (7a)

                                                                                     (7b)

                                                                           (7c)

                                                                         (7d)

This formula is the same as the Simpson’s th rule, if  is only a function of .

 

 

Back to TOC

           

Test your knowledge of Runge-Kutta 4th order method [HTML] [PDF] [DOC]

           

h=240