A population growth model due to Cooke et alia [3]
describes the population y(t) at time t by the equation
|
For each set of parameter values, solve the problem using three values of the delay, namely T = 0.2,1.0, 2.4 , and plot the solutions on the same figure. Structures can be indexed, so this can be coded as
for i = 1:3
T = Delays(i);
sol(i) = dde23('prob6f',T,3.5,[0, 25],opts);
end
On exit from the loop, the solution for the first delay is
sol(1).x,sol(1).y and so forth. Note that T must be
communicated to prob6f as a parameter or global variable
because it appears in the equation. In the code fragment it is
communicated as a global variable along with the parameters of the
data set. You should use tolerances more stringent than the
defaults, e.g.,
opts = ddeset('RelTol',1e-5,'AbsTol',1e-8);
You might find it interesting to compare your solutions with those
of Figure 3 in [3]. The following figures show the
solutions for two of the data sets. Obviously the delay has a
profound effect on the solution.

