xmile_to_deSolve | R Documentation |
xmile_to_deSolve
returns a list that serves as an input for
deSolve's ODE function.
xmile_to_deSolve(filepath)
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 |
This function extracts the xml from the file specified via filepath
to generate a list with the necessary elements to simulate with
deSolve.
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.
path <- system.file("models", "SIR.stmx", package = "readsdr")
xmile_to_deSolve(path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.