Technical Documentation¶
This is the technical documentation. See Tutorials instead to get started.
Methods¶
-
epimodel.
epimodel
(struct_linear, struct_interaction)¶ Parses struct into matrices
Parameters: - struct_linear (struct) –
struct corresponding to linear flows. The syntax is
struct.origin.target = flowrate
- struct_interaction (struct) –
struct corresponding to interacted flows. The syntax is
struct.origin.interaction.target = flowrate
Example
% SEIR model struct_linear.exposed.infectious = 1; struct_linear.infectious.recovered = 1; struct_interaction.susceptible.infectious.exposed = 1; seir_model = epimodel(struct_linear, struct_interaction);
- struct_linear (struct) –
-
epimodel.
set_initial_dist
(struct_dist)¶ Sets initial distribution
Parameters: struct_dist (struct) – struct of initial distribution. Unfilled values default to zero Example
struct_dist.infectious = 1e-4; struct_dist.susceptible = 1 - 1e-4; seir_model.set_initial_dist(struct_dist);
-
epimodel.
simulate
(end_time, time_step)¶ Runs simulation/ODE forward
Parameters: - end_time (double) – end time of simulation
- time_step (double) – [default 1e-3] time step of discretization
Example
seir_model.simulate(10);
See also
Note
Note that The values are computed using an “explicit” udpate, so time_step needs to small enough to satisfy the CFL condition.
Properties¶
-
epimodel.
results
¶ Type: struct
Description: Struct of simulation results
Example: plot(model.results.time, model.results.infectious);
-
epimodel.
init_dist
¶ Type: double Description: vector of initial distribution Note: Set it using set_initial_dist
-
epimodel.
name2loc
¶ Type: struct Description: (INTERNAL ATTRIBUTE) struct of location for different variables
-
epimodel.
loc2name
¶ Type: cell array Description: (INTERNAL ATTRIBUTE) cell array of variable names
-
epimodel.
time_knots
¶ Type: double Description: time knot points of simulation