rk2


rk2, a Fortran90 code which solves one or more ordinary differential equations (ODE) using an explicit Runge-Kutta method of order 2, also known as Heun's method, the explicit midpoint method, or the modified Euler method.

Licensing:

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

Languages:

rk2 is available in a C version and a C++ version and a Fortran90 version and a MATLAB version and an Octave version and a Python version.

Related Data and codes:

rk2_test

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

midpoint, a Fortran90 code which solves one or more ordinary differential equations (ODE) using the (implicit) midpoint method, with a version of fsolve() handling the associated nonlinear equation, and using a fixed time step.

midpoint_adaptive, a Fortran90 code which solves one or more ordinary differential equations (ODE) using the (implicit) midpoint method, relying on fsolve() to solve the implicit equation, and using an adaptive timestep.

midpoint_explicit, a Fortran90 code which solves one or more ordinary differential equations (ODE) using the (explicit) midpoint method, also called the modified Euler method.

midpoint_fixed, a Fortran90 code which solves one or more ordinary differential equations (ODE) using the (implicit) midpoint method, using fixed point iteration for the nonlinear equation.

rk4, a Fortran90 code which applies the fourth order Runge-Kutta (RK) algorithm to estimate the solution of an ordinary differential equation (ODE).

Reference:

  1. Catalin Trenchea, John Burkardt,
    Refactorization of the midpoint rule,
    Applied Mathematics Letters,
    Volume 107, September 2020.

Source Code:


Last revised on 13 November 2024.