pmcore::prelude

Type Alias Init

pub type Init = fn(_: &Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>, _: f64, _: &Covariates, _: &mut Matrix<f64, Dyn, Const<1>, VecStorage<f64, Dyn, Const<1>>>);
Expand description

This closure represents the initial state of the system: Params:

  • p: The parameters of the model; Use the [fetch_params!] macro to extract the parameters
  • t: The time at which the initial state is evaluated; Hardcoded to 0.0
  • cov: A reference to the covariates at time t; Use the [fetch_cov!] macro to extract the covariates
  • x: A mutable reference to the state vector at time t Example:
use pharmsol::*;
let init = |p, t, cov, x| {
 fetch_params!(p, ka, ke, v);
 fetch_cov!(cov, t, wt);
 x[0] = 500.0;
 x[1] = 0.0;
};