{VERSION 3 0 "SGI MIPS UNIX" "3.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "" -1 256 "" 1 18 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{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 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT 256 18 "Matrices in Maple." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 54 "To load t he functions on linear algebra in Maple type:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 165 "linalg is a Maple package. Type the command: ?index,packages t o see the list of other packages you can load with the command with. Y ou can enter a matrix as follows:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "matrix(2,2,[ [1,2], [3,4] ]);" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 32 "matrix(2,3,[ [1,2,3],[4,5,6] ]);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 303 "So the first argument is the number of r ows (called rowdim in Maple), the second is the number of columns (cal led coldim) and the third is a list of lists, where each list represen ts a row. Since the first two arguments give the dimensions of the mat rix, you can also skip the brackets of the row lists." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "matrix(2,3,[ 1,2,3,4,5,6 ]);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "matrix(2,3,[ seq(i,i=1..6) ] );" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 135 "Concatenation of names in \+ Maple release 5 is done by the dot \".\" In Maple 5 the expression x. 5 stands for x5, so x.5 is the same as x5" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 17 "seq(x.i,i=0..10);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 165 "In Maple 6 the syntax is different, instead of the dot you hav e to use ||, so if you have Maple 6 then don't use the previous comman d, but use the following instead:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "seq(x||i, i=0..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "N:=4;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 123 "If you \+ are using Maple 5 instead of Maple 6, then replace x||i by x.i in the \+ following command, otherwise you get an error." }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 54 "A:=matrix(N,N,[ seq(seq(x||i^j,j=0..N-1),i=0.. N-1) ]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 2 "A;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "print(A);" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 139 "Matrices have some special status in Maple. For one th ing, just typing A; doesn't display the matrix, you'll have to use pri nt(A) or op(A)." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 6 "op(A);" } }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "det(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "factor(%);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 119 "You may remember from linear algebra that A is a Vanderm onde matrix, and that it's determinant factors as you see here." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "A:=matrix(3,3,[ seq(i^2,i=0. .8) ]);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "det(A);" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "inverse(A);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "evalm( A^(-1) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "B:=%;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "multiply(A,B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "evalm( A &* B);" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 108 "Note \+ that in Maple, the * is always commutative. The non-commutative matrix multiplication is denoted by &*." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "evalm(A^3+72*x*B);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "charpoly(A,x);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "subs(x=A,%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "eval m(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 18 "evalm(lambda - A); " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 7 "det(%);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "" 0 "" {TEXT 257 4 "Note" }{TEXT -1 313 ": Maple 6 has a new package for linear algebra, called Linea rAlgebra. The procedures in the new package are more efficient (they a re faster) than the procedures in linalg. Everything we do in this cla ss will work under Maple 6 as well as Maple 5. The reason is that in t he math department we still have Maple 5." }}}}{MARK "38 0 1" 313 } {VIEWOPTS 1 1 0 1 1 1803 }