Maple as a calculator If 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); NiMjISInIiM8 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. LUkqZmFjdG9yaWFsRyUqcHJvdGVjdGVkRzYjIiNU IlMrKysrPzpsO3ZTTTBpKzwzciFROzhtX19NJA== Obtaining approximate decimal expansions of numbers with evalf evalf(-6/17); NiMkIStsPFRITiEjNQ== Pi; evalf(Pi); evalf(Pi,75); SSNQaUclKnByb3RlY3RlZEc= JCIrYUVmVEohIio= JCJmb0gxayJ5SSNmV1woNCNlNXYkKlJwcj4lKUddektRVkVZUUt6KmVgRWZUSiEjdQ== 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; NiMiI1w= sqrt(36); NiMiIic= evalf( exp(1) ); NiMkIitHPUc9RiEiKg== cos(Pi); NiMhIiI= arctan(1); NiMsJComIyIiIiIiJSIiIiUjUGlHIiIiIiIi Getting information about a command ?arctan A 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); NiM+JSdEaWdpdHNHIiNd NiMkIlNeUCpScHI+JSlHXXpLUVZFWVFLeiplYEVmVEohI1w= Assignment (giving names to expressions): a:=-16/7; b:=Pi+a; d:=b^2+c; evalf(d); NiM+JSJhRyMhIzsiIig= NiM+JSJiRywmJSNQaUciIiIjIiM7IiIoISIi NiM+JSJkRywkKiYiIiMiIiIpLCYlI1BpRyIiIiMiIzsiIighIiIiIiMiIiIiIiI= NiMkIlM7LjcnSDM4bSJSazxJI3ohKSkpel5bJT5oYjBsOSEjXA== Restarting the Maple kernel (to clear all assignments): a:=77; a; restart: a; NiM+JSJhRyIjeA== NiMiI3g= NiMlImFH Suppressing output of assignments with the colon (:) expression terminator: a:=33; NiM+JSJhRyIjTA== a:=34: a; NiMiI00= You can clear assignments more selectively than with restart, using unassign: a:=99: a; unassign('a'); a; NiMiIyoq NiMlImFH 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; JCIkQiIiIic= JCIkJSkqIiIn JCIiJCIiJw== JCIrbm1tbWEhIio= 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.
<Text-field style="Heading 1" layout="Heading 1">Escape-route from Maple</Text-field> You 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== UUIvb3JhbmdlMS9yaW5nbGFuZC9wdWJsaWNfaHRtbC8zMzc2Ig== 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== UUovb3JhbmdlMS9yaW5nbGFuZC9wdWJsaWNfaHRtbC8zMzcvdGVzdGRpcjYi LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYpLUkjbW9HRiQ2L1ElcmVhZEYnLyUlYm9sZEdRJXRydWVGJy8lLG1hdGh2YXJpYW50R1ElYm9sZEYnLyUrZm9udHdlaWdodEdGNC8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGOS8lKXN0cmV0Y2h5R0Y5LyUqc3ltbWV0cmljR0Y5LyUobGFyZ2VvcEdGOS8lLm1vdmFibGVsaW1pdHNHRjkvJSdhY2NlbnRHRjkvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR0ZILUYsNi1RIn5GJy9GM1Enbm9ybWFsRidGN0Y6RjxGPkZARkJGREZGRkktSSNtc0dGJDYjUSpmb28ubWFwbGVGJy1GLDYtUSI7RidGTkY3L0Y7RjFGPEY+RkBGQkZERkYvRkpRLDAuMjc3Nzc3OGVtRicvJStmb3JlZ3JvdW5kR1EoWzAsMCwwXUYnLyUrZXhlY3V0YWJsZUdGOUZO USZIZWxsbzYi IiIj IiIl
<Text-field style="Heading 1" layout="Heading 1">Ditching the worksheet completely</Text-field> If 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.maple print("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 > quit bytes used=790696, alloc=655240, time=0.01 ringland@luthor(56-4:52pm)> ?read
JSFH