|
Last update(s): Thu Oct 13 15:29:24 2005 ... Fri Oct 6 14:59:55 2006
Maple is a programming language and optional GUI environment for symbolic algebra and high-precision decimal integer and floating-point arithmetic.
Its development started about 1980 at the University of Waterloo, in Waterloo, Ontario, Canada, and was later spun off into a separate commercial company that is now known as Maplesoft, a division of Waterloo Maple Inc.
The University of Utah has subscribed to a Maple site license since about 1990, and consequently, Maple is widely available on campus, and used in many courses in several different departments.
What books are available for Maple?
About 300 of them: see the extensive maple-extract bibliography.
What documentation is available online for Maple?
Although we have machine-readable copies of the Maple 9 Advanced Programming Guide and the Maple 9 Introductory Programming Guide, we do not yet have permission to make them available to our local user community. The vendor does not distribute any of its manuals with the software, so your best choice may be one or more of the recent books listed in the bibliography cited earlier. Instructors may prepare notes about Maple for courses that they teach. One such is the now-somewhat-dated /u/cl/doc/maple-intro.pdf file.
The only generally accessible online documentation is therefore the help system inside Maple. In a Maple session, type a question mark followed by a function name or topic, or use the Help button in the GUI version:
% maple ... > ?sqrt sqrt - compute the square root Calling Sequence sqrt(x) sqrt(x, symbolic) ...
What version of Maple do we have?
We maintain several historical versions of Maple. You can see what they are like this:
% which maple /usr/local/bin/maple % ls /usr/local/bin/maple* /usr/local/bin/maple /usr/local/bin/mapleV4 /usr/local/bin/mapleV8 /usr/local/bin/mapleV10 /usr/local/bin/mapleV5 /usr/local/bin/mapleV8.01 /usr/local/bin/mapleV2 /usr/local/bin/mapleV5.1 /usr/local/bin/mapleV9 /usr/local/bin/mapleV3 /usr/local/bin/mapleV7 /usr/local/bin/mapleV9.5 % file /usr/local/bin/maple /usr/local/bin/maple: symbolic link to `mapleV8'
Thus, at the time of writing, the default was version 8, but versions 2 through 10 are available.
For stability during academic terms, we normally do not change the default version number except at term breaks. There were some serious deficiencies of Maple version 9 that prevented advancing to it.
The programs listed above require only terminal access. There are companion programs with names prefixed by x that provide the GUI version:
% ls /usr/local/bin/xmaple* /usr/local/bin/xmaple /usr/local/bin/xmapleV4 /usr/local/bin/xmapleV8 /usr/local/bin/xmapleV10 /usr/local/bin/xmapleV5 /usr/local/bin/xmapleV8.01 /usr/local/bin/xmapleV2 /usr/local/bin/xmapleV5.1 /usr/local/bin/xmapleV9 /usr/local/bin/xmapleV3 /usr/local/bin/xmapleV7 /usr/local/bin/xmapleV9.5
How do I make Maple start faster?
By default, Maple V9 and later use a Java interface to the X11 Window System, simplifying the vendor's problem of supporting Maple on multiple incompatible window systems, and providing a more uniform cross-platform interface for users. Unfortunately, the Java interface also adds about 125MB to the memory requirements, and noticeably slows startup and display.
If you use the -cw (classic worksheet) option on the xmapleV9 (or later) command line, Maple eliminates the Java layer, interfaces directly to the X Window System, and starts up faster. It also changes the appearance of displayed plots, and graphs saved via the Export -> Encapsulated PostScript (EPS) menu path have somewhat better quality, with larger fonts, and smoother curves.
The GUI version of Maple allows you to store a record of a session in a special binary file called a Maple worksheet. This has the advantage that you can reload it in a later session, and resume working where you left off. However, the disadvantage is that its format is known only to Maple: you cannot edit it, and you may have to discard it, if it ever becomes corrupted. For that reason, many seasoned Maple users prefer to keep their Maple programs in simple text files that can be edited with their favorite text editor, and then loaded into a Maple session with read("filename");.
How do I use high-precision arithmetic?
Set the Digits variable to the desired decimal precision, and then enter numerical expressions for evaluation. Here is an example:
% maple ... > Digits := 50: > erfc(-7.5); 1.9999999999999999999999999722335061396943089933603 > sin(1/256.0) / (1/256.0); 0.99999745687042983799221222193087945750276128903457 > 40!; 815915283247897734345611269596115894272000000000
WARNING: In Maple 9 and later, the last reported digit may not be correctly rounded, so set Digits a bit larger than you need. This deficiency has been reported to the vendor.
How do I make a simple 2-D function plot?
In terminal mode, Maple plots with characters, producing a view like this:
% maple ... > plot(sin(x)/x, x = -5..5, y = -1..1); AA1A*AAAA AAA + AAA AAA 0.8 + AA AA + AA AA + AA AA 0.6 + AA AA + AA A + A A 0.4 + A AA + AA A 0.2 + AA AA + AA AA + AA -+--+--+--+--**-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+-**--+--+--+--+- -4 AA -2 0 + 2 AA 4 AAA + AAA AAAAAAAA -0.2 + AAAAAAAA + -0.4 + + + -0.6 + + + -0.8 + + -1 +
In the xmaple GUI, the plot is displayed with higher resolution, somewhat like this:
Use the Export menu to save the plot in any of a variety of formats.
How do I make a 3-D surface plot?
Use the plot3d() function with the function to be plotted as the first argument, and the coordinate ranges as the second and third arguments:
% maple > plot3d(sin(sqrt(x^2+y^2))/sqrt(x^2+y^2), x = -12..12, y = -12..12);
The resulting plot looks something like this in the GUI (a text-character plot of 3-D surfaces is of little value):
You can grab the surface and manipulate the figure to get a desired view, then save it just like with the 2-D plot described in an earlier question on this Web page.
One such view, with the surface turned upside down, looks like this after trimming unwanted surrounding space:
How can I improve the quality of Maple graphics?
A problem with most software for producing PostScript illustrations is that line widths are too thin, and text too small, when reduced in size for publication in a typical two-column scientific journal, or as a figure in a book. Also, the orientation is often set to landscape, rather than portrait, which is distinctly inconvenient when the illustration is to be incorporated in another document.
Unfortunately, Maple does not provide sufficient user control over the internal parameters that affect plot appearance, and the author of this FAQ has often had to resort to editing the output PostScript file. Here is an example of what can be done to make Maple plots more publishable:
% maple ... > plotsetup(ps, > plotoutput = "erf-erfc.eps", > plotoptions = "noborder, color, portrait"); > plot([erf(x), erfc(x)], > x = -5 .. 5, > y = -2.1 .. 2.1, > thickness = 5, > color = [blue, red], > font = [HELVETICA, 24]);
There does not appear to be any way to get the thickness, color, and font options set globally: if you put them in the plotoptions assignment in the plotsetup function call, they either get ignored, or raise errors. Maple does not provide for user-defined functions with a variable number of arguments, so you cannot easily hide them away in a private wrapper function around the plot command either.
The output PostScript file can be converted with ImageMagick to a half-size bitmap file for Web-browser display
% convert -resize 187x259 erf-erfc.eps erf-erfc.png
to produce this plot, which is now about the size that would be used in a two-column journal article:
The text size in the plot is now reasonably comparable to that in the surrounding prose, and the lines are thick enough to be easily distinguishable.
However, notice that the zero digit at the origin is misplaced (just one of many quibbles that we have with Maple graphics). It can be moved to the correct position by making a simple edit of the PostScript file, commenting out the bad line, and following it with the patched one (long lines have been wrapped here by insertion of backslash-newline, but don't do that in the PostScript file):
% BAD: (0) dup 0 stringbbox 3461 exch sub exch \ 2391 exch sub exch m show (0) dup 0 stringbbox 3367 exch sub exch \ 2391 exch sub exch m show
Similarly, the axis labels can be suppressed if desired by commenting them out (long lines again wrapped for display here):
% OMIT: (y) dup 0 stringbbox 2 idiv 4846 exch sub exch \ 1988 exch sub exch m show ... % OMIT: (x) dup 0 stringbbox 3018 exch sub exch 2 idiv \ 3500 exch sub exch m show
I tried to start Maple, but it refused because of too many concurrent users. What can I do?
Wait a half hour or so, and then retry. If the problem persists, ask systems staff for help. The number of Maple licenses that we purchase has normally been sufficient.
I'm working on machine X. Why does it not have Maple?
The Maple vendor supports only a few of the architectures that we have: Apple Mac OS X on PowerPC, GNU/Linux on AMD64 and IA-32, Microsoft Windows IA-32, OSF/1 Alpha, SGI IRIX MIPS, and Sun Solaris SPARC. The latest version is not available on all of those platforms.
How does Maple compare with Maxima and Mathematica?
While there is considerable subject overlap among symbolic algebra systems, there is little similarity in syntax, library functionality, or design philosophy, and we know of no automatic translation tools that can convert code from one symbolic-algebra language to another.
Nevertheless, if you are familiar with at least one of these languages, the Web page Maxima, Maple, and Mathematica: the Summary and its parent page The Playsome Threesome: Maxima, Maple, and Mathematica may be helpful. The first displays a large table of how to do common things in each of the three languages.
Is there a local mailing list for questions about Maple?
No, there is not, but one can easily be created if there is sufficient user demand. In the meantime, students who use Maple in courses should direct their questions to their instructors. Questions dealing with Maple in numerical analysis can be directed to the na (numerical analysis) mailing list.
How do I compute the inverse of a function?
Define the inverse as a function involving Maple's solve() function. For example, to obtain the inverse error function, which is not otherwise supplied by Maple, use either of these (equivalent) definitions:
% maple ... > ierf := x -> solve(erf(y) = x, y): > ierf := proc(x) local y: return solve(erf(y) = x, y) end proc:
You can then plot the inverse and compute its Taylor series like this:
> plot(ierf(x), x = -0.999 .. 0.999); > taylor(ierf(x), x = 0, 7);
For more detail, see this na list posting.