Shooting a Cannonball Over a Wall BRIEF ABSTRACT We present problems related to shooting a cannonball over a mountain to hit a target with a minimum velocity. Two dimensional projectile motion is appropriate. GENERAL INFORMATION FileName: CANNON Full title: Shooting a Cannonball Over a Wall Last Revision Date: 28 May 1996. Developer: Lynn Kiaer, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Contact: Brian J. Winkel, Department of Mathematical Sciences, United States Military Academy, West Point NY 10996 USA. Phone: 914-938-3200. Email: ab3646@usma2.usma.edu. FAX: 914-938-2409. Aaron D. Klebanoff, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. Phone: 812-877-8151. Email: Aaron.Klebanoff@Rose-Hulman.Edu. FAX: 812-877-3198. Support: The production of this material is supported by the National Science Foundation under Division of Undergraduate Education grant DUE-9352849: Development Site for Complex, Technology-Based Problems in Calculus with Applications in Science and Engineering and the Arvin Foundation of Columbus IN. STATEMENT OF PROBLEM Your mission is to shoot a cannonball over a wall, so that the cannonball lands as far as possible on the far side of the wall. You may place the cannon at any distance behind the wall. We refer to this distance behind the wall as the setback distance. (1) Shoot a cannonball (assuming there is no wall) so that the cannonball lands as far as possible from the launch site if the cannon has muzzle velocity of 25 meters/second. (2) Shoot a cannonball (assuming there is no wall) so that the cannonball lands as far as possible from the launch site if the cannon has muzzle velocity of v meters/second. (3) Shoot a cannonball, assuming the cannonball must clear a wall of 10 feet, so that the cannonball lands as far as possible on the far side of the wall if the cannon has muzzle velocity of 25 meters/second. You can choose the setback distance, the distance behind the wal, to be anything you like. KEYWORDS Two dimensional projectile motion, derivative, optimization TEACHER NOTES ISSUES RELATED TO THE PROBLEM A picture is invaluable in leading the students to the discovery that the solutions to the third problem involves both the launch angle and the setback distance from the wall. Prerequisites This problem can be introduced early in a course in differential calculus, although students with no physics background may need an introduction to projectile motion. Highly analytic students may very quickly determine the function to be optimized, while other students can successfully approach the problem by trial and error, only eventually formulating the problem analytically. These students will nevertheless have succeeded in determining a multi-step solution process, and will also have developed their intuition and reasoning skills. This problem can be introduced before the derivative, allowing students to explore their understanding of limits in a practical setting. Time allotment - time management This could be a tricky problem as the students need to realize that while there may appear to be two variables, e.g., distance behind the wall and the angle, they will come to realize that for a fixed velocity these two variables are not independent. Part of one class may address formulation issues, but we would suggest a period of several days, parhaps a week for work on the problem, preferably in groups. Expectations Students wouild become proficient in use of describing motion with projectile motion equations in a different setting. Future payoffs Students would be able to formulate projectile motion and general motion problems, with constraints better. Extensions One could consider the thickness of the wall, the size of the ball shot, and perhaps put some non-flat terrain behind and in front of the wall. Further, one could introduce air-resistance to the shot. References and Sources Problem suggested by John Rickert, Department of Mathematics, Rose-Hulman Institute of Technology, Terre Haute IN 47803 USA. POSSIBLE SOLUTION(S) Problem 1. We place our cannon at the origin (0, 0) and we set up the appropriate functions x[t] and y[t] for two dimensional projectile motion. x[t_] = 25 Cos[theta] t; y[t_] = -9.8/2 t^2 + 25 Sin[theta] t; Since we want to maximize the horizontal distance traveled by the cannonball, we need to find out when the cannonball hits the ground. time = Solve[y[t]==0,t]; t2=t/.time[[2]] 5.10204 Sin[theta] So the distance traveled by the cannonball is distance[theta_] = x[t2] 127.551 Cos[theta] Sin[theta] We can find the maximum distance by solving for theta, FindRoot[distance'[theta]==0,{theta, Pi/6}] {theta -> 0.785398} This value is theta = Pi/4 as we can see. Pi/4//N 0.785398 Or we could plot distance[theta] and examine it for a theta which gives a maximum value. And here too we see that at the midpoint between 0 and pi/2, i.e. Pi/4, we attain a maximum distance. Plot[distance[theta],{theta,0, Pi/2}] -Graphics- Let's look at distance'[theta] to see if we can ascertain a maximum directly. distance'[theta] 2 2 127.551 Cos[theta] - 127.551 Sin[theta] But this is a simple problem! Setting distance'[theta] equal to zero reduces our problem to finding an angle theta so that the squares of its sine and cosine are equal. Since common sense says our angle must be between 0 and Pi/2, this angle is Pi/4. Problem 2. Our analysis of the first problem did not depend on the initial velocity - or, in fact, on the gravitational constant. The optimal launch angle is still Pi/4. Problem 3. The same functions x[t] and y[t] still give the trajectory of our cannonball, but now we need a more complex solution procedure. Our solution will now consist of a launch angle and a setback distance. The distance to be optimized, the distance beyond the wall, is the total distance travelled less the setback distance. The total distance travelled is still x[t2], where t2 is the time the cannonball hits the ground. The setback distance is the distance travelled before the cannonball first achieves a height of 10 meters. We find t1, time it takes to arrive at the wall as as function of theta, and then compute the distance travelled to that point, x[t1]. x[t1] is the setback distance. walltime = Solve[y[t]==10,t]; t1=t/.walltime[[1]]; So our distance beyond the wall given a launch angle of theta is walldistance[theta], which is the distance walldistance[theta_] = x[t2] - x[t1] 127.551 Cos[theta] Sin[theta] - 0.255102 Cos[theta] (250. Sin[theta] - 2 1. Sqrt[-19600. + 62500. Sin[theta] ]) Now we want to set the derivative of the walldistance[theta] equal to zero to find the maximum distance beyond the wall. We can find a numerical solution, choosing our initial guess with the help of a plot of the function walldistance. We must be careful, because for some choices of theta, the setback distance is undefined. In fact plotting walldistance from theta = 0 to theta = Pi/2 shows just that problem. But it also shows the reasonable value of theta for a maximum walldistance. What can be the physical explanation for this plot? Plot[walldistance[theta],{theta,0,Pi/2}, PlotRange->{{0, Pi/2},{0, 60}}] -Graphics- Now we are ready for a numerical solution. derwalldistance[theta_]=walldistance'[theta] 2 2 127.551 Cos[theta] - 127.551 Sin[theta] - 0.255102 Cos[theta] (250. Cos[theta] - 62500. Cos[theta] Sin[theta] ----------------------------------) + 2 Sqrt[-19600. + 62500. Sin[theta] ] 0.255102 Sin[theta] (250. Sin[theta] - 2 1. Sqrt[-19600. + 62500. Sin[theta] ]) sol = FindRoot[derwalldistance[theta]==0,{theta,Pi/4}] {theta -> 0.878922} We name the optimal angle for launch thetaLaunch. thetaLaunch = theta/.sol[[1]]; This says we should launch at an angle of 0.878922 radians for a distance of 52.8375 ft beyond the wall. walldistance[thetaLaunch] 52.8375 And where should we launch from, i.e. what is the setback distance from the wall? This is given by x[t1] (the distance travelled before the projectile arrives at the wall) evaluated at the time t1 (the time it takes to get from the launch position to the wall) for the given angle theta. x[t1]/.sol[[1]] 9.82558 Thus we should launch some 9.82558 ft in front of the wall at an angle of 0.878922 radians for a maximum distance beyond the wall of 52.8375 ft. We prepare a graphic to illustrate our final solution. We produce a graphic for the wall. wall = Show[Graphics[Line[{{x[t1],0},{x[t1],10}}/.sol[[1]]]]] -Graphics- First we offer the path of the cannonball given the angle for maximum distance beyond the wall. xLaunch[t_] = x[t]/.sol[[1]]; yLaunch[t_] = y[t]/.sol[[1]]; Then we offer the time at which the cannonball lands on the other side of the wall. tLand = t2/.sol[[1]]; We generate a plot of the trajectory. shot = ParametricPlot[{xLaunch[t],yLaunch[t]},{t,0,tLand}] -Graphics- And finally offer a rendering of the trajectory and the wall. Show[shot,wall,AspectRatio->Automatic] -Graphics- A little cleverness can yield an exact solution. Since we know that our launch angle is between 0 and Pi/2, we can replace Cos[theta] with Sqrt[1-Sin[theta]^2] in walldistance'[theta] thus creating a function with only the "variable" Sin[theta]. f[theta_]=walldistance'[theta]/. {Cos[theta]->Sqrt[1-Sin[theta]^2]}; We can replace the Sin[theta] terms with s in the above expression. g[s_]=f[theta]/.{Sin[theta]->s}; Since this expression is algebraic, Mathematica can solve it. sol = Solve[g[s]==0,s] {{s -> -3574.53}, {s -> 0. - 3574.53 I}, {s -> 0.770051}} s1 = s/.sol[[3]] 0.770051 Since s is Sin[theta] we see that our angle (in radians) is the same as before. ArcSin[s1] 0.878922 ISSUES IN SOLUTION Students are sometimes surprised to find that the initial velocity has no bearing on the optimal angle in problems 1 and 2. The more pragmatic students may want to take into account the thickness of the wall, the size of the cannonball, and air resistance. While the wall and the cannonball do not add to the complexity of the problem, air resistance does. This problem can be revisited later when the students have sufficient familiarity with differential equations to incorporate air resistance.