Crate diffurch

Source
Expand description

diffurch is a library that implements numerical methods for ordinary and delay differential equations.

§Supported types of equations

  • Continuous ODEs (Ordinary Differential Equations).
  • Non-sliding discontinuous or impulse ODEs (*).
  • Continuous or impulse (neutral) DDEs (Delay Differential Equations) with constant or variable non-vanishing delays.
  • Non-sliding discontinuous (neutral) DDEs with constant or variable non-vanishing delays (*).

(here (*) means that kind of equation is supported using an event system rather than by using discontinuous functions directly in equation)

§Features

  • Event detection
  • Event filtering
  • Delay-induced discontinuity propagation
  • Dense output
  • Wide range of explicit Runge-Kutta methods with interpolation
  • (not yet) Automatic step size control

§Goals

  • Peak performance: as much as possible is done at compile time, avoiding dynamic dispatch or unnecessary runtime branching.
  • Support for ODEs and DDEs, including neutral DDEs.
  • Support for discontinuous, impulse, and hybrid equations.
  • Ergonomics, minimal boilerplate: use of convenience macros to wrap closures and (not yet there) simple symbolic system.

Re-exports§

pub use equation::*;
pub use event::*;
pub use filter::*;
pub use initial_condition::*;
pub use loc::*;
pub use solver::*;
pub use state::*;

Modules§

collections
Custom collections that are used in a crate
equation
Defines Equation, which holds the right hand side of the equation.
event
Defines Event
filter
Defines crate::Filter trait for filtering callbacks in crate::Event and crate::Loc.
initial_condition
Defines InitialCondition.
loc
Detection and location of events
polynomial
Defines crate::polynomial! macro and crate::polynomial::Differentiable conatiner for pairs of closures.
rk
In this module, RungeKuttaTable struct and many known Runge-Kutta methods are defined.
solver
Defines Solver.
state
Defines State, the core object which is acted upon during integration.

Macros§

equation
Creates a crate::Equation from a closure.
event
Creates a crate::Event from a closure.
event_mut
State-mutating counter-part of event!.
generic_rk_order2
Macro declares a static RungeKuttaTable<2> of order 2 with linear interpolantion, and Euler method as an embedded scheme. https://en.wikipedia.org/wiki/List_of_Runge%E2%80%93Kutta_methods#cite_ref-butcher_1-0
generic_rk_order3
Macro declares a static RungeKuttaTable<3> of order 3 with linear interpolantion, and embedded order 2 method https://en.wikipedia.org/wiki/List_of_Runge–Kutta_methods
loc_bool
Convenience macro for change-of-bool event locator
loc_sign
Convenience macro for change-of-sign event locator
mut_state_fn
Constructs a MutStateFnMut object from a closure.
polynomial
Produces [crate::util::with_derivative::Differentiable] that holds a polynomial, produced by crate::polynomial_closure and its derivative closure, produced by crate::polynomial_derivative_closure.
polynomial_closure
Produce a fn(f64) -> f64 closure that represents a polynomial function with given coefficients.
polynomial_derivative_closure
Same as crate::polynomial_closure, but produces a closure, that corresponds to differentiated polynomial function.
state_fn
Constructs a StateFnMut object from a closure.