Runge Kutta Method Calculator
Work out runge kutta method instantly with clear inputs, formula shown and shareable results.
About Runge Kutta Method Calculator
Classical fourth-order Runge-Kutta averages four slope evaluations per step with weights 1, 2, 2, 1 over 6. Its error falls as h⁴, so it is dramatically more accurate than Euler's method for the same step count.
Formula
RK4
yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
Worked example
With the default values below, Runge Kutta Method Calculator returns RK4 result of 0.9323323582. Change any input above and every figure here is recalculated in your browser.
Inputs used
- Coefficient a in dy/dx = a·y + b
- -1
- Constant b
- 1
- Initial value y(0)
- 0.5
- Integrate to x =
- 2
Results
- RK4 result
- 0.9323323582
- Exact solution
- 0.9323323584
- Euler's method for comparison
- 0.9336902221
- RK4 absolute error
- 0.000000000183
Step by step
- 1Values used
- 2RK4
- 3RK4 result= 0.9323323582
- 4Exact solution= 0.9323323584
- 5Euler's method for comparison= 0.9336902221
- 6RK4 absolute error= 0.000000000183
Assumptions and limits
- The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to 12 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
For dy/dx = −y + 1 with y(0) = 0.5 at x = 2?
The exact answer is 1 − 0.5e⁻² ≈ 0.9323324, and RK4 with 100 steps matches it to about ten decimal places.
Why is RK4 so popular?
It balances accuracy and cost well, needing no derivatives of f and no history of previous steps.
