{VERSION 5 0 "SUN SPARC SOLARIS" "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 "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 1 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 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 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Output" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 3 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 " " 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Plot" 0 13 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 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 0 "" 0 "" {TEXT -1 363 " \+ Computer Project II\n \+ Math 2270-1, April 2002\n\n In this second part of the projec t you will experiment with a discrete dynamical system.\nOne can model the level of glucose and insulin in the blood using a system of the f orm \n G(n+1) = aG(n) + bH(n)" }} {PARA 0 "" 0 "" {TEXT -1 383 " H(n+1 ) = cG(n) + dH(n) .\nHere G(n) represents the level of glucose in the \+ blood at time n and H(n) represents the level of insulin in the blood \+ at time n. The coefficients a,b,c and d vary for different body chemis tries. This model is supposed to be valid between meals. Below I will \+ do some computations for one choice of coefficients a,b,c and d." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 37 "restart: with (linalg): with (plots):" }}{PARA 7 "" 1 "" {TEXT -1 80 "Warning, the protected names norm and trace have been redefined and unprotected\n" }}{PARA 7 "" 1 "" {TEXT -1 50 "Warning, the name changecoords has been redefined\n" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "A_1 := matrix(2,2, [1.5, 1 , 0, .5]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$A_1G-%'matrixG6#7$7$$ \"#:!\"\"\"\"\"7$\"\"!$\"\"&F," }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 124 " This is one choice of coefficients a,b,c and d. Let's see what h appens with the initial conditions G(0)= 100 and H(0) = 0. " }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "v_0 := vector ([100,-90]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%$v_0G-%'vectorG6#7$\"$+\"!#!*" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 145 "G[0] := 100: H[0] := -90:\n for i from 1 to 30 do \nG[i] := evalm ((A_1)^i&* v_0) [1]:\nH[i] := ev alm ((A_1)^i&*v_0) [2];\n#print (i, G[i], H[i]);\nod:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 70 "plot1 := pointplot (\{seq([G[i], H[ i]], i= 0..30)\}):\ndisplay (\{plot1\});" }}{PARA 13 "" 1 "" {GLPLOT2D 382 286 286 {PLOTDATA 2 "6#-%'POINTSG6A7$$\"$+'!\"\"$!$]%F)7 $$\"$+\"\"\"!$!#!*F/7$$\"'+Dc!\"%$!&]i&F57$$\"&+]%!\"$$!&]7\"F;7$$\"%+ X!\"#$!%]AFA7$$\"*lT*yV!\"&$!+J?eYF!#77$$\"*5)H>HFG$!+iS;$\\&FJ7$$\"*0 1i%>FG$!+7Gj)4\"!#67$$\"*O&[(H\"FG$!+DcE(>#FU7$$\"*J&>]')!\"'$!+]7`%R% FU7$$\"*\"GQndFhn$!*]i!*y)!#57$$\"*w$4YQFhn$!*]7yv\"!\"*7$$\"*D1kc#Fhn $!)]i:N!\")7$$\"*+Dcr\"Fhn$!(]7.(!\"(7$$\"*+DJ:\"Fhn$!(]iS\"Fhn7$$\"(+ ](yFG$!']7GFG7$$\"*s4%olFG$!+:5Ht8FJ7$$\"*g5v\">FA$!+qJ!>Q)!#<7$$\"*A8 E&)*FG$!+x]Xmo!#87$$\"*$y$o@#F5$!+pPh;*yZ\"F5$!+QvALMF]r7$ $\"*9uA7\"F;$!+1O)G2\"!#97$$\"*kF=[(F5$!+7swX@F]s7$$\"*4&)y)\\F5$!+BW` \"H%F]s7$$\"*uc_K$F5$!+Y)oIe)F]s7$$\"*(G^\"o&F;$!+OD_0n!#;7$$\"*Cvwy$F ;$!+2X5T8!#:7$$\"*%o6DDF;$!+9!4Ao#Fht7$$\"*B6Mo\"F;$!+H!=WO&Fht7$$\"*R S$y7FA$!+M1Qw;Fbt7$$\"*MpA_)F;$!+o7w_LFbt" 1 2 0 1 10 0 2 9 1 4 2 1.000000 45.000000 45.000000 0 0 "Curve 1" }}}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 274 " This plot tracks our solution for the first thirty iter ations. Notice that the solution seems to spiral inwards and time incr eases. We can find a formula for the soltution using eigenvalues and e igenvectos as follows. First we find the eigenvecotrs and eigenvalues \+ od A_1. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "(v_1,v_2) := ei genvects(A_1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>6$%$v_1G%$v_2G6$7%$ \"\"&!\"\"\"\"\"<#-%'vectorG6#7$$!+++++5!\"*F,7%$\"#:F+F,<#-F/6#7$F,\" \"!" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "v_1; v_2;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%^$$\" \"*!\"\"$!+++++?!#5\"\"\"<#-%'vectorG6#7$^$$F)!\"*$!\"!\"\"!^$$F6F6$F' F6" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#7%^$$\"\"*!\"\"$\"+++++?!#5\"\" \"<#-%'vectorG6#7$^$$!+++++?!\"*$\"\"!F6^$F5$F+F6" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 753 " Now we want to write v_0 as a linear combination of the eigenvectors v_1 and v_2. In fact, if we work with the eigenve ctors v_1 = [-2, i] and v_2 = [2,i] then we see \n \+ v_0 = -50 v_1 + 50 v_2.\nThen, because v_1 has a n eigenvalue of .9 + .2 i and v_2 has an eigenvalue of .9 - .2 i, we s ee that (don't worry about the imaginary parts; they cancel) \n A_1^ k (v_0) = -50 A_1^k (v_1) + 50 A_1^k (v_2) =\n \+ -50(.9+.2i)^k v_1 + 50(.9-.2i)^k v_2.\nThe important thing to ntoice is that the real part of each eignevalue is .9, which is a positive number less than one. Thus we can see that the solution gets closer and closer to the origin with each iteration (by a factor \+ of .9). \n" }}{PARA 0 "" 0 "" {TEXT -1 331 "Your part of this project \+ is the following:\nFind a 2x2 matrix A_2 such that for some initial da ta the solution collapses towards the origin and for other initial dat a the solution gets arbitrarily large. Demonstrate this behavior by pl otting some data for 30 iterations. (Hint: think about what the eigenv alues of A_2 have to be. )" }}}}{MARK "8 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }