Skip to content

Commit

Permalink
Add equation
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Nov 14, 2024
1 parent 7d59e3b commit adf14fa
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion odin.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@ library(odin2)

## A simple example {#sec-odin-sir}

Here is a small system of equations for an "SIR" (Susceptible-Infected-Recovered) model, implemented as a set of ordinary differential equations:
Here is a small system of differential equations for an "SIR" (Susceptible-Infected-Recovered) model:

\begin{gather*}
\frac{dS}{dt} = -\beta S \frac{I}{N}\\
\frac{dI}{dt} = \beta S \frac{I}{N} - \gamma I\\
\frac{dR}{dt} = \gamma I
\end{gather*}

And here is an implementation of these equations in `odin`:

```{r}
sir <- odin({
Expand Down

0 comments on commit adf14fa

Please sign in to comment.