Crate sir_ddft

source ·
Expand description

This crate contains solvers for the SIR model, the spatial SIR model extension including diffusion and a novel SIR model based on dynamical density functional theory.

§Usage

Basic usage follows the same pattern for all models:

// Setup parameters and initial state
let params = SIRParameters::new(0.5, 0.1);
let state = SIRState::new(0.998, 0.002, 0.);
// Create the IVP and solver
let mut ivp = SIRODEIVP::new(params, state);
let solver = RKF45Solver::<SIRODEIVP>::new();
// Integrate for some time
ivp.add_time(2.0);
solver.integrate(&mut ivp);
// Retrieve the result
let (t,state) = ivp.get_result();

Modules§

Structs§

Enums§

  • Types of one-dimensional grids.
  • Types of two-dimensional grids.