modelbuilder()
function. This function calls a Shiny app (in the /inst/modelbuilder folder), which is the main user interface. The Shiny app in turn uses the various functions in the /R folder to provide all functionality. Each model is stored in a list object called mbmodel, and saved as an Rds file.
The model list will have the components described below. The following constraints are currently imposed:
mbmodel$title
- model titlembmodel$description
- a short (1 sentence) model descriptionmbmodel$author
- name of model author/creatormbmodel$date
- date of creation or last changembmodel$details
- a detailed model descriptionmbmodel$var[[i]]$varname
- characters containing variable name, stringmbmodel$var[[i]]$vartext
- description of variable, stringmbmodel$var[[i]]$varval
- starting value, numericmbmodel$var[[i]]$flows
- all flow terms, as vector of stringsmbmodel$var[[i]]$flownames
- description of each flow, vector of stringsi = 1..number of variables
mbmodel$par[[i]]$parname
- parameter namembmodel$par[[i]]$partext
- description of parameter mbmodel$par[[i]]$parval
- default value i = 1..number of parameters
mbmodel$time[[i]]$timename
- tstart/tfinal/dt (fixed names, in that order)mbmodel$time[[i]]$timetext
- text mbmodel$time[[i]]$timeval
- default valuei = 1,2,3 being tstart, tfinal and dt
mbmodel$par[[i]]$lb
- lower bound for parameter mbmodel$par[[i]]$ub
- upper bound for parameter Several model examples following the above structure are in the \auxiliary\modelfiles
folder. They are provided both as Rds files and as .R scripts which can be run to produce the Rds files.
A script in \auxiliary\helperfuncttions
can take a mbmodel provided as Rds or R file and produce the other file. It can also turn any Rds or R script into ode/stochastic/discrete function code.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.