run_integration: Run an integration over time

View source: R/run_integration.R

run_integrationR Documentation

Run an integration over time

Description

A generic function to integrate a series of ODEs. Designed to have arguments compatible with other run_xxx() functions, rather than optimally designed for ode(). deriv_function must have three arguments (t, pop_vec, param_vec), where t is the time, pop_vec contains the current state of the population in a vector with named elements, and param_vec contains a vector of named parameters. It must return a list with two elements, the first of which is a vector of the derivatives of the population at pop_vec, and the second is an empty vector.

Usage

run_integration(
  deriv_function,
  populations,
  end.time,
  timestep = 1,
  debug = FALSE,
  ...
)

Arguments

deriv_function

Function to calculate derivative

populations

Data frame with columns corresponding to function requirements

end.time

End time of simulation

timestep

(optionally) record the state every timestep - default 1

debug

(optionally) Do you want to print out a limited amount of debugging information about your code? - default FALSE

...

Other arguments for deriv_function, mostly parameters

Value

Data frame containing population history of simulation over time


IBAHCM/RPiR documentation built on Jan. 12, 2023, 7:41 p.m.