xmile_to_deSolve {readsdr} | R Documentation |
Parse XMILE to deSolve components
Description
xmile_to_deSolve
returns a list that serves as an input for
deSolve's ODE function.
Usage
xmile_to_deSolve(filepath)
Arguments
filepath |
A string that indicates a path to a file with extension .stmx or .xmile. Vensim files (.mdl) are not xmile files. They must be exported from Vensim with extension .xmile |
Details
This function extracts the xml from the file specified via filepath
to generate a list with the necessary elements to simulate with
deSolve.
Value
This function returns a list with at least four elements. stocks, a numeric vector that contains initial values. consts, a numeric vector with the model's constants. func, the function that wraps the model's equations. sim_params, a list with control parameters. If the model includes a table or graphical function, this function returns the element graph_funs, a list with these functions.
Examples
path <- system.file("models", "SIR.stmx", package = "readsdr")
xmile_to_deSolve(path)