Skip to contents

SplitODEProblem(f1, f2, u0, tspan, p) is du/dt = f1(u, p, t) + f2(u, p, t), with f1 the stiff (implicit) part for IMEX methods; the Jacobian of f1 may be given as SplitFunction(f1, f2, jac = J1) or as an ODEFunction() f1 with jac_fn. DynamicalODEProblem(f1, f2, v0, u0, tspan, p) is dv/dt = f1(v, u, p, t), du/dt = f2(v, u, p, t) on the state c(v, u) (velocities first), and SecondOrderODEProblem(f, du0, u0, tspan, p) the second order system d2u/dt2 = f(du, u, p, t) as such a problem with f2 = v. IncrementingODEProblem(f, u0, tspan, p) takes f(du, u, p, t, alpha, beta) = alpha F(u, p, t) + beta du, the form of low storage methods. SplitSDEProblem(f1, f2, g, u0, tspan, p) and DynamicalSDEProblem(f1, f2, g, v0, u0, tspan, p) (noise g(v, u, p, t) on the velocities) are the stochastic versions, DynamicalDDEProblem(f1, f2, v0, u0, h, tspan, p) (f1(v, u, h, p, t), with h(p, t) the history of c(v, u)) and SecondOrderDDEProblem(f, du0, u0, h, tspan, p) the delay versions. TwoPointBVProblem(f, bc, u0, tspan, p) has separate conditions bc = list(bca, bcb) with bca(ua, p) at the start and bcb(ub, p) at the end; SecondOrderBVProblem(f, bc, u0, tspan, p) is d2u/dt2 = f(du, u, p, t) with bc(du, u, p, t) (du(s) and u(s) give the solution), and TwoPointSecondOrderBVProblem() the second order problem with bc = list(bca, bcb) of (dua, ua, p) and (dub, ub, p).

Usage

SplitFunction(f1, f2, jac = NULL, ...)

SplitODEProblem(f1, f2 = NULL, u0, tspan, p = numeric(), ...)

DynamicalODEFunction(f1, f2, ...)

DynamicalODEProblem(f1, f2, v0, u0, tspan, p = numeric(), ...)

SecondOrderODEProblem(f, du0, u0, tspan, p = numeric(), ...)

IncrementingODEFunction(f, ...)

IncrementingODEProblem(f, u0, tspan, p = numeric(), ...)

SplitSDEFunction(f1, f2, g, ...)

SplitSDEProblem(f1, f2, g, u0, tspan, p = numeric(), ...)

DynamicalSDEFunction(f1, f2, g, ...)

DynamicalSDEProblem(f1, f2, g, v0, u0, tspan, p = numeric(), ...)

DynamicalDDEFunction(f1, f2, ...)

DynamicalDDEProblem(f1, f2, v0, u0, h, tspan, p = numeric(), ...)

SecondOrderDDEProblem(f, du0, u0, h, tspan, p = numeric(), ...)

SDDEFunction(f, g, ...)

BVPFunction(f, bc, bcresid_prototype = NULL, twopoint = FALSE, ...)

TwoPointBVPFunction(f, bc, ...)

DynamicalBVPFunction(f, bc, ...)

TwoPointDynamicalBVPFunction(f, bc, ...)

TwoPointBVProblem(f, bc, u0, tspan, p = numeric(), ...)

SecondOrderBVProblem(f, bc, u0, tspan, p = numeric(), ...)

TwoPointSecondOrderBVProblem(f, bc, u0, tspan, p = numeric(), ...)

Arguments

jac

For SplitFunction(), the Jacobian jac(u, p, t) of f1.

...

Problem options.

u0, v0, du0

Initial states and velocities (or guesses for BVPs).

tspan, p

Time span and parameters.

f, f1, f2, g

Right-hand sides and diffusion, see Details.

h

History function.

bc

Boundary conditions.

bcresid_prototype, twopoint

Options of the BVP functions.

Value

A problem or a function object.

Details

The function types SplitFunction(), DynamicalODEFunction(), IncrementingODEFunction(), SplitSDEFunction(), DynamicalSDEFunction(), DynamicalDDEFunction(), SDDEFunction(), BVPFunction(), TwoPointBVPFunction(), DynamicalBVPFunction() and TwoPointDynamicalBVPFunction() hold the same parts and may be passed in place of the functions.

Examples

prob <- SecondOrderODEProblem(function(du, u, p, t) -u, 0, 1, c(0, pi))
sol <- solve(prob, Tsit5())
round(sol(pi), 4)
#> [1]  0 -1
sp <- SplitODEProblem(function(u, p, t) -2 * u, function(u, p, t) u, 1, c(0, 1))
solve(sp, Tsit5())(1)
#> [1] 0.3678796