Exams
Test Series
Previous Year Papers
Syllabus
Books
Cut Off
Latest Updates
Eligibility
Runge Kutta 4th Order Method Introduction, Formula, Algorithm & Example
IMPORTANT LINKS
The Runge-Kutta method is a popular and effective way to solve ordinary differential equations (ODEs), especially when we know the starting value (initial value problem). It gives more accurate results than simple methods like Euler’s method and does not need complicated higher-order derivatives.
Among the different Runge-Kutta methods, the 4th order Runge-Kutta method (often called RK4) is the most widely used. It works by estimating four different slopes (or values of the function’s rate of change) at each step. These slopes are then combined in a smart way to give a better estimate of the next value. This makes the method both accurate and easy to apply using just the original function, without needing its higher derivatives.
Maths Notes Free PDFs
Topic | PDF Link |
---|---|
Class 12 Maths Important Topics Free Notes PDF | Download PDF |
Class 10, 11 Mathematics Study Notes | Download PDF |
Most Asked Maths Questions in Exams | Download PDF |
Increasing and Decreasing Function in Maths | Download PDF |
What is Runge-Kutta Method
The Taylor series method needs you to find higher-order derivatives (like second, third, and so on) of a function. This can be hard and take a lot of time, especially for complex equations.
The Runge-Kutta method makes things easier. It turns the problem into a series of simple first-order equations and uses step-by-step calculations to find the solution at different points.
There are different levels (or orders) of the Runge-Kutta method:
- First-order Runge-Kutta method is also called Euler’s method. It’s the simplest and uses a basic formula to estimate the next value.
- Second-order Runge-Kutta method, also known as the midpoint method, checks the value at the middle of the step to get a better estimate.
- Third-order Runge-Kutta method adds even more steps in between to improve accuracy further.
1st Order:
2nd Order:
3rd Order:
where
What is Runge-Kutta 4th Order Method?
The 4th order Runge-Kutta method approximates the curve of the function f between two points by a 4th degree polynomial. It requires 4 slope estimates at each step.
Geometrically, we can visualize the curve between two points as part of a 4th degree polynomial. The 4th order Runge-Kutta method finds 4 tangents to this curve at evenly spaced points, and uses the average of their slopes as an approximation of the entire curve between the two points.
Runge-Kutta Formula for 4th Order
The formula for Runge-kutta 4th order is:
Where,
The slope estimates
- 3 Live Test
- 163 Class XI Chapter Tests
- 157 Class XII Chapter Tests
Runge-Kutta 4th Order Method Algorithm
Runge kutta 4th order method algorithm is as follows
Step : 1 Start
Step : 2 Now describe the function f (x,y)
Step : 3 Read the starting condition values
Step : 4 Calculate the size step
Step : 5 Set, i = 0
Step : 6 Loop
i = i +1
Step : 7 Show
Step : 8 Stop
C Program for Runge-Kutta Method 4th Order
#include <stdio.h>
/ Function to calculate the derivative dy/dx
double derivative(double x, double y) {
/ Define the derivative function here
double dy_dx = /* Insert the expression for dy/dx */;
return dy_dx;
}
/ Function to implement the fourth-order Runge-Kutta method
double rungeKutta(double x0, double y0, double x, double h) {
int n = (int)((x - x0) / h); / Number of iterations
double y = y0;
for (int i = 1; i <= n; i++) {
double k1 = h * derivative(x0, y);
double k2 = h * derivative(x0 + 0.5 * h, y + 0.5 * k1);
double k3 = h * derivative(x0 + 0.5 * h, y + 0.5 * k2);
double k4 = h * derivative(x0 + h, y + k3);
/ Calculate the next value of y
y = y + (1.0 / 6.0) * (k1 + 2 * k2 + 2 * k3 + k4);
x0 = x0 + h; / Increment x
}
return y;
}
int main() { double x0 = 0; / Initial x double y0 = 1; / Initial y double x = 0.2; / Final x at which we want y double h = 0.1; / Step size double y = rungeKutta(x0, y0, x, h); printf("The value of y at x = %f is %f\n", x, y); return 0;
}
This C program calculates the value of y at a given x using the fourth-order Runge-Kutta method.
Properties of Runge-Kutta 4th Order Method
- High Accuracy
It gives very accurate results compared to lower-order methods like Euler’s or 2nd-order methods, especially for small step sizes.
- No Need for Higher Derivatives
Unlike the Taylor series method, it doesn’t require calculating second, third, or higher-order derivatives — only the first derivative is used.
- Self-Starting Method
It doesn’t need previous points to start. You can begin solving right from the initial condition, making it easier to implement.
- Single-Step Method
It calculates the solution at the next step using only the current point, without needing values from earlier steps.
- Widely Used for Non-Stiff Problems
It works very well for many types of ordinary differential equations (ODEs) that are not stiff.
- Deterministic Results
For the same initial conditions and step size, it will always give the same result — it’s predictable and stable for most problems.
It gives very accurate results compared to lower-order methods like Euler’s or 2nd-order methods, especially for small step sizes.
Unlike the Taylor series method, it doesn’t require calculating second, third, or higher-order derivatives — only the first derivative is used.
It doesn’t need previous points to start. You can begin solving right from the initial condition, making it easier to implement.
It calculates the solution at the next step using only the current point, without needing values from earlier steps.
It works very well for many types of ordinary differential equations (ODEs) that are not stiff.
For the same initial conditions and step size, it will always give the same result — it’s predictable and stable for most problems.
Advantages of Runge Kutta 4th Order Method
The Runge-Kutta method offers several advantages in numerical computations for solving ordinary differential equations (ODEs). These advantages include:
- Accuracy: The Runge-Kutta method, especially higher-order variants like the fourth-order method, provides more accurate results compared to simpler numerical methods. It considers multiple intermediate steps and calculates weighted averages, resulting in improved accuracy.
- Versatility: The Runge-Kutta method is versatile and can be applied to a wide range of ODEs, including both first-order and higher-order differential equations. It is not limited to specific types of equations and can handle various initial conditions.
- Efficiency: Despite its higher accuracy, the Runge-Kutta method remains computationally efficient. It strikes a balance between accuracy and computational complexity, making it a reliable choice for solving ODEs in various scientific and engineering applications.
- Stability: The Runge-Kutta method exhibits stability properties, ensuring that the numerical solutions remain bounded and do not diverge significantly. This stability is crucial for obtaining reliable results over a wide range of integration steps.
Disadvantages of Runge-Kutta 4th Order Method
- More Calculations Per Step
It needs multiple function evaluations (4 per step), making it slower than simpler methods like Euler’s for small problems.
- Not Ideal for Stiff Equations
It doesn't work well for "stiff" differential equations (where solutions change very fast). For such problems, special methods are better.
- Fixed Step Size
The basic version uses a fixed step size, which might not be efficient. Small steps give better accuracy but take longer to compute.
It needs multiple function evaluations (4 per step), making it slower than simpler methods like Euler’s for small problems.
It doesn't work well for "stiff" differential equations (where solutions change very fast). For such problems, special methods are better.
The basic version uses a fixed step size, which might not be efficient. Small steps give better accuracy but take longer to compute.
Runge-Kutta 3rd Order vs Runge-Kutta 4th order Method
Parameter
Runge-Kutta 3rd Order
Runge-Kutta 4th Order
Formula
<br> <br> <br>
<br> <br> <br> <br>
Accuracy
Less accurate compared to the fourth order
More accurate, provides better approximations
Number of Function Evaluations
Requires three function evaluations at each step
Requires four function evaluations at each step
Computational Complexity
Less computationally expensive
Slightly more computationally expensive
Stability
Less stable for stiff systems
More stable for a wider range of systems
Error Control
Limited error control capabilities
Allows for adaptive step size control and error estimation
Applications
Suitable for general-purpose problems
Preferred for problems requiring high accuracy
Parameter |
Runge-Kutta 3rd Order |
Runge-Kutta 4th Order |
Formula |
|
|
Accuracy |
Less accurate compared to the fourth order |
More accurate, provides better approximations |
Number of Function Evaluations |
Requires three function evaluations at each step |
Requires four function evaluations at each step |
Computational Complexity |
Less computationally expensive |
Slightly more computationally expensive |
Stability |
Less stable for stiff systems |
More stable for a wider range of systems |
Error Control |
Limited error control capabilities |
Allows for adaptive step size control and error estimation |
Applications |
Suitable for general-purpose problems |
Preferred for problems requiring high accuracy |
Runge-Kutta Method 4th Order Solved Examples
Example 1: Find the value of k₁ using the Runge-Kutta 4th order method, if
dy/dx = x + 2y², and y(0.2) = 1.05, with step size h = 0.1.
Solution:
We are given:
- Differential equation: dy/dx = x + 2y²
- Initial values: x₀ = 0.2, y₀ = 1.05
- Step size: h = 0.1
Step 1: Identify the function
f(x, y) = x + 2y²
Step 2: Apply the Runge-Kutta formula to find k₁
k₁ = h × f(x₀, y₀)
Substitute the values:
k₁ = 0.1 × f(0.2, 1.05)
= 0.1 × [0.2 + 2 × (1.05)²]
= 0.1 × [0.2 + 2 × 1.1025]
= 0.1 × [0.2 + 2.205]
= 0.1 × 2.405
= 0.2405
Answer: The value of k₁ is 0.2405.
Example 2: Find the value of k₁ using the Runge-Kutta 4th order method, if
dy/dx = x² + y, and y(0.5) = 1.2, with step size h = 0.1.
Solution:
We are given:
- Differential equation: dy/dx = x² + y
- Initial values: x₀ = 0.5, y₀ = 1.2
- Step size: h = 0.1
Step 1: Identify the function
f(x, y) = x² + y
Step 2: Apply the Runge-Kutta formula to find k₁
k₁ = h × f(x₀, y₀)
Substitute the values:
k₁ = 0.1 × f(0.5, 1.2)
= 0.1 × [(0.5)² + 1.2]
= 0.1 × [0.25 + 1.2]
= 0.1 × 1.45
= 0.145
Answer:The value of k₁ is 0.145
If you want to score well in your math exam then you are at the right place. Here you will get weekly test preparation, live classes, and exam series. Download the Testbook App now to prepare a smart and high-ranking strategy for the exam.
FAQs For Runge Kutta Method of 4th Order
What is runge kutta method of 4th order?
The approximate value of y for a particular point x is provided by the Runge-Kutta method. The Runge Kutta RK4 approach is only applicable to first order ODEs.
What order is RK4?
RK4 is fourth order Runge kutta method.
What is the formula of the Runge-Kutta fourth order method?
Formula of the Runge-Kutta fourth order method
What is the application of Runge-Kutta?
Yes, Runge-Kutta 4th order method is a direct method.
What is Simpson's rule and Runge-Kutta method used for?
Simpson's rule is used for approximating definite integrals, while the Runge-Kutta method is employed for solving ordinary differential equations numerically.
What is the first order Runge-Kutta method known as?
The first order Runge-Kutta method is known as Euler's Method and First Order Runge-Kutta.
Is the 4th order Runge-Kutta method more accurate than Euler’s method?
Yes, it is much more accurate and stable compared to Euler's method, even when using a similar step size.