The goal of readsdr is to bridge the design capabilities from specialised System Dynamics software with the powerful numerical tools offered by R libraries. The package accomplishes this goal by parsing .xmile files (Vensim and Stella models) into R objects to construct networks (graph theory), ODE functions for deSolve and Stan.
You can install the released version of readsdr from CRAN with:
And the development version from GitHub with:
library(readsdr)
filepath <- system.file("models/", "SIR.stmx", package = "readsdr")
mdl <- read_xmile(filepath)
summary(mdl)
#> Length Class Mode
#> description 4 -none- list
#> deSolve_components 4 -none- list
#> graph_dfs 2 -none- list
For reading Vensim models, they must be exported as .xmile.
For information on how to use this package, see the vignette or type vignette("Introduction_to_readsdr")
in R.
=
, <>
)AND
, OR
, NOT
)If Else Then
<
, >
)Pulse
1Step
1SMTH1
, SMTH3
, SMTHN
ABS
, SQRT
NORMAL
=
, <>
):AND:
, :OR:
, :NOT:
)IF_THEN_ELSE
<
, >
)Pulse
1Pulse Train
1Step
1SMOOTH
, SMOOTH3
, SMOOTH3I
, SMOOTHI
ABS
, SQRT
1 Restricted to Euler integration.
uniflow and non-negative stock features from Stella are not supported.
No built-in is supported for translations to Stan code.
Modules from Stella are not supported.
Thanks to:
Duggan, J. (2016). System Dynamics Modeling with R. Springer.