{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 14 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "R3 Font 3" -1 258 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "Map le Plot" -1 259 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 51 " \+ " }{TEXT 256 19 "SIR Epidemic Model " }} {PARA 0 "" 0 "" {TEXT -1 166 "\n The SIR model of infectious disease s was derived by Kermack\nand McKendrick (1927). They studied the\npl ague outbreak in the island of Bombay, India in 1905-1906. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 50 "restart;\nwith(DEtools):\nwith(linalg):\n with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 55 "Define SIR equati ons, parameters and initial conditions" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 176 "r:= 1.0: a := 1.0:\neqns := diff(SU(t),t)=-r*SU(t)*IN(t),\n \+ diff(IN(t),t)= r*SU(t)*IN(t)-a*IN(t),\n diff(R(t),t) = \+ a*IN(t);\ninits:= SU(0)=2.8, IN(0)=0.2, R(0)=0.0;" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 29 "Generate a numerical solution" }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 84 "soln := dsolve(\{eqns,inits\},\{SU(t),IN(t),R(t)\}, \ntype=numeric, output=listprocedure):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 25 "Generate string for title" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "rr := convert(r,string): aa := convert(a,string):\ncode := c at(`SIR Models with rates r =`,rr,` a = `,aa);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 90 "Define functions for the susceptibles - s(t), the in fectives - i(t) and\nthe removed - r(t)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "s := subs(soln,SU(t)): i:=subs(soln,IN(t)):\nre := subs(soln,R (t)):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 49 "p1 := plot(\{s,i,r e\},0..5,title=code,color=black):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "pt := textplot(\{[1,2.5,\"S(t)\"],[3, 1.75,\"R(t)\"], [3,1,\"S(t)\"]\}):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "displ ay(\{p1,pt\});" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 132 "Kermack and Mc Kendrick obtained data on the weekly death total.\nThis is close to dr /dt which is a*i(t). We define a death function." }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 22 "deaths := t -> a*i(t);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 30 "plot(deaths,0..10,title=code);" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 85 "eqns2 := diff(SU(t),t)=-r*SU(t)*IN(t),\n \+ diff(IN(t),t)= r*SU(t)*IN(t)-a*IN(t);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 66 "DEplot(\{eqns2\},[SU(t),IN(t)],t=0..10,SU=0..3,IN=0 ..3,arrows=slim);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {MARK "13" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }