New in Wolfram Mathematica 7: Delay Differential Equations  previous | next 
Solve Systems of Delay Differential Equations
This solves a system of three delay differential equations corresponding to a Kermack-McKendrick epidemic model.
In[1]:=

Click for copyable input
Module[{sold, \[Tau]1 = 1, \[Tau]2 = 10},

 sold = First[NDSolve[{

     Subscript[y, 1]'[

       t] == -Subscript[y, 1][t] Subscript[y, 2][t - \[Tau]1] + 

       Subscript[y, 2][t - \[Tau]2], Subscript[y, 1][t /; t <= 0] == 5,

     Subscript[y, 2]'[t] == 

      Subscript[y, 1][t] Subscript[y, 2][t - \[Tau]1] - 

       Subscript[y, 2][t], Subscript[y, 2][t /; t <= 0] == 1/10,

     Subscript[y, 3]'[t] == 

      Subscript[y, 2][t] - Subscript[y, 2][t - \[Tau]2], 

     Subscript[y, 3][t /; t <= 0] == 1},

    {Subscript[y, 1], Subscript[y, 2], Subscript[y, 3]}, {t, 0, 100}]];

 Plot[Evaluate[{Subscript[y, 1][t], Subscript[y, 2][t], 

     Subscript[y, 3][t]} /. sold], {t, 0, 100}, Filling -> Axis, 

  AspectRatio -> 1]]
Out[1]=