# SolveSI: Modelling of sterilization and immigration of comapnion... In oswaldosantos/capm: Companion Animal Population Management

## Description

System of ordinary differential equations to simulate the effect of sterilization and immigration on population dynamics.

## Usage

 ```1 2``` ```SolveSI(pars = NULL, init = NULL, time = NULL, dd = "b", im = 0, s.range = NULL, ...) ```

## Arguments

 `pars` `vector` of length 4. The values are point estimates of birth rate, death rate, carrying capacity and sterilization rate. The names of this values must be "b", "d", "k" and "s", respectively. `init` `vector` of length 2. The values are initial population size and initial proportion of sterilized animals. The names of this values must be "n" and "q", respectively. `time` time sequence for which output is wanted; the first value of times must be the initial time. `dd` string equal to `b`, `d` or `bd` to define if density-dependece act on birth rate, death rarte or both, respectively. `im` a number representing the total of immigrants per time unit. `s.range` optional sequence (between 0 and 1) of the sterilization rates to be simulated. `...` further arguments passed to ode function.

## Details

The implemented model is described by Amaku, et. al., 2009 and the function is a wrapper around the defaults of ode function, whose help page must be consulted for details.

## Value

`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 sisxth element `results` is a `data.frame` with up to as many rows as elements in time. First column contains the time, second column the population size and third column the proportion of sterilized animals. If `s.range` is specified, fourth column contains its specific instances.

## Note

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

## References

Amaku M, Dias R and Ferreira F (2009). Dinamica populacional canina: potenciais efeitos de campanhas de esterilizacao. Revista Panamericana de Salud Publica, 25(4), pp. 300-304.

Soetaert K, Cash J and Mazzia F (2012). Solving differential equations in R. Springer.

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```# Parameters and initial conditions. pars_solve_si = c(b = 0.245, d = 0.101, k = 98050, s = 0.048) init_solve_si = c(n = 89137, q = 0.198) # Solve for a specific sterilization rate. solve_si_pt = SolveSI(pars = pars_solve_si, init = init_solve_si, time = 0:15, dd = "b", im = 100, method = "rk4") # Solve for a range of sterilization rates. solve_si_rg = SolveSI(pars = pars_solve_si, init = init_solve_si, time = 0:15, dd = "b", im = 100, s.range = seq(0, .4, l = 50), method = "rk4") ```