Projectile Motion, finding required theta of launch

In summary, the objective is to code a solver that finds the θ value needed to launch a projectile and hit a target. The problem is distinguishing between an overshoot and an undershoot. The code uses four ODEs to solve for the projectile's path and the bisection method to determine the next guess point. One approach to solving this problem is to integrate to the x coordinate of the target and adjust based on whether the projectile hits above or below the target. Another approach is to find the derivative of the y intercept with angle for a starting guess. This will indicate which direction to search in for the next guess. However, since the bisection method has no knowledge of previous guesses, this approach may not be usable.
  • #1
Zacattackz
7
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
  • #2
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:
  • #3
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.
 
  • #4
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).
 
  • #5
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.
 
  • #6
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.
 
  • #7
Could you explain that better? I should find my velocity vector when the height is the same as the target height?
 
  • #8
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:
  • #9
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!
 

1. What is projectile motion?

Projectile motion is the motion of an object through the air or space under the influence of gravity. It follows a curved path known as a parabola due to the vertical and horizontal components of its velocity.

2. How do you calculate the range of a projectile?

The range of a projectile can be calculated using the formula R = (v^2 * sin(2θ))/g, where R is the range, v is the initial velocity, θ is the angle of launch, and g is the acceleration due to gravity.

3. How do you find the required angle of launch for a specific range?

To find the required angle of launch for a specific range, you can rearrange the range formula to solve for θ. The equation would be θ = 0.5 * arcsin(R * g)/v^2.

4. Can the angle of launch affect the range of a projectile?

Yes, the angle of launch directly affects the range of a projectile. The range will be maximum when the angle of launch is 45 degrees, and it will be zero if the angle is 90 degrees.

5. What factors can affect the accuracy of calculating the required angle of launch for a specific range?

The accuracy of calculating the required angle of launch can be affected by factors such as air resistance, initial velocity, and the effects of external forces like wind. It is also essential to use accurate and precise measurements in the calculations.

Similar threads

Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
7
Views
2K
Replies
4
Views
802
  • Mechanical Engineering
Replies
21
Views
2K
  • Introductory Physics Homework Help
2
Replies
39
Views
2K
  • Classical Physics
Replies
25
Views
1K
Replies
2
Views
2K
  • Introductory Physics Homework Help
Replies
15
Views
20K
  • Introductory Physics Homework Help
Replies
7
Views
2K
  • Introductory Physics Homework Help
Replies
4
Views
1K
Back
Top