top

Runge-Kutta Method Calculator

To use Runge-Kutta method calculator, enter the equation, write initial condition, interval values, step size, and click calculate button

ADVERTISEMENT
ADVERTISEMENT

Give Us Feedback

Runge-Kutta Method Calculator

Runge Kutta Method Calculator is used to calculate ordinary differential equations (ODEs) numerically.

What is Runge-kutta method?

Runge-kutta method is a numerical technique to find the solution of the ordinary differential equation. The method provides us with the value of y as the corresponding value of x. It is also known as the RK method.

RK method

Here we use the most common RK-4 which is known as runge-kutta of order fourth.

Formula of Runge-kutta method

The formula of the Runge-Kutta method of order fourth is given as:

yi+1 = yi + h/6(k1 + 2k2 + 2k3 + k4)

Here,

xi+1 = xi+h

where

  • i is the number of iterations.

For the value of k’s, we have

  • k1= f(xi, yi)
  • k2= f(xi + h/2, yi + hk1/2)
  • k3= f(xi + h/2, yi + hk2/2)
  • k4= f(xi + h, yi + hk3)

How to calculate Runge-kutta method problems?

Here is a numerical example to understand this iterative method.

Example:

If we have differential function x2+1 with the "2" number of iterations. The initial value of the x is 1 to 3 and the initial value of y is 2.

Solution:

Step 1: The step size is

h= (3-1)/2 = 1, x0= 1, y0 = 2 and n= 2

f(x, y) = x^2+1

Step 2: For 1st iteration

x1= x0+h = 1+1 = 2

k1= f(x0, y0)= f(1, 2) = 2

k2= f(x0 + h/2, y0+ hk1/2) = f(1 + 1/2, 2 + (1)(2)/2) = f(3/2, 3) = 3.25

k3= f(x0 + h/2, y0 + hk2/2) = f(1 + 1/2, 2 + (1)(3.25)/2) = f(2/2, 3.625) = 3.25

k4 = f(x0 + h,y0 + hk3) = f(1 + 1, 2 + (1)(3.25)) = f(2, 5.25) = 5

y1 = y(x1) = y(2) = y0+ h/6(k1+2k2+2k3+k4) = 2+1/6(2+2(3.25)+2(3.25)+5)

y1 = 5.333

Step 3: For the 2nd iteration we have x1 and y1 to calculate x2 and y2.

x2= x1+h = 2+1 = 3

k1= f(x1, y1) = f(2, 5.333) = 5

k2= f(x1+ h/2, y1+ hk1/2) = f(2 + 1/2, 5.333 + (1)(5)/2) = f(5/2, 7.83) = 7.25

k3= f(x1+ h/2, y1+ hk2/2) = f(2 + 1/2, 5.333 + (1)(7.25)/2= f(5/2, 8.958) = 7.25

k4 = f(x1 + h, y1 + hk3) = f(2+1, 5.333 + (1)(7.25)) = f(3, 12.583) = 10

y2 = y(x2) = y (3) = y1+ h/6(k1+ 2k2 + 2k3 + k4) = 5.333 + 1/6(5 + 2(7.25) + 2(7.25) +10)

y2 = 12.666

Hence the approximate value of y2 = 12.666.

X
Allmath loader
AdBlocker Detected!

To calculate result you have to disable your ad blocker first.