{VERSION 5 0 "APPLE_PPC_MAC" "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 0 2 0 0 0 0 0 0 0 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 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 "Normal" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 1 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 0 "" }}{PARA 256 "" 0 "" {TEXT -1 17 "Bambi vs the Lawn" }{TEXT 256 20 ": problem 1.6 (p43)" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "restart; with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 2 " \+ " }}{PARA 0 "" 0 "" {TEXT -1 38 "important constants (rates are annual )" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 144 "max_grass_density := \+ 3000;\nmax_grass_growth_rate := 0.8;\nmax_deer_eat_grass_rate := 1.2; \nmax_deer_reproduce_rate := 1.5;\ndeer_death_rate := 1.1;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 2 " " }}{PARA 0 "" 0 "" {TEXT -1 67 "30-year simulation (timestep = 1 for yearly, 365 for daily updates)" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 61 "timestep := 1;\nfor y from 1 to 31*timestep do\n if (y=1) then\n" }{TEXT -1 19 "initial population s" }{MPLTEXT 1 0 56 "\n deer_pop[1] := 100;\n grass_density[1] := 30 00;\n else" }{TEXT -1 53 "\nnonlinear growth rates (read the problem c arefully)\n" }{MPLTEXT 1 0 290 " grass_growth_rate := max_grass_growt h_rate * ((max_grass_density-grass_density[y-1])/max_grass_densi ty);\n\n grass_eaten_rate := max_deer_eat_grass_rate * (grass_density [y-1]/max_grass_density);\n\n deer_growth_rate := max_deer_reproduce_ rate * (grass_density[y-1]/max_grass_density);" }{TEXT -1 30 "\npopula tion update: grass\n " }{MPLTEXT 1 0 125 " grass_density[y] := gras s_density[y-1] + \n(grass_growth_rate*grass_density[y-1] - grass_eaten _rate*deer_pop[y-1])/timestep;\n" }{TEXT -1 24 "population update: de er" }{MPLTEXT 1 0 125 "\n deer_pop[y] := deer_pop[y-1] + (deer_growth _rate*deer_pop[y-1] -deer_death_rate*deer_pop[y-1])/timestep;\n\n end \+ if;\nend do:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 10 "make plots" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 125 "plot1 := [[(n-1)*timestep, deer_pop[n*timestep]] $n=1..31]:\nplot 2 := [[(n-1)*timestep, grass_density[n*timestep]] $n=1..31]:\n" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 100 "plot([plot1,plot2],title=\" deer & grass\",style=point,symbol=[circle,cross],legend=[\"deer\", \"g rass\"]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 \+ 0 0" 0 }{VIEWOPTS 1 1 0 3 2 1804 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }