Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

DDE of Neutral Type

This example shows how to use ddensd to solve the neutral DDE presented by Paul [1] for 0 ≤ tπ.

Click ddex4.m or type edit ddex4.m in a command window to view the code for this example in an editor.

The equation is

y '(t) = 1 + y(t) – 2y(t/2)2y '(tπ)

with history:

y(t) = cos (t) for t ≤ 0.

  1. Create a new program file in the editor. This file will contain a main function and four local functions.

  2. Define the first-order DDE as a local function.

    function yp = ddefun(t,y,ydel,ypdel) 
        yp = 1 + y - 2*ydel^2 - ypdel;
    end
  3. Define the solution delay as a local function.

    function dy = dely(t,y) 
        dy = t/2;
    end
  4. Define the derivative delay as a local function.

    function dyp = delyp(t,y) 
        dyp = t-pi;
    end
  5. Define the solution history as a local function.

    function y = history(t)
        y = cos(t);
    end
  6. Define the interval of integration and solve the DDE using the ddensd function. Add this code to the main function.

    tspan = [0 pi];
    sol = ddensd(@ddefun,@dely,@delyp,@history,tspan);
  7. Evaluate the solution at 100 equally spaced points between 0 and π. Add this code to the main function.

    tn = linspace(0,pi);
    yn = deval(sol,tn);
  8. Plot the results. Add this code to the main function.

    figure
    plot(tn,yn);
    xlim([0 pi]);
    ylim([-1.2 1.2])
    xlabel('time t');
    ylabel('solution y');
    title('Example of Paul with 1 equation and 2 delay functions')
  9. Run your program to calculate the solution and display the plot.

References

[1] Paul, C.A.H. "A Test Set of Functional Differential Equations." Numerical Analysis Reports. No. 243. Manchester, UK: Math Department, University of Manchester, 1994.

Related Examples

More About

Was this topic helpful?