svStochasticIntegratorDRI1

struct DRI1Coefficients
#include <svStochasticIntegratorDRI1.h>

Coefficients for the Debrabant & Roessler DRI1 weak-order-2 method. Names follow the DRI1 tableau.

Public Members

double a021

Drift-stage A-matrix coefficient (A0).

double a031

Drift-stage A-matrix coefficient (A0).

double a032

Drift-stage A-matrix coefficient (A0).

double a121

Drift-stage A-matrix coefficient (A1).

double a131

Drift-stage A-matrix coefficient (A1).

double b021

Diffusion-stage B-matrix coefficient (B0).

double b031

Diffusion-stage B-matrix coefficient (B0).

double b121

Diffusion-stage B-matrix coefficient (B1).

double b131

Diffusion-stage B-matrix coefficient (B1).

double b221

Second diffusion-stage B-matrix coefficient (B2).

double b222

Second diffusion-stage B-matrix coefficient (B2).

double b223

Second diffusion-stage B-matrix coefficient (B2).

double b231

Second diffusion-stage B-matrix coefficient (B2).

double b232

Second diffusion-stage B-matrix coefficient (B2).

double b233

Second diffusion-stage B-matrix coefficient (B2).

double alpha1

Drift weight vector entry.

double alpha2

Drift weight vector entry.

double alpha3

Drift weight vector entry.

double c02

Stage time node (drift c0).

double c03

Stage time node (drift c0).

double c12

Stage time node (diffusion c1).

double c13

Stage time node (diffusion c1).

double beta11

Diffusion weight vector beta^(1) entry.

double beta12

Diffusion weight vector beta^(1) entry.

double beta13

Diffusion weight vector beta^(1) entry.

double beta22

Diffusion weight vector beta^(2) entry.

double beta23

Diffusion weight vector beta^(2) entry.

double beta31

Diffusion weight vector beta^(3) entry.

double beta32

Diffusion weight vector beta^(3) entry.

double beta33

Diffusion weight vector beta^(3) entry.

double beta42

Diffusion weight vector beta^(4) entry.

double beta43

Diffusion weight vector beta^(4) entry.

class svStochasticIntegratorDRI1 : public StochasticRKIntegratorBase
#include <svStochasticIntegratorDRI1.h>

The svStochasticIntegratorDRI1 class implements the Debrabant-Roessler DRI1 method, an efficient weak second-order (deterministic order 3) Runge-Kutta method for Ito SDEs. It is a good general-purpose weak-order-2 method, handling non-commutative noise via the mixed iterated integral \(\hat I_{(k,l)} = \tfrac12(\Delta\hat W_k \Delta\hat W_l \mp \sqrt h\,\Delta\hat Z)\).

This implements the DRI1 method. The random variables are a three-point increment \(\Delta\hat W\) (from the Gaussian \(\Delta W\)), its diagonal \(\chi_1 = (\Delta\hat W^2 - h)/2\), and a two-point increment \(\Delta\hat Z\) (from the Gaussian \(\Delta Z\), scale \(\sqrt h\)) used only for the cross-noise terms when there is more than one noise source.

The step is fully explicit and derivative-free: three drift stages ( \(H_0^{(0)}=x_n, H_2^{(0)}, H_3^{(0)}\)) and, per noise source, diffusion stages ( \(H_2^{(k)}, H_3^{(k)}\) and, for the coupled case, \(\hat H_2^{(k)}, \hat H_3^{(k)}\)), all evaluated pointwise. See the .cpp for the exact recurrence.

Warning

Stochastic integration is in beta.

Subclassed by svStochasticIntegratorDRI1NM, svStochasticIntegratorRI1, svStochasticIntegratorRI3, svStochasticIntegratorRI5, svStochasticIntegratorRI6

Public Functions

svStochasticIntegratorDRI1(DynamicObject *dyn)

Constructor.

void setNonMixing(bool enabled)

When true, the cross-noise (mixed iterated integral) terms are skipped. This is the “non-mixing” DRI1NM variant, which is exact for diagonal noise and more efficient because it avoids the extra stage-state diffusion evaluations. For diagonal noise it produces the same result as the full DRI1. Defaults to false (full DRI1).

inline bool getNonMixing() const noexcept

Return whether mixed noise-source terms are omitted.

Returns:

True for the diagonal-noise variant.

Protected Functions

void integrateImpl(double currentTime, double timeStep) override

Performs the integration of the associated dynamic objects up to time currentTime+timeStep

svStochasticIntegratorDRI1(DynamicObject *dyn, const DRI1Coefficients &coefficients)

Constructor used by the sibling Roessler weak-order-2 methods (RI1/RI3/RI5/RI6), which share DRI1’s step and differ only in their coefficient tableau.

inline void bindStochasticMethodStorage() override

Allocate the scratch required by this numerical method.

void bindMethodStorage()

Size method buffers from the bound state and noise dimensions once.

void gatherDerivativeStage(size_t stageIndex)

Copy live drift values into the selected stage column.

Parameters:

stageIndex – Zero-based stage column to read or write.

void gatherAllDiffusionStages(size_t stageIndex)

Capture every independent noise source in the selected stage column.

Parameters:

stageIndex – Zero-based stage column to read or write.

void gatherDiffusionStage(size_t globalNoiseIndex, size_t stageIndex)

Capture the selected noise source in its packed rows of a stage column.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • stageIndex – Zero-based stage column to read or write.

void gatherHatDiffusions(size_t hatStageIndex, bool secondHat)

Capture live diffusion values for a mixed-integral support stage.

Parameters:
  • hatStageIndex – Zero-based mixed-integral support stage.

  • secondHat – Select the second support-stage family when true.

void combineTwoDrifts(size_t firstStage, double firstFactor, size_t secondStage, double secondFactor)

Combine two drift stages into combinedDerivative in the given order.

Parameters:
  • firstStage – First drift stage to read.

  • firstFactor – Multiplier for the first contribution.

  • secondStage – Second drift stage to read.

  • secondFactor – Multiplier for the second contribution.

void combineThreeDrifts(double firstFactor, double secondFactor, double thirdFactor)

Combine drift stages zero, one, and two into combinedDerivative.

Parameters:
  • firstFactor – Multiplier for the first contribution.

  • secondFactor – Multiplier for the second contribution.

  • thirdFactor – Multiplier for the third contribution.

void scaleDrift(size_t stageIndex, double factor, Eigen::VectorXd &output)

Multiply one drift stage into the supplied buffer.

Parameters:
  • stageIndex – Zero-based stage column to read or write.

  • factor – Multiplier for the selected stage.

  • output – Already sized destination buffer.

void scaleDiffusion(size_t globalNoiseIndex, size_t stageIndex, double factor)

Scale one source and stage into its rows of combinedDiffusion.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • stageIndex – Zero-based stage column to read or write.

  • factor – Multiplier for the selected stage.

void combineThreeDiffusions(size_t globalNoiseIndex, double firstFactor, double secondFactor, double thirdFactor)

Combine stages zero, one, and two for one source into combinedDiffusion.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • firstFactor – Multiplier for the first contribution.

  • secondFactor – Multiplier for the second contribution.

  • thirdFactor – Multiplier for the third contribution.

void copyHatDiffusion(size_t globalNoiseIndex, size_t hatStageIndex, bool secondHat)

Copy one source from a mixed-integral support stage into combinedDiffusion.

Parameters:
  • globalNoiseIndex – Independent noise-source index in the bound topology.

  • hatStageIndex – Zero-based mixed-integral support stage.

  • secondHat – Select the second support-stage family when true.

Protected Attributes

const DRI1Coefficients coefficients

DRI1 coefficients.

bool methodStorageBound = false

True after all method buffers have been sized.

Eigen::VectorXd combinedDerivative

Weighted drift combination used to build a candidate.

Eigen::VectorXd firstDiffusionDrift

Drift combination for the first diffusion-support candidate.

Eigen::VectorXd secondDiffusionDrift

Drift combination for the second diffusion-support candidate.

Eigen::VectorXd combinedDiffusion

Weighted diffusion contributions in packed noise-source order.

Eigen::MatrixXd derivativeStages

Drift scalars by stage; each stage occupies one contiguous column.

Eigen::MatrixXd diffusionStages

Packed diffusion scalars by stage, grouped by independent source.

Eigen::MatrixXd firstHatDiffusions

Diffusions sampled at the first family of mixed-integral support states.

Eigen::MatrixXd secondHatDiffusions

Diffusions sampled at the second family of mixed-integral support states.

Eigen::VectorXd weakDW

Discrete weak-method increments indexed by independent source.

Eigen::VectorXd diagonalIntegral

Diagonal iterated-integral terms indexed by independent source.

Eigen::VectorXd weakDZ

Auxiliary discrete increments used for mixed noise-source terms.

Eigen::VectorXd pseudoSteps

Temporary per-source noise weights for candidate construction.

Protected Static Functions

static DRI1Coefficients getCoefficients()

Returns the DRI1 coefficient tableau.

Private Members

bool nonMixing = false
class svStochasticIntegratorDRI1NM : public svStochasticIntegratorDRI1
#include <svStochasticIntegratorDRI1.h>

DRI1NM: the “non-mixing” (diagonal-noise) variant of DRI1.

Implementation of the DRI1NM method. Identical to DRI1 but skips the cross-noise mixed-integral terms, which is exact (and more efficient) for diagonal/scalar-noise problems.

Warning

Stochastic integration is in beta.

Public Functions

inline explicit svStochasticIntegratorDRI1NM(DynamicObject *dyn)

Constructor.

class svStochasticIntegratorRI1 : public svStochasticIntegratorDRI1
#include <svStochasticIntegratorDRI1.h>

RI1: Roessler weak-order-2 Ito method (Roessler 2009), any noise.

Weak order 2, deterministic order 3, for Ito SDEs of any noise structure (diagonal, non-diagonal, non-commutative, scalar-additive). Shares DRI1’s step; differs only in its coefficient tableau (the RI1 tableau).

Warning

Stochastic integration is in beta.

Public Functions

svStochasticIntegratorRI1(DynamicObject *dyn)

Constructor.

Private Static Functions

static DRI1Coefficients getCoefficients()

Returns the RI1 coefficient tableau.

class svStochasticIntegratorRI3 : public svStochasticIntegratorDRI1
#include <svStochasticIntegratorDRI1.h>

RI3: Roessler weak-order-2 Ito method (Roessler 2009), any noise.

Public Functions

svStochasticIntegratorRI3(DynamicObject *dyn)

Constructor.

Private Static Functions

static DRI1Coefficients getCoefficients()

Returns the RI3 coefficient tableau.

class svStochasticIntegratorRI5 : public svStochasticIntegratorDRI1
#include <svStochasticIntegratorDRI1.h>

RI5: Roessler weak-order-2 Ito method (Roessler 2009), any noise.

Public Functions

svStochasticIntegratorRI5(DynamicObject *dyn)

Constructor.

Private Static Functions

static DRI1Coefficients getCoefficients()

Returns the RI5 coefficient tableau.

class svStochasticIntegratorRI6 : public svStochasticIntegratorDRI1
#include <svStochasticIntegratorDRI1.h>

RI6: Roessler weak-order-2 Ito method (Roessler 2009), any noise.

Public Functions

svStochasticIntegratorRI6(DynamicObject *dyn)

Constructor.

Private Static Functions

static DRI1Coefficients getCoefficients()

Returns the RI6 coefficient tableau.