scenarios | R Documentation |
Triggers dynamic simulation(s) of a 0D model for one to many scenarios. The individual scenarios can differ by the initial state or the values of parameters. Optionally produces basic plots.
times |
Numeric vector defining the times for which the future state of the system is computed. |
scenarios |
Either |
fortran |
Logical. Passed to the respective argument of
|
plot.vars |
Logical. Plot the dynamics of all state variables? |
plot.pros |
Logical. Plot the dynamics of process rates? |
leg |
Keyword to set the position of the legend (if plots are created). |
mar |
Numeric vector of length 4 to control figure margins. See the
|
... |
Possible optional arguments passed to the numerical solver,
namely |
A data frame with at least three columns and one row for each
time requested via the times
argument. The first column
indicates the scenario, the second column holds the time, and further
columns hold the values of state variables and process rates.
If the scenarios
argument is used to update initial values and /
or parameters, the following applies: For each parameter not being included
(by name) in the vector for a particular scenario, the default value
will be used (as stored in the workbook from which the model was imported).
The same is true for the initial values of variables. See the examples
below.
David Kneis david.kneis@tu-dresden.de
Look at buildFromWorkbook
for how to create a
suitable model object.
# build the model
m <- buildFromWorkbook(system.file("models/SEIR.xlsx", package="rodeo"))
# run with defaults
x <- m$scenarios(times=0:30, scenarios=NULL)
# run with updated values
x <- m$scenarios(times=0:30,
scenarios=list(default=c(t=1, i=0.2, r=0.4), fast=c(t=1, i=0.5, r=0.1))
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.