Solving DDE Problems
This section uses an example to describe:
dde23to solve initial value problems (IVPs) for delay differential equations (DDEs)
Example: A Straightforward Problem
This example illustrates the straightforward formulation, computation, and display of the solution of a system of DDEs with constant delays. The history is constant, which is often the case. The differential equations are
The example solves the equations on [0,5] with history
The demo |
dde23, you must rewrite the equations as an equivalent system of first-order differential equations. Do this just as you would when solving IVPs and BVPs for ODEs (see Solving ODE Problems). However, this example needs no such preparation because it already has the form of a first-order system of equations.
dde23as a vector. For the example we could use
dde23with the functions
dde23returns the mesh it selects and the solution there as fields in the solution structure
sol. Often, these provide a smooth graph.
Evaluating the Solution at Specific Points
The method implemented in
dde23 produces a continuous solution over the whole interval of integration . You can evaluate the approximate solution, , at any point in using the helper function
deval and the structure
sol returned by
deval function is vectorized. For a vector
ith column of
Sint approximates the solution .
Using the output
sol from the previous example, this code evaluates the numerical solution at 100 equally spaced points in the interval [0,5] and plots the result.