Ordinary Differential Equation Using Fourth Order Runge Kutta (RK) Method Pseudocode


1. Start

2. Define function f(x,y)

3. Read values of initial condition(x0 and y0), 
   number of steps (n) and calculation point (xn)
   
4. Calculate step size (h) = (xn - x0)/n

5. Set i=0

6. Loop 
      
      k1 = h * f(x0, y0)
      k2 = h * f(x0+h/2, y0+k1/2)
      k3 = h * f(x0+h/2, y0+k2/2)
      k4 = h * f(x0+h, y0+k3)
      
      k = (k1+2*k2+2*k3+k4)/6
      
      yn = y0 + k
      
      i = i + 1
      x0 = x0 + h
      y0 = yn
      
   While i < n


7. Display yn as result

8. Stop

Recommended Readings

  1. Ordinary Differential Equation Using Euler's Method Algorithm
  2. Ordinary Differential Equation Using Euler's Method Pseudocode
  3. Ordinary Differential Equation Using Euler's Method Using C Programming
  4. Ordinary Differential Equation Using Euler's Method Using C++ Programming
  5. Ordinary Differential Equation Using Fourth Order Runge Kutta (RK) Method Algorithm
  6. Ordinary Differential Equation Using Fourth Order Runge Kutta (RK) Method Pseudocode
  7. Ordinary Differential Equation Using Fourth Order Runge Kutta (RK) Method Using C
  8. Runge Kutta (RK) Fourth Order Using C++ with Output