{VERSION 2 3 "SUN SPARC SOLARIS" "2.3" } {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 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 } {CSTYLE "" -1 257 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 264 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 265 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 266 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 267 "" 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 268 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 269 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 270 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 271 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 272 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 273 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 274 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 275 "" 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0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 276 1 {CSTYLE "" -1 -1 "" 1 14 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 277 1 {CSTYLE "" -1 -1 "" 1 14 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 {PARA 256 "" 0 "" {TEXT 256 17 "Vector Operations" }}{PARA 258 "" 0 "" {TEXT -1 0 "" }}{PARA 257 "" 0 "" {TEXT 257 59 "We show th e Maple commands for standard vector operations. " }}{PARA 259 "" 0 " " {TEXT -1 0 "" }}{EXCHG {PARA 260 "" 0 "" {TEXT -1 41 "These commands are in the linalg package." }}{PARA 261 "> " 0 "" {MPLTEXT 1 0 22 "re start:\nwith(linalg):" }}}{EXCHG {PARA 262 "" 0 "" {TEXT -1 51 "In Map le a vector is represented in square brackets" }}{PARA 263 "> " 0 "" {MPLTEXT 1 0 44 "a := vector([1,2,2]); b := vector([2,1,3]);" }}} {EXCHG {PARA 264 "" 0 "" {TEXT -1 19 "To add the vectors " }{TEXT 258 1 "a" }{TEXT -1 5 " and " }{TEXT 259 1 "b" }{TEXT -1 9 " use the " } {TEXT 261 6 "matadd" }{TEXT -1 27 " command (matrix addition)." }} {PARA 265 "" 0 "" {TEXT -1 33 " To compute the scalar multiple 5" } {TEXT 260 1 "a" }{TEXT -1 12 " we use the " }{TEXT 262 9 "scalarmul" } {TEXT -1 9 " command." }}{PARA 266 "> " 0 "" {MPLTEXT 1 0 28 "matadd(a ,b);\nscalarmul(a,5);" }}}{EXCHG {PARA 267 "" 0 "" {TEXT -1 30 "To com pute the dotproduct use " }{TEXT 263 7 "dotprod" }{TEXT 274 1 " " } {TEXT -1 30 "and compute crossproducts use " }{TEXT 264 10 "crossprod \+ " }}{PARA 268 "> " 0 "" {MPLTEXT 1 0 29 "dotprod(a,b);\ncrossprod(a,b) ;" }}}{EXCHG {PARA 269 "" 0 "" {TEXT -1 33 "Note that the last line co mputes " }{TEXT 265 3 "aXb" }{TEXT -1 14 " - to compute " }{TEXT 266 4 "bXa " }{TEXT -1 21 "we would need to use " }{TEXT 267 14 "crossprod (b,a)" }}{PARA 270 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 271 "" 0 "" {TEXT -1 238 "To find the length of a vector one may use the relation \+ ||a|| = sqrt( dotprod(a,a) ) , or use the norm command. From experienc e, I have found that the square root definition works better - especia lly with vectors with symbolic components." }}{PARA 272 "> " 0 "" {MPLTEXT 1 0 51 "len := sqrt( dotprod(a,a) );\notherway := norm(a,2); " }}}{EXCHG {PARA 273 "" 0 "" {TEXT -1 154 "The norm of a vector is th e length of a vector. There are several definitions of the length of a vector. The 2 chooses the definition I gave in class. Do " }{TEXT 272 5 "?norm" }{TEXT -1 50 " to find other definitions of length of a \+ vector.\n" }}}{EXCHG {PARA 274 "" 0 "" {TEXT -1 136 "To differentiate \+ or integrate a vector one must differentiate/integrate each component \+ of the vector. This is done with the help of the " }{TEXT 268 3 "map" }{TEXT -1 9 " command." }}{PARA 275 "> " 0 "" {MPLTEXT 1 0 147 "a := v ector( [t,t^2, t^3] );\nda := map(diff, a, t); # derivative of a wit h respect to t\nia := map(int, a, t); # integral of a with respect \+ to " }}}{EXCHG {PARA 276 "" 0 "" {TEXT -1 73 "Most operations on expre ssions also work on vectors with the help of the " }{TEXT 269 3 "map" }{TEXT -1 49 " command. One command which does not work is the " } {TEXT 270 4 "subs" }{TEXT -1 32 " command. Instead one needs the " } {TEXT 271 4 "map2" }{TEXT -1 44 " command. To understand the differenc es try " }{TEXT 273 4 "?map" }{TEXT -1 57 " and ?map2 . For example to substitute t=3 in the vector " }{TEXT 275 1 "a" }}{PARA 277 "> " 0 " " {MPLTEXT 1 0 71 "map( subs,\{t=3\}, a ); #does not work\nmap2( su bs, \{t=3\}, a); #works" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{MARK "4 0 0" 32 }{VIEWOPTS 1 1 0 1 1 1803 }