[][src]Struct bacon_sci::ivp::RK45

pub struct RK45<N: ComplexField, S: DimName> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N, S, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6, U6>, 
{ /* fields omitted */ }

Runge-Kutta-Fehlberg method for solving an IVP.

Defines the Butch Tableaux for a 5(4) order adaptive runge-kutta method. Uses RKInfo to do the actual solving. Provides an interface for setting the conditions on RKInfo.

Examples

use nalgebra::{VectorN, U1};
use bacon_sci::ivp::{RK45, RungeKuttaSolver};
fn derivatives(_t: f64, state: &[f64], _p: &mut ()) -> Result<VectorN<f64, U1>, String> {
    Ok(VectorN::<f64, U1>::from_column_slice(state))
}

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

Implementations

impl<N: ComplexField, S: DimName> RK45<N, S> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N, S, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6, U6>, 
[src]

pub fn new() -> Self[src]

Trait Implementations

impl<N: Clone + ComplexField, S: Clone + DimName> Clone for RK45<N, S> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N, S, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6, U6>, 
[src]

impl<N: Debug + ComplexField, S: Debug + DimName> Debug for RK45<N, S> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N, S, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6, U6>, 
[src]

impl<N: ComplexField, S: DimName> From<RK45<N, S>> for RKInfo<N, S, U6> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, S, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>, 
[src]

impl<N: ComplexField, S: DimName> RungeKuttaSolver<N, S, U6> for RK45<N, S> where
    DefaultAllocator: Allocator<N, S>,
    DefaultAllocator: Allocator<N, U6>,
    DefaultAllocator: Allocator<N, U6, U6>,
    DefaultAllocator: Allocator<N::RealField, U6>,
    DefaultAllocator: Allocator<N::RealField, U6, U6>,
    DefaultAllocator: Allocator<N, S, U6>, 
[src]

Auto Trait Implementations

impl<N, S> !RefUnwindSafe for RK45<N, S>[src]

impl<N, S> !Send for RK45<N, S>[src]

impl<N, S> !Sync for RK45<N, S>[src]

impl<N, S> !Unpin for RK45<N, S>[src]

impl<N, S> !UnwindSafe for RK45<N, S>[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>,