run_integration: Run an integration over time

Description Usage Arguments Value

View source: R/run_integration.R

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

1
2
3
4
5
6
7
8
run_integration(
  deriv_function,
  populations,
  end.time,
  timestep = 1,
  debug = FALSE,
  ...
)

Arguments

deriv_function

Dunction 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


boydorr/ProgInR documentation built on Nov. 16, 2019, 3:34 a.m.