Skip to contents

Initialize an empty stock-and-flow model of class sdbuildR_xmile. You can either create an empty stock-and-flow model or load a template from the model library.

Usage

xmile(name = NULL)

Arguments

name

Name of the template to load. If NULL, an empty stock-and-flow model will be created with default simulation parameters and a default header. If specified, the name should be one of "logistic_model", "SIR", "predator-prey", "Crielaard2022", "coffee_cup", "bank_account", "Lorenz", "Rossler", "vanderPol", "Duffing", "Chua", "spruce_budworm".

Value

Stock-and-flow model of class sdbuildR_xmile.

Examples

sfm <- xmile()
summary(sfm)
#> Your model contains:
#> * 0 Stocks
#> * 0 Flows
#> * 0 Constants
#> * 0 Auxiliaries
#> * 0 Graphical Functions
#> * 0 Custom model units
#> * 0 Macros
#> 
#> Simulation time: 0.0 to 100.0 seconds (dt = 0.01)
#> Simulation settings: solver euler in R


# Load a template
sfm <- xmile("Lorenz")
sim <- simulate(sfm)
plot(sim)