13.07.2015 Views

MAPLE: The basics

MAPLE: The basics

MAPLE: The basics

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>MAPLE</strong>: <strong>The</strong> <strong>basics</strong>In this short document we will give a brief introduction to the <strong>MAPLE</strong>symbolic computation package.1 Getting started, : vs ;So you will be looking at a Maple worksheet with a [> symbol and a flashingcursor next to it. This is called an execution group. It is here that you ask<strong>MAPLE</strong> questions.Every <strong>MAPLE</strong> command must end with a colon (:) or a semicolon (;)and to execute the command press the return button. <strong>The</strong> difference whenusing a colon, semicolon or neither is illustrated below.[> 1+1;[>2[> 1+1:[>[> 1+1>Warning, premature end of inputIn the first instance <strong>MAPLE</strong> calculated the sum and returned some outputwhile in the second example <strong>MAPLE</strong> calculated the result but did notreturn any output. <strong>The</strong> final example illustrates a <strong>MAPLE</strong> error message.1


2 Word processingTo add text to a worksheet you place your cursor on a clear execution group.Now on the top menu you will see a T (between the ∑ and the [> symbols).Click this and the > symbol will disappear. Now type text here. To get anew execution group click on the [> button.If you want to add some mathematical symbols to your text then typethe Maple commands use the mouse to highlight them and go to Format -Convert To - Standard Math from the top menu bar.We can also add Greek letters to your text by typing their English name,e.g. delta, gamma highlighting the word and choosing Format - Convert To- Standard Math from the top menu bar. In this case you will obtain δ andγ.In <strong>MAPLE</strong> the number π = 3.1415 . . . is written as Pi. As <strong>MAPLE</strong> iscase sensitive this is different from typing pi which is the Greek letter π andcontains no meaning. Similarly √ −1 in <strong>MAPLE</strong> is I. We can even deal withan infinity with <strong>MAPLE</strong>, type infinity.3 Clearing the memory, restartIn order to clear <strong>MAPLE</strong>s memory we type [> restart; .4 Floating point numbers, evalfIf you wanted to find out what sin(3) is you will try[> sin(3);[>sin(3)But you wanted to know the number! This is a common problem in <strong>MAPLE</strong>,it wants to give the precise answer but you would like to ‘get a feeling’ for2


the numerical value. To force <strong>MAPLE</strong> to give you a numerical answer, if itcan, use the evalf command.[> evalf( sin(3) );[>0.1411200081Other examples are[> exp(50);[> evalf( exp(50) );[> (3/2)*(3/12);[> evalf( (3/2)*(3/12) );[> evalf( (3/8) );[> int( exp(sin(x)), x=0..1);[> evalf(int( exp(sin(x)), x=0..1) );[>e 500.5184705529 10 22380.37500000000.3750000000∫ 10 esin(x) dx1.6318696085 Plotting, plotLet us plot the graph of sin(1/x) where x ranges from 0 to 1.[> plot( sin(1/x) , x=0..1);By changing the x range we can investigate the behavior of sin(1/x) as xapproaches zero.We can also plot three dimensional graphs using the plot3d command.3


To plot z = sin √ x 2 + y 2 for x over the range −1 to 1 and y over the range−1 to 1 type[> plot3d( sin(sqrt(x^2+y^2)) , x=-1..1, y=-1..1);Sometimes plotting graphs on a small scale is misleading. Now try[> plot3d( sin(sqrt(x^2+y^2)) , x=-10..10, y=-10..10);[> plot3d( sin(sqrt(x^2+y^2)) , x=-30..30, y=-30..30);Each time you plot something you will notice that by clicking the picturea new menu bar will appear. Explore this bar, functions they may help youunderstand your plot.6 Further information<strong>The</strong> following URLs may be of some use:1. http://www.maplesoft.com2. http://www.mapleapps.com/tutorial.shtml3. http://www.indiana.edu/ ∼ statmath/math/maple<strong>The</strong> mathematics library has several books on programing and problemsolving using <strong>MAPLE</strong>.A series of <strong>MAPLE</strong> manuals are also available for consultation in themicrolab. Please do not remove them from the lab.4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!