Struct rkf45::ErrorControlOptions
source · pub struct ErrorControlOptions {
pub absolute_magnitude: f64,
pub relative_magnitude: f64,
pub function_scale: f64,
pub derivative_scale: f64,
}
Expand description
Options for computing desired error when performing adaptive time-stepping.
rkf45_adaptive
compares its estimate to a desired error, which is computed as
D = max(absolute_magnitude + relative_magnitude * (function_scale * y[i] + derivative_scale * dt * dydt[i]))
where [i]
denotes the i
th component, and the max is taken over all components.
This form supports a variety of ways of controlling the size of the desired error
relative to y
itself or to its increments.
Fields§
§absolute_magnitude: f64
Magnitude of the absolute component of desired error. Even if relative error is the primary feature of interest, this must be set to a nonzero value as a safety measure in case both y and dydt are near zero.
relative_magnitude: f64
Magnitude of the relative component of desired error.
function_scale: f64
Contribution of y
to the relative component of desired error.
derivative_scale: f64
Contribution of y
’s increment (dt * dydt
) to the relative component of desired error.
Implementations§
source§impl ErrorControlOptions
impl ErrorControlOptions
sourcepub fn simple(scale: f64) -> ErrorControlOptions
pub fn simple(scale: f64) -> ErrorControlOptions
A simple error control option that sets the desired error to
D = max(scale * (1 + y[i] + dt * dydt[i]))
This has a lower bound of scale
, but it grows proportional to y
or dydt
as either one
becomes large.