{VERSION 5 0 "IBM INTEL NT" "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 Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 256 "" 1 12 0 0 0 0 0 0 0 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 "Heading 1" -1 3 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 6 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 2" -1 4 1 {CSTYLE "" -1 -1 "Times" 1 14 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 4 4 1 0 1 0 2 2 0 1 }{PSTYLE "Heading 3" -1 5 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }{PSTYLE "List Item" -1 14 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 -12 3 3 1 0 1 0 2 2 14 5 }{PSTYLE "Title" -1 18 1 {CSTYLE "" -1 -1 "Times" 1 18 0 0 0 1 2 1 2 2 2 2 1 1 1 1 }3 1 0 0 12 12 1 0 1 0 2 2 19 1 }{PSTYLE "Exercise" -1 256 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 -12 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 18 "" 0 "" {TEXT -1 0 "" }{TEXT 256 24 "Linear Al gebra Powertool" }}{PARA 18 "" 0 "" {TEXT -1 20 "Gaussian Elimination " }}{PARA 4 "" 0 "" {TEXT -1 19 "On Line Section 1.4" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 67 "Worksheet written by Mi chael K. May, S.J., revised by Russell Blyth" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 52 "restart: with(lin alg): with(plots): with(plottools):" }}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 7 "Outline" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 76 "This worksheet go es through the problems covered in the On Line 1.4 section." }}{PARA 0 "" 0 "" {TEXT -1 25 "The basic objectives are:" }}{PARA 14 "" 0 "" {TEXT -1 56 "1) Converting between systems of equations and matrices " }}{PARA 14 "" 0 "" {TEXT -1 54 "2) Using Maple commands for element ary row operations" }}{PARA 14 "" 0 "" {TEXT -1 50 "3) Using more gen eral Maple commands on matrices." }}}}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 59 "Part1: Converting between systems of equations and matrices" }} {EXCHG {PARA 0 "" 0 "" {TEXT -1 503 "The book points out that the Gaus sian elimination method we used on systems of equations can be perform ed in shorthand by working on the matrix of coefficients of the system . In Maple the command for converting from a system of equations to a matrix is genmatrix. To convert back from a matrix to a system of eq uations, the command is geneqns. Each of these commands has two forms , one for the matrix of coefficeients, and one for the augmented matri x. These commands are part of the linalg package." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 118 "To convert from a system of equations to a matri x we first need a list of equations, and an ordered list of variables. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 153 "eq1 := x + y + 2*z + w = 1;\neq2 := 3*x - 4*y + z + w = 2;\neq3 := 4*x - 3*y + 3*z + 2*w = 3;\neqlist := [eq1, eq2, eq3];\nvarlist := [x, y, z, w];" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 298 "If we want the matrix of coeffici ents, the command genmatrix has two parameter: the list of equations a nd the list of variables. If we want the augmented matrix, we add a t hird parameter, the name `flag` (note the backquotes, found on the key to the left of the \"1\" key, top left of the keyboard)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "M1 := genmatrix(eqlist, varlist);\n M2 := genmatrix(eqlist, varlist,`flag`);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 245 "If we have the augmented matrix, we can use the delcols \+ command to remove the last column (we ask for columns 5 through 5 to \+ be removed) to obtain the coefficient matrix. The col command is used to turn the last column into a vector of values." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 42 "M2a := delcols(M2,5..5);\nM2b := col(M2,5); " }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 302 "To convert back from a matri x to a system of equations we use the geneqns command. To produce a s ystem with the constants set to zero (that is, a homogeneous system) w e use two parameters: the matrix and the variable list. For a nonhomo geneous system, we use a third parameter, a vector of constants." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 69 "homsys := geneqns(M1,varlist );\nnonhomsys := geneqns(M2a,varlist,M2b);" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 5 "" 0 "" {TEXT -1 10 "Exercises: " }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 95 "1) Use Maple to convert th e system\{x-y+2z-2w=1, 2x+y+3w=4, 2x+3y+2z=6\} to an augmented matrix. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 256 " " 0 "" {TEXT -1 45 "2) Use Maple to convert the augmented matrix " } {XPPEDIT 18 0 "matrix([[0, 0, 2, 4, 1], [3, 1, 2, 6, 0], [1, 1, 1, 1, \+ 1], [0, 1, 2, -1, 1]]);" "6#-%'matrixG6#7&7'\"\"!F(\"\"#\"\"%\"\"\"7' \"\"$F+F)\"\"'F(7'F+F+F+F+F+7'F(F+F),$F+!\"\"F+" }{TEXT -1 45 " to a s ystem of equations in x, y, z, and w." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 145 "3) Use the \+ command N1 := randmatrix(3, 5); to generate a random 3 by 5 matrix na med N1. Convert it to a system of equations in x, y, z, and w." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{SECT 1 {PARA 3 "" 0 " " {TEXT -1 32 "Part2: Elementary row operations" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 278 "Once we have a system of equations converted to an \+ augmented matrix, the next task is to use elementary row operations to perform Gaussian elimination on the matrix. The linalg package of Ma ple has a command corresponding to each type of elementary row operati on. The command " }}{PARA 0 "" 0 "" {TEXT -1 24 "addrow(M, r1, r2, sc al);" }}{PARA 0 "" 0 "" {TEXT -1 68 "is used to add scal times row r1 \+ of matrix M to row r2. The command" }}{PARA 0 "" 0 "" {TEXT -1 20 "mu lrow(M, r1, scal);" }}{PARA 0 "" 0 "" {TEXT -1 54 "is used to multiply row r1 of M by scal. The command " }}{PARA 0 "" 0 "" {TEXT -1 19 "sw aprow(M, r1, r2);" }}{PARA 0 "" 0 "" {TEXT -1 49 "is used to switch ro ws r1 and r2 of the matrix M." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 74 "We use these operations to reduce the mat rix M2 above to row echelon form." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "print(M2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "M3a := addrow(M2,1,2,-3);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "M3b := addrow(M3a,1,3,-4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "M3c := addrow(M3b,2,3,-1);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 155 "This completes Gaussian elimination on the system. If instead we want to perform Gauss-Jordan elimination, we continue on t o the reduced row echelon form." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "M3d := mulrow(M3c,2,-1/7);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "M3e := addrow(M3d,2,1,-1);" }}}{EXCHG {PARA 5 "" 0 " " {TEXT -1 10 "Exercises:" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 117 "4 ) Use elementary row operations on the matrix N1 from exercise 3 to o btain a row equivalent matrix in echelon form." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 92 "5) \+ Use more row operations to reduce N1 to a row equivalent matrix in red uced echelon form." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}} {SECT 1 {PARA 3 "" 0 "" {TEXT -1 50 "Part3: Some more powerful linear algebra commands" }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 201 "Gaussian eli mination and Gauss Jordan elimination are standard techniques in linea r algebra. Rather than use row operations one by one, they can be per formed with the gausselim and gaussjord commands." }}}{EXCHG {PARA 0 " > " 0 "" {MPLTEXT 1 0 29 "gausselim(M2);\ngaussjord(M2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 204 "Sometimes we do not need the reduced mat rix, but only the number of nonzero rows in the reduced matrix. This \+ is found using the rank command. The transpose of a matrix is given b y the transpose command." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "rank(M2);\ntranspose(M2);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 236 "We started this section by converting systems of equations into matrix f orm. The command linsolve(MatCoef, ConstVec); finds the solution to a system which has MatCoef as the matrix of coefficients, and ConstVec \+ the vector of constants." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "gensol := linsolve(M2a, M2b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 130 "The _ti are Maple-provided parameters in the solution vectors. We can find a translation vector by setting the parameters to zero." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 47 "transvec := subs(_t[1]=0, _t [2]=0, op(gensol));" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 113 "Spanning \+ vectors are obtained by setting each parameter to 1 in turn and subtra cting off the translation vectors." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 164 "svec1 := subs(_t[1]=1, _t[2]=0, op(gensol)); \nspanv ec1 := evalm(svec1- transvec);\nsvec2 := subs(_t[1]=0, _t[2]=1, op(gen sol));\nspanvec2 := evalm(svec2 - transvec);\n" }}}{EXCHG {PARA 5 "" 0 "" {TEXT -1 10 "Exercises:" }}}{EXCHG {PARA 256 "" 0 "" {TEXT -1 91 "6) Find the general solution to the system of equations you generate d in exercise 3 above." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "0 0 1" 24 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }