Integration Methods
Bristlecone supports model systems defined in discrete or continuous time. For continuous-time model systems - defined as ordinary differential equation(s) - Bristlecone applies numerical integration to calculate changes in the modelled properties through time.
Included integration methods
The following integration functions are included within the Bristlecone.Integration namespace:
Solver |
Function |
Description |
|---|---|---|
Runge-Kutta 4 |
|
A fourth-order Runge Kutta method to provide approximate solutions to ODE systems. |
Adding a custom integration method
You can add a custom integration routine by wrapping your integration
function to match the EstimationEngine.Integration.IntegrationRoutine type signature as follows:
open Bristlecone
let myCustomIntegrator: EstimationEngine.Integration.IntegrationRoutine =
fun tInitial tEnd tStep initialConditions rhs -> invalidOp "Doesn't actually do anything!"
let engine () =
Bristlecone.mkContinuous () |> Bristlecone.withContinuousTime myCustomIntegrator
When defining a custom integration routine, the argument rhs is a compiled
internally using Base.makeCompiledFunctionForIntegration function from
the Bristlecone.Integration namespace. This function is used to
compile a 'right-hand side' equation that 'bakes in' the environment
(external forcing) data.
module Bristlecone from Bristlecone
<namespacedoc><summary>The core library of Bristlecone, containing model-fitting functions.</summary></namespacedoc>
Main functionality of Bristlecone, including functions to scaffold `ModelSystem`s and for model-fitting (tests and real fits).
--------------------
namespace Bristlecone
<summary> The estimation engine represents the method used to calculate equations and optimise a likelihood function. The whole estimation engine is tensor-based internally, but may take float-based equations as a legacy option. </summary>
<summary> Represents a low-level numerical method used to integrate functions. Takes the intial time, final time, and time step, and returns a function that is compiled to only require the current time and current state. Must return the baseline state plus evolutions. </summary>
<summary>A basic estimation engine for ordinary differential equations, using a Nelder-Mead optimiser.</summary>
<summary> Use a custom integration method </summary>
bristlecone