{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 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 262 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 255 0 0 1 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 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 258 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 258 "" 0 "" {TEXT -1 21 "More Realistic Models" } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 90 "The cell below defines the model used as an example with the Java applet in th is module. " }{TEXT 267 15 "Evaluate it now" }{TEXT -1 80 ". You wil l be able to work with similar models by modifying the definition of \+ " }{TEXT 268 6 "pts[0]" }{TEXT -1 4 ", .." }{TEXT 269 8 ". pts[20" } {TEXT -1 58 "]. These are the values of the population multiplier at \+ " }{TEXT 270 5 "p = 0" }{TEXT -1 2 ", " }{TEXT 271 6 "p = 50" }{TEXT -1 4 ", .." }{TEXT 272 9 ". p = 100" }{TEXT -1 2 "0." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 639 "pts[ 0] \+ := 0.8:\npts[ 1] := 0.8:\npts[ 2] := 0.8:\npts[ 3] := 0.8:\npts[ 4] := 1.0:\npts[ 5] := 1.2:\npts[ 6] := 1.2:\npts[ 7] := 1.2:\npts[ 8] := 1 .2:\npts[ 9] := 1.2:\npts[10] := 1.2:\npts[11] := 1.2:\npts[12] := 1.2 :\npts[13] := 1.2:\npts[14] := 1.2:\npts[15] := 1.0:\npts[16] := 0.8: \npts[17] := 0.6:\npts[18] := 0.4:\npts[19] := 0.2:\npts[20] := 0.0:\n \nmult := proc(p)\n local j, t, pout;\n j := trunc(p/50) :\n t := (p - 50 * j)/50:\n if (j = 20) then\n \+ pout := pts[20]:\n else\n pout := (1 - t) * pts[j] + t * pts[j + 1]:\n fi;\npout;\nend:\n\nplot(mult(p),p=0..1000); \n\nf := p -> a * p * mult(p):\na := 1:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 1 "\n" }}{PARA 0 "" 0 "" {TEXT -1 39 "The cell below defines \+ a procedure -- " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 262 6 "cobweb" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 89 " -- that can be used to draw cobweb diagrams.\nThis pr ocedure requires three arguments.\n\n" }}{PARA 0 "" 0 "" {TEXT 263 4 " fcn " }}{PARA 0 "" 0 "" {TEXT -1 100 " -- the function that describes \+ how each term of the sequence is computed from the preceding term.\n\n " }}{PARA 0 "" 0 "" {TEXT 264 5 "first" }}{PARA 0 "" 0 "" {TEXT -1 50 " -- the value of the first term of the sequence.\n\n" }}{PARA 0 "" 0 "" {TEXT 265 1 "n" }}{PARA 0 "" 0 "" {TEXT -1 76 " -- the number of te rms of the sequence to be shown in the cobweb diagram \n\n" }}{PARA 0 "" 0 "" {TEXT 266 27 "Evaluate the cell below now" }}{PARA 0 "" 0 "" {TEXT -1 4 ". \n" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 1488 "with(plots):\nwith(plottools):\n\nPopModel :=\n proc(fcn, first, n) \n if n <= 1 then first else fcn( PopModel(fcn, first, n-1)) fi:\n end:\n\ncobweb := \n proc(fcn , first, n, top)\n local blk, rd, blu, frm, cobweblist, j;\n\n \+ cobweblist := \{line([first, 0], [first, fcn(first)])\}:\n\n for \+ j from 3 to n do\n cobweblist := cobweblist union\n \+ \{line([PopModel(fcn, first, j-2), PopModel(fcn, first, j-1)],\n \+ [PopModel(fcn, first, j-1), PopModel(fcn, first, j-1)]), \+ \n line([PopModel(fcn, first, j-1), PopModel(fcn, first, j -1)],\n [PopModel(fcn, first, j-1), PopModel(fcn, fir st, j)])\}\n od:\n\n frm := display(\{line([0, 0], [0, top]), \n line([0, top], [top, top]),\n \+ line([top, top], [top, 0]),\n line([top, 0], [0 , 0])\},\n color = BLACK,\n ax es = NONE,\n scaling = CONSTRAINED):\n\n blk : = plot(f(p),\n p = 0..top,\n y = 0..top,\n color = BLACK,\n scal ing = CONSTRAINED):\n\n rd := display(cobweblist,\n \+ color = RED,\n axes = NONE,\n \+ scaling = CONSTRAINED):\n\n blu := display(\{line([0, 0], [top , top])\},\n color = BLUE,\n axe s = NONE,\n scaling = CONSTRAINED):\n\n display ([blk, rd, blu, frm]); \n end:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 133 "The following cell illustrates ho w this new procedure can used along with other Maple procedures to inv estigate long term behavior. " }{TEXT 261 16 "Evaluate it now." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 300 " cobweb(f, 50, 30, 1000);\n\n pop := proc(n) option remember; \n if n = 1 then 50 else f(pop(n-1)) fi\n end:\n\n fo r k from 1 to 30 \n do printf(`%4d %10.4f`, k, pop(k));\n pr int();\n od;\n\n plot([seq([n, pop(n)], n = 1 .. 30)], \n \+ year = 1 .. 30, title = `Population`);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 0" 21 }{VIEWOPTS 1 1 0 1 1 1803 }