sd_simulate {readsdr}R Documentation

Simulate a System Dynamics model

Description

Simulate a System Dynamics model

Usage

sd_simulate(
  ds_inputs,
  start_time = NULL,
  stop_time = NULL,
  timestep = NULL,
  integ_method = "euler"
)

Arguments

ds_inputs

A list of deSolve inputs generated by read_xmile

start_time

A number indicating the time at which the simulation begins.

stop_time

A number indicating the time at which the simulation ends.

timestep

A number indicating the time interval for the simulation. Also known as dt.

integ_method

A string indicating the integration method. It can be either "euler" or "rk4"

Value

a data frame

Examples

path      <- system.file("models", "SIR.stmx", package = "readsdr")
ds_inputs <- xmile_to_deSolve(path)
sd_simulate(ds_inputs, 0, 1, 0.25, "rk4")

[Package readsdr version 0.3.0 Index]