Win a Hat! (Its a really nice hat, its a really hard problem)

We have been struggling to solve an equation for our shooter, and have decided to make this a public competition!

See thistwitter post for some incentive

We need an equation that describes the trajectory of a ball, which exits a shooter at a fixed velocity, and only experiances gravetational acceleration. There are plenty of equations that describe this, see https://en.wikipedia.org/wiki/Trajectory_of_a_projectile#Angle_required_to_hit_coordinate_.28x.2Cy.29

Our problem is the height we need to shoot is directly affected by our angle.

The deets:
http://imgur.com/a/aOAnM

Solve for Theta, No Regression!

The first person to submit through any medium will win the Hat

It’s not a single equation. It’s 2 equations… you will need the equation in 2 directions… x and y

x = x(original position) + v(original velocity in x direction)t
y = y(original position) +v(original velocity in y direction)t + 1/2 g(t squared)

Your original velocity in the x and y come from your angle (theta)

Use trig… solve for relationship between these two and then you can get the angle you need.

I am a physics teacher… I am not giving you the final equations… use trig and algebra … you can do this…

Ditto. velocity time graphs work really well, too.

I understand you are a physics teacher, and want us to solve it ourselves, but I also understand that this is an equation that requires a system of equations that, when put together, results in at least three instances of theta, the variable we want to solve for. This is, even for trained educators (like all of our math teachers and physics teachers), hard. I would have posted the immense amount of derivations of this equation we came across, but I wanted to let people go into this problem with a fresh perspective. We are hoping that the creative and intelligent minds of chief Delphi can solve this problem.

My answer? Don’t worry about the changing height at all, because the delta-y shouldn’t make a significant impact on shooter consistency (in this case). Just assume your shooter will hit the middle of the target when its theta is between 0 and the maximum angle, and then do the math with the height as a constant.

We’ve spent 6 hours deriving, and though we know we have other options like regression and not sweating the change of the shooter we thought we could make this a fun challenge… (Furthest we’ve gotten starting from the wikipedia equation) http://m.imgur.com/DKugmhV

Ignoring the height change, it is an easy solution, and as several people have said, it is very easy to do yourselves. Chances are, your uncertainty in your velocity will make a bigger difference than the height variation (as a result, you are going to have to calibrate your shooter by testing it anyway, the equations will just give you a ballpark value to start with).

If you do try to account for the height change, I don’t believe there is a closed form solution. I end up with a 6th order polynomial in sin(Theta),which does not have a general solution. You would have to numerically solve the equation for the appropriate values of x and v. Here is as far as I got:

The height at a given distance will be (measured from the release point):

y = x tan(Theta) - g * x^2 / (2 (v cos(Theta))^2) = x tan(Theta) - 32.2 * x^2 / (2 (v cos(Theta))^2)

This needs to match the height that you need to shoot above the release point. If I am understanding correctly:

y(x) = ht = 8.083 - 1.4381 sin(Theta) - 0.8147 = 7.2683 - 1.4381 sin(Theta)

For simplicity, define A = 7.2683 and B = 1.4381:

Combining the two equations:

x tan(Theta) - 32.2 * x^2 / (2 (v cos(Theta))^2) = A - B sin(Theta)

We could probably solve the preceding equation numerically for any particular values of x and v, but we will try to solve it symbolically instead.

Substitute a new variable, u = sin(Theta). This also implies that cos(Theta) = sqrt(1-u^2), and tan(Theta) = u/sqrt(1-u^2). If we solve for u, we have Theta = asin(u) :

x u/sqrt(1-u^2) - 32.2 * x^2 / (2 (v^2 (1-u^2))) = A - B u

Define C = 32.2 * x^2 / (2 v^2):

x u/sqrt(1-u^2) - C/(1-u^2) = A - B u

Move everything but the first term to one side:

x u/sqrt(1-u^2) = C/(1-u^2) + A - B u

Square both sides (easily done using WolframAlpha, etc.):

x^2 u^2 / (1-u^2) = ( (u^2-1)(A – B u) – C )^2 / (u^2-1)^2 = ( (u^2-1)(A – B u) – C )^2 / (1 - u^2)^2

Multiply both sides by (1-u^2)^2

x^2 u^2 * (1-u^2) = ( (u^2-1)(A – B u) – C )^2

Expand everything:

x^2 u^2 – x^2 u^4 = A^2 u^4-2 A^2 u^2+A^2-2 A B u^5+4 A B u^3-2 A B u-2 A C u^2+2 A C+B^2 u^6-2 B^2 u^4+B^2 u^2+2 B C u^3-2 B C u+C^2

Move everything to one side:

0 = A^2 u^4-2 A^2 u^2+A^2-2 A B u^5+4 A B u^3-2 A B u-2 A C u^2+2 A C+B^2 u^6-2 B^2 u^4+B^2 u^2+2 B C u^3-2 B C u+C^2 - x^2 u^2 + x^2 u^4

Collect terms:

0 = B^2 u^6-2 A B u^5-2 B^2 u^4 + x^2 u^4 +A^2 u^4+4 A B u^3+2 B C u^3-2 A^2 u^2 - x^2 u^2+B^2 u^2-2 A C u^2-2 B C u-2 A B u+A^2+2 A C+C^2

0 = B^2 u^6-2 A B u^5 + (x^2+A^2 -2B^2) u^4 + (4 A B +2 B C) u^3 +
(-2 A^2 - x^2 +B^2-2 AC) u^2 + (-2 B C u-2 A B) u+A^2+2 A C+C^2

Well, it’s no solution for theta, but considering your math is sound, you deserve a hat.

*Plot this function with given values of Vo, d, and h vs x=0 to pi/3 radians.

Where it crosses the X axis is the angle solution in radians.

Vo = given initial (launch) speed feet/sec

d = horizontal distance from launch point to goal, feet

h = vertical height from launch point to goal, feet

Example solution for f(40,20,8) => 0.607 radians = 34.8 degrees

*

f(Vo,d,h).png




f(Vo,d,h).png

*Here’s a spreadsheet to play with.

Where the graph crosses the X axis is the angle solution in degrees.

Vo = initial (launch) speed feet/sec

d = horizontal distance from launch point to goal, feet

h = vertical height from launch point to goal, feet.

theta Vo d h.xls (76.5 KB)


theta Vo d h.xls (76.5 KB)

(https://www.youtube.com/watch?v=vyVkyakC6xk)

It’s probably worth repeating: these are parabolic trajectory computations, ignoring air drag. The real world will be different:

When I see something like this, I just have to ask… which is more time-intensive, spending hours or days figuring out difficult, theoretical equations and then attempting to apply them to a real world that doesn’t exactly match the equations, or just doing a little trial and error, plotting the results and doing a line of best fit on the data to give you the appropriate angle and shooter speed?

Don’t get me wrong, understanding the equations and how those equations differ from reality is important… but that’s something that you’ll learn in physics class, using structured experiments designed to teach it.

*It all depends on what your goal is and what inspires you, Jon.

Some students are inspired by this stuff. Some are not. Vive la différence.

http://www.chiefdelphi.com/forums/attachment.php?attachmentid=13384&d=1357326120

Exactly. Also, sometimes modeling works well, sometimes it doesn’t. Sometimes things working well is the best experience long term, sometimes it isn’t.

This reminds my first taste of calculus back in 2010; two college mentors and I were trying to figure out the physics of various ball trajectories. After 3 hours, we didn’t have any results that seemed believable and another set of student/mentors had a prototype kicker that they were testing in the hallway with a spring scale to gather empirical data with. Ultimately the empirical testing worked the best that particular time.

Based on that and other experiences, I’ve settled on a set of criteria that helps me figure out which route (or a mix) to take. I’ll preface it by saying that this is what I’d do in a personal work/hobby situation, not as a mentor. As a mentor, I’d do some of each and let the students find out for themselves more or less what works for them, as I did before. Or rather, do some simulation, and then use a prototype to get some empirical data to match it up.

So, the first thing that I consider is how difficult/expensive a prototype is and how long such would take to make and test. If a prototype is going to be difficult, expensive, and/or time consuming, then I’ll be more inclined to model than to prototype, and vice-versa.

Next, I factor in how much I know about and the difficulty of modeling the design in question. If I know how to accurately (and to a lesser degree, precisely) model the design and it isn’t going to become a final exam question to deal with (read: multiple pages of equations and expressions), then I’ll model it first, rather than going straight to a prototype. Otherwise, I’ll reduce it down to blocks if possible and then model those that fit the above criteria.

Finally, the last thing I factor is what the end goal is. If it is a specific design, I’d be content with getting an empirical answer that just works. However, if the goal is more scientific in nature, such as a generalization or better knowledge of operation, then I’ll model it, then prototype/test, then tweak the model, and repeat the cycle until I’m within an acceptable margin of error.

One other point I’ll make is to factor in the degree of modeling required. There are many things and situations that have multiple models depending on application. An example of I know of in my field (EET) is diodes; in some applications they’re just one-way valves for current, in some the nominal voltage drop is added, and in others, the internal resistance and/or exponential voltage drop equation is added. One device, many different models. In physics (and mechanical designs) various forms of drag fall into this category, such as air resistance and friction. Sometimes it matters, sometimes it doesn’t.

Another “gotcha” to watch out for in regards to degrees of modeling is the tolerances of the design components. You’re only as accurate and precise as the hardware you’re going to build with. One of the biggest killers of fancy models is false precision; there is a reason why they teach the concept of significant figures in science courses (and why you should use them in engineering too!).

Sorry for the long post (or “thought post” as Dr. Joe might call this), but seeing the level of math being performed, I thought this might be good to know for those playing at home.

Here is a picture of our labview implementation of the code for this… It calculates angle based on the distance to the tower (horizontally), the height of the opening, and the velocity of the shooter.

It’s split up to make it more readable, but is essentially a quadratic formula with three terms that are each calculated from the parameters. There are 2 quad formulas because in a normal parabola, the ball will cross the opening twice (once going up, once going down), so there are two solutions. We take the closer one.

Hope this helped!





Here’s a detailed explanation of the derivation of the function.