Skip to main content

Milstein

Struct Milstein 

Source
pub struct Milstein<T: Real, Y: State<T>> {
    pub h0: T,
    pub h_min: T,
    pub h_max: T,
    pub max_steps: usize,
    /* private fields */
}
Expand description

Derivative-Free Milstein method for solving SDEs.

Provides strong order 1.0 convergence for commutative/diagonal noise, which is an improvement over the 0.5 strong order of Euler-Maruyama.

Fields§

§h0: T§h_min: T§h_max: T§max_steps: usize

Implementations§

Source§

impl<T: Real, Y: State<T>> Milstein<T, Y>

Source

pub fn new(h0: T) -> Self

Creates a new Milstein method solver

Source

pub fn h_min(self, h_min: T) -> Self

Set minimum step size

Source

pub fn h_max(self, h_max: T) -> Self

Set maximum step size

Source

pub fn max_steps(self, max_steps: usize) -> Self

Set maximum number of steps

Trait Implementations§

Source§

impl<T: Real, Y: State<T>> Interpolation<T, Y> for Milstein<T, Y>

Source§

fn interpolate(&mut self, t_interp: T) -> Result<Y, Error<T, Y>>

Evaluate the step-local interpolant at the given time. Read more
Source§

impl<T: Real, Y: State<T>> StochasticNumericalMethod<T, Y> for Milstein<T, Y>

Source§

fn init<F>( &mut self, sde: &mut F, t0: T, tf: T, y0: &Y, ) -> Result<Evals, Error<T, Y>>
where F: SDE<T, Y> + ?Sized,

Initialize the solver before integration Read more
Source§

fn step<F>(&mut self, sde: &mut F) -> Result<Evals, Error<T, Y>>
where F: SDE<T, Y> + ?Sized,

Advance the solution by one step Read more
Source§

fn t(&self) -> T

Time of last accepted step
Source§

fn y(&self) -> &Y

State at last accepted step
Source§

fn t_prev(&self) -> T

Time of previous accepted step
Source§

fn y_prev(&self) -> &Y

State at previous accepted step
Source§

fn h(&self) -> T

Step size for next step
Source§

fn set_h(&mut self, h: T)

Set step size for next step
Source§

fn status(&self) -> &Status<T, Y>

Current solver status
Source§

fn set_status(&mut self, status: Status<T, Y>)

Set solver status

Auto Trait Implementations§

§

impl<T, Y> Freeze for Milstein<T, Y>
where T: Freeze, Y: Freeze,

§

impl<T, Y> RefUnwindSafe for Milstein<T, Y>

§

impl<T, Y> Send for Milstein<T, Y>
where Y: Send,

§

impl<T, Y> Sync for Milstein<T, Y>
where Y: Sync,

§

impl<T, Y> Unpin for Milstein<T, Y>
where T: Unpin, Y: Unpin,

§

impl<T, Y> UnsafeUnpin for Milstein<T, Y>
where T: UnsafeUnpin, Y: UnsafeUnpin,

§

impl<T, Y> UnwindSafe for Milstein<T, Y>
where T: UnwindSafe, Y: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.