OrdinaryDiffEqRKN
Runge-Kutta-Nyström (RKN) methods for solving second-order differential equations of the form d²u/dt² = f(u, du/dt, t)
. These methods are specifically designed for second-order ODEs and can be more efficient than converting to first-order systems when the problem has this natural structure.
Key Properties
RKN methods provide:
- Direct integration of second-order ODEs without conversion to first-order systems
- Efficient handling of problems where velocity dependence is minimal or absent
- Specialized variants for different types of second-order problems
- High-order accuracy with methods up to 12th order available
- Trigonometrically-fitted variants for oscillatory problems
- Improved efficiency for second-order problems compared to first-order conversions
When to Use RKN Methods
These methods are recommended for:
- Second-order differential equations with natural
d²u/dt² = f(u, du/dt, t)
structure - Classical mechanics problems (Newton's equations of motion)
- Oscillatory second-order systems (springs, pendulums, wave equations)
- Problems where velocity dependence is weak or absent
- Celestial mechanics and orbital dynamics
- Vibration analysis and structural dynamics
- Wave propagation problems in their natural second-order form
Problem Types
Velocity-independent problems: d²u/dt² = f(u, t)
When the acceleration depends only on position (and possibly time):
- More efficient specialized methods available
- Classical examples: gravitational problems, springs with
F = -kx
Velocity-dependent problems: d²u/dt² = f(u, du/dt, t)
When acceleration depends on both position and velocity:
- General RKN methods handle the full dependence
- Examples: damped oscillators, air resistance problems
Solver Selection Guide
General-purpose RKN methods
Nystrom4
: Fourth-order method for general second-order ODEsIRKN3
,IRKN4
: Improved Runge-Kutta-Nyström methods
Velocity-independent specialized methods
Nystrom4VelocityIndependent
: Fourth-order ford²u/dt² = f(u, t)
Nystrom5VelocityIndependent
: Fifth-order ford²u/dt² = f(u, t)
Velocity-dependent methods
FineRKN4
: Fourth-order allowing velocity dependenceFineRKN5
: Fifth-order allowing velocity dependence
High-order Dormand-Prince variants
DPRKN4
: Fourth-order Dormand-Prince RKNDPRKN5
: Fifth-order Dormand-Prince RKNDPRKN6
: Sixth-order with free interpolantDPRKN6FM
: Sixth-order with optimized error coefficientsDPRKN8
: Eighth-order for high accuracyDPRKN12
: Twelfth-order for extreme precision
Trigonometrically-fitted methods for oscillatory problems
ERKN4
: Embedded 4(3) pair for periodic problemsERKN5
: Embedded 5(4) pair for periodic problemsERKN7
: Higher-order embedded pair for oscillatory systems
Specialized methods
RKN4
: Fourth-order for linear inhomogeneous second-order IVPs
Advantages Over First-Order Conversion
- Natural problem structure: Preserves the physical meaning of the equations
- Specialized optimizations: Methods can exploit second-order structure
To be able to access the solvers in OrdinaryDiffEqRKN
, you must first install them use the Julia package manager:
using Pkg
Pkg.add("OrdinaryDiffEqRKN")
This will only install the solvers listed at the bottom of this page. If you want to explore other solvers for your problem, you will need to install some of the other libraries listed in the navigation bar on the left.
Example usage
using OrdinaryDiffEqOrdinaryDiffEqRKN
function HH_acceleration!(dv, v, u, p, t)
x, y = u
dx, dy = dv
dv[1] = -x - 2x * y
dv[2] = y^2 - y - x^2
end
initial_positions = [0.0, 0.1]
initial_velocities = [0.5, 0.0]
tspan = (0.0, 1.0)
prob = SecondOrderODEProblem(HH_acceleration!, initial_velocities, initial_positions, tspan)
sol = solve(prob, Nystrom4(), dt = 1 / 10)
Full list of solvers
OrdinaryDiffEqRKN.IRKN3
— TypeIRKN3()
Improved Runge-Kutta-Nyström method Method of order three, which minimizes the amount of evaluated functions in each step. Fixed time steps only. Second order ODE should not depend on the first derivative.
Keyword Arguments
References
@article{rabiei2012numerical, title={Numerical Solution of Second-Order Ordinary Differential Equations by Improved Runge-Kutta Nystrom Method}, author={Rabiei, Faranak and Ismail, Fudziah and Norazak, S and Emadi, Saeid}, publisher={Citeseer}}
OrdinaryDiffEqRKN.IRKN4
— TypeIRKN4()
Improved Runge-Kutta-Nyström method Improves Runge-Kutta-Nyström method of order four, which minimizes the amount of evaluated functions in each step. Fixed time steps only. Second order ODE should not be dependent on the first derivative. Recommended for smooth problems with expensive functions to evaluate.
Keyword Arguments
References
@article{rabiei2012numerical, title={Numerical Solution of Second-Order Ordinary Differential Equations by Improved Runge-Kutta Nystrom Method}, author={Rabiei, Faranak and Ismail, Fudziah and Norazak, S and Emadi, Saeid}, publisher={Citeseer}}
OrdinaryDiffEqRKN.Nystrom4
— TypeNystrom4()
Improved Runge-Kutta-Nyström method 4th order explicit Runge-Kutta-Nyström method. Allows acceleration to depend on velocity.
Keyword Arguments
References
E. Hairer, S.P. Norsett, G. Wanner, (1993) Solving Ordinary Differential Equations I. Nonstiff Problems. 2nd Edition. Springer Series in Computational Mathematics, Springer-Verlag.
OrdinaryDiffEqRKN.Nystrom4VelocityIndependent
— TypeNystrom4VelocityIndependent()
Improved Runge-Kutta-Nyström method A 4th order explicit method. Used directly on second order ODEs, where the acceleration is independent from velocity (ODE Problem is not dependent on the first derivative).
Keyword Arguments
References
E. Hairer, S.P. Norsett, G. Wanner, (1993) Solving Ordinary Differential Equations I. Nonstiff Problems. 2nd Edition. Springer Series in Computational Mathematics, Springer-Verlag.
OrdinaryDiffEqRKN.Nystrom5VelocityIndependent
— TypeNystrom5VelocityIndependent()
Improved Runge-Kutta-Nyström method A 5th order explicit method. Used directly on second order ODEs, where the acceleration is independent from velocity (ODE Problem is not dependent on the first derivative).
Keyword Arguments
References
E. Hairer, S.P. Norsett, G. Wanner, (1993) Solving Ordinary Differential Equations I. Nonstiff Problems. 2nd Edition. Springer Series in Computational Mathematics, Springer-Verlag.
OrdinaryDiffEqRKN.FineRKN4
— TypeFineRKN4()
Improved Runge-Kutta-Nyström method A 4th order explicit method which can be applied directly to second order ODEs. In particular, this method allows the acceleration equation to depend on the velocity.
Keyword Arguments
References
@article{fine1987low, title={Low order practical {R}unge-{K}utta-{N}ystr{"o}m methods}, author={Fine, Jerry Michael}, journal={Computing}, volume={38}, number={4}, pages={281–297}, year={1987}, publisher={Springer}}
OrdinaryDiffEqRKN.FineRKN5
— TypeFineRKN5()
Improved Runge-Kutta-Nyström method A 5th order explicit method which can be applied directly to second order ODEs. In particular, this method allows the acceleration equation to depend on the velocity.
Keyword Arguments
References
@article{fine1987low, title={Low order practical {R}unge-{K}utta-{N}ystr{"o}m methods}, author={Fine, Jerry Michael}, journal={Computing}, volume={38}, number={4}, pages={281–297}, year={1987}, publisher={Springer}}
OrdinaryDiffEqRKN.DPRKN4
— TypeDPRKN4()
Improved Runge-Kutta-Nyström method 4th order explicit method. The second order ODE should not depend on the first derivative.
Keyword Arguments
References
@article{Dormand1987FamiliesOR, title={Families of Runge-Kutta-Nystrom Formulae}, author={J. R. Dormand and Moawwad E. A. El-Mikkawy and P. J. Prince}, journal={Ima Journal of Numerical Analysis}, year={1987}, volume={7}, pages={235-250}}
OrdinaryDiffEqRKN.DPRKN5
— TypeDPRKN5()
Improved Runge-Kutta-Nyström method 5th order explicit method. The second order ODE should not depend on the first derivative.
Keyword Arguments
References
@article{Bettis1973ARN, title={A Runge-Kutta Nystrom algorithm}, author={Dale G. Bettis}, journal={Celestial mechanics}, year={1973}, volume={8}, pages={229-233}, publisher={Springer}}
OrdinaryDiffEqRKN.DPRKN6
— TypeDPRKN6()
Improved Runge-Kutta-Nyström method 6th order explicit method. The second order ODE should not depend on the first derivative. Free 6th order interpolant
Keyword Arguments
References
@article{Dormand1987FamiliesOR, title={Families of Runge-Kutta-Nystrom Formulae}, author={J. R. Dormand and Moawwad E. A. El-Mikkawy and P. J. Prince}, journal={Ima Journal of Numerical Analysis}, year={1987}, volume={7}, pages={235-250}}
OrdinaryDiffEqRKN.DPRKN6FM
— TypeDPRKN6FM()
Improved Runge-Kutta-Nyström method 6th order explicit method. The second order ODE should not depend on the first derivative. Compared to DPRKN6
, this method has smaller truncation error coefficients which leads to performance gain when only the main solution points are considered.
Keyword Arguments
References
@article{Dormand1987FamiliesOR, title={Families of Runge-Kutta-Nystrom Formulae}, author={J. R. Dormand and Moawwad E. A. El-Mikkawy and P. J. Prince}, journal={Ima Journal of Numerical Analysis}, year={1987}, volume={7}, pages={235-250}}
OrdinaryDiffEqRKN.DPRKN8
— TypeDPRKN8()
Improved Runge-Kutta-Nyström method 8th order explicit method. The second order ODE should not depend on the first derivative. Not as efficient as DPRKN12
when high accuracy is needed, however this solver is competitive with DPRKN6
at lax tolerances and, depending on the problem, might be a good option between performance and accuracy.
Keyword Arguments
References
@article{dormand1987high, title={High-order embedded Runge-Kutta-Nystrom formulae}, author={Dormand, JR and El-Mikkawy, MEA and Prince, PJ}, journal={IMA Journal of Numerical Analysis}, volume={7}, number={4}, pages={423–430}, year={1987}, publisher={Oxford University Press}}
OrdinaryDiffEqRKN.DPRKN12
— TypeDPRKN12()
Improved Runge-Kutta-Nyström method 12th order explicit method. The second order ODE should not depend on the first derivative. Most efficient when high accuracy is needed.
Keyword Arguments
References
@article{dormand1987high, title={High-order embedded Runge-Kutta-Nystrom formulae}, author={Dormand, JR and El-Mikkawy, MEA and Prince, PJ}, journal={IMA Journal of Numerical Analysis}, volume={7}, number={4}, pages={423–430}, year={1987}, publisher={Oxford University Press}}
OrdinaryDiffEqRKN.ERKN4
— TypeERKN4()
Improved Runge-Kutta-Nyström method Embedded 4(3) pair of explicit methods. Integrates the periodic properties of the harmonic oscillator exactly. The second order ODE should not depend on the first derivative. Uses adaptive step size control. This method is extra efficient on periodic problems.
Keyword Arguments
References
@article{demba2017embedded, title={An Embedded 4 (3) Pair of Explicit Trigonometrically-Fitted Runge-Kutta-Nystr{"o}m Method for Solving Periodic Initial Value Problems}, author={Demba, MA and Senu, N and Ismail, F}, journal={Applied Mathematical Sciences}, volume={11}, number={17}, pages={819–838}, year={2017}}
OrdinaryDiffEqRKN.ERKN5
— TypeERKN5()
Improved Runge-Kutta-Nyström method Embedded 5(4) pair of explicit methods. Integrates the periodic properties of the harmonic oscillator exactly. The second order ODE should not depend on the first derivative. Uses adaptive step size control. This method is extra efficient on periodic problems.
Keyword Arguments
References
@article{demba20165, title={A 5 (4) Embedded Pair of Explicit Trigonometrically-Fitted Runge–Kutta–Nystr{"o}m Methods for the Numerical Solution of Oscillatory Initial Value Problems}, author={Demba, Musa A and Senu, Norazak and Ismail, Fudziah}, journal={Mathematical and Computational Applications}, volume={21}, number={4}, pages={46}, year={2016}, publisher={Multidisciplinary Digital Publishing Institute}}
OrdinaryDiffEqRKN.ERKN7
— TypeERKN7()
Improved Runge-Kutta-Nyström method Embedded pair of explicit methods. Integrates the periodic properties of the harmonic oscillator exactly. The second order ODE should not depend on the first derivative. Uses adaptive step size control. This method is extra efficient on periodic problems.
Keyword Arguments
References
@article{SimosOnHO, title={On high order Runge-Kutta-Nystr{"o}m pairs}, author={Theodore E. Simos and Ch. Tsitouras}, journal={J. Comput. Appl. Math.}, volume={400}, pages={113753}}
OrdinaryDiffEqRKN.RKN4
— TypeRKN4()
Improved Runge-Kutta-Nyström method 3 stage fourth order method to solve second order linear inhomogeneous IVPs. Does not include an adaptive method. Solves for for d-dimensional differential systems of second order linear inhomogeneous equations.
This method is only fourth order for these systems, the method is second order otherwise!
Keyword Arguments
References
@article{MONTIJANO2024115533, title = {Explicit Runge–Kutta–Nyström methods for the numerical solution of second order linear inhomogeneous IVPs}, author = {J.I. Montijano and L. Rández and M. Calvo}, journal = {Journal of Computational and Applied Mathematics}, volume = {438}, pages = {115533}, year = {2024},}