-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding Lotka Volterra to model library
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: "Lotka-Volterra" | ||
index_entry: "simple two-species competition model" | ||
author: Jennifer Freeman | ||
--- | ||
|
||
- $X$ - number of individuals in species $X$ | ||
- $Y$ - number of individuals in species $Y$ | ||
- $r_i$ - growth rate of species $I$ | ||
- $a_{ij}$ - intra/inter-specific density dependence, ``effect of species $j$ on species $i$'' (Hastings, 1997) | ||
|
||
$$ | ||
\begin{align*} | ||
\frac{dX}{dt} &= r_x X (1 - a_{xx}X - a_{xy}Y) \\ | ||
\frac{dY}{dt} &= r_y Y (1 - a_{yy}Y - a_{yx}X) | ||
\end{align*} | ||
$$ | ||
|
||
Hastings, A. (1997). Competition. In: Population Biology. Springer, New York, NY. https://doi.org/10.1007/978-1-4757-2731-9_7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
library(macpan2) | ||
|
||
## expression lists | ||
################################################### | ||
|
||
## free form computations for convenience | ||
## none | ||
|
||
## absolute flow rates (per time only) | ||
## reference | ||
flow_rates = list( | ||
## growth rate of species X and Y | ||
growth_x ~ rx * X | ||
, growth_y ~ ry * Y | ||
## intraspecific effect | ||
## species X on X | ||
, intraspecific_x ~ growth_x * axx * X | ||
## species Y on Y | ||
, intraspecific_y ~ growth_y * ayy * Y | ||
## interspecific effect | ||
## species X on Y | ||
, interspecific_xy ~ growth_x * ayx * Y | ||
## species Y on X | ||
, interspecific_yx ~ growth_y * axy * X | ||
) | ||
|
||
## state updates | ||
state_updates = list( | ||
X ~ X + growth_x - intraspecific_x - interspecific_xy | ||
, Y ~ Y + growth_y - intraspecific_y - interspecific_yx | ||
) | ||
|
||
## simple unstructured scalar expression | ||
expr_list = ExprList( | ||
during = c( | ||
flow_rates | ||
, state_updates | ||
) | ||
) |
8a5d7c1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it!