Projectile Motion, finding required theta of launch

Click For Summary

Discussion Overview

The discussion revolves around determining the launch angle (θ) required for a projectile to hit a target, considering the effects of drag and the need for a coding solution to solve the problem. Participants explore various methods for calculating the trajectory and adjusting the launch angle based on the projectile's path relative to the target.

Discussion Character

  • Homework-related
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant seeks to distinguish between overshoot and undershoot in projectile motion to inform their coding solution for finding the correct launch angle.
  • Another participant suggests that allowing for drag complicates the problem, but proposes using standard shooting methods for boundary value problems to find the target.
  • A participant acknowledges the presence of drag and discusses the inefficiencies of integrating trajectories that may hit the ground.
  • There is a suggestion to remove ground considerations to simplify the integration process, although concerns about still landing under the target are raised.
  • Some participants propose using the derivative of the y-intercept with respect to θ to determine the direction to adjust the angle for a given starting guess.
  • One participant mentions the limitations of using the bisection method due to its lack of knowledge about previous guesses, which may affect the efficiency of finding the correct angle.
  • Another participant suggests starting with a straight line guess between the launch point and the target, then adjusting the angle in steps until the target is surpassed, followed by a bisection approach.
  • There is a clarification about the range of θ being between 0 and π/2 for targets in the first quadrant, but concerns about the bisection method's restrictions are reiterated.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to solve the problem, with no consensus on a single method. Some agree on the need for numerical derivatives and adjustments based on trajectory, while others emphasize the limitations of the bisection method and the challenges posed by drag.

Contextual Notes

Participants note that the problem is constrained by the requirement to use a specific ODE solver and the bisection method, which may limit the exploration of alternative approaches. The discussion also highlights the uncertainty regarding the target's location and its impact on the launch angle adjustments.

Zacattackz
Messages
7
Reaction score
1

Homework Statement


The objective is to code a working solver, but my question is specifically with the physics aspect. I am to find the θ value necessary to launch a projectile and hit a target. My problem is distinguishing between an overshoot and an undershoot. For example:

WKjbz0M.jpg

Both of these launches have minimum points (the dots), that represent their closest point to the target (red with cross). Both of the minpoints fall in the same quadrant relative to the target (quadrant 3), but the blue needs to decrease the launch angle, while green needs to increase. How do I tell the difference between these and so tell my code whether to increase or decrease its guess? If the minpoint lands in any other quadrant I decrease or increase θ accordingly (decrease for quad 1,2 ; increase for quad 4)

Homework Equations


x,y,θ, velocity are known at all points on the line. As well as their derivatives.
To find the minpoints. ν⋅d = 0 is used where:
ν=velocity vector= xdot*i+ydot*j
d=vector from projectile to target=(T_x-x)*i+(T_y-y)*j
Target location = (T_x,T_y)

The code will solve for when v⋅d is equal to zero. Here is a picture illustrating that instance:

eIJaqxG.jpg

edit: I realize the velocity vector should fall inside of the blue, my mistake

The Attempt at a Solution


Here is an example of what my code does.Each image shows a successive guess angle and its corresponding path. The red circle is the target, while circles on the path indicate where a minimum distance has been found.

http://imgur.com/a/YPlv9

The first guess is an undershoot, while the second is a "high" undershoot. Causing the final guess to change the theta angle in the wrong direction. I need a way to detect when the guess is a "high" undershoot.
 
Last edited:
Physics news on Phys.org
Just to be clear, you are not restricting to parabolic trajectory, you want to allow drag, possibly non-linear drag? With parabolic trajectory, the problem is trivial. However, given what you say you know about the trajectory, any standard 'shooting method' for two point value boundary value problems should suffice. Are you familiar with these?

For these, you would 'integrate' to the x coordinate of the target, and then adjust based on whether you hit above or below the target y. These methods would converge very efficiently for your problem.
 
Last edited:
Yes, there is drag. I didn't post the 4 ODEs used to solve for the projectile's path, but can if that would help.

Integrating to the x coordinate would work (with exceptions for when the projectile hits the ground). But isn't as efficient because of the exceptions (I think). Integrating a high shot for its trajectory until termination (y=0) would be a longer integration than to any minpoint. I believe it would also run into the same problem. A high shot could fall under the target, while a low shot could as well.
 
Take the ground out of your problem. It isn't necessary. Then, you have no exceptions. You do have to integrate further, but convergence should be very rapid with standard methods (you should need e.g. 6 tries for very good precision).
 
That method still runs into the same problem. With a high shot I can still land underneath the target in the same way that a low shot can. Here's a pic: (starting velocities aren't constant, blue path should be higher, but you get the idea)
fXB2XSM.jpg


For a given starting velocity there should usually be 2 different paths to the target. A "direct" path, and a "high" path that runs into excess air resistance before dropping onto the target. It doesn't matter which path I use, but I do need to realize which path was attempted and was hoping there was a way to determine this before a solution is found.
 
You don't need to know which path case you are. You just need to find (possibly numerically) the derivative of y intercept with angle for a starting guess. That tells you which way to go for that starting path.
 
Could you explain that better? I should find my velocity vector when the height is the same as the target height?
 
I would hope you can derive something from your diff eqs. However, if you can't, you just integrate to y intercept for two very close values of theta. Compute a numeric derivative of y intercept with theta, and this tells you which way to go.

I would suggest one starting point:

https://www.amazon.com/dp/0521880688/?tag=pfamazon01-20

which has nice chapter on solving such problems. Forget using their code if you want to do your own, but they explain the methodology quite well (IMO). Two Point Boundary Value Problems is the relevant chapter.
 
Last edited by a moderator:
The problem requires using the given ODE solver to create the projectile's path. It also requires use of the bisection method to determine the next guess point (I think this was done to make the project easier, not having to figure out a root solver). Anyways, because the bisection method has no knowledge of previous guesses other than if they were high/low, I don't think it would be usable with the derivative of the y intercept.

That restriction also rules out the shooting method and others mentioned in the book. As my actual root finder is pre determined.

I'm guessing, once we submit our code, the target location used to grade it will be close to the launch point. Which will cause only extremely high theta values to return the "high" undershoot, and those likely won't be "guessed" by the bisection method.
 
  • #10
That clears up several things. However, even with bisection you can use the method I described for a numeric derivative estimate to decide which way to search. Start taking steps in the direction indicated by the derivative until you get to the other side of the target. Then bisect, keeping two thetas which land above and below the target. Binary intersections is fine and robust if slow.
 
  • #11
I could if I had good boundaries. But all I'm given is the target will land in the first quadrant. Necessitating boundaries of θ = 0 and θ = 2π. What could occur is landing just under the target, adjusting to a higher theta, and having a "high" overshoot and raising theta again. I'm probably overthinking the problem and the target locations used to grade the code will be easy to solve for.
 
  • #12
Zacattackz said:
I could if I had good boundaries. But all I'm given is the target will land in the first quadrant. Necessitating boundaries of θ = 0 and θ = 2π. What could occur is landing just under the target, adjusting to a higher theta, and having a "high" overshoot and raising theta again. I'm probably overthinking the problem and the target locations used to grade the code will be easy to solve for.
I think you are overcomplicating. Given a target location, in the first quadrant, theta must be between 0 and pi/2 (or -pi/2 to pi/2 if the start can be higher than the target). Drag isn't going to make a projectile go backwards or float upwards. Then, start with guess of straight line between the start and the target. This should necessarily be low. Then increase angle in steps of any decent size till you land on other side of target. Then bisect.
 
  • #13
Yes, my mistake, I meant π/2.

While it would be great to increase theta in routine intervals till a sign change occurs. The bisection restriction necessitates cutting almost in half on the first jump. And the project was originally described as "code your own bisection method but I should be able to replace it with my own version and might do just that" Thanks for the help!
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 21 ·
Replies
21
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
2
Views
3K
  • · Replies 15 ·
Replies
15
Views
27K
  • · Replies 39 ·
2
Replies
39
Views
5K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 25 ·
Replies
25
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K