Delay Differential Equations - Maple Help

Home : Support : Online Help : Mathematics : Differential Equations : dsolve : numeric : Delay Differential Equations

dsolve/numeric/delay

find numerical solution of delay differential initial value problems

 Calling Sequence dsolve(delaysys, numeric, vars, options)

Parameters

 delaysys - set or list; ordinary differential or differential-algebraic equation(s) with delays numeric - name; instruct dsolve to find a numerical solution vars - (optional) dependent variable or a set or list of dependent variables for delaysys options - (optional) equations of the form keyword = value

Description

 • The dsolve command with the numeric or type=numeric option and a real-valued delay differential initial value problem finds a numerical solution for the delay IVP. If the optional equation method=numericmethod is provided (where numericmethod is one of rkf45, ck45, or rosenbrock), dsolve uses that method to obtain the numerical solution.
 The dsolve command is able to detect the presence of delays automatically, but it requires additional information for the case of variable delays (see delaymax later).
 • In addition to the options described in dsolve[numeric] and dsolve[Error_Control], delay differential systems also have the following options

 'delaymax' = positive 'delaypts' = positive integer

 'delaymax'= positive
 This option is required for problems with a variable delay, and is required to specify the maximum delay time for all delays in the system.
 'delaypts'= positive integer
 This option specifies the maximum point storage to allocate when storing delay data, and must be at least 6, and at that setting will only be able to retain an accurate solution history for the last integration step taken. By default, this value is conservatively set to 10000. Note that if a small value is used, the computation will use less memory, but the results may be inaccurate. A warning is produced if this value is specified below 100.
 • The delay computation implemented for the numeric solvers utilizes the natural interpolant built into the solvers, storing solution values back to delaymax as the computation proceeds. On initialization, the dependent variable values are assumed to be constants set to the initial values for all times $t<\mathrm{t0}$, and once the delay time for a delay term exceeds $t-\mathrm{t0}$, the interpolant comes into play. Derivatives of the dependent variable values are assumed to be zero for all times $t<\mathrm{t0}$.
 In some cases, such as delays for derivatives, use of the initial value or zero is not desirable, and in these cases a constant value for $t<\mathrm{t0}$ can be specified as the second argument to the delay function. For example, $y\left(t-1\right)$ specifies that for $t<1$ the initial value of $y$ is used, while $y\left(t-1,0\right)$ specifies that for $t<1$ the value $0$ be used. Similarly, $\mathrm{D}\left(y\right)\left(t-1\right)$ specifies that for $t<1$ the value $0$ be used, while ${\mathrm{D}}_{1}\left(y\right)\left(t-1,1\right)$ specifies that for $t<1$ the value $1$ be used.
 In the event that a requested delay is so small as to be past the end of the last computed step, extrapolation using the interpolant of the last available step is used.
 In the event that insufficient storage is allocated for a problem (in other words, if delaypts was set too small), the storage downgrades. Initially, it reduces to storing only integration step endpoints using a linear interpolant. Then if further downgrading is required, the storing reduces to every second endpoint, and consequently to every fourth, every eighth and so on. Note that solution accuracy is significantly degraded when downgrading is in use, so it is best to make delaypts sufficiently large so that downgrading is unnecessary.
 • Note that delays can be used with DAE IVPs as well as with events, though events do not support setting of a past value on the trigger of an event. Also, note that the interpolant is only C1 continuous, so any DAE problems where a second derivative of a delay is required will fail to run, as the discontinuities will affect the error control.

Examples

Basic use of a delay

 > $\mathrm{dsys}≔\left\{\mathrm{diff}\left(y\left(t\right),t\right)=-y\left(t-1\right),y\left(0\right)=2\right\}$
 ${\mathrm{dsys}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}{-}{y}{}\left({t}{-}{1}\right){,}{y}{}\left({0}\right){=}{2}\right\}$ (1)
 > $\mathrm{dsn}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric}\right)$
 ${\mathrm{dsn}}{≔}{\mathbf{proc}}\left({\mathrm{x_rkf45_dae}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (2)
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn},0..10\right)$

Variable delay: note that this example shows the subtlety of setting delaymax. Although the delay at $t=0$ is $\frac{1}{2}+{ⅇ}^{\frac{1}{2}}=2.148721271$, it is only needed to store a delay of $1.07$, since the value at the initial point is in use until that time and the delay is monotonically decreasing.

 > $\mathrm{dsys}≔\left\{\mathrm{diff}\left(y\left(t\right),t\right)=-y\left(t-\frac{1}{2}-\mathrm{exp}\left(-\left(t-\frac{1}{2}\right)\right)\right),y\left(0\right)=2\right\}$
 ${\mathrm{dsys}}{≔}\left\{\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{y}{}\left({t}\right){=}{-}{y}{}\left({t}{-}\frac{{1}}{{2}}{-}{{ⅇ}}^{{-}{t}{+}\frac{{1}}{{2}}}\right){,}{y}{}\left({0}\right){=}{2}\right\}$ (3)
 > $\mathrm{dsn}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric},\mathrm{delaymax}=1.07\right)$
 ${\mathrm{dsn}}{≔}{\mathbf{proc}}\left({\mathrm{x_rkf45_dae}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (4)
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn},0..10\right)$

Initial value specification through delay: this example shows the use of a second argument to the delay function to provide a nonzero derivative value for t<0.

Use of the default (delay value for D(y)(t-1) is 0):

 > $\mathrm{dsys}≔\left\{\mathrm{diff}\left(y\left(t\right),t,t\right)+\mathrm{diff}\left(y\left(t-1\right),t\right)+y\left(t\right)=0,y\left(0\right)=0,z\left(t\right)=\mathrm{diff}\left(y\left(t-1\right),t\right),\mathrm{D}\left(y\right)\left(0\right)=1\right\}:$
 > $\mathrm{dsn}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric}\right):$
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn},\left[\left[t,y\left(t\right),\mathrm{color}=\mathrm{red}\right],\left[t,z\left(t\right),\mathrm{color}=\mathrm{blue}\right]\right],0..2\right)$

So we see a jump in the derivalue value at t=1. We can instead specify that the delay value for D(y)(t-1) is 1 by using D[1](y)(t-1,1):

 > $\mathrm{dsys}≔\left\{\mathrm{diff}\left(y\left(t\right),t,t\right)+\mathrm{D}\left[1\right]\left(y\right)\left(t-1,1\right)+y\left(t\right)=0,y\left(0\right)=0,z\left(t\right)=\mathrm{D}\left[1\right]\left(y\right)\left(t-1,1\right),\mathrm{D}\left(y\right)\left(0\right)=1\right\}:$
 > $\mathrm{dsn}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric}\right):$
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn},\left[\left[t,y\left(t\right),\mathrm{color}=\mathrm{red}\right],\left[t,z\left(t\right),\mathrm{color}=\mathrm{blue}\right]\right],0..2\right)$

As an example of what effect one will see by too small a value of delaypts we compare a correct solution with one obtained by setting the value too small.

 > $\mathrm{dsys}≔\left\{\mathrm{diff}\left(y\left(t\right),t,t\right)+\frac{3y\left(t\right)-y\left(t-2\mathrm{\pi }\right)}{2}=0,y\left(0\right)=0,\mathrm{D}\left(y\right)\left(0\right)=1\right\}:$
 > $\mathrm{dsn1}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric}\right):$
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn1},10..4\mathrm{\pi }\right)$
 > $\mathrm{dsn2}≔\mathrm{dsolve}\left(\mathrm{dsys},\mathrm{numeric},\mathrm{delaypts}=20\right):$
 > $\mathrm{plots}\left[\mathrm{odeplot}\right]\left(\mathrm{dsn2},10..4\mathrm{\pi }\right)$

One can see that the concavity of the curve in the second plot is different than the first. This effect is more pronounced for systems that have stiffness, or high rates of change.

Compatibility

 • The delaysys parameter was introduced in Maple 2015.
 • The delaymax and delaypts options were introduced in Maple 2015.