Struct rgsl::types::ordinary_differential_equations::ODEiv2Driver
source · pub struct ODEiv2Driver<'a> { /* private fields */ }
Implementations§
source§impl<'a> ODEiv2Driver<'a>
impl<'a> ODEiv2Driver<'a>
sourcepub fn alloc_y_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64
) -> Option<ODEiv2Driver<'a>>
pub fn alloc_y_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64
) -> Option<ODEiv2Driver<'a>>
These functions return a pointer to a newly allocated instance of a driver object. The functions automatically allocate and initialise the evolve, control and stepper objects for ODE system sys using stepper type T. The initial step size is given in hstart. The rest of the arguments follow the syntax and semantics of the control functions with same name (gsl_odeiv2_control_*_new).
sourcepub fn alloc_yp_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64
) -> Option<ODEiv2Driver<'a>>
pub fn alloc_yp_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64
) -> Option<ODEiv2Driver<'a>>
These functions return a pointer to a newly allocated instance of a driver object. The functions automatically allocate and initialise the evolve, control and stepper objects for ODE system sys using stepper type T. The initial step size is given in hstart. The rest of the arguments follow the syntax and semantics of the control functions with same name (gsl_odeiv2_control_*_new).
sourcepub fn alloc_standard_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64,
a_y: f64,
a_dydt: f64
) -> Option<ODEiv2Driver<'a>>
pub fn alloc_standard_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64,
a_y: f64,
a_dydt: f64
) -> Option<ODEiv2Driver<'a>>
These functions return a pointer to a newly allocated instance of a driver object. The functions automatically allocate and initialise the evolve, control and stepper objects for ODE system sys using stepper type T. The initial step size is given in hstart. The rest of the arguments follow the syntax and semantics of the control functions with same name (gsl_odeiv2_control_*_new).
sourcepub fn alloc_scaled_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64,
a_y: f64,
a_dydt: f64,
scale_abs: &[f64]
) -> Option<ODEiv2Driver<'a>>
pub fn alloc_scaled_new(
sys: &'a mut ODEiv2System<'_>,
t: &ODEiv2StepType,
hstart: f64,
epsabs: f64,
epsrel: f64,
a_y: f64,
a_dydt: f64,
scale_abs: &[f64]
) -> Option<ODEiv2Driver<'a>>
These functions return a pointer to a newly allocated instance of a driver object. The functions automatically allocate and initialise the evolve, control and stepper objects for ODE system sys using stepper type T. The initial step size is given in hstart. The rest of the arguments follow the syntax and semantics of the control functions with same name (gsl_odeiv2_control_*_new).
sourcepub fn set_hmin(&mut self, hmin: f64) -> GSLResult<()>
pub fn set_hmin(&mut self, hmin: f64) -> GSLResult<()>
The function sets a minimum for allowed step size hmin for driver self. Default value is 0.
sourcepub fn set_hmax(&mut self, hmax: f64) -> GSLResult<()>
pub fn set_hmax(&mut self, hmax: f64) -> GSLResult<()>
The function sets a maximum for allowed step size hmax for driver self. Default value is ::DBL_MAX.
sourcepub fn set_nmax(&mut self, nmax: usize) -> GSLResult<()>
pub fn set_nmax(&mut self, nmax: usize) -> GSLResult<()>
The function sets a maximum for allowed number of steps nmax for driver self. Default value of 0 sets no limit for steps.
sourcepub fn apply(&mut self, t: &mut f64, t1: f64, y: &mut [f64]) -> GSLResult<()>
pub fn apply(&mut self, t: &mut f64, t1: f64, y: &mut [f64]) -> GSLResult<()>
This function evolves the driver system d from t to t1. Initially vector y should contain the values of dependent variables at point t. If the function is unable to complete the calculation, an error code from gsl_odeiv2_evolve_apply is returned, and t and y contain the values from last successful step.
If maximum number of steps is reached, a value of enums::Value::MaxIteration is returned. If the step size drops below minimum value, the function returns with ::NoProg. If the user-supplied functions defined in the system sys returns enums::value::BadFunc, the function returns immediately with the same return code. In this case the user must call gsl_odeiv2_driver_reset before calling this function again.
sourcepub fn apply_fixed_step(
&mut self,
t: &mut f64,
h: f64,
n: usize,
y: &mut [f64]
) -> GSLResult<()>
pub fn apply_fixed_step(
&mut self,
t: &mut f64,
h: f64,
n: usize,
y: &mut [f64]
) -> GSLResult<()>
This function evolves the driver system d from t with n steps of size h. If the function is unable to complete the calculation, an error code from gsl_odeiv2_evolve_apply_fixed_step is returned, and t and y contain the values from last successful step.
sourcepub fn reset(&mut self) -> GSLResult<()>
pub fn reset(&mut self) -> GSLResult<()>
This function resets the evolution and stepper objects.
sourcepub fn reset_hstart(&mut self, hstart: f64) -> GSLResult<()>
pub fn reset_hstart(&mut self, hstart: f64) -> GSLResult<()>
The routine resets the evolution and stepper objects and sets new initial step size to hstart. This function can be used e.g. to change the direction of integration.