In the following example from a Maple session, Maple's output is shown to the right of the input expressions.
p := x^2-x-2;
2
p := x - x - 2
q := (x+1)^2;
2
q := (x + 1)
s := p/q;
2
x - x - 2
s := ------------
2
(x + 1)
diff(s,x); # Differentiate with respect to x.
2
2 x - 1 x - x - 2
---------- - 2 ------------
2 3
(x + 1) (x + 1)
normal(s);
x - 2
-------
x + 1
x := 3^50;
x := 717897987691852588770249
s; # Re-evaluate s with a value substituted for x.
717897987691852588770247
--------------------------
717897987691852588770250
# Set the precision to use for floating point results.
Digits := 40;
Digits := 40
evalf(s); # Re-evaluate s in floating point format.
.9999999999999999999999958211332927043849
quit
The command maple actually invokes a script which parses various command line options, sets appropriate environment variables, and then starts the Maple kernel (and possibly a separate user interface). The command xmaple invokes maple with the -x option (see below).
The -a (assertion) option tells Maple to check all assertions. This is equivalent to specifying kernelopts(ASSERT=true) at the beginning of the session.
The -b (library) option tells Maple that the following argument should be used as the pathname of the directory which contains the Maple library. This initializes the Maple variable 'libname'. By default, 'libname' is initialized with the pathname /usr/local/maple/lib. Some sites might customize the maple shell script to redefine the library pathname. For example,
maple -b /usr/public/waterloo/maple/lib $*
More than one -b option can be specified. In this case, the
first -b option overrides the default 'libname' setting, and
subsequent -b options are appended to 'libname', forming a Maple
expression sequence of directory names.
The -c (execute command) option specifies a command that Maple is to execute on startup. The command can be any valid Maple command, but may not contain any blank characters. Multiple -c options may be specified. Commands specified by -c options, and files specified by -i options, are executed in the order they were specified, after the normal initialization files have been read.
The -e (break on error) option tells Maple what to do when an error is encountered while reading a file. -e0 tells Maple to to report the error and keep reading the file. -e1 (the default) tells Maple to stop reading the file (and skip to the end) when a syntax error is encountered. -e2 tells Maple to stop reading and skip to the end when any type of error is encountered. This behaviour can also be changed from within Maple using the command interface(errorbreak=n) where n is 0, 1, or 2.
The -F (no filter) option prevents Maple from exiting when the standard input has been redirected from a file, and the end of the file is encountered. By default, Maple will exit. If -F is specified, Maple will instead continue interactively at that point.
The -g (garbage collection interval) option tells Maple at what interval (in terms of number of words of storage allocated) to perform garbage collection. The default on most UNIX platforms is every 250,000 words. This setting can also be changed from within Maple using the command kernelopts(gcfreq=n) where n is the desired interval.
The -I (Install) option starts Maple in the license manager installation mode. This is normally used by the system administrator to install additional Maple licenses.
The -i (initialization file) option specifies additional files to be read after the standard Maple initialization files. Multiple -i options may be specified. Files specified by -i options, and commands specified by -c options, are executed in the order they were specified, after the normal initialization files have been read.
The -km p option is used to start Maple in the parallel server kernel mode. The parallel server mode enables each worksheet within a given Maple V session to be independent of other worksheets. The -km s option is used to start Maple in the single server kernel mode. By default, all worksheets during a given session share the same mathematical information. For example, if you assign a value to a variable in one worksheet, all other worksheets in the current session will be affected by this new definition. Worksheets are not independent sessions.
The -L (Log file) option is used to create a log of all the library modules that are loaded during the course of a Maple session. This is useful if you have developed a library of Maple routines, and want to determine which ones are actually used. As each module is loaded, its name is recorded in the specified log file. This file is not closed until the Maple session exits.
The -P (Parse only) option causes Maple to read input, but not evaluate any expressions. This can be used to quickly check a file of Maple commands for syntax errors, and should be used in conjunction with -e0 so that Maple will not stop when an error is encountered.
The -q (quiet) option will suppress the printing of Maple's startup message, various informational messages (bytes used messages and garbage collection messages), and the signoff message. Maple is better suited for use as a filter when these messages are suppressed.
The -s (suppress initialization) option causes Maple to forgo reading any initialization file when initiating a session.
If there is a system-wide Maple initialization file with the name init under the src subdirectory of the Maple library, then this file is read and the Maple statements in it are executed before the session starts. If a Maple initialization file named .mapleinit exists in the user's home directory, this file is read next.
The -T (Test limit) option is used to limit the amount of system resources that Maple can consume before execution is terminated. This option takes four parameters, separated by commas. The CPU time limit parameter specifies the maximum number of seconds of CPU time that the Maple process is to use. The data limit restricts the amount of memory, in kBytes, that Maple can use. The stack limit sets the maximum stack size, in kBytes. The core dump limit specifies the maximum size of core file that can be produced in the unlikely event of a core dump. You can specify any prefix of the four parameters, and omit the rest (for example, specify just the CPU and data limits).
The -t (test mode) option causes Maple to change its configuration to one suitable for running the Maple test suite. Specifically, the prompt is changed to "#-->", prettyprinting is disabled, and all but the last "bytes used" messages are suppressed. The final "bytes used" message is printed to stderr. This is not normally needed by Maple users.
The -w (warning level) option specifies whether maple should print certain warnings. -w0 suppresses all warnings. -w1 allows only warnings generated by the library to be printed (for example, "new definition for ...", as generated by the "with" function). -w2 allows warnings generated by the library or the kernel (for example, "... is implicitly declared local"). -w3 allows warnings generated by the library, the kernel, or the parser (for example, "... unterminated string constant..."). -w4 allows all of the above, and also warnings about things that are different from the previous release (for example, "... is a lexically scoped parameter). The default setting is -w3.
The -x (X interface) option causes Maple to run with an X Window user interface (see the following section).
In addition to the Maple options described above, options specific to window systems can also be used. For example, the option -bg red tells the X version of Maple to use red as the background color.
Maple V - Programming Guide by M.B. Monagan, K.O. Geddes, G. Labahn, and S. Vorkoetter, Springer and Waterloo Maple, Inc. (1997).
The march, mint, and updtsrc commands.
The MAPLE variable specifies where to find the Maple library, the Maple share library, the help browser index, and various configuration files. If the MAPLE variable is undefined, Maple uses "/usr/local/maple" as the default.
The HOME variable is used to identify where the user's .mapleinit file is located.
The PATH variable is used to locate auxiliary programs, such as the plot driver.
The XAPPLRESDIR variable is used to indicate where the Maple X Window resource files are.
$MAPLE/lib/src/init - system wide initialization file (where the setting of the environment variable MAPLE is subject to change at each installation).
$HOME/.mapleinit - user's own Maple initialization file.
$MAPLE/afm/* - Adobe Font Metric files used by Maple's PostScript(tm) plot driver.
$XAPPLRESDIR/MapleVR5 - the resource file used by the X Window System Maple interface.
$XAPPLRESDIR/Maple2dX11m - the resource file used by the X Window System two-dimensional plotting interface.
$XAPPLRESDIR/Maple3dX11m - the resource file used by the X Window System three-dimensional plotting interface.
ADMINISTRATOR'S ADDRESS GOES HEREIf your site does not have a site license, send your technical queries to:
support@maplesoft.comAn e-mail discussion group, the Maple User's Group (MUG), is available for sharing of information among Maple users. To join the Maple User's Group, send an e-mail to "majordomo@daisy.uwaterloo.ca", containing the text "subscribe maple-list". To contribute to the group, e-mail to "maple-list@daisy.uwaterloo.ca".