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 $v$ (in m/s) and angle $a$ (in degrees) at an elevation $h$ (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 $x(t)$ and $y(t)$ the horizontal and vertical positions of the projectile at time $t$, where we place the lift-off position $h$ meters directly above the origin of the $xy$-plane . So $x(0) = 0$ and $y(0) = h$. The first and second derivatives of $x(t)$ are the projectile's horizontal speed and acceleration, respectively. Similarly for $y(t)$. So we have also the initial conditions

\begin{displaymath}D(x)(0) = v\cos (a) \mbox{\quad and \quad} D(y)(0) = v\sin (a).\end{displaymath}

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:


\begin{displaymath}\frac{d^2\,x(t)}{dt^2} = 0.\end{displaymath}

Now for $y(t)$. Since there is no air resistance, the projectile's vertical acceleration is simply that of gravity, namely $g = 9.81 m/s^2$:


\begin{displaymath}\frac{d^2\,y(t)}{dt^2} = -9.81.\end{displaymath}

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:


\begin{displaymath}\frac{d^2\,x(t)}{dt^2} = -k\frac{d(x(t)}{dt}\end{displaymath}

for some positive constant $k$.

And in the vertical direction:


\begin{displaymath}\frac{d^2\,y(t)}{dt^2}=-g -k\frac{d(y(t)}{dt}.\end{displaymath}

Finally...
In either model we obtain equations of motion $x(t)$ and $y(t)$ for the projectile's path. The projectile is at its maximum height at the instant when its vertical speed is 0. We just solve $y'(t)=0$ for $t$ and then plug that solution into $y(t)$. The projectile lands exactly when $y(t) =
0$. The solution $t$ of this equation is the length of time the projectile was in flight, and substituting into $x(t)$ 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 $x(t)$:
> 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 $y(t)$:
> 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 $v$, $a$, and $h$, and an optional fourth parameter $k$, 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*t$\,^{\wedge}$2:
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*k$\,^{\wedge}$2)/(k$\,^{\wedge}$2)-
(g+v*sin(1/180*Pi*a)*k)*exp(-k*t)/(k$\,^{\wedge}$2):
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: $v = 40$ m/s, $a = 45$ degrees, $h = 10$ meters and No air resistance.

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

Example: As above, but this time assuming air resistance, say $k = 0.12$

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

Example: Again with $v = 40$, $h = 10$, and $k = 0.12$, but this time letting $a$ vary from $40$ to $50$ degrees through $2$ 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 $1/2$ 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