Description Usage Arguments Details Value Note Author(s) References See Also Examples
Functions used as part of argument model to call simulation functions.
1 2 3 4 5 6 |
t |
time |
p |
parameters, an array |
x |
state variable |
tz |
times of sudden disturbance |
State variable can be population density, or chemical concentration. For expon, p is dim 1: the rate coeff. For expon.rand, p is dim 2: mean and sdev of rate coeff. For expon.forced, p is dim 3: rate coeff and disturbance parameters. For expon.var, p is dim 4: mean, drift coeff, amplitude, and period of sinusoidal variation.
Functions expon.z and expon.g define discontinuous disturbance regime. Function expon.z defines times of discontinuities, and expon.g applies a linear disturbance at tz times defined by expon.z.
Rate of change or derivative of model. Except expon.z and expon.g that return disturbance regime.
Model functions are employed mainly to define the ODE to be simulated by sim.comp, sim.mruns, sim.rnum, sim, simd and other simulation functions.
Nominal parameter values are defined in input files. Variation of param values are defined in lists.
Input files are in 'datafiles.zip' in directory 'datafiles' and organized by chapters of Acevedo (2012). Input files are required to run the examples below.
Miguel F. Acevedo Acevedo@unt.edu
Acevedo M.F. 2012. Simulation of Ecological and Environmental Models. CRC Press.
Simulation functions sim.comp
, sim.rnum
, sim.mruns
, sim
, simd
Methods euler
, RK4
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 | ## Not run:
# exponential
model <- list(f=expon)
# single run
file<-"chp4/exp-pop-inp.csv"
out <- sim.comp(model,file)
# multiple runs
param <- list(plab="r", pval = seq(-0.02,0.02,0.01))
out.r <- sim.mruns(model, file, param)
# Monte Carlo run
model <- list(f=expon.rand)
file<-"chp4/exp-rnum-inp.csv"
out.rk <- sim.rnum(model,file)
# Harvest, multiple runs
exp.f <- list(f=expon.forced)
param <- list(plab="Ha",pval=c(0,-0.1,-0.2))
t.X <- sim(exp.f,"chp7/exp-harvest-inp.csv",param)
# Seasonality
exp.v <- list(f=expon.var)
param <- list(plab="rd",pval=c(0,-0.005,-0.01))
t.X <- sim(exp.v,"chp7/exp-var-inp.csv",param)
# sudden disturbance
exp.sud <- list(f=expon,z=expon.z,g=expon.g)
param <- list(plab="Ha",pval=c(-10,-20,-30))
t.X <- simd(exp.sud,file="chp7/exp-sud-inp.csv",param)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.