System of ordinary differential equations to simulate the effect of immigration of owned dogs, abandonment, sterilization of owned and stray dogs and adoption, on population dynamics.

1 2 |

`pars` |
a named |

`init` |
a named |

`time` |
time sequence for which output is wanted; the first value of times must be the initial time. |

`s.range` |
optional sequence (between 0 and 1) of the sterilization rates to be simulated. |

`a.range` |
optional |

`alpha.range` |
optional |

`v.range` |
optional |

`s.fm` |
logical. If |

`...` |
further arguments passed to ode function. |

The `pars`

argument must contain named values, using the following conventions: `1`

: owned animals; `2`

: stray animals; `f`

: females; `m`

: males. Then:

`b1`

and `b2`

: number of births.

`df1`

, `dm1`

, `df2`

and `dm2`

: death rate.

`sf1`

, `sm1`

, `sf2`

and `sm2`

: sterilization rate.

`k1`

and `k2`

: carrying capacity.

`h1`

and `h2`

: mean harem size.

`a`

: abandonment rate.

`alpha`

: adoption rate.

`v`

: immigration rate.

`z`

: proportion of sterilized immigrants.

The `init`

argument must contain named values for the inital number of animals, using the following conventions: `1`

: owned animals; `2`

: stray animals; `f`

: females; `m`

: males; and `s`

: sterilized. Then, the names are:

`f1`

, `fs1`

, `m1`

, `ms1`

, `f2`

, `fs2`

, `m2`

and `ms2`

.

If any range is specified (e.g `s.range`

), the remaining ranges must be specified too (`a.range`

, `alpha.range`

and `v.range`

).
The function is a wrapper around the defaults of ode function, whose help page must be consulted for details. An exception is the method argument, which here has "rk4" as a default.

`list`

. The first element, `name`

, is a string with the name of the function, the second element, `model`

, is the model function. The third, fourth and fifth elements are vectors (`pars`

, `init`

, `time`

, respectively) containing the `pars`

, `init`

and `time`

arguments of the function. The sisxthth element `results`

is a `data.frame`

with up to as many rows as elements in time. The first column contain the time and subsequent columns contain the size of specific subpopulations, named according to conventions above. The `group`

column differentiate between owned and strays. When *.range arguments are given, the last fourth columsn specify their instances.

Logistic growth models are not intended for scenarios in which population size is greater than carrying capacity and growth rate is negative.

http://oswaldosantos.github.io/capm

ode.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ```
# Parameters and initial conditions.
pars.solve.iasa = c(
b1 = 21871, b2 = 4374,
df1 = 0.104, dm1 = 0.098, df2 = 0.125, dm2 = 0.118,
sf1 = 0.069, sf2 = 0.05, sm1 = 0.028, sm2 = 0.05,
k1 = 98050, k2 = 8055, h1 = 1, h2 = 0.5,
a = 0.054, alpha = 0.1, v = 0.2, z = 0.1)
init.solve.iasa = c(
f1 = 33425, fs1 = 10865,
m1 = 38039, ms1 = 6808,
f2 = 3343, fs2 = 109,
m2 = 3804, ms2 = 68)
# Solve for point estimates.
solve.iasa.pt <- SolveIASA(pars = pars.solve.iasa,
init = init.solve.iasa,
time = 0:8, method = 'rk4')
# Solve for parameter ranges.
solve.iasa.rg <- SolveIASA(pars = pars.solve.iasa,
init = init.solve.iasa,
time = 0:8,
s.range = seq(0, .4, l = 15),
a.range = c(0, .2),
alpha.range = c(0, .2),
v.range = c(0, .1),
method = 'rk4')
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.