{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

quiz6_solution - @biophy,tspan,y0 plot(t,y,1 k hold on...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [] = biophy_onefunc(); %BIOPHY_ONEFUNC - A function to solve three coupled differential equations %for s(t), i(t), r(t) during an epidemic of the Honk Kong FLu in New York %City in 1968-1969. %Function call on command line - biophy_onefunc %Output - plot of s, i, and r vs. t %File written by S.C. Tegler. Last modified 3/8/11. %--------------------------------------------------- tspan=[0 150]; y0=[1;1.27e-6;0]; [t,y]=ode45(
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: @biophy ,tspan,y0); plot(t,y(:,1), '+k' ); hold on ; plot(t,y(:,2), 'or' ); plot(t,y(:,3), 'sb' ); grid xlabel( 'Time (Days)' ); ylabel( 'Fraction of Population' ); title( 'SIR Model of Hong Kong Flu In NYC 1968-1969' ); legend( 'Susceptible' , 'Infected' , 'Recovered' ); function dydt = biophy(t,y) beta = 0.5; r = 0.333; S = y(1); I = y(2); R = y(3); dydt = [-beta*S*I;beta*S*I-r*I;r*I]; end end...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online