Trait bacon_sci::ivp::AdamsSolver
source · pub trait AdamsSolver<N, const S: usize, const O: usize>: Sizedwhere
N: ComplexField,{
// Required methods
fn predictor_coefficients() -> SVector<N::RealField, O>;
fn corrector_coefficients() -> SVector<N::RealField, O>;
fn error_coefficient() -> N::RealField;
fn solve_ivp<T, F>(
self,
f: F,
params: &mut T
) -> Result<Vec<(N::RealField, SVector<N, S>)>, String>
where T: Clone,
F: FnMut(N::RealField, &[N], &mut T) -> Result<SVector<N, S>, String>;
fn with_tolerance(self, tol: N::RealField) -> Result<Self, String>;
fn with_dt_max(self, max: N::RealField) -> Result<Self, String>;
fn with_dt_min(self, min: N::RealField) -> Result<Self, String>;
fn with_start(self, t_initial: N::RealField) -> Result<Self, String>;
fn with_end(self, t_final: N::RealField) -> Result<Self, String>;
fn with_initial_conditions(self, start: &[N]) -> Result<Self, String>;
fn build(self) -> Self;
}Expand description
This trait allows a struct to be used in the Adams Predictor-Corrector solver
Things implementing AdamsSolver should have an AdamsInfo to handle the actual IVP solving.
Examples
See struct Adams for an example of implementing this trait
Required Methods§
sourcefn predictor_coefficients() -> SVector<N::RealField, O>
fn predictor_coefficients() -> SVector<N::RealField, O>
The polynomial interpolation coefficients for the predictor. Should start with the coefficient for n - 1
sourcefn corrector_coefficients() -> SVector<N::RealField, O>
fn corrector_coefficients() -> SVector<N::RealField, O>
The polynomial interpolation coefficients for the corrector. Must be the same length as predictor_coefficients. Should start with the implicit coefficient.
sourcefn error_coefficient() -> N::RealField
fn error_coefficient() -> N::RealField
Coefficient for multiplying error by.
sourcefn solve_ivp<T, F>(
self,
f: F,
params: &mut T
) -> Result<Vec<(N::RealField, SVector<N, S>)>, String>where
T: Clone,
F: FnMut(N::RealField, &[N], &mut T) -> Result<SVector<N, S>, String>,
fn solve_ivp<T, F>( self, f: F, params: &mut T ) -> Result<Vec<(N::RealField, SVector<N, S>)>, String>where T: Clone, F: FnMut(N::RealField, &[N], &mut T) -> Result<SVector<N, S>, String>,
Use AdamsInfo to solve an initial value problem
sourcefn with_tolerance(self, tol: N::RealField) -> Result<Self, String>
fn with_tolerance(self, tol: N::RealField) -> Result<Self, String>
Set the error tolerance for this solver.
sourcefn with_dt_max(self, max: N::RealField) -> Result<Self, String>
fn with_dt_max(self, max: N::RealField) -> Result<Self, String>
Set the maximum time step for this solver.
sourcefn with_dt_min(self, min: N::RealField) -> Result<Self, String>
fn with_dt_min(self, min: N::RealField) -> Result<Self, String>
Set the minimum time step for this solver.
sourcefn with_start(self, t_initial: N::RealField) -> Result<Self, String>
fn with_start(self, t_initial: N::RealField) -> Result<Self, String>
Set the initial time for this solver.
sourcefn with_end(self, t_final: N::RealField) -> Result<Self, String>
fn with_end(self, t_final: N::RealField) -> Result<Self, String>
Set the end time for this solver.
sourcefn with_initial_conditions(self, start: &[N]) -> Result<Self, String>
fn with_initial_conditions(self, start: &[N]) -> Result<Self, String>
Set the initial conditions for this solver.