Enum Method

Source
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

  • 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

§References

  1. 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
  2. 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

Source

pub fn information(&self) -> Information

Returns information about the method

Source

pub fn description(&self) -> &'static str

Returns a description of the method

Source

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.

Trait Implementations§

Source§

impl Clone for Method

Source§

fn clone(&self) -> Method

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Method

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Method

Source§

fn eq(&self, other: &Method) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for Method

Source§

impl Eq for Method

Source§

impl StructuralPartialEq for Method

Auto Trait Implementations§

§

impl Freeze for Method

§

impl RefUnwindSafe for Method

§

impl Send for Method

§

impl Sync for Method

§

impl Unpin for Method

§

impl UnwindSafe for Method

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.