### Problem 1

Hale [7] cites predator-prey models obtained by introducing a resource limitation on the prey and assuming the birth rate of predators responds to changes in the magnitude of the population y1 of prey and the population y2 of predators only after a time delay t. Starting with the system of ODEs [15]
 y1¢(t)
 =
 a  y1(t)  +  b  y1(t)  y2(t)
 y2¢(t)
 =
 c  y2(t)  +  d  y1(t)  y2(t)
we arrive in this way at a system of DDEs
 y1¢(t)
 =
 a  y1(t) æç è 1 - y1(t)m ö÷ ø +  b  y1(t)  y2(t)
 y2¢(t)
 =
 c  y2(t)   +  d  y1(t-t)  y2(t-t)
It is interesting to explore the effect of the delay, so let us solve both systems on [0,100] with initial value y1(0) = 80, y2(0) = 30 for the ODEs and the same vector as constant history for the DDEs. Suppose that the parameters a = 0.25, b = -0.01, c = -1.00, d = 0.01 , and m = 200 .

Recall that you solve ODEs with dde23 by setting lags to []. When this is done, the argument Z that dde23 supplies to the functions it calls is the empty array. You can use this to code the evaluation of both sets of equations in the same function by testing isempty(Z) to find out which set to evaluate. A more straightforward approach is to use two functions for the two sets of equations. Solve the DDE with t = 1. Plot in one figure y2(t) against y1(t) for the two solutions. This phase plane plot of the solution of the ODEs should be a closed curve corresponding to a limit cycle. To achieve this you will need to tighten the error tolerances with a command like

```   opts = ddeset('RelTol',1e-5,'AbsTol',1e-8);
```
The figure makes the point that introducing a delay into an ODE model can have a profound effect on the solution. If you experiment with t, you will find this to be true even for small delays. It is also interesting to remove the resource term 1- y1(t)/m and see how the orbits change as t is changed.

### References

[7]
J. Hale, Functional Differential Equations, Springer-Verlag, Berlin, 1971.

[15]
J.M. Ortega and W.G. Poole, An Introduction to Numerical Methods for Differential Equations, Pitman Publishing Inc., Marshfield, Massachusetts, 1981.