{VERSION 4 0 "IBM INTEL NT" "4.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 "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 257 "" 0 1 93 41 59 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 93 41 59 0 0 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 259 "" 0 1 93 41 59 0 0 1 0 0 0 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 256 20 "Leslie Growth Models" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 258 31 "Part 1. Age-distributed growth" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 31 "B uild the Leslie growth matrix " }{XPPEDIT 18 0 "L" "6#%\"LG" }{TEXT -1 32 ". \n[Notes: (1) We first define " }{XPPEDIT 18 0 "L" "6#%\"LG " }{TEXT -1 66 " to be a matrix of zeros. (2) Next we insert symbolic \+ birth rates " }{XPPEDIT 18 0 "a[j]" "6#&%\"aG6#%\"jG" }{TEXT -1 21 " i n the first row of " }{XPPEDIT 18 0 "L" "6#%\"LG" }{TEXT -1 229 ". (3 ) Then we insert symbolic survival rates on the first subdiagonal. (4 ) The for-from-do structure is a way to tell Maple to do the same oper ation over and over. (5) The odd word \"od\" is \"do\" backwards -- i t means \"end do\".]" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "L:=diag(0,0,0,0,0,0,0,0,0,0,0 ,0):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "a:='a':for j from 1 to 12 d o L[1,j]:=a[j] od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "b:='b':for j \+ from 1 to 11 do L[j+1,j]:=b[j] od: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print(L);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 40 "Construct the \+ characteristic polynomial " }{XPPEDIT 18 0 "p(lambda)" "6#-%\"pG6#%'la mbdaG" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "p(lambda): =charpoly(L,lambda);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "Constru ct the auxiliary function " }{XPPEDIT 18 0 "q(lambda" "6#-%\"qG6#%'lam bdaG" }{TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "c:='c':for \+ j from 1 to 11 do c[j]:=mul(b[i],i=1..j) od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 66 "j:='j': q(lambda):=a[1]/lambda+sum(a[j]*c[j-1]/lambda ^j,j=2..12);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 69 "Assign birth an d survival rates for the New Zealand sheep population." }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 86 "a:=array(1..12,[0,0.045,0.391,0.472,0.484,0.54 6,0.543,0.502,0.468,0.459,0.433,0.421]):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 84 "b:=array(1..11,[0.845,0.975,0.965,0.950,0.926,0.895,0 .850,0.786,0.691,0.561,0.370]):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "for j from 1 to 12 do L[1,j]:=a[j] od:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 41 "for j from 1 to 11 do L[j+1,j]:=b[j] od: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print(L);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 5 "Plot " }{XPPEDIT 18 0 "q(lambda)" "6#-%\"qG6#%'lambdaG" } {TEXT -1 5 " and " }{XPPEDIT 18 0 "p(lambda)" "6#-%\"pG6#%'lambdaG" } {TEXT -1 1 "." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "plot(q(lambda),lam bda=0..2, y=0..10);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "plot(p(lambd a),lambda=-2..2,y=-2..2);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 47 "No w let Maple compute the eigenvalues directly." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "eigenvals(L);\n" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT 259 38 "Part 2. Properties of Leslie matrices" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 37 "Fill in the dominant eigenvalue here:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "l ambda1:= ;\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 50 "Enter the followi ng lines, and explain the output." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "k:=10: x0:=[1,1,1,1,1,1,1,1,1,1,1,1]: " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "xk:=evalm(L^k&*x0); " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "evalm(L&*xk); evalm(lambda1*xk);\n" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "By varying k in the preceding step, find an eigenvector f or the dominant eigenvalue." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 16 "P art 3. Summary" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}}{MARK "0 0 0" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }