Runge-Kutta (RK4) Method Calculator
Solve ODEs with the RK4 method using step size and initial conditions.
1. Problem setup
Use JavaScript/Math syntax: x + y, x*y, Math.sin(x), y - x*x. We already expose common Math functions via with(Math){...}.
2. Solution steps
No computation yet. Fill the form and click “Run RK4”.
Runge–Kutta 4th order formula
Given \(\frac{dy}{dx} = f(x, y)\) and a current point \((x_n, y_n)\) with step \(h\):
k₁ = f(xₙ, yₙ)
k₂ = f(xₙ + h/2, yₙ + h·k₁/2)
k₃ = f(xₙ + h/2, yₙ + h·k₂/2)
k₄ = f(xₙ + h, yₙ + h·k₃)
yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
This method is popular because it strikes an excellent balance between accuracy and computational cost.
Tips
- If the solution diverges, try a smaller step size \(h\).
- For stiff ODEs, RK4 might not be the best choice.
- Always check your function syntax if you get NaN results.
Formula (LaTeX) + variables + units
','\
k₁ = f(xₙ, yₙ) k₂ = f(xₙ + h/2, yₙ + h·k₁/2) k₃ = f(xₙ + h/2, yₙ + h·k₂/2) k₄ = f(xₙ + h, yₙ + h·k₃) yₙ₊₁ = yₙ + (h/6)(k₁ + 2k₂ + 2k₃ + k₄)
- T = property tax (annual or monthly depending on input) (currency)
- NIST — Weights and measures — nist.gov · Accessed 2026-01-19
https://www.nist.gov/pml/weights-and-measures - FTC — Consumer advice — consumer.ftc.gov · Accessed 2026-01-19
https://consumer.ftc.gov/
Last code update: 2026-01-19
- Initial audit spec draft generated from HTML extraction (review required).
- Verify formulas match the calculator engine and convert any text-only formulas to LaTeX.
- Confirm sources are authoritative and relevant to the calculator methodology.