Package 'mode'

Title: Solve Multiple ODEs
Description: Solve multiple ODEs in parallel.
Authors: Rich FitzJohn [aut, cre], Alex Hill [aut], Imperial College of Science, Technology and Medicine [cph]
Maintainer: Rich FitzJohn <[email protected]>
License: MIT + file LICENSE
Version: 0.1.14
Built: 2024-12-08 04:47:08 UTC
Source: https://github.com/mrc-ide/mode

Help Index


Create a mode model from a C++ input file

Description

Create a mode model from a C++ input file. This function will compile the mode support around your model and return an object that can be used to work with the model.

Usage

mode(filename, quiet = FALSE, workdir = NULL, skip_cache = FALSE)

Arguments

filename

The path to a single C++ file

quiet

Logical, indicating if compilation messages from pkgbuild should be displayed. Error messages will be displayed on compilation failure regardless of the value used.

workdir

Optional working directory to use. If NULL uses a temporary directory. By using a different directory of your choosing you can see the generated code.

skip_cache

Logical, indicating if the cache of previously compiled models should be skipped. If TRUE then your model will not be looked for in the cache, nor will it be added to the cache after compilation.

Value

A generator object based on your source files


Create a mode_control object.

Description

Create a mode control object for controlling the adaptive stepper. The returned object can be passed into a mode model on initialisation.

Usage

mode_control(
  max_steps = NULL,
  atol = NULL,
  rtol = NULL,
  step_size_min = NULL,
  step_size_max = NULL,
  debug_record_step_times = NULL
)

Arguments

max_steps

Maxmimum number of steps to take. If the integration attempts to take more steps that this, it will throw an error, stopping the integration.

atol

The per-step absolute tolerance.

rtol

The per-step relative tolerance. The total accuracy will be less than this.

step_size_min

The minimum step size. The actual minimum used will be the largest of the absolute value of this step_size_min or .Machine$double.eps. If the integration attempts to make a step smaller than this, it will throw an error, stopping the integration.

step_size_max

The largest step size. By default there is no maximum step size (Inf) so the solver can take as large a step as it wants to. If you have short-lived fluctuations in your rhs that the solver may skip over by accident, then specify a smaller maximum step size here.

debug_record_step_times

Logical, indicating if we should record the steps taken. This information will be available as part of the statistics() output

Value

A named list of class "mode_control"