Skip to contents

Creates a deSolve compliant times sequence that can be used as the times argument in ode, specifying the times for which simulation output is wanted.

Usage

create_desolve_times(model, duration, step, unit = "h")

Arguments

model

An object of class sbmlModel.

duration

A number describing the total duration of the simulation.

step

A number describing the resolution in terms of step size.

unit

An optional character string describing the time unit of the specified duration and step length. Timings are aligned with the time unit of the model. Current options are "h" for hours (default), "d" for days, or "model" when assuming the specified duration and step length are considered in line with the time unit of the model.

Value

A vector of simulation output times formatted for use as the times argument in ode.

See also

Examples

model_file <- system.file("extdata/", "simple_oral.sbml", package = "sbmlpbk")
model <- load_sbml(model_file)

times <- create_desolve_times(
  model,
  duration = 10, # 10 days
  step = 1/24,   # every hour
  unit = 'd'     # times in days
)

head(times)
#> [1] 0 1 2 3 4 5