function dy = epi1delay(t,y,z)

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%  function dy = epi1delay(t,y,z)                        %
%  Solution to CSE Your Homework Assignment Project 6    %
%  More Models of Infection: It's Epidemic               %
%  epi1delay.m Dianne P. O'Leary   11/03                 %
%                                                        %
%  This program evaluates dy/dt for the DDE model of     %
%  Problem 3.                                            %
%  The rate of recovery now = rate of new infection in   %
%         past.                                          %
%  The y vector has 3 components:                        %
%        infected, susceptible, and recovered.           %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global mytrans myrecov myinitinfec

inf = y(1);
sus = y(2);
rec = y(3);

diold = mytrans*z(1)*z(2);

dy(1,1) =   mytrans*inf*sus - diold;
dy(2,1) = - mytrans*inf*sus;
dy(3,1) =   diold;

