CNsim {soilfoodwebs}R Documentation

A function to simulate the dynamics over time wrapping getPARAMS and foodwebode

Description

A function to simulate the dynamics over time wrapping getPARAMS and foodwebode

Usage

CNsim(
  usin,
  DIETLIMTS = NA,
  diet_correct = TRUE,
  Conly = FALSE,
  userdefinedinputs = NA,
  start_mod = NA,
  TIMES = 1:100,
  keepallnitrogen = TRUE,
  has_inorganic_nitrogen = FALSE,
  densitydependence = NA,
  inorganic_nitrogen_properties = list(INN = NA, q = NA, eqmN = NA),
  DETEXPT = NA,
  DETEXPTSTART = NA,
  rtn_only_state = TRUE
)

Arguments

usin

The community you want to simulate.

DIETLIMTS

The diet limits matrix for the stoichiometry correction (proportion of diet)?

diet_correct

Boolean: Does the organism correct it's diet?

Conly

Boolean: Is the model meant for carbon only?

userdefinedinputs

Do you want to input a user defined vector of input functions? If NA the input values that keep the system at equilibrium are calculated. If not, put in a vector of input rates for each node.

start_mod

A vector of modifications to the starting conditions, which default to the biomass vector in the community. This vector is multiplied by the biomass vector.

TIMES

The vector of times that you want to run the model. Defaults to 1 to 100 by 1.

keepallnitrogen

Boolean: Keep all the nitrogen pools in the model output? Will be set to FALSE if you are running a stability analysis using the function stability2().

has_inorganic_nitrogen

Boolean: Is there an inorganic nitrogen pool?

densitydependence

Which nodes have density dependence? NA default means none of them do. Should be a vector of 0 (no DD) and 1 (DD) for each node.

inorganic_nitrogen_properties

A list of state variables for the inorganic nitrogen pool (INN = inputs, q = per capita loss of N, eqmN = equilibrium N). Must include a value for two of the three variables and has the final one as NA.

DETEXPT

The pool that should be used for the detritus experiment by name or position in the vector usin$prop$ID.

DETEXPTSTART

The start of the detritus experiment. Defaults to 100.

rtn_only_state

Boolean: Do you want to only return the model state variables? If FALSE then the consumption rates and production efficiency at each time step are also returned.

Details

A function that simulates the food web over the user defined times. If you do not modify the starting state using start_mod or add a detritus experiment using DETEXPT, then the result will just be a flat line if the food web is stable.

Value

The output of the simulation.

See Also

The function uses getPARAMS and foodwebode to simulate the community.

Examples

# Basic example with a 5% reduction in predator biomass:
CNsim(intro_comm, start_mod = c(0.95, 1,1,1,1,1,1))

# Simulate a decomposition experiment:
CNsim(intro_comm, DETEXPT = c("Detritus1"), DETEXPTSTART = 100)


[Package soilfoodwebs version 1.0.2 Index]