pub enum Method {
Show 16 variants
Radau5,
BwEuler,
FwEuler,
Rk2,
Rk3,
Heun3,
Rk4,
Rk4alt,
MdEuler,
Merson4,
Zonneveld4,
Fehlberg4,
DoPri5,
Verner6,
Fehlberg7,
DoPri8,
}
Expand description
Specifies the numerical method to solve (approximate) ODEs
§Recommended methods
- Method::DoPri5 for ODE systems and non-stiff problems using moderate tolerances
- Method::DoPri8 for ODE systems and non-stiff problems using strict tolerances
- Method::Radau5 for ODE and DAE systems, possibly stiff, with moderate to strict tolerances
Note: A Stiff problem arises due to a combination of conditions, such as the ODE system equations, the initial values, the stepsize, and the numerical method.
§Limitations
- Currently, the only method that can solve DAE systems is Method::Radau5
- Currently, dense output is only available for Method::DoPri5, Method::DoPri8, and Method::Radau5
§References
- E. Hairer, S. P. Nørsett, G. Wanner (2008) Solving Ordinary Differential Equations I. Non-stiff Problems. Second Revised Edition. Corrected 3rd printing 2008. Springer Series in Computational Mathematics, 528p
- E. Hairer, G. Wanner (2002) Solving Ordinary Differential Equations II. Stiff and Differential-Algebraic Problems. Second Revised Edition. Corrected 2nd printing 2002. Springer Series in Computational Mathematics, 614p
Variants§
Radau5
Radau method (Radau IIA) (implicit, order 5, embedded) for ODEs and DAEs
BwEuler
Backward Euler method (implicit, order 1, unconditionally stable)
FwEuler
Forward Euler method (explicit, order 1, conditionally stable)
Note: This method is interesting for didactic purposes only and should not be used in production codes.
Rk2
Runge (Kutta) method (mid-point) (explicit, order 2)
Reference: page 135 of Hairer, Nørsett, and Wanner (2008)
Rk3
Runge (Kutta) method (explicit, order 3)
Reference: page 135 of Hairer, Nørsett, and Wanner (2008)
Heun3
Heun method (explicit, order 3)
Reference: page 135 of Hairer, Nørsett, and Wanner (2008)
Rk4
“The” Runge-Kutta method (explicit, order 4)
Reference: page 138 of Hairer, Nørsett, and Wanner (2008)
Rk4alt
Runge-Kutta method (alternative) (explicit, order 4, 3/8-Rule)
Reference: page 138 of Hairer, Nørsett, and Wanner (2008)
MdEuler
Modified Euler method (explicit, order 2(1), embedded)
Merson4
Merson method (explicit, order 4(“5”), embedded)
“5” means that the order 5 is for linear equations with constant coefficients; otherwise the method is of order3.
Reference: page 167 of Hairer, Nørsett, and Wanner (2008)
Zonneveld4
Zonneveld method (explicit, order 4(3), embedded)
Reference: page 167 of Hairer, Nørsett, and Wanner (2008)
Fehlberg4
Fehlberg method (explicit, order 4(5), embedded)
Note: this method gives identically zero error estimates for quadrature problems y'=f(x)
(see page 180 of ref # 1).
DoPri5
Dormand-Prince method (explicit, order 5(4), embedded)
Verner6
Verner method (explicit, order 6(5), embedded)
Fehlberg7
Fehlberg method (explicit, order 7(8), embedded)
Note: this method gives identically zero error estimates for quadrature problems y'=f(x)
(see page 180 of ref # 1).
DoPri8
Dormand-Prince method (explicit, order 8(5,3), embedded)
Implementations§
Source§impl Method
impl Method
Sourcepub fn information(&self) -> Information
pub fn information(&self) -> Information
Returns information about the method
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
Returns a description of the method
Sourcepub fn erk_methods() -> Vec<Method>
pub fn erk_methods() -> Vec<Method>
Returns a list of explicit Runge-Kutta methods
Note: FwEuler is also an explicit RK method; however it is not included in this list because it is implemented separately.