{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 } {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 40 "Predators and Prey -- Sp rings and Masses" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 140 "The cell below illustrates how Maple can be used to inve stigate models like the Predator - Prey and Spring-and-Mass models in \+ this module. " }{TEXT 256 69 "Evaluate it now and then use it as the \+ basis for further exploration." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 646 "\nwith('plots'):\ninitialp \+ := 300:\ninitialq := 300:\n\nh := 0.1:\nsteps := 120:\n\nf := (p, \+ q) -> (0.005 * q - 1) * p:\ng := (p, q) -> (1 - 0.005 * p) * q:\n\np : = proc(n) option remember;\n if (n = 1) then\n initialp\n \+ else\n p(n - 1) + h * f(p(n - 1), q(n - 1))\n fi:\n \+ end:\n\nq := proc(n) option remember;\n if (n = 1) then\n i nitialq\n else\n q(n - 1) + h * g(p(n - 1), q(n - 1))\n \+ fi:\n end:\n\nrd := plot([seq([n, p(n)], n = 1 .. steps)], 1 .. s teps, color = red):\nblu := plot([seq([n, q(n)], n = 1 .. steps)], 1 . . steps, color = blue):\ndisplay([rd, blu]);\n\nplot([seq([p(n), q(n)] , n = 1 .. steps)]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }} }}{MARK "0 2 1" 69 }{VIEWOPTS 1 1 0 1 1 1803 }