# SIR Model API

Simulate the epidemic model SIR

## Features

• Free
• Responds in JSON format

## What is the SIR model?

The classical SIR model is used to model the disease spread. It divides the population into three non-overlapping classes: susceptibles (S), infected, (I), and recovered (R). The model describes how the number of individuals under each of the classes changes over time. These changes are described according to the system of ordinary differential equations below:

\begin{aligned} {dS \over dt} &= { - {\beta SI} \over N } \\ {dI \over dt} &= { {\beta SI} \over N } - {\gamma I} \\ {dR \over dt} &= {\gamma I} \end{aligned}

$$\beta$$ is the effective transmission rate while $$\gamma$$ is the removal rate. The model assumes a closed population (i.e. constant population). This means that at each time $$t$$, $$S + I + R = N$$, where $$N$$ is the total population. Read More.

## How to use

The API needs six parameters. All query parameters must be a number:

• s - initial number of susceptible individuals
• i - initial number of infected
• r - initial number of recovered
• b - beta (effective transmission rate)
• g - gamma (removal rate)
• t - time length

The response is an object with three keys:

• t - index of time (index starts at 0)
• s - number susceptible individuals at time t
• i - number infected individuals at time t
• r - number recovered individuals at time t