{VERSION 5 0 "SUN SPARC SOLARIS" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "courier" 1 10 255 0 0 1 2 1 0 0 1 0 0 0 0 1 }{CSTYLE "" -1 256 "" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "helvetica" 1 10 0 0 0 0 1 2 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 12 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }1 0 0 0 8 4 0 0 0 0 0 0 -1 0 }{PSTYLE "" 3 256 1 {CSTYLE "" -1 -1 "" 1 12 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 }{PSTYLE "" 0 257 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 3 258 1 {CSTYLE "" -1 -1 "" 1 10 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 }{PSTYLE " " 3 259 1 {CSTYLE "" -1 -1 "" 1 10 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 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 257 "" 0 "" {TEXT -1 19 "Transformations.mws" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 635 "Here we offer graphical \+ illustrations of the effect of a linear transformation or an affine tr ansformation of the plane. This will probably be a bit mysterious, so don't worry if you can't follow what it's all about. We will have a \+ great deal more to say about this later when we \"linearize\" systems \+ and do \"stability analysis.\" The portion \"Tranformation procedures \" should not be modified by the student. It computes A v for a matr ix A and vector v and plots both v and A v , and does the analogous o peration for an affine transformation. After you have some idea what t his about we will introduce eigenvalues and eigenvectors." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "wit h(linalg): with(plots):" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 348 "Don't worry about the warnings--the stan dard meanings of norm and trace in Maple have to do with number theory , so this is just reminding us that we are going to be using the linea r algebra meanings for now. (If you are doing number theory and linea r algebra simultaneously, then you are probably smart enough to get ar ound this little conflict.) " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 133 "When you hit Return here the next section wil l open up automatically. Just go ahead and hit Enter or Return again t o get through it." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1 " " } {TEXT -1 0 "" }}}{SECT 1 {PARA 256 "" 0 "" {TEXT 256 57 "Transformatio n procedure (DO NOT TAMPER WITH THIS CODE!!]" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "Ltransform:= proc( A :: matrix , V :: list )\nloca l i;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 107 "if nops(V) = 2 then\nplot( \{ V, [seq(convert(multiply(A, op(i, V)), list), i = 1 .. nops(V))]\}, thickness=2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 86 "else polygonplot( \{ V, [seq(convert(multiply(A, op(i, V)), list), i = 1 .. nops(V))]\}) ;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 71 "Atransform: = proc( F :: matrix , V :: list )\nlocal i, j, dimen, P1, P2;" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "dimen:= nops( V[1]);" }}{PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 20 "if nops(V) = 2 then " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 114 "plot([V, [seq(convert(multiply(F,[seq( op(i, V)[j], \+ j = 1 .. dimen),1]), list), i = 1 .. nops(V))]], thickness=2);" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "else P1:= polygonplot([V], color = \+ yellow):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "P2:= polygonplot([seq( convert( multiply(F, [seq(op(i, V)[j], j = 1 .. dimen),1]),list), i = 1 .. nops(V))], color = blue ):" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "display(P1, P2);" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 3 "fi;" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 4 "end:" }}}}{SECT 1 {PARA 258 "" 0 "" {TEXT -1 27 "Examples of transformations" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "A:= matrix( [ [1, 3], [3, 1] ] ); # a \"symmetric mat rix\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "B:= matrix( [ [1, \+ 2], [0, 1] ] ); # a \"shear\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 82 "C:= matrix( [ [cos(Pi/3), -sin(Pi/3)], [sin(Pi/3), cos(Pi/3)] ]) ; # a \"rotation\"" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 112 "SQ := [ [0, 0], [1, 0], [1, 1], [0, 1] , [0, 0] ]: polygonplot(SQ, color \+ = green, scaling = CONSTRAINED); # a box" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 132 "quasicircle:= [ seq( [cos(j*Pi/36), sin(j*Pi/36)], j = 0 .. 72 )]: polygonplot(quasicircle, color = yellow, scaling = CON STRAINED);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 73 "seg1:= [ [0 , 0], [ 3, -2] ]: plot( seg1, xtickmarks = 4); # a segment" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 60 "seg2:= [ [0, 0] , [1, 1] ]: \+ plot( seg2 ); # another segment" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "seg3:= [ [0, 0], [-1, 1] ]: plot( seg3 ); # yet anot her segment" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "seg4:= [ [0, 0], [0.5, 0.2] ]: plot( seg4 ); # and just one more" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "Ltransform( A, seg1 ); # see what A does to the first segment" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "Lt ransform( B, seg1 ); # see what B does to the first segment" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "display( Ltransform( C, seg1 ), xtickmarks = 4, ytickmarks = 4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Ltransform( A, seg2 );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 46 "Where did seg 2 go to, and why don't we see it?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "display( Ltransform( A, seg3 ), xtickmarks = 4, ytick marks = 4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 90 "P1:= Ltransf orm( A, SQ ): P2:= Ltransform( A, seg2 ): display( [P1, P2], thickne ss = 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 184 "P1:= Ltransform(A, quasicircle ): \+ P2:= Ltransform(A, [ [0,0], [cos(Pi/4), sin(Pi/4)]]): P3:= Ltransform (A, [ [0,0],[cos(3*Pi/4), sin(3*Pi/4)]]): display( [P1, P2, P3], thick ness = 2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 104 "Can you see which \+ parts of the square went where? Once, again, what happened to the ori ginal segment 2?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 106 "P1:= L transform( B, SQ ): P2:= Ltransform ( B, seg2): display([P1, P2], x tickmarks = 4, thickness = 2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 39 "Can you see why this i s called a shear?" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 147 "P1:= \+ Ltransform( C, SQ ): P2:= Ltransform ( C, seg2): display([P1, P2 ] , thickness = 2, xtickmarks = 3, ytickmarks = 3, scaling = CONSTRAINED );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " " 0 "" {TEXT -1 145 "Now it's your turn! Define new matrices, new vec tors (segments), and see what the transformations do both to the vecto rs and to the unit square." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 539 "Nex t let's take a look at affine transformations. In this case instead of taking [x, y] to [ax + by, cx + dy], which obviously takes [0, 0] to \+ itself, we take [x, y] to [ax + by +r, cx + dy +f], which takes [0,0] \+ to [r,s]. Since there are 6 parameters involved you need to specify a \+ 2 x 3 matrix. Properly speaking, these affine transformations should b e viewed as projections onto the plane of lthe application of inear tr ansformations in space, and this is how we have implemented the code; \+ but but most of this will be hidden from you. " }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 44 "F:= matrix( [ [1, -0.5, 1], [-0.5, 1, 0] ]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Atransform(F, seg1);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Atransform(F, seg3);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Atransform(F, seg4);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 19 "Atransform( F, SQ);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 27 "Atransform(F, quasicircle);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}}{SECT 1 {PARA 259 "" 0 "" {TEXT -1 28 "Eigenvalues and eigenvectors " }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 139 "\nA matrix is entered by givi ng the number of rows, number of columns, and a list of the entries fr om left to right, top row to bottom row. " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "E:= matrix( 2 , 2, [ -4, 5/2, -5/2, 1]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 81 "\nIt is easy to get the eigenvalues, but \+ watch out, they could be complex numbers." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "eigenvals(E);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 474 "\nIf you request the eigenvectors you actually get more: a LIST ( or a SEQUENCE of LISTS) in which the first entry is the eigenvalue, th e second is the multiplicity (typically in real life problems this wil l be one), and the third is a SET of independent eigenvectors that bel ong to the eigenvalue in question. In our first example there is a re peated eigenvalue (-3/2 appeared twice), so the multiplicity is 2, but there is only one independent eigenvector, namely [1, 1]." }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "V:= eigenvects(E);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 302 "\nTo extract the eigenvector use the op command. W e want the first (and only) operand of the third operand of V. (Think \+ of this as stripping off the large square brackets and selecting the t hird item that lies therein, then stripping off the curley braces and \+ taking the one thing that is inside them.)" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "v1:= op( op(3, V) );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 143 "Check for yourself that \+ this is correct! Is it true that A v1 = (-3/2) v1 ? Let's try using our transform procedure to do a graphical check." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 25 "seg:= [ [0, 0], [1, 1] ]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Ltransform( E , seg );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 71 "T ry this for yourself, using multiples of [1, 1] -- what do you notice? " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 357 "\nHere's another example, th is time with two distinct complex eigenvalues. Oftentimes we don't ca re about specific complex eigenvalues; the mere absence of real eigenv alues is all we need to know. Other times we only care about features of the complex eigenvalues, such as whether they are pure imaginary, \+ or if they have positive or negative real parts. " }}{PARA 0 "> " 0 " " {MPLTEXT 1 0 49 "F:= matrix(2, 2, [4, 1, -2, 3]); eigenvals(F);\n " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 57 "The next one has two distinct pure imaginary eigenvalues." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "G:= matrix(2, 2, [-0.4, -4, 2, 0.4] ); eigenvals(G);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 42 "The next has two distict real eigenvalues." }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "H:= matrix(2, 2, [2, 3, 4, 1]); \+ eigenvals(H);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "V:= eigenv ects(H);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 38 "sortEV := (a,b) -> evalb( a[1]>b[1] );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 " sort( [V], sortEV );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 366 "\nLet's \+ see if we can extract those two independent eigenvectors from this mes s. First we turn the SEQUENCE called V into a LIST by putting it in [ ]. Then we dig in. The first eigenvector is the first (and only) it em of the third item of the first item of [V]; the second is the first (and only) item of the third item of the second item of [V] (got all \+ that?). " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "v1:=op( op(3, op(1, [V ]) )); v2:=op( op(3, op(2, [V]) ));\n " }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 56 "seg1: = [ [0, 0], [1, 1] ]: seg2:= [ [0,0], [1, -4/3] ]:" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Ltransform( H , seg1);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Ltran sform( H, seg2 );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 693 "How about that? Fortunately, unless we are plann ing to write down explicit solutions of our differential equations, we seldom need all this. And since the solutions corresponding to the v arious eigenvectors are solutions of the linearized system, which we a re only using as a guide to the behaviour of the original non-linear s ystems in the vicinity of equilibrium points, there isn't a lot of poi nt in getting formulas. All we are really interested in is the stabil ity properties and local behaviour of the linearized system (which is \+ supposed to reflect that of the original system), and, as mentioned ab ove, this is often possible to read just from the kinds of eigenvalues that we get. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 326 "Now try it yourself. Put in one of the transformations A , B, or C, and find out if there are any real eigenvalues. If there ar e, see if you can illustrate the stretching or shring effect of the tr ansformation on the appropriate line segment. Use TAB to get to the %? and replace it with the name of the matrix you have chosen." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "eigenvals( %? );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "V:= eigenvects( %? );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 59 "v1:=op( op(3, op(1, [V]) )); v2:= op( op(3, op(2, [V]) ));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 63 "seg1:= [ [0, 0], [ %? , %? ] ]: seg2:= [ [0,0], [ %? , %? ] ]:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Ltransform( %? , seg1 );" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Ltransform( %? , seg2 );" } }}}}{MARK "0 0 0" 8 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }