{VERSION 3 0 "IBM INTEL NT" "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 "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Output" 2 20 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 1 14 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 }{CSTYLE "" -1 260 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "" 0 1 0 0 255 1 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 263 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 0 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Text Ou tput" -1 2 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 1 3 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Warning" 2 7 1 {CSTYLE "" -1 -1 "" 0 1 0 0 255 1 0 0 0 0 0 0 1 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Error" 7 8 1 {CSTYLE "" -1 -1 "" 0 1 255 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Output " 0 11 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 12 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 \+ Font 0" -1 256 1 {CSTYLE "" -1 -1 "Helvetica" 1 12 128 0 128 1 2 1 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 1 11 0 128 128 1 2 1 2 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 258 1 {CSTYLE "" -1 -1 " " 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 259 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 2 0 0 0 0 0 0 0 } 0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 11 260 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }1 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 } {PSTYLE "" 0 261 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 0 262 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 0 1 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {EXCHG {PARA 258 "" 0 "" {TEXT 260 42 "Short Introduction to M aple in the MLC Lab" }}{PARA 261 "" 0 "" {TEXT 261 34 "Mth 341 Linear \+ Algebra Spring 2000" }}{PARA 262 "" 0 "" {TEXT 262 13 "Bent Petersen" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 377 "The wo rkstations in the MLC lab are PCs running Windows NT 4.0. In order to \+ use the machines you must have an ORST account. When you logon to a ma chine in the MLC lab your ORST directory on the ORST server will be vi sible as drive Z: This is where you should keep your personal files. T hen they will be available from any PC in the MLC lab (and many other \+ labs) when you login." }}{PARA 0 "" 0 "" {TEXT -1 1 " " }}{PARA 0 "" 0 "" {TEXT 256 5 "Login" }}{PARA 0 "" 0 "" {TEXT -1 330 "The machines \+ in the lab are normally left on, but the monitors may be turned off. I f the monitor is off, then switch it on. Next press the Ctrl-Alt-Delet e keys simultaneously. You should get a login prompt. Enter your ORST \+ user name and press the Tab key (not the Enter key). Then enter your O RST password and press the Enter key." }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 418 "Next you may see a message about a s low network connection. This message is bogus, but it is accompanied b y a question, \"Do you want to download your profile?\" You should ans wer yes if you want your customary layout of desktop icons, wallpaper, and so forth. Changes made to your profile during the current session will be saved to server when you logout. You should get in the habit \+ of answering yes to this question." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 164 "Next you may see a question about a defa ult Novell server. Just answer \"none\" unless you have a reason to an swer otherwise. This question should never appear again." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 269 "To start Maple (o r Matlab, or Mathematica, ... ) select the Start button (lower left co rner of the screen), then Programs from the menu, etc. If you don't kn ow the appropriate steps here ask for help. Writing all this out in de tail produces an incredibly dull document." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 257 6 "Logout" }}{PARA 0 "" 0 "" {TEXT -1 205 "When you are done with your session, you should logout. \+ To logout select the Start button (this is a very strange Windows idio m), and then select \"Shut Down ...\" and finally select \"Logon as an other user.\"" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 110 "Another way to do it is to press Ctrl-Alt-Delete. A menu will appear. Select logoff. That is the simplest way." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 204 "Do not select Resta rt or Shutdown unless you have a reason to do so. Do not turn off the \+ PC. You may turn off the monitor if you wish. That will save power and will reduce the load on the air-conditioner." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 187 "Note - if you do not log out you leave your account open for the next person to come along. Tha t person will have access to your personal files on the ORST server. D o not forget to logout!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 533 "If you plan to leave the lab, even just for a few m inutes, save your work and logoff. When you return and logon, even to \+ a different machine, your work will be available. Do not select \"Lock Workstation.\" If you do, someone else wishing to use the workstation may power-cycle it in order to gain access and some of your work may \+ be lost as a result. The same comments apply to relying on a password \+ protected screensaver. Don't do it. Save your work and logoff. You hav e no claim on any workstation if you are not physically present." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT 258 13 "The Work sheet" }}{PARA 259 "" 0 "" {TEXT -1 470 "When you are using Maple in a window environment it is possible to move around on the worksheet by \+ left-clicking the mouse. As a result, commands may end up being execut ed in a nonlinear order. This can cause some confusion, since there is no visual clue. One way to fix a mess is to have Maple re-execute the whole worksheet (look on the Edit menu). This works best if old expre ssions are cleaned up first, so it is a good idea to start each worksh eet with the command " }{TEXT 259 8 "restart;" }{TEXT -1 1 " " }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 468 "Note each Maple command must be terminated by a colon or a semicolon (except help commands preceded by a question mark). Yo u can spread the command over several lines by postponing the terminat ing colon or semicolon. You simply move to a new line by pressing Ente r. Maple will chatter at you when you move to a new line in this manne r if the previous command is unterminated. Ignore it, but keep in mind a command will not be executed before it is properly terminated." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 229 "You can \+ also stack up several commands on one line by terminating them individ ually with colons or semicolons. The effect of the colon is to suppres s output from the corresponding command, though the command is still c arried out." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 33 "Maple has some built in constants" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Pi; evalf(Pi); I; I^ 2;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%#PiG" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"+aEfTJ!\"*" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#%\"IG " }}{PARA 11 "" 1 "" {XPPMATH 20 "6#!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 210 "Note the upper case letters. If you enter pi you will ju st get the Greek letter pi, not the real number pi. By the way, the ev alf() function takes a second parameter specifiying the precision in d ecimal digits." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 13 "evalf(Pi,60);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$\"gn%\\(4#e5v$*Rpr>%)G]zKQVEYQKz*e`EfTJ!#f" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 223 "You can also set th e precision by assigning a value to Digits (the default is 10). Maple \+ usually does exact calculations, but when floating point numbers are i nvolved the Digits sets the precision. Here's an amusing example" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 53 "Digits:=4: convert(evalf(Pi),`rational`); Digits:=10:" }}{PARA 11 "" 1 "" {XPPMATH 20 "6##\"#A\"\"(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 194 "It is not obvious, but the con version to a rational number makes use of Digits. Thus we would not ge t the correct result if we simply passes 4 as the second parameter in \+ evalf() as you can see: " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 32 "convert(evalf(Pi,4),`rational`);" } }{PARA 11 "" 1 "" {XPPMATH 20 "6##\"%r:\"$+&" }}}{EXCHG {PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 75 "Note by the way the Map le assignment operator is :=, be careful about that!" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 89 "If you want a convenien t rational number which yields pi to 100 decimal places here it is" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "Digits:=100: convert(evalf(Pi),`rational`); Digits:=10:" }} {PARA 11 "" 1 "" {XPPMATH 20 "6##\"S([f%zg()4\"=b;CGe*[6q50NE5(>t%\"St T*p?8$)4_E@$yVsa**=EE#)eJB1:" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 51 "You can never tell when you might need \+ this result!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 139 "Let's look a bit at symbolic manipulations now. Maple distingu ishes between functions and expressions. Here's one way to define a fu nction:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "f:=x->sin(3*x+x^2);" }}{PARA 11 "" 1 "" {XPPMATH 20 " 6#>%\"fGR6#%\"xG6\"6$%)operatorG%&arrowGF(-%$sinG6#,&9$\"\"$*$)F0\"\"# \"\"\"\"\"\"F(F(F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 33 "We can also define an expression:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "g:=sin(3*x+x^2);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%\"gG-%$sinG6#,&%\"xG\"\"$*$)F)\"\"#\"\"\"\"\"\"" }} }{EXCHG {PARA 0 "" 0 "" {TEXT -1 148 "Important note: Both of the exam ples above assume that x has not already been assigned a value. It n eeds to be an unassigned variable (see below)." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 62 "That they are different w e can see by trying to evaluate them:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "f(1.0); g(1.0);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$! +`\\-ov!#5" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#--%$sinG6#,&%\"xG\"\"$*$ )F(\"\"#\"\"\"\"\"\"6#$\"#5!\"\"" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 125 "Note by using a decimal point we \+ forced Maple to do a floating point evaluation. We can also get the pr ecise result of course" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "f(1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$sinG6#\"\"%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 139 "We can see very clearly that g is regarded as \+ an expression involving x. To evaluate it at say x=1 we may use the su bstitute command subs()" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "subs(x=1,g); evalf(%,20);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$sinG6#\"\"%" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#$!5P^#GzI&\\-ov!#?" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 229 "This example also demonstrates the use o f the percentage symbol to represent the previously evaluated quantity . It is called the ditto operator. Be very careful if you use the ditt o operator on another line - it always means the " }{TEXT 263 19 "prev iously evaluted" }{TEXT -1 92 " expression, which may not be the prev ious expression that happens to be on your worksheet!" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 311 "An expression can als o be evaluated by using the eval() function, but do check help to make sure you don't have any surprises in more complicated situations. The commands eval() and subs() work in quite different ways. In the simpl e case that we illustrated here eval() is actually the preferred comma nd to use." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 12 "eval(g,x=1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%$ sinG6#\"\"%" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 75 "We can convert an expression into a function by using t he unapply() command" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "h:= unapply(g,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"hGR6#%\"xG6\"6$%) operatorG%&arrowGF(-%$sinG6#,&9$\"\"$*$)F0\"\"#\"\"\"\"\"\"F(F(F(" }}} {EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 132 "S ome Maple commands work on expressions, some work on functions, and so me on both. For example, here are the derivatives of f and g." }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 16 "D(f); diff(g,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#R6#%\"xG6\"6$%)operatorG%&arrowGF&*&-%$cosG6 #,&9$\"\"$*$)F/\"\"#\"\"\"\"\"\"F5,&F0F5F/F3F5F&F&F&" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#*&-%$cosG6#,&%\"xG\"\"$*$)F(\"\"#\"\"\"\"\"\"F.,&F)F .F(F,F." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 175 "In the case of the expression you have to specify the va riable you are differentiating with respect to. It should now be clear how to take partial derivatives of expressions. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 342 "As an analysist I have a strong preference for functions but an algebraist may prefer expressi ons. Most of the time it does not matter which you use, you can even u se both simultaneously, as long as you keep it clear in your mind. Whe never dealing with any symbolic manipulation system of any kind keep y our data types straight in your mind! " }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 144 "As a final general example let's bri ng back some fond memories from calculus - the problem of integration. Here's on example to get you started:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 36 "Int(1/(1+x^6),x) = int( 1/(1+x^6),x);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#/-%$IntG6$*&\"\"\"F(, &\"\"\"F**$)%\"xG\"\"'F(F*!\"\"F-,,-%'arctanG6#F-#F*\"\"$*&-%%sqrtG6#F 5F(-%#lnG6#,(*$)F-\"\"#F(!\"\"*&F7F(F-F*F*FAF*F*#FA\"#7-F26#,&F-F@*$F7 F(FA#F*F.*&F7F(-F;6#,(F>F*FBF*F*F*F*#F*FD-F26#,&F-F@FHF*FI" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 281 "Note the int() operator returns the integral, but the Int() operator just retu rns a symbolic expression for the integral. This behavior of the Int() function is known as postponed evaluation and is sometimes useful. Ot her functions have unevaluated (or postponed) versions as well." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 189 "If you w ant a display like the one above but don't want to type the integrand \+ twice you can make use of the ditto operator and the fact that you can assign any sequence of symbols in Maple:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 33 "ex:=1/(1+x^6),x: Int (%) = int(%);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#/-%$IntG6$*&\"\"\"F(, &\"\"\"F**$)%\"xG\"\"'F(F*!\"\"F-,,-%'arctanG6#F-#F*\"\"$*&-%%sqrtG6#F 5F(-%#lnG6#,(*$)F-\"\"#F(!\"\"*&F7F(F-F*F*FAF*F*#FA\"#7-F26#,&F-F@*$F7 F(FA#F*F.*&F7F(-F;6#,(F>F*FBF*F*F*F*#F*FD-F26#,&F-F@FHF*FI" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 116 "You can \+ achieve a similar result even more easily by using the value function \+ to evaluate an unevaluated expression:" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "Int(1/(1+x^6),x): %=val ue(%);" }}{PARA 12 "" 1 "" {XPPMATH 20 "6#/-%$IntG6$*&\"\"\"F(,&\"\"\" F**$)%\"xG\"\"'F(F*!\"\"F-,,-%'arctanG6#F-#F*\"\"$*&-%%sqrtG6#F5F(-%#l nG6#,(*$)F-\"\"#F(!\"\"*&F7F(F-F*F*FAF*F*#FA\"#7-F26#,&F-F@*$F7F(FA#F* F.*&F7F(-F;6#,(F>F*FBF*F*F*F*#F*FD-F26#,&F-F@FHF*FI" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 116 "Note the use a bove of the colon to supress the output from the first command, so it \+ does not clutter up our display." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 153 "One common error comes from trying to us e a variable with an assigned value as a dummy variable of integration (or in other contexts). Here's an example:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "x:=3: int(x^4,x); " }}{PARA 8 "" 1 "" {TEXT -1 51 "Error, (in int) wrong number (or type ) of arguments" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 103 "Obviously what's needed is some way to unassign a v ariable. Maple provides a number of ways to do this." }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "unassign( 'x'); int(x^4,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%\"xG\"\"&\" \"\"#\"\"\"F'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 166 "Note the use of the single quotes here. You can pass a number of variables to unassig n by separating them with commas, but each one must be enclosed in sin gle quotes." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 114 "A simpler way to unassign one variable is to assign it its nam e extracted by single quotes (this is a Maple idiom)" }}{PARA 0 "" 0 " " {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 25 "x:=3; x:= 'x'; int(x^4,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"xG\"\"$" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"xGF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%\"xG\"\"&\"\"\"#\"\"\"F'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 390 "Note we assigned x a value and then we unassigned it, after \+ which we could use it as an unassigned variable. This is quite conveni ent, but sometimes the single quotes are hard to find on the keyboard \+ and even harder to see on the monitor. Thus, even though it is more ty ping you may prefer to use the evaluate to a name function evaln() si nce it does not require the pesky single quotes." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 30 "x:=3; x:=ev aln(x); int(x^4,x);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"xG\"\"$" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"xGF$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*$)%\"xG\"\"&\"\"\"#\"\"\"F'" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 157 "Before using the evaln() function in more complex situations, \+ it would be a good idea to check Maple's help page for it. You may get some unexpected results!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 70 "To do linear algebra we first need to loa d the linear algebra package." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "with(linalg):" }}{PARA 7 "" 1 "" {TEXT -1 32 "Warning, new definition for norm" }}{PARA 7 "" 1 "" {TEXT -1 33 "Warning, new definition for trace" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 208 "Note we terminate t his command with a colon rather than a semicolon since otherwise it pr oduces quite a bit of output. Even with the colon, it is not completel y quiet. Fortunately you can ignore the warnings." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 165 "Matrices can be specifie d by giving a list of the individual rows as lists (lots of brackets!) , or by specifying the size, and then listing all the entries row-wise :" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 45 "A:=matrix([[1,2,3,4],[0,-1,3,4],[2,-1,2,3]]);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"AG-%'matrixG6#7%7&\"\"\"\"\"#\"\"$ \"\"%7&\"\"!!\"\"F,F-7&F+F0F+F," }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 43 "A:=matrix(3,4,[1,2,3,4,0,-1,3,4,2,-1,2,3]);" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%\"AG-%'matrixG6#7%7&\"\"\"\"\"#\"\"$\"\"%7&\"\"!!\" \"F,F-7&F+F0F+F," }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 70 "The rref() command produces the row-reduced-Gauss- Jordan-echelon form:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "R:=rref(A);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"RG-%'matrixG6#7%7&\"\"\"\"\"!F+#\"\"$\"#>7&F+F*F+#!\"\"F.7&F +F+F*#\"#DF." }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 " " {TEXT -1 395 "If you just want to solve a system of equations Ax=b y ou can do that. Things work out best if you specify b as a vector (bec ause to Maple every matrix has 2 subscripts, even row and column matri ces). Note a vector is specified by giving a list of its entries and i s displayed horizontally by Maple. There is no notion of row or column vector. If you need them they are 1 by N or N by 1 matrices." }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "b:=vector([3,1,-4]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"bG-% 'vectorG6#7%\"\"$\"\"\"!\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "linsolve(A,b);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'vectorG6#7&&% #_tG6#\"\"\",&#\"\"#\"\"$F*F'#!\"\"F.,&F'#\"#DF.#\"#bF.F*,&F'#!#>F.#!# SF.F*" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 286 "Note the solutions is returned as a vector containing a \+ parameter. Note Maple chose the first variable as the parameter, so we don't get the solution in canonical form. Alternately we can row redu ce the augmented matrix and then read-off the solution with the canoni cal parametrization." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 19 "rref(augment(A,b));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#-%'matrixG6#7%7'\"\"\"\"\"!F)#\"\"$\"#>#!#SF,7'F)F(F)#! \"\"F,#\"#EF,7'F)F)F(#\"#DF,#\"#:F," }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 70 "Note you can use the augment() \+ function to construct matrices as well:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 62 "c1:=vector([1,2,3]); c 2:=vector([0,1,4]); c3:=vector([1,3,7]);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#c1G-%'vectorG6#7%\"\"\"\"\"#\"\"$" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#c2G-%'vectorG6#7%\"\"!\"\"\"\"\"%" }}{PARA 11 "" 1 " " {XPPMATH 20 "6#>%#c3G-%'vectorG6#7%\"\"\"\"\"$\"\"(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 152 "Even tho ugh the vectors are displayed as rows they are augmented as columns in the matrix. (To add rows to a matrix one uses the stackmatrix() comma nd.)" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "C:=augment(c1,c2,c3); rank(C); rref(C);" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#>%\"CG-%'matrixG6#7%7%\"\"\"\"\"!F*7%\"\"#F*\"\" $7%F.\"\"%\"\"(" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#\"\"#" }}{PARA 11 " " 1 "" {XPPMATH 20 "6#-%'matrixG6#7%7%\"\"\"\"\"!F(7%F)F(F(7%F)F)F)" } }}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 97 " Finally let's observe that symbolic solutions are also available if yo u are sufficiently devious:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "b:=vector([b1,b2,b3]); Id:=d iag(1,1,1);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"bG-%'vectorG6#7%%#b 1G%#b2G%#b3G" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#IdG-%'matrixG6#7%7% \"\"\"\"\"!F+7%F+F*F+7%F+F+F*" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "X:=rref(augment(C,Id));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"X G-%'matrixG6#7%7(\"\"\"\"\"!F*F+#\"\"%\"\"&#!\"\"F.7(F+F*F*F+#!\"$F.# \"\"#F.7(F+F+F+F*#!\"%F.#F*F." }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 39 "R:=augment(col(X,1),col(X,2),col(X,3));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\"RG-%'matrixG6#7%7%\"\"\"\"\"!F*7%F+F*F*7%F+F+F+" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 40 "XX:=augment(col(X,4),col(X, 5),col(X,6));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#XXG-%'matrixG6#7%7 %\"\"!#\"\"%\"\"&#!\"\"F-7%F*#!\"$F-#\"\"#F-7%\"\"\"#!\"%F-#F6F-" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 20 "XXX:=evalm(XX &* b);" }} {PARA 11 "" 1 "" {XPPMATH 20 "6#>%$XXXG-%'vectorG6#7%,&%#b2G#\"\"%\"\" &%#b3G#!\"\"F-,&F*#!\"$F-F.#\"\"#F-,(%#b1G\"\"\"F*#!\"%F-F.#F8F-" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "R1:=stackmatrix(row(R,1),row (R,2));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%#R1G-%'matrixG6#7$7%\"\" \"\"\"!F*7%F+F*F*" }}}{EXCHG {PARA 260 "> " 1 "" {MPLTEXT 1 0 37 "lins olve(R1,vector([XXX[1],XXX[2]]));" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#- %'vectorG6#7%,(&%#_tG6#\"\"\"!\"\"%#b2G#\"\"%\"\"&%#b3G#F,F0,(F(F,F-#! \"$F0F1#\"\"#F0F(" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 " " 0 "" {TEXT -1 81 "Of course the solution is only valid if the compat ibility condition is satisfied:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 35 "XXX[3]=0; # Compatibilty co ndition" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#/,(%#b1G\"\"\"%#b2G#!\"%\" \"&%#b3G#F&F*\"\"!" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 931 "A few things to note here. The stackmatrix() com mand builds matrices by stacking rows, the augment() command builds ma trices by adding columns, matrix multiplication is denoted by &*, and \+ the evalm() command force Maple to display a matrix. Note if you try t he last example above directly with the linsolve() command Maple will \+ be silent. This is Maple's way of indicating it could not find a solut ion (very human). If you try row reducing the augmented matrix augment (C,b) then Maple will return the incorrect answer (indicating no solut ion for any b). Maple assumes that the symbolic expressions that come \+ up in the calculations are not 0 (unless identically 0) and so gets an extraneous pivot in this example. Maple's behavior is precisely what \+ is wanted if you are working in the context of rational functions, but not in our case. The method above is just one way around this problem . Perhaps you can find a cleaner procedure." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 494 "The multiplication operator in Maple is normally *. Maple has a builtin symbolic simplification faci lity which works on symbols without worrying too much about their natu re. This facility assumes that the multiplication denoted by * is comm utative. Since matrix multiplication in general is not commutative the re is a potential problem when simplifying matrix expressions. This is the reason that &* is used for matrix multiplication. The simplify fa cility does not assume commutativity for &*." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 226 "That should give you enough to get started with Maple. Enjoy, but expect to be frustrated once in a \+ while. Maple is a powerful tool, but it requires you to understand som e of what is going on (and to keep track of data types)." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 178 "There is more Map le and linear algebra material on the web page for this class if you n eed more suggestions. Also Maple has a very good built in help system. Use it - for example" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 5 "?subs" }}}{EXCHG {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 79 "will bring up a window wi th helpful information concerning the subs() function." }}}}{MARK "68 \+ 1" 0 }{VIEWOPTS 1 1 0 3 2 1804 }