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

# Runge-Kutta Method Calculator

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

## 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. 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:

y_{i+1}=y_{i}+h/6(k_{1}+2k_{2}+2k_{3}+k_{4}) where

x_{i+1} = x_{i}+h

where i is the number of iterations.

For the value of k’s, we have

- k
_{1}= f(x_{i},y_{i}) - k
_{2}= f(x_{i}+h/2, y_{i}+hk_{1}/2) - k
_{3}=f(x_{i}+h/2,y_{i}+hk_{2}/2) - k
_{4}= f(x_{i}+h,y_{i}+hk_{3})

## How to calculate Runge-kutta method problems?

Here is a numerical example to understand this iterative method.

**Example:**

If we have differential function x^{2}+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, x_{0}= 1, y_{0} = 2 and n= 2

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

**Step 2: **For 1^{st} iteration

x_{1}= x_{0}+h = 1+1 = 2

k_{1}= f(x_{0},y_{0})= f(1,2) = 2

k_{2}= f(x_{0}+h/2, y_{0}+hk_{1}/2) = f(1+1/2,2+(1)(2)/2) = f(3/2,3) = 3.25

k_{3}= f(x_{0}+h/2, y_{0}+hk_{2}/2) = f(1+1/2,2+(1)(3.25)/2) = f(2/2,3.625) = 3.25

k_{4} = f(x_{0}+h,y_{0}+hk_{3}) = f(1+1,2+(1)(3.25)) = f(2,5.25) = 5

y_{1} = y(x_{1}) = y(2) = y_{0}+ h/6(k_{1}+2k_{2}+2k_{3}+k_{4}) = 2+1/6(2+2(3.25)+2(3.25)+5) = 5.333

**Step 3: **For the 2^{nd} iteration we have x_{1} and y_{1} to calculate x_{2} and y_{2}.

x_{2}= x_{1}+h = 2+1 = 3

k_{1}= f(x_{1},y_{1}) = f(2,5.333) = 5

k_{2}= f(x_{1}+h/2, y_{1}+hk_{1}/2) = f(2+1/2,5.333+(1)(5)/2) = f(5/2,7.83) = 7.25

k_{3}= f(x_{1}+h/2, y_{1}+hk_{2}/2) = f(2+1/2,5.333+(1)(7.25)/2= f(5/2,8.958) = 7.25

k_{4} = f(x_{1}+h,y_{1}+hk_{3}) = f(2+1,5.333+(1)(7.25)) = f(3,12.583) = 10

y_{2} = y(x_{2}) = y (3) = y_{1}+ h/6(k_{1}+2k_{2}+2k_{3}+k_{4}) = 5.333+1/6(5+2(7.25) +2(7.25) +10) = 12.666

**Hence the approximate value of y _{2} = 12.666.**