Maple as a calculatorIf you are unfamiliar with Maple, work through this introduction and make sure you understand everything in it.Addition, subtraction, multiplication and division operators (+,-,*,/):2*(5-8)/(1+16);Note that all commands end with a semi-colon (;) or colon ( : , see below).
Hit the Enter key to execute your command. The cursor does NOT have to be at the end of the line.
Arithmetic is done exactly if possible. Very large integers can be handled.LUkqZmFjdG9yaWFsRyUqcHJvdGVjdGVkRzYjIiNUObtaining approximate decimal expansions of numbers with evalfevalf(-6/17);Pi;
evalf(Pi);
evalf(Pi,75);Note: to continue an execution group on a new line, use Shift-Enter instead of just Enter.Note: In the latest version of the graphical interface, your input is formatted as you type.
Use the right-arrow key to get out of a sub-expression.
Powers, trig functions, etc.:7^2;sqrt(36);evalf( exp(1) );cos(Pi);
arctan(1);Getting information about a command?arctanA help window will open. Information on arctan and related functions will be accessible.
Changing the precision of Maple's approximate "floating point" arithmetic:Digits:=50;
evalf(Pi);Assignment (giving names to expressions):a:=-16/7;
b:=Pi+a;
d:=b^2+c;
evalf(d);Restarting the Maple kernel (to clear all assignments):a:=77;
a;
restart:
a;Suppressing output of assignments with the colon (:) expression terminator:a:=33;a:=34:a;You can clear assignments more selectively than with restart, using unassign:a:=99:
a;
unassign('a');
a;Note that the forward quote has to be used in the above.
An example of a calculation with Maple:file_bytes:=123e6;
file_bits:=file_bytes*8;
bits_per_sec:=3e6;
transfer_time_in_minutes:=file_bits/bits_per_sec/60;An big advantage of Maple over a calculator is that you have an easily editable record of what you have done.Be sure to Save your worksheet frequently: Maple crashes often, and you can lose all your work.Escape-route from MapleYou will at some point in the future no longer be using Maple because there is a free and/or better alternative. You therefore don't want all your thoughts and work locked up in files that you cannot look at without using the Maple program.We can prepare for this day by writing our Maple code in text files instead of Maple worksheets.Using a plain text editor, such as gedit, create a file called "foo.maple" with some Maple commands in it.Once you've done that, you can execute the commands as follows.LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUkjbWlHRiQ2JVErY3VycmVudGRpckYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JKG1mZW5jZWRHRiQ2JC1GIzYmLUYsNiNRIUYnLyUrZm9yZWdyb3VuZEdRKFswLDAsMF1GJy8lK2V4ZWN1dGFibGVHUSZmYWxzZUYnL0YzUSdub3JtYWxGJ0ZDLUkjbW9HRiQ2LVEiO0YnRkMvJSZmZW5jZUdGQi8lKnNlcGFyYXRvckdGMS8lKXN0cmV0Y2h5R0ZCLyUqc3ltbWV0cmljR0ZCLyUobGFyZ2VvcEdGQi8lLm1vdmFibGVsaW1pdHNHRkIvJSdhY2NlbnRHRkIvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR1EsMC4yNzc3Nzc4ZW1GJ0Y9RkBGQw==This shows you what Maple's current working directory is. If necessary change the current directory to the one where your text file resides. You may first need to check the "allow system calls" box in the Tools>Options dialog.LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUkjbWlHRiQ2JVErY3VycmVudGRpckYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1JKG1mZW5jZWRHRiQ2JC1GIzYoLUYsNiNRIUYnLUkjbXNHRiQ2I1FKL29yYW5nZTEvcmluZ2xhbmQvcHVibGljX2h0bWwvMzM3L3Rlc3RkaXJGJ0Y6LyUrZm9yZWdyb3VuZEdRKFswLDAsMF1GJy8lK2V4ZWN1dGFibGVHUSZmYWxzZUYnL0YzUSdub3JtYWxGJ0ZHLUkjbW9HRiQ2LVEiO0YnRkcvJSZmZW5jZUdGRi8lKnNlcGFyYXRvckdGMS8lKXN0cmV0Y2h5R0ZGLyUqc3ltbWV0cmljR0ZGLyUobGFyZ2VvcEdGRi8lLm1vdmFibGVsaW1pdHNHRkYvJSdhY2NlbnRHRkYvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR1EsMC4yNzc3Nzc4ZW1GJ0ZBRkRGRw==LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYpLUkjbW9HRiQ2L1ElcmVhZEYnLyUlYm9sZEdRJXRydWVGJy8lLG1hdGh2YXJpYW50R1ElYm9sZEYnLyUrZm9udHdlaWdodEdGNC8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGOS8lKXN0cmV0Y2h5R0Y5LyUqc3ltbWV0cmljR0Y5LyUobGFyZ2VvcEdGOS8lLm1vdmFibGVsaW1pdHNHRjkvJSdhY2NlbnRHRjkvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZILUYsNi1RIn5GJy9GM1Enbm9ybWFsRidGN0Y6RjxGPkZARkJGREZGRkktSSNtc0dGJDYjUSpmb28ubWFwbGVGJy1GLDYtUSI7RidGTkY3L0Y7RjFGPEY+RkBGQkZERkYvRkpRLDAuMjc3Nzc3OGVtRicvJStmb3JlZ3JvdW5kR1EoWzAsMCwwXUYnLyUrZXhlY3V0YWJsZUdGOUZODitching the worksheet completelyIf your work does not involve graphics, you can avoid using the Worksheet completely by writing your commands in a text file as above, and then executing them from the command line like this:ringland@luthor(54-4:51pm)> cat foo.mapleprint("Hello");a:=2;a+a;ringland@luthor(55-4:52pm)> /eng/tools/maple11.02/bin/maple foo.maple |\134^/| Maple 11 (X86 64 LINUX)._|\134| |/|_. Copyright (c) Maplesoft, a division of Waterloo Maple Inc. 2007 \134 MAPLE / All rights reserved. Maple is a trademark of <____ ____> Waterloo Maple Inc. | Type ? for help.> print("Hello"); "Hello"> a:=2; a := 2> a+a; 4> quitbytes used=790696, alloc=655240, time=0.01ringland@luthor(56-4:52pm)>?readJSFH