{VERSION 2 3 "APPLE_68K_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 256 "" 0 "" {TEXT -1 34 "\"R\" BL, VRBL and GRBL \+ -- Maple Lab" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 "The cell below sets up the parameters for the model simulated u sing the TI-92 in this module. " }{TEXT 256 15 "Evaluate it now" } {TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "n := 30:\nt := [seq(0,i=1..n)]:\n\nt[1] := 0.25 :\nt[2] := 0.25:\nt[3] := 0.25:\nt[4] := 0.25:\n\np := 50:\nk := 2:\nd := 7:\n\nwith(plots):\nwith(plottools):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 99 "The cell defines a proced ure Cold that simulates the model and draws graphs showing the resul t. " }{TEXT 257 52 "Evaluate the next cell now to define this procedu re." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1640 "rp := rand(1..p):\n\nCold := proc ()\n local q, i, j, v, w, oldi, olds, oldr, newi, news, newr, p1, p2, p3,\n \+ ilist, slist, rlist, infected, susceptible, recovered;\n q := [ seq(0, i=1..p)]:\n for i from 1 to 5 do\n v := rp():\n \+ while q[v] > 0 do v := rp() od:\n q[v] := 1:\n od:\n \+ olds := p - 5:\n oldi := 5:\n oldr := 0:\n ilist := \{ \}:\n slist := \{\}:\n rlist := \{\}:\n for w from 1 to n \+ do\n for v from 1 to p do\n if q[v] = 0 then\n \+ for j from 1 to k do\n i := rp():\n \+ if ((q[i] > 0) and \n (stats[ra ndom, uniform]() < t[q[i]])) then\n q[v] := 1:\n fi:\n od:\n fi:\n \+ od:\n newr := 0:\n news := 0:\n for j from \+ 1 to p do\n if q[j] = 0 then\n news := news + 1:\n elif q[j] > d then\n newr := newr + 1:\n fi:\n od:\n newi := p - news - newr: \n slist := slist union \{line([w-1, olds],[w,news])\}:\n \+ ilist := ilist union \{line([w-1, oldi],[w,newi])\}:\n rli st := rlist union \{line([w-1, oldr],[w,newr])\}:\n olds := ne ws:\n oldr := newr:\n oldi := newi:\n for i fr om 1 to p do\n if q[i] > 0 then\n q[i] := q [i] + 1:\n fi:\n od:\n od:\n p1 := display (rlist, color=BLUE, axes=NONE):\n p2 := display(slist, color=BLACK , axes=NONE):\n p3 := display(ilist, color=RED, axes=NONE):\n \+ display([p1, p2, p3], axes=NORMAL);\n end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 97 "The next cell does o ne simulation of the same model done in the browser window using the T I-92. " }{TEXT 258 15 "Evaluate it now" }{TEXT -1 106 ". You can do \+ additional simulations exactly the same way, changing the various para meters as appropriate." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "Cold();" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 34 }{VIEWOPTS 1 1 0 1 1 1803 }