pub struct ImplicitRungeKutta<E, F, T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> {
pub h0: T,
pub newton_tol: T,
pub max_newton_iter: usize,
pub rtol: T,
pub atol: T,
pub h_max: T,
pub h_min: T,
pub max_steps: usize,
pub max_rejects: usize,
pub safety_factor: T,
pub min_scale: T,
pub max_scale: T,
/* private fields */
}Expand description
Implicit Runge-Kutta solver that can handle:
- Fixed-step methods with Newton iteration for stage equations
- Adaptive step methods with embedded error estimation
- Gauss methods (A-stable, symplectic for Hamiltonian systems)
- Radau methods (L-stable, good for stiff problems)
- Lobatto methods (A-stable, good for constrained systems)
§Type Parameters
E: Equation type (e.g., Ordinary, Delay, Stochastic)F: Family type (e.g., Adaptive, Fixed, Gauss, Radau, Lobatto)T: Real number type (f32, f64)V: State vector typeD: Callback data typeconst O: Order of the methodconst S: Number of stages in the methodconst I: Total number of stages including interpolation (equal to S for methods without dense output)
Fields§
§h0: T§newton_tol: T§max_newton_iter: usize§rtol: T§atol: T§h_max: T§h_min: T§max_steps: usize§max_rejects: usize§safety_factor: T§min_scale: T§max_scale: TImplementations§
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 4, 2, 2>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 4, 2, 2>
Sourcepub fn gauss_legendre_4() -> Self
pub fn gauss_legendre_4() -> Self
Creates a new Gauss-Legendre 2-stage implicit Runge-Kutta method of order 4.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 6, 3, 3>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 6, 3, 3>
Sourcepub fn gauss_legendre_6() -> Self
pub fn gauss_legendre_6() -> Self
Creates a new Gauss-Legendre 3-stage implicit Runge-Kutta method of order 6.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 2, 2, 2>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 2, 2, 2>
Sourcepub fn lobatto_iiic_2() -> Self
pub fn lobatto_iiic_2() -> Self
Creates a new Lobatto IIIC 2-stage implicit Runge-Kutta method of order 2.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 4, 3, 3>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Adaptive, T, V, D, 4, 3, 3>
Sourcepub fn lobatto_iiic_4() -> Self
pub fn lobatto_iiic_4() -> Self
Creates a new Lobatto IIIC 3-stage implicit Runge-Kutta method of order 4.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 1, 1, 1>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 1, 1, 1>
Sourcepub fn backward_euler(h0: T) -> Self
pub fn backward_euler(h0: T) -> Self
Backward Euler method of order 1 with 1 stage. A-stable and suitable for stiff problems.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 2, 2, 2>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 2, 2, 2>
Sourcepub fn crank_nicolson(h0: T) -> Self
pub fn crank_nicolson(h0: T) -> Self
Crank-Nicolson method of order 2 with 2 stages. A-stable and suitable for stiff problems.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 2, 2, 2>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 2, 2, 2>
Sourcepub fn trapezoidal(h0: T) -> Self
pub fn trapezoidal(h0: T) -> Self
Trapezoidal method of order 2 with 2 stages. A-stable and suitable for stiff problems.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 3, 2, 2>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 3, 2, 2>
Sourcepub fn radau_iia_3(h0: T) -> Self
pub fn radau_iia_3(h0: T) -> Self
Radau IIA method of order 3 with 2 stages. A-stable and suitable for stiff problems.
Source§impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 5, 3, 3>
impl<E, T: Real, V: State<T>, D: CallBackData> ImplicitRungeKutta<E, Fixed, T, V, D, 5, 3, 3>
Sourcepub fn radau_iia_5(h0: T) -> Self
pub fn radau_iia_5(h0: T) -> Self
Radau IIA method of order 5 with 3 stages. A-stable and suitable for stiff problems.
Source§impl<E, F, T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> ImplicitRungeKutta<E, F, T, V, D, O, S, I>
Sourcepub fn max_rejects(self, max_rejects: usize) -> Self
pub fn max_rejects(self, max_rejects: usize) -> Self
Set the maximum number of consecutive rejected steps before declaring stiffness
Sourcepub fn safety_factor(self, safety_factor: T) -> Self
pub fn safety_factor(self, safety_factor: T) -> Self
Set the safety factor for step size control (default: 0.9)
Sourcepub fn min_scale(self, min_scale: T) -> Self
pub fn min_scale(self, min_scale: T) -> Self
Set the minimum scale factor for step size changes (default: 0.2)
Sourcepub fn max_scale(self, max_scale: T) -> Self
pub fn max_scale(self, max_scale: T) -> Self
Set the maximum scale factor for step size changes (default: 10.0)
Sourcepub fn newton_tol(self, newton_tol: T) -> Self
pub fn newton_tol(self, newton_tol: T) -> Self
Set the Newton iteration tolerance (default: 1e-10)
Sourcepub fn max_newton_iter(self, max_newton_iter: usize) -> Self
pub fn max_newton_iter(self, max_newton_iter: usize) -> Self
Set the maximum number of Newton iterations per stage (default: 50)
Sourcepub fn dense_stages(&self) -> usize
pub fn dense_stages(&self) -> usize
Get the number of terms in the dense output interpolation polynomial
Trait Implementations§
Source§impl<E, F, T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Default for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Default for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
Source§impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Interpolation<T, V> for ImplicitRungeKutta<Ordinary, Adaptive, T, V, D, O, S, I>
impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Interpolation<T, V> for ImplicitRungeKutta<Ordinary, Adaptive, T, V, D, O, S, I>
Source§impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Interpolation<T, V> for ImplicitRungeKutta<Ordinary, Fixed, T, V, D, O, S, I>
impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> Interpolation<T, V> for ImplicitRungeKutta<Ordinary, Fixed, T, V, D, O, S, I>
Source§impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> OrdinaryNumericalMethod<T, V, D> for ImplicitRungeKutta<Ordinary, Adaptive, T, V, D, O, S, I>
impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> OrdinaryNumericalMethod<T, V, D> for ImplicitRungeKutta<Ordinary, Adaptive, T, V, D, O, S, I>
Source§fn init<F>(
&mut self,
ode: &F,
t0: T,
tf: T,
y0: &V,
) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
fn init<F>(
&mut self,
ode: &F,
t0: T,
tf: T,
y0: &V,
) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
Source§fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
Source§fn set_status(&mut self, status: Status<T, V, D>)
fn set_status(&mut self, status: Status<T, V, D>)
Source§impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> OrdinaryNumericalMethod<T, V, D> for ImplicitRungeKutta<Ordinary, Fixed, T, V, D, O, S, I>
impl<T: Real, V: State<T>, D: CallBackData, const O: usize, const S: usize, const I: usize> OrdinaryNumericalMethod<T, V, D> for ImplicitRungeKutta<Ordinary, Fixed, T, V, D, O, S, I>
Source§fn init<F>(
&mut self,
ode: &F,
t0: T,
tf: T,
y0: &V,
) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
fn init<F>(
&mut self,
ode: &F,
t0: T,
tf: T,
y0: &V,
) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
Source§fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
fn step<F>(&mut self, ode: &F) -> Result<Evals, Error<T, V>>where
F: ODE<T, V, D>,
Source§fn set_status(&mut self, status: Status<T, V, D>)
fn set_status(&mut self, status: Status<T, V, D>)
Auto Trait Implementations§
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> Freeze for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> RefUnwindSafe for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> Send for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> Sync for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> Unpin for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
impl<E, F, T, V, D, const O: usize, const S: usize, const I: usize> UnwindSafe for ImplicitRungeKutta<E, F, T, V, D, O, S, I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.