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 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- listFor reading Vensim models, they must be exported as .xmile.
vignette("Introduction_to_readsdr") gives more detail on how to use the package.
=, <>)AND, OR, NOT)If Else Then<, >)Pulse 1Step 1=, <>):AND:, :OR:, :NOT:)IF_THEN_ELSE<, >)Pulse 1Pulse Train 1Step 11 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.