[][src]Struct bacon_sci::ivp::BDF6

pub struct BDF6<N: ComplexField> { /* fields omitted */ }

6th order backwards differentiation formula method for solving an initial value problem.

Defines the higher and lower order coefficients. Uses BDFInfo for the actual solving.

Examples

use nalgebra::DVector;
use bacon_sci::ivp::{IVPSolver, BDF6, BDFSolver};
fn derivatives(_t: f64, state: &[f64], _p: &mut ()) -> Result<DVector<f64>, String> {
    Ok(-DVector::from_column_slice(state))
}

fn example() -> Result<(), String> {
    let bdf = BDF6::new()
        .with_dt_max(0.1)?
        .with_dt_min(0.00001)?
        .with_tolerance(0.00001)?
        .with_start(0.0)?
        .with_end(10.0)?
        .with_initial_conditions(&[1.0])?
        .build();
    let path = bdf.solve_ivp(derivatives, &mut ())?;
    for (time, state) in &path {
        assert!(((-time).exp() - state.column(0)[0]).abs() < 0.001);
    }
    Ok(())
}

Implementations

impl<N: ComplexField> BDF6<N>[src]

pub fn new() -> Self[src]

Trait Implementations

impl<N: ComplexField> BDFSolver<N> for BDF6<N>[src]

impl<N: Clone + ComplexField> Clone for BDF6<N>[src]

impl<N: Debug + ComplexField> Debug for BDF6<N>[src]

impl<N: ComplexField> Default for BDF6<N>[src]

impl<N: ComplexField> From<BDF6<N>> for BDFInfo<N>[src]

Auto Trait Implementations

impl<N> RefUnwindSafe for BDF6<N> where
    N: RefUnwindSafe,
    <N as ComplexField>::RealField: RefUnwindSafe
[src]

impl<N> Send for BDF6<N> where
    <N as ComplexField>::RealField: Send
[src]

impl<N> Sync for BDF6<N> where
    <N as ComplexField>::RealField: Sync
[src]

impl<N> Unpin for BDF6<N> where
    N: Unpin,
    <N as ComplexField>::RealField: Unpin
[src]

impl<N> UnwindSafe for BDF6<N> where
    N: UnwindSafe,
    <N as ComplexField>::RealField: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 
[src]

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,