Skip to contents

Discontinuity(t, order) marks a discontinuity of the derivative of order order at time t, as DelayDiffEq's type; pass a list of them (or plain times, of order 0) as d_discontinuities to solve() for a DDE problem. A discontinuity of order k propagates through each constant lag up to the order of the method.

Usage

Discontinuity(t, order = 0L)

Arguments

t

A time.

order

The order of the discontinuity.

Value

A Discontinuity.

Examples

prob <- DDEProblem(function(u, h, p, t) -h(p, t - 1), 1, function(p, t) 1, c(0, 3),
                   constant_lags = 1)
sol <- solve(prob, MethodOfSteps(Tsit5()), d_discontinuities = list(Discontinuity(0.5, 1L)))
sol$retcode
#> [1] "Success"