Appendix A5. Sound Advice and Encouraging Words
Developed jointly by Hartig and Ledder
Save early, save often
This may be the best advice you will get for working with any computer application. This, and a heads up about Auto save. Maple's Auto save feature can be set from the opening panel in the Preferences... dialogue (Maple 9.5 menu on a Macintosh, Tools/Options... on a PC). Use it. Set a save interval of 5 minutes and you will never loose more than 5 minutes of you time when Maple crashes, and Maple will crash. That's a promise.
We suggest that you also become accustomed to pressing Command-S (Control-S on a PC) every once and a while. This is the keyboard equivalent for Save on the File menu. Certainly you will want to "do a save" as you finish a major part of a worksheet or are about to embark on a doubtful computation.
What you see may not be what you get
When you look at a worksheet on the display, you see what might be called the "visible state" of the worksheet. This is not the same as the "internal state", which we can think of as being what Maple sees in the worksheet. There are two kinds of problems that can arise.
Maple sees things that you cannot see
The internal state of Maple may not be distinguishing between different worksheets that are active on the display. To see this, open the Preferences... dialogue and use the pop up menu to set the Kernel mode to "shared" (it will probably be set to "parallel" mode when you first see it). Then execute the following command.
> | b := 2; |
Now open a new worksheet (Command-N) and use it to execute the entry "b;". Maple will return a value of 2 for "b" even though the value was not assigned in that worksheet. This is referred to as "sharing the kernel". All open worksheets store their assignments in the same kernel and they immediately take effect in all open worksheets.
This used to be the default mode for Maple worksheets and can obviously cause confusion. On the other hand, shared kernel mode can be very useful in situations where you would like to make some separate computations and store them in a different worksheet. Fortunately, the default mode is no longer "shared kernel". The default for Maple 9.5 worksheets is "parallel kernels". That is, each worksheet that opens up has its own kernel for its assignments and calculations. I recommend that you stick with the parallel kernels.
Wait a minute. I just looked and I saw a third mode: "mixed kernel", what's that all about?
Answer: When you choose mixed kernel mode you will be asked to specify the kernel connection for each worksheet window when you open a new worksheet. Those worksheets that share a kernel will share variable assignments. Those using parallel kernels have independent variable assignments.
Our advice: Stay with parallel kernels until you have had plenty of Maple experience.
You see things that Maple cannot see
This can happen in two different ways.
First of all, the "restart" command clears all variable assignments, but it does not erase lines of output. Thus, if you execute "restart", you will still see the output of previous assignments even though they are not part of Maple's internal state.
Second, when you save a worksheet, all of the output regions are saved with it. Then, when you load that worksheet later, the output is still visible. However, the internal state of Maple does not include any of this visible output. The situation is similar to that effected by "restart". One way to "fix" this is by executing all the inputs, top to bottom, by choosing Edit/Execute/Worksheet. As an alternative consider thinking about what you want to accomplish (always a good idea), and then working your way through the newly opened worksheet executing only those entries that you think you will need to accomplish the task at hand. It may be as simple as loading the plots package and redefining a variable or two.
Whenever, during the course of worksheet development, Maple seems to be unable, or unwilling, to obey an input command, consider doing a "restart" and sorting out exactly what other inputs are needed to accomplish the task. Execute only those inputs, then the troublesome input and hope for the best. If it still fails to "work" then at least you know that the visual state is also the internal state so the problem is probably with that particular input. Ask someone else take a look at it.
The famous "pi" pitfall (and others)
Certain names are reserved by Maple for specific uses. Examples include "sqrt", "sin", "cos", and "exp". Another important quantity is the famous number "Pi". The natural logarithm base e was given as "E" in older versions of Maple, but is now accessible only as "exp(1)" and never as "E" or as "e". Consider these examples.
> | Pi;
evalf(%); |
> | pi;
evalf(pi); |
> | exp(1);
evalf(%); |
> | e;
evalf(%); |
The "pi" pitfall
In order to make output more readable, Maple displays Greek characters when you indicate the Greek letter by name in the input. This feature is generally convenient, but it does lead to a common pitfall.
> | Pi; |
> | pi; |
Note that the Maple outputs for "Pi" and "pi" look exactly the same. However, the two quantities are not the same to Maple. "Pi" is the famous constant, but "pi" is a name that can be defined by the user or left unassigned. Examine the following input/output pairs.
> | cos(Pi/4);
evalf(%); |
> | cos(pi/4);
evalf(%); |
See what we mean?
The "e" error
Similar problems arise when the unsuspecting user types e^x expecting Maple to understand that this is exp(x). Here are some examples involving errors with the use of the variable e.
> | e^x;
exp(x); |
Note that the outputs are slightly different. Unfortunately, the incorrect output for the exponential function (the first one) looks more like what is seen in a textbook than the correct output (the second one). Take a look a the following (incorrect) calculations that appear to be correct.
> | diff(e^x,x); |
In fact, this is a correct differentiation formula for base b = e. Unfortunately Maple does not return 1 for ln(e).
> | evalf(%); |
Here is how the incorrect input interacts with an integral.
> | int( e^x, x=0..1); |
This is also correct output, if Maple recognized e as the famous number the user thinks it is.
New Maple users sometimes try to plot the exponential function like this.
> | plot(e^x, x=-1..1); |
Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct
Error, empty plot
Unfortunately, neither the warning nor the error message address the real issue which is: Maple cannot evaluate e^x because e is an unknown variable, not the number the user expects it to be.
Moral: When you get a strange result or a syntax error and there doesn't seem to be anything wrong, look back in your worksheet to see if you used the wrong spelling for pi or perhaps entered exp(x) as e^x.
Some encouraging words
Help abounds. Maple's Help facility is top notch and we hope you become accustomed to using it. Anytime a procedure seems to be acting up, or you want to learn about a new process, check the examples on the Help page. Just highlight the procedure name in the worksheet, pull down the Help menu, and choose the second item: Help on "highlighted selection".
The Help system is set up like a browser encouraging you to explore related issues, feel free. You can navigate back and forth between Help pages by clicking on the arrow icons at the top of the Help browser window. The left pane of the Help window has search options that will list all folders and Help sheets for items typed into the search field.
Take the tour
If you have not done so already, consider taking a new user's tour. You may select any of the following options (also available directly from the Help menu: Choose the item named New Users.
Complete the Quick New User's Tour , a focused overview of the Maple system (about 10 minutes).
Complete the New User's Tour , an in-depth, comprehensive overview of the Maple system.
Refer to the How to Perform Basic Tasks , a quick summary of the most common Maple commands, syntax, and more.