Skip to contents

RODEProblem(f, u0, tspan, p) is du/dt = f(u, p, t, W) driven by a noise process W (a WienerProcess() with the shape of rand_prototype, or of u0, unless noise gives one; see noise_processes). RODEFunction(f) wraps the right-hand side. solve(prob, alg, dt = ) integrates with fixed steps: RandomEM() is the Euler method with the noise held at its value at the start of the step, RandomHeun() the Heun method, RandomTamedEM() the tamed Euler method u + dt f / (1 + dt |f|), and RandomTaylor15() the derivative free order 1.5 Taylor method of Asai, for a scalar NoiseGrid() that resolves the path more finely than the steps. The solution is a RODESolution; sol$W is the noise path.

Usage

RODEFunction(f, ...)

RODEProblem(
  f,
  u0,
  tspan,
  p = numeric(),
  rand_prototype = NULL,
  noise = NULL,
  seed = 0L,
  ...
)

RandomEM()

RandomTamedEM()

RandomHeun()

RandomTaylor15()

Arguments

f

Right-hand side f(u, p, t, W), or a RODEFunction.

...

Problem options passed to solve().

u0, tspan, p

Initial state, time span and parameters.

rand_prototype

Shape of the noise when noise is not given.

noise

A noise process.

seed

Seed for the noise.

Value

A problem, a function, an algorithm or a solution.

Examples

f <- function(u, p, t, W) 1.01 * u + 0.87 * u * W
prob <- RODEProblem(f, 0.5, c(0, 1))
sol <- solve(prob, RandomEM(), dt = 0.01, seed = 1)
tail(sol$u, 1)
#> [[1]]
#> [1] 2.240383
#>