rk4


rk4, a Fortran77 code which implements a simple Runge-Kutta solver for an initial value ordinary differential equation (ODE).

The code does not include any error estimator. It takes a single step at a time, requiring the user to control the step size.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

rk4 is available in a C version and a C++ version and a Fortran77 version and a Fortran90 version and a MATLAB version and a Python version.

Related Data and Programs:

rk4_test

backward_euler, a Fortran77 code which solves one or more ordinary differential equations (ODE) using the (implicit) backward Euler method, using a version of fsolve() for the implicit equation.

bdf2, a Fortran77 code which solves one or more ordinary differential equations (ODE) using the (implicit) backward difference formula of order 2 (BDF2), using fsolve() to solve the implicit equation.

cwg_ode, a Fortran77 code which implements three ODE solvers by C William Gear.

driv, a Fortran77 code which solves real or complex systems of ordinary differential equations;

euler, a Fortran77 code which solves one or more ordinary differential equations (ODE) using the forward Euler method.

nms, a Fortran77 library which includes the DDRIV package of ODE solvers.

ode, a Fortran77 library which solves a system of ordinary differential equations, by Shampine and Gordon.

odepack, a Fortran77 library which contains nine ODE solvers, including LSODE, LSODES, LSODA, LSODAR, LSODPK, LSODKR, LSODI, LSOIBT, and LSODIS, by Alan Hindmarsh.

rkf45, a Fortran77 code which implements the Runge-Kutta-Fehlberg ODE solver.

test_ode, a Fortran90 code which contains routines which define some test problems for ODE solvers.

trapezoidal, a Fortran77 code which solves one or more ordinary differential equations (ODE) using the (implicit) trapezoidal method, and a version of fsolve() to handle the nonlinear equation.

Reference:

  1. Erwin Fehlberg,
    Low-order Classical Runge-Kutta Formulas with Stepsize Control,
    NASA Technical Report R-315, 1969.
  2. Lawrence Shampine, Herman Watts, S Davenport,
    Solving Non-stiff Ordinary Differential Equations - The State of the Art,
    SIAM Review,
    Volume 18, pages 376-411, 1976.

Source Code:


Last revised on 05 November 2023.