FOR FREE YEAR SOLVED

Runge Kutta Method

Back to Programming

Description

This method is used to solve the differential equation in numerical. It is a family of the implicit and explicit iterative method. It is very simple to program and their truncation error can be controlled in a more straightforward manner than for multiple methods. The Runge Kutta method were the usual tool for calculating the needed initial values for the multistep method.

 

The method propagates a solution over an interval by combining different Euler-style steps. Each step is evaluated with different parameters.

 

DERIVATION

Suppose the differential equation be represented as:

Where

And therefore, the recursion is given by

In an s stage Runge kutta method, 

and 

The constants αjγj and wj are to be determined such that 

For the fourth-order Runge Kutta method we consider:

Now by determining the values of the constants we get:

Where

 

GRAPHICAL REPRESENTATION

Algorithm

INPUT: 

A function f(x, y)

 

OUTPUT: 

The value after solving the differential equation

 

PROCESS:

Step 1: [defining function f(x,y)]
	Set a ← 1 and b ← 3
	Return f(x, y)

Step 2: [defining runge kutta method]
	Set x[0] ← 0.0
	Set y[0] ← 1.0
	Set f[0] ← g(0.0,1.0)
	Set h ← 0.1
	for j = 0 to 9 repeat
		Set f[j] ← g(x[j], y[j])
		Set k1 ← h × g(x[j], y[j])
		Set k2 ← h × g(x[j] + h/2.0, y[j] + k1/2.0)
		Set k3 ← h × g(x[j] + h/2.0, y[j] + k2/2.0)
		Set k4 ← h × g(x[j] + h, y[j] + k3)
		Set y[j + 1] ← y[j] + ((k1 + k4 + 2.0 × (k2 + k3))/6.0)
		Set x[j + 1] ← x[j] + h
		Print x[j], y[j], f[j]
	[End of ‘for’ loop]
	Print y[9]
[End of runge kutta method]

Code

ADVANTAGES

1. This method is very simple to program.

2. Their truncation error can be controlled in a more straightforward manner than for multiple methods.

 

DISADVANTAGES

1. This method uses much more evaluations of the derivative f(x,y) to get the same accurate result compared to the multistep methods.

 

APPLICATIONS

1. These methods were the tool for calculating the needed initial values for the multistep methods.