function f = epi1dae(t,y) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % function f = epi1dae(t,y) % % Solution to CSE Your Homework Assignment Project 6 % % More Models of Infection: It's Epidemic % % epidae.m Dianne P. O'Leary 11/03 % % % % This program evaluates dy/dt for the DAE model of % % Problem 2. % % The y vector has 3 components: % % infected, susceptible, and recovered. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% global mytrans myrecov inf = y(1); sus = y(2); rec = y(3); f(1,1) = mytrans*inf*sus - inf/myrecov; f(2,1) = - mytrans*inf*sus; f(3,1) = 0;