plot_odeweb function

Plot food web dynamics

Plot food web dynamics

Plot solution of the ODE for the food web. Currently only species and not nutrients are plotted.

plot_odeweb(x, nb_s)

Arguments

  • x: matrix with solutions. First row should be the time vector.
  • nb_s: numeric, number of species as in the model (e.g., create_model_Unscaled_nuts).

Returns

No return value, called for side effects.

Examples

## Not run: library(ATNr) library(deSolve) set.seed(123) # number of species, nutrients, and body masses n_species <- 20 n_basal <- 5 n_nutrients <- 3 masses <- sort(10^runif(n_species, 2, 6)) #body mass of species # create food web matrix L <- create_Lmatrix(masses, n_basal) L[, 1:n_basal] <- 0 fw <- L fw[fw > 0] <- 1 model <- create_model_Unscaled_nuts( n_species, n_basal, n_nutrients, masses, fw ) # initialize model as default in Schneider et al. (2016) model <- initialise_default_Unscaled_nuts(model, L) # defining integration time times <- seq(0, 500, 5) biomasses <- runif(n_species + n_nutrients, 2, 3) sol <- lsoda_wrapper(times, biomasses, model, verbose = FALSE) plot_odeweb(sol, model$nb_s) ## End(Not run)
  • Maintainer: Benoit Gauzens
  • License: GPL (>= 2)
  • Last published: 2023-09-04

Useful links