{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 "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 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 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 }3 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 0 0 0 0 0 0 0 0 1 }3 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 257 "" 0 "" {TEXT -1 0 "" }}{PARA 256 "" 0 "" {TEXT 256 14 "Linear Algebra" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 597 "The text has an excellent section introducing \+ linear algebra. This can be found in Chapters 6 and 7, which provides \+ the basic commands for linear algebra. You begin any session where you are going to ask Maple to perform operations in linear algebra by ent ering the Maple linear algebra package. (By using a ; instead of a :, \+ you see the functions that this particular package has and it is an ex tensive package. Some of these topics will be familiar, but many may n ot be. Once again, the Maple help can be used to learn more about a pa rticular topic of interest and how to use the Maple package.)" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 52 "There are \+ several ways that you can enter a matrix. " }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 37 "A := matrix([[1, -2, -4],[0, 3, 5]]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "B := matrix(2, 3, [4, -2, 0, 7, 2, \+ -3]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 357 "If your matrix has a ce rtain structure that can be easily programmed in, then the array comma nd with a simple Maple program is an easier way to produce your matrix . The array command creates the dimensions of the matrix, then you can write a program to fill in the entries. Maple has for and do loops as shown below. A do loop is ended with the command od: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "C := a rray(1..2,1..3):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "for i t o 2 do " }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 " for j to 3 do" }} {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 " C[i,j] := x^i + j - i" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 8 " od: od:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "print(C);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "evalm(2*A + B + C);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 134 "Note \+ that Maple does have several special matrix forms that can be entered \+ more easily with other commands, such as a diagonal matrix." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "Q := diag(4, -5, 3);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 150 "Matrix multiplication requires & *. Clearly, the matrices above cannot be multiplied together, but we \+ can multiply the transpose of one with another." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "F := evalm( A&*transpose(B)); G := evalm(transpose(A)&*C);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 79 "Other matrix operations are very easy with many of t he commands fairly obvious." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "inverse(F);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "det(F); \+ det(G); " }{TEXT -1 24 "Note that G is singular." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "trace(F);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 105 "Maple has a couple ways to solve linear systems of equations. Sup pose we want to solve the linear system " }{TEXT 257 2 "Ax" }{TEXT -1 3 " = " }{TEXT 258 1 "b" }{TEXT -1 7 ", where" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 64 "A := matrix(3,3,[1, 0, 2, 3, 4, -2, 2, -1, 0]); \+ b := [2, 6, -3];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "x := li nsolve(A, b);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 70 "An alternate met hod using Gaussian elimination can be done as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "A1 := augment(A, b);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "B := gausselim(A1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "x := backsub(B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 80 "Maple readily handles the infinite or no soluti on cases for linear systems also." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 48 "A2 := matrix(3,3,[2, -1, 4, 3, 0, 1, 1, 1, -3]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "b1 := [2, 4, 2]; b2 := [1, 3 , -1];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "x1 := linsolve(A2 ,b1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "x2 := linsolve(A2, b2);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "rank(A2);" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 84 "Very useful information about matr ices concerns their eigenvalues and eigenvectors. " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "eig := eigenvectors(A);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 160 "The response gives the value of each eigenvalue, its multiplicity, and its corresponding eigenvector. We can readily a cquire any of these components as follows:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 7 "eig[2];" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "eig[3][3];" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 94 "The characteris tic matrix and characteristic polynomial are found with the following \+ commands." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "charmat(A, lam bda); " }{TEXT -1 40 "Characteristic matrix in the form lI - A" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "charpoly(A, lambda); " } {TEXT -1 37 "Characteristic polynomial det(lI - A)" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "roots(%, lambda); " }{TEXT -1 30 "Eigenvalu es and multiplicities" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "42" 0 } {VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }