Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

08: Continuous Time Markov Chains (CTMC)

You can find a simulator for CTMCs here. It has a documentation on how to write model definitions here.

Use this definition of a SIR model[1] as a starting point.

//SIR Model

const beta = 2e-4[1/h];
const mu = 2e-2[1/h];
const population_size = 1000;

/* Species definitions */
Susceptible();
Infected();
Recovered();

/* The initial state */
Initial: 1 Infected + (population_size-1) Susceptible;

/* Rules */
Infected + Susceptible -> 2 Infected @ beta;
Infected -> Recovered @ mu;

/* Observed variables */
output ##Susceptible;
output ##Infected;
output ##Recovered;
Footnotes
  1. Model definition contributed by Pia Wilsdorf.