pub struct SdeProblem<F, G>{
pub x0: Array1<f64>,
pub t_span: [f64; 2],
pub n_brownian: usize,
pub f_drift: F,
pub g_diffusion: G,
}Expand description
Defines a Stochastic Differential Equation problem of the form:
dx = f(t, x) dt + g(t, x) dW, x(t0) = x0where f is the drift coefficient, g is the diffusion matrix,
and dW is an m-dimensional Wiener process increment.
§Type Parameters
F- drift function type:Fn(f64, &Array1<f64>) -> Array1<f64>G- diffusion function type:Fn(f64, &Array1<f64>) -> Array2<f64>
Fields§
§x0: Array1<f64>Initial state vector x(t0), dimension n
t_span: [f64; 2]Time span [t0, t1]
n_brownian: usizeNumber of independent Brownian motions (Wiener processes), m
f_drift: FDrift coefficient f(t, x): R × R^n → R^n
g_diffusion: GDiffusion matrix g(t, x): R × R^n → R^{n×m}
Implementations§
Source§impl<F, G> SdeProblem<F, G>
impl<F, G> SdeProblem<F, G>
Sourcepub fn new(
x0: Array1<f64>,
t_span: [f64; 2],
n_brownian: usize,
f_drift: F,
g_diffusion: G,
) -> Self
pub fn new( x0: Array1<f64>, t_span: [f64; 2], n_brownian: usize, f_drift: F, g_diffusion: G, ) -> Self
Create a new SDE problem.
§Arguments
x0- Initial state vector (length n)t_span- Time interval [t0, t1]n_brownian- Number of independent Brownian motionsf_drift- Drift function f(t, x) → R^ng_diffusion- Diffusion function g(t, x) → R^{n×m}
§Errors
Returns an error if the time span is invalid (t0 >= t1).
Sourcepub fn validate(&self) -> IntegrateResult<()>
pub fn validate(&self) -> IntegrateResult<()>
Validate the problem parameters
Auto Trait Implementations§
impl<F, G> Freeze for SdeProblem<F, G>
impl<F, G> RefUnwindSafe for SdeProblem<F, G>where
F: RefUnwindSafe,
G: RefUnwindSafe,
impl<F, G> Send for SdeProblem<F, G>
impl<F, G> Sync for SdeProblem<F, G>
impl<F, G> Unpin for SdeProblem<F, G>
impl<F, G> UnsafeUnpin for SdeProblem<F, G>where
F: UnsafeUnpin,
G: UnsafeUnpin,
impl<F, G> UnwindSafe for SdeProblem<F, G>where
F: UnwindSafe,
G: UnwindSafe,
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
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more