28.01.2013 Views

Solving DDEs in Matlab - Radford University

Solving DDEs in Matlab - Radford University

Solving DDEs in Matlab - Radford University

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

of the current <strong>in</strong>tegration are formed <strong>in</strong>to an array. The entries are propagated<br />

and duplicates purged as described earlier.<br />

An <strong>in</strong>itial discont<strong>in</strong>uity <strong>in</strong> the first derivative appears <strong>in</strong> derivatives of successively<br />

higher order. When the discont<strong>in</strong>uities are <strong>in</strong> a derivative of sufficiently<br />

high order that they do not affect the order of the formulas, we can stop track<strong>in</strong>g<br />

them. The relatively low order of the BS(2,3) triple implies that the effects<br />

of discont<strong>in</strong>uities are rather more short-lived than with other popular formulas.<br />

Our basic assumption is that y(x) is cont<strong>in</strong>uous, so only four levels of propagation<br />

are needed. Dur<strong>in</strong>g the <strong>in</strong>tegration itself, the only time we permit a<br />

discont<strong>in</strong>uity <strong>in</strong> y(x) is at the <strong>in</strong>itial po<strong>in</strong>t, which is <strong>in</strong>dicated by provid<strong>in</strong>g the<br />

value of the solution as the value of the option ’InitialY’. The DDE is evaluated<br />

us<strong>in</strong>g this value, so both y and f are cont<strong>in</strong>uous to the right of the <strong>in</strong>itial<br />

po<strong>in</strong>t. The facilities of dde23 allow us to deal with discont<strong>in</strong>uous changes <strong>in</strong> the<br />

solution at other times. If the discont<strong>in</strong>uity occurs dur<strong>in</strong>g the <strong>in</strong>tegration, as for<br />

example at the time of occurrence of an event, the <strong>in</strong>tegration is to be restarted<br />

with the appropriate value of the solution supplied via ’InitialY’. Potential<br />

discont<strong>in</strong>uities of any order <strong>in</strong> the <strong>in</strong>itial history are specified via the ’Jumps’<br />

option. If either k<strong>in</strong>d of discont<strong>in</strong>uity <strong>in</strong> y(x) is possible, discont<strong>in</strong>uities are<br />

propagated to one higher level <strong>in</strong> the solver.<br />

The Hoppensteadt–Waltman model <strong>in</strong>volves the solution of ODEs as well as<br />

<strong>DDEs</strong>. The solver makes no assumption about whether terms with lags actually<br />

appear <strong>in</strong> the equations. This makes it possible to solve ODEs, though it is best<br />

then to set lags = [] because any delay specified affects the list of potential<br />

low-order discont<strong>in</strong>uities, hence the details of the <strong>in</strong>tegration.<br />

6 Event Location<br />

Recall that the Marchuk model has a coefficient ξ(m) that has a jump <strong>in</strong> its<br />

first derivative with respect to the state variable m(t). Such discont<strong>in</strong>uities are<br />

qualitatively different from the discont<strong>in</strong>uities that we treat with the ’Jumps’<br />

option because they occur at unknown times. An event is said to occur at time t ∗<br />

when a scalar function g(t, y(t), y(t−τ1), . . . , y(x−τk)), called an event function,<br />

vanishes at t = t ∗ . There may be many event functions and it may be important<br />

how the function vanishes, but we defer discussion of these complications. As<br />

with the propagated discont<strong>in</strong>uities, if we locate events and restart there, we<br />

<strong>in</strong>tegrate only with smooth functions. The theoretical and practical difficulties<br />

of event location are often not appreciated, but a theoretical analysis is possible<br />

with reasonable assumptions, e.g. [17], and a number of quality ODE solvers<br />

provide for the location of events. In particular, all the solvers of the <strong>Matlab</strong><br />

ODE Suite have a powerful event location capability that we have exploited<br />

<strong>in</strong> develop<strong>in</strong>g dde23. The capability is realized by means of the zero–f<strong>in</strong>d<strong>in</strong>g<br />

function odezero. A nice exposition of its algorithm is found <strong>in</strong> C.B. Moler [9].<br />

Although we did not change the basic algorithm, we modified the function to<br />

account for the circumstances of dde23.<br />

The user <strong>in</strong>terface for event location <strong>in</strong> dde23 is similar to that of ode23.<br />

12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!