DISP Mathematics (Scie 1500R)

MAPLE Lab. Tutorial 7 Motion of Projectiles Monday March 6.

1 BACKGROUND

This week we build on what you learned earlier about differential equations and procedures.

All the commands you will need are given. But be warned, some of them are long. Be very careful with your typing. You will need to be sure that you get all the brackets -- ( { [ -- correct, all the uppercase Pi's correct, and all the : and ; correct!! Also, where it says print(t#tex2html_wrap_inline95#...t#tex2html_wrap_inline97#) be sure to use the backwards t#tex2html_wrap_inline99#, not '.

Consider an object being projected into the air with speed (in m/s) and angle (in degrees) at an elevation (meters) above the ground. We will write a procedure which takes these as input, and returns four things, namely:

(i) the maximum height above the ground reached by the projectile, (ii) the length of time in the air, (iii) the horizontal distance travelled, and (iv) an animation of the flight.

The Theory

Denote by and the horizontal and vertical positions of the projectile at time , where we place the lift-off position meters directly above the origin of the -plane . So and . The first and second derivatives of are the projectile's horizontal speed and acceleration, respectively. Similarly for . So we have also the initial conditions

1st Model: No Air Resistance

In this ideal situation, there are essentially no horizontal forces acting on the projectile during flight. Then Newton's Second Law tells us it's horizontal acceleration is zero:

Now for . Since there is no air resistance, the projectile's vertical acceleration is simply that of gravity, namely :

2nd Model: Air Resistance Proportional to Velocity

It is a fact that when an object travels through a medium (like air), it is going be met with resistance, which, at relatively low speeds, is roughly proportional to the object's velocity. This changes our model. In the horizontal direction, we now have:

for some positive constant .

And in the vertical direction:

Finally...
In either model we obtain equations of motion and for the projectile's path. The projectile is at its maximum height at the instant when its vertical speed is 0. We just solve for and then plug that solution into . The projectile lands exactly when . The solution of this equation is the length of time the projectile was in flight, and substituting into gives the horizontal distance travelled.

2 EXERCISES

NAME STUDENT #

> xdeq := diff(x(t),t$2) = 0; 1. What do the symbols t$2 signify?

Using the initial conditions on horizontal position and speed, we can solve for :
> dsolve(xdeq,x(0)=0,D(x)(0)=v*cos(Pi/180*a), x(t));
Record the solution here.

2. (a) Why the Pi/180?
(b) Why v*cos(Pi/180*a)?
To avoid typing 9.81 many times, let us set
> g:= 9.81;
> ydeq := diff(y(t),t$2) = -g; And solving for : > dsolve(ydeq,y(0)=h,D(y)(0)=v*sin(Pi/180*a),y(t)); Record the solution here. > xrdeq := diff(x(t),t$2) = -k*diff(x(t),t);
> dsolve(xrdeq,x(0)=0, D(x)(0) = v*cos(Pi/180*a), x(t));
Record the solution here.

> yrdeq := diff(y(t),t\$2)=-g-k*diff(y(t),t);
> dsolve(yrdeq,y(0)=h,D(y)(0)=v*sin(Pi/180*a),y(t));
Record the solution here.

Putting it All Together
Our procedure takes as input the parameters , , and , and an optional fourth parameter , the constant for air resistance.
> projectile := proc(v,a,h,k)
local x,y,t,ttop,ytop,tbot,xbot:
if nargs=3 then
x := v*cos(Pi/180*a)*t:
y := h + v*sin(Pi/180*a)*t - 1/2*g*t2:
else
x := v*cos(1/180*Pi*a)/k-v*cos(1/180*Pi*a)*exp(-k*t)/k:
y := -g*t/k+(g+v*sin(1/180*Pi*a)*k+h*k2)/(k2)-
(g+v*sin(1/180*Pi*a)*k)*exp(-k*t)/(k2):
fi:
ttop := fsolve(diff(y,t)=0,t,0..infinity):
ytop := subs(t=ttop,y):
tbot := max(fsolve(y=0,t,0..infinity)):
xbot := subs(t=tbot,x):
print(t#tex2html_wrap_inline177#maximum height attainedt#tex2html_wrap_inline179#= evalf(ytop)):
print(t#tex2html_wrap_inline181#time before landingt#tex2html_wrap_inline183#= evalf(tbot)):
print(t#tex2html_wrap_inline185#horizontal distance travelledt#tex2html_wrap_inline187#= evalf(xbot)):
animatecurve([x,y,t=0..tbot]):
end;

Note:

(a). Our use of "max" was for picking off the positive solution (and therefore not t=0) in the list returned by fsolve.

(b). Remember to click on the plot and then on the Play button to view the animation.

3. What does if nargs=3 do?

4. Where do the expressions following the x:= and y:= come from?

5. (a) What is ttop?
(b) What is ytop?
(c) What is tbot?
(d) What is xbot?

Example: m/s, degrees, meters and No air resistance.

> with(plots):
> projectile(40,45,10);

Example: As above, but this time assuming air resistance, say

> projectile(40,45,10,0.12);

Example: Again with , , and , but this time letting vary from to degrees through degree increments; the plots suppressed.

> for j from 40 to 50 by 2 do
print(a=j);
projectile(40,j,10,0.12);
print(t#tex2html_wrap_inline211#t#tex2html_wrap_inline213#);
od:

Note:

(a). Use shift+enter between lines in for loops (as you would in a procedure).

(b). We hid the plots by closing the for loop with a colon. If you want to see all these animations, then replace the : after od with ; .

6. By modifying the last do...od loop, find (to the nearest degree) what elevation gives the maximum horizontal distance travelled.
Horizontal distance travelled is maximum when elevation angle is

7. Repeat question 6. but now with no air resistance.
Horizontal distance travelled is maximum when elevation angle is

Tony Thompson
2000-08-16