Maple can be used to answer all the questions posed at the end of the last section, but you have to tell it what to do. To do this, you have to type Maple commands in the worksheet that define your problem. This can be done in the following two steps.
To help you get started, a worksheet has been created where these two steps have already been done. To load this worksheet, go to the File menu and select the Open... item. This will pop up a file selection dialog box. Go to the Selection text entry subwindow and type in the filename given below.
/usr7/bfarr/Maple/projectile.msThen click on the Load button.
After a few seconds, your worksheet should look like the following.
> g := 9.8;
> v0 := 20;
> theta := Pi/6;
> x0 := 0;
> y0 := 1;
> x := t -> v0*cos(theta)*t+x0;
> y := t -> -g*t^2/2+v0*sin(theta)*t+y0;
The first four lines are where we set the values of the parameters. The last two lines are where we define the functions x(t) and y(t).
Notice the structure of the first five lines. Each has the form
label := value ;
, where label is a name for the
parameter and value is its numerical value. The :=
between the label and the value is Maple syntax for ``is defined to
be''. It is very important not to have a space between the :
and the =
.
Maple uses the =
sign by itself for a different purpose,
which we'll learn about shortly. At the end of each command is a
semi-colon, ;
, which is how you tell Maple that this is the end
of a command. Every Maple command has to end with a semi-colon, so
don't forget it.
To execute a command, use the mouse to put the cursor somewhere in the line containing the command and press the Return key. This passes your command to the Maple computational engine. If all goes well, Maple prints the result immediately below the command.
Put your cursor on the first line of the worksheet ( the line reading
g := 9.8 ;
and press the Return key. This defines the
acceleration due to gravity to be 9.8 meters per second squared. Then
execute the next four commands that set values of parameters by
pressing the Return key. After you submit a command, Maple
jumps automatically to the next command so you should be able to submit
the commands just by pressing the Return key four more times,
but you can always use the mouse if necessary to move
the cursor to the proper line.
Note that most keyboards don't have Greek characters, but Maple
recognizes the string theta to be the Greek letter .
Maple uses the string
Pi
to stand for the mathematical constant
.
The final two commands in the worksheet define the functions x(t)
and y(t). Note the syntax for defining a function carefully,
including the arrow notation
->
. The arrow notation is commonly used in mathematics and
relates to the idea of a function as an input-output box. Given an
input value of t the arrow points to the output of the function. To
type the arrow, type a dash (-) followed by a greater than
symbol (>) without a space between the two
symbols. Use the mouse, if necessary to position the cursor and
submit these two commands.
Once you have defined the functions, you can use them to calculate values of x(t) and y(t). For example, you could check that your functions give the correct values at t=0 with the following commands.
> x(0);
> y(0);
You can evaluate the functions for any value of t, but you can also do a lot more. In the next section, we find the value of t for which the projectile hits the ground, and then use this value of t to find how far the projectile has traveled.