Trouble Shooting Notes
Learning to use Maple can be an extremely frustrating experience, if you let it. There are some types of errors which occur from the beginning that can be spotted and corrected easily by a person fluent in Maple, so if you have access to such a person, use him or her.
Here are a few suggestions that may be of use when you're stuck with a worksheet that's not working like it should.
Important! Loading an old Maple worksheet does not excute it. This is something you must do separately, either one cell at a time or all at once.
Also important! Remember that you can rexecute any cell in the worksheet at any time. This can lead to confusion about what you did last, because it may not be what is just above.
Use help: There is a help sheet with examples for every Maple word. A quick read thru will often clear up syntax problems. One very common early mistake is to leave out the parentheses around the inputs of a word. For example, typing
> plot x^2;
Syntax error, missing operator or `;`
will get you a syntax error, because you left out the parentheses.
>
The maple prompt is `>` . You can begin entering input after it. Make sure you are typing into an input cell, if you are expecting output.
End maple statements with a semicolon `;` or colon `:` . Maple suppresses output when the command line ends with a colon. Maple does not process until it comes to a (semi)colon. If you are getting no output when you should be, try feeding in a semicolon. This often works.
> p := expand((a+b)^5);
> p;
> q := expand((1+x)^9):
> q;
>
When in doubt, put in parentheses. For example, (x+3)/(x-3) is very different from x+3 / x-3 .
> (x+3)/(x-3),x+3 / x-3 ;
>
Make sure your variables are variable . You may have assigned a value, say 3, to x in a previous problem. To make x a variable again, type x := 'x': . Use the forward quote ' key, just below the double quote " here. If you forget this, strange things might happen. One way to handle this is to keep an input cell of variables used.
> x := 3;
> x := 'x';
>
Use restart; By typing restart; in an input cell and pressing enter, you clear all assignments, and start with a clean slate. This fixes a lot of problems fast, but you will need to re-execute input cells.
> hello := yes;
> hello;
> restart;
> hello;
> `this is a long name` := 12;
> `this is a long name`;
> check := "do not worry";
> check;
Do not forget to end loops with od , `if` statements with fi , and procedures with end . If you start a loop with do , Maple does not begin processing until it finds the end of the loop, which is signaled by the word od ; The same applies to the if .. then ... fi; and proc ... end; contructions. If you are getting no output when you should be, try feeding an od; , fi; , or end; This often works.
>
>
Unwanted output?: Is there output you need but don't want to see? Use a colon `:` instead of a semicolon to end the Maple statement which generates the output.
> unapply(x^2-100,x);
> printlevel:= 10;
>
> unapply(x^2-200,x);
{--> enter unapply, args = x^2-200, x
<-- exit unapply (now at top level) = proc (x) options operator, arrow; x^2-200 end}
> printlevel:=1;
Are all words you are using defined? Have you executed the input cells containing the procedures you need? Have you loaded the packages containing the words you need? Undefined words are simply returned by Maple. Hint: When using words from packages in procedure definitions, use the full name, e.g, use plots[display] instead of display.
> thisword := proc(x) x^2 + 10 end;
> thisword(3);
> restart;
> thisword(3);
>
> debug(thisword);
> thisword(3);
{--> enter thisword, args = 3
<-- exit thisword (now at top level) = 19}
> undebug(thisword);
> thisword(3);
>
> interface(verboseproc=2);
> print(plot):
>