next up previous
Next: Doing it again Up: Maple introduction Previous: Projectile problem - Maple

Hitting the target

The usual assumption in a projectile problem is that the projectile hits the ground when y = 0. That is, the firing range is assumed to be flat. We can use the Maple solve command to do this. Type the following command into your Maple window. You should get the output shown below.

  > solve(y(t) = 0,t);

displaymath323

Notice that there are two values of t returned by the solve command, but we only want the positive value.

The syntax of the solve command is that you give it the equation you want solved(y(t) = 0), and then the variable you want to solve for (t).

To compute how far the projectile has traveled, we need to evaluate x(t) at the time when the projectile hits the ground. One way to do this would be with the following command.

  > x(2.136344744);

displaymath324

However, there is an easier way. If we give the solve command a label, then we can use the results later on. Here is an example.

  > t_hit := solve(y(t) = 0,t);

displaymath325

  > x(t_hit[2]);

displaymath324

There is no need to re-type the solve command. Just go back to you the solve command and add the label. The syntax t_hit[2] was to get the second value of time.

Maple gives an exact answer. If you want a decimal approximation, you can use the evalf command as in the following example.

  > evalf(x((t_hit[2])));

displaymath327



Sean O Anderson
Wed Sep 4 09:48:47 EDT 1996