ddensd
Solves neutral delay differential equations with state-dependent delays.
Category: Mathematics > Numerical Integration and Differential Equations
Syntax
sol = ddensd(ddefun, dely, delyp, history, tspan)
Solves y'(t) = ddefun(t, y, ydel, ypdel), where ydel holds delayed values of y and ypdel delayed values of y'.
sol = ddensd(ddefun, dely, delyp, history, tspan, options)
Also applies options from ddeset.
Description
A neutral equation contains delayed derivatives, which makes it more delicate than an ordinary delay equation. Delays may depend on time and on the solution itself.
When the equation has no delayed derivative term, pass [] for delyp and ignore the fourth argument of ddefun; this reduces to the problem handled by ddesd.
Input arguments
ddefun- Handle
dydt = ddefun(t, y, ydel, ypdel). dely- Delay for
y: a constant, or a functiondely(t, y). delyp- Delay for
y', or[]if the equation has no delayed derivative term. history- Constant vector or function giving the solution before
t0. tspan- Interval
[t0 tf].
Output arguments
sol- Solution structure with
sol.xandsol.y, usable withdeval.
Example
A plain delay problem
sol = ddensd(@(t, y, ydel, ypdel) -ydel, 1, [], 1, [0 2]);
fprintf('%.4f\n', sol.y(end))
Output
-0.5000