PDA

View Full Version : Golf ball flight


Paul7
Mar17-04, 03:57 AM
I am currently trying to create a computer simulation of the flight of a golf ball and am having difficulties in calculating the acceleration of the ball.

The following forces are applied to the ball:

http://www.3dreal.co.uk/project/phys.jpg

I know how to calculate the forces but am unsure as how to resolve the forces into component form and then calculate the acceleration of the ball?

Thanks Paul

Palpatine
Mar17-04, 04:07 AM
Do you have equations that yield the drag and magnus given a certain velocity? The drawing only illustrates the orientation of the forces relative to the velocity.

HallsofIvy
Mar17-04, 05:22 AM
"Magnus"? What is "magnus"?



You will need to know the strength (magnitude) of each force as well as its angle with respect to a specific direction. If you can get the angle with respect to the horizontal then it should be simple trigonometry to get horizontal and vertical components.

Paul7
Mar17-04, 08:14 AM
Am calculating the magnus force or uplift force using:

Fm = (2PI^2 * p * v * r^4 * w) / 2r

were p = density of air, r = radius, w = angular velocity, v = velocity

The drag is calculated using:

Fd = 0.5 * cd * p * area * v^2

where cd = drag coefficient, area = cross sectional area

The diagram just shows for a particular position during flight. The magnus force is always perpendiclur to the velocity and the drag always opposes the velocity.

My problem is resolving the forces into an X and Y component and calcuating the net force. I think I could do this if I knew the angles but I dont think I do. Is there any way to do this without knowing the angles?

Chen
Mar17-04, 09:19 AM
In your simulation, surely you know the inital angle at which the golf ball is fired into the air, right?

Let that angle be alpha... in the very first moment of the flight, the drag force is alpha degrees below the X axis, the magnus force is alpha degrees to the left of the Y axis, and the gravitational force is on the Y axis.

\Sigma F_x = F_m\sin {\alpha} + F_d\cos {\alpha}
\Sigma F_y = F_m\cos {\alpha} - F_d\sin {\alpha} - F_g

Now you use Pythagoras to find the net force, and the angle of the force is given by:
\tan {\theta} = \frac{\Sigma F_y}{\Sigma F_x}

So you know the momentary acceleration of the ball. Use that to calculate the new velocity of the ball, and you would have the new alpha, and this whole thing would happen all over again.

russ_watters
Mar17-04, 09:54 AM
Originally posted by Paul7
My problem is resolving the forces into an X and Y component and calcuating the net force. I think I could do this if I knew the angles but I dont think I do. Is there any way to do this without knowing the angles? No, you have to know the angles. But you should know the first set of angles and be able to calculate the rest [like Chen was saying].

I assume you are doing some sort of step method here, calculating everything every 1/100 of a second or so. Since you know the launch angle, you have the entire first set of decelerations. Find the resultant and calculate the position after 1/100 of a second assuming all those decelerations are constant (over such a short time period, they are very nearly constant). Now calculate the angle between the first and second positions.

Are you familiar with Newton's Method (http://www.teachers.ash.org.au/mikemath/calcnumnewton/) for numerical solving of equations?

Palpatine
Mar17-04, 10:23 AM
Let \vec{v} be the 3-dimensional velocity vector.
Let \Delta{t} be the time since the last update(frame) of the simulation.
Let m be the mass of the ball.
Let \vec{v}\prime be the new updated velocity vector.

Now \vec{v}\prime=\vec{v} -

(\frac{\vec{v}}{\|\vec{v}\|}\frac{\frac{1}{2}c_{d} \|\vec{v}\|^2\Delta{t}A\rho}{m}) -

(g\vec{k}\Delta{t}) +

(\frac{\vec{v}\times(\vec{k}\times\vec{v})}{\|\vec {v}\times(\vec{k}\times\vec{v})\|} \ \frac{2\pi^2\rho\|\vec{v}\|r^4\omega\Delta{t}}{2rm })

Chen
Mar17-04, 10:28 AM
Sorry if my post was messy, I was in a rush. I forgot to mention that at some point (namely, immediately after the Y component of the velocity equals zero) your angle alpha will become negative. When this happens \sin \alpha will also be negative, which means both F_m and F_d will too change their signs.

Paul7
Mar17-04, 11:14 AM
Thanks alot for the help

Dont no if am being a bit dumb but whats the K vector in Palpatine's equation? and also would I solve this three times once for X, Y, Z coordinates?

Palpatine
Mar17-04, 11:15 AM
k is the unit vector in the z (up direction) <0,0,1>

Palpatine
Mar17-04, 11:22 AM
If you have a vector library you only have to do it once and adapt your drawing code or whatever to use the coordinates in the vector object.

Remember the new position vector is the old one + old velocity vector * (delta t).

Chen
Mar17-04, 11:38 AM
Originally posted by Palpatine
k is the unit vector in the z (up direction) <0,0,1>
I'm sorry but I don't understand is how:

\frac{\vec{v}}{\|\vec{v}\|}

Gives you the direction of the velocity vector. I'm genuinely interested because I only recently picked up vectors in mathematics. [:)]

Ah wait, is it because:

\frac{\vec{v}}{\|\vec{v}\|} = \frac{\|\vec{v}\|\cos \theta}{\|\vec{v}\|} = \cos \theta

Palpatine
Mar17-04, 11:44 AM
A vector of length 1 multiplied by a constant is the same as scaling the vector with that amount. Consequently its also the same as making the length of the vector the same as the amount you multiplied it with.

Thus if you divide a vector by its magnitude ( ||v|| ), it yields a vector of length 1 (unit vector) in the direction in which v is pointing.

Palpatine
Mar17-04, 11:52 AM
Also note where it multiplies vectors it means cross product and also that you must do it in the order specified because v x u is not equal to u x v

Michael D. Sewell
Mar17-04, 02:28 PM
You can also get wind drift as a function of time by using the following equation:

Drift = wind velocity * sin theta [t - (range/initial velocity)]

theta is the angle of the crosswind
range is the horizontal distance the ball has traveled at time t

Please note that at lower velocities the drag is NOT proportional to the square of velocity. This is done with numerical integration. Wind drift is proportional to wind velocity. Also note that corrections for elevation (msl) of the golf course and temperature are simply a function of the air density. Wind drift is also proportional to air density. I have much more information; if you need it, say so.

Hope this helps you. -Mike

jamesrc
Mar17-04, 02:37 PM
Originally posted by HallsofIvy
"Magnus"? What is "magnus"?



If you're still interested and nobody's mentioned it yet, the Magnus force, named for the guy who first demonstrated it, shows up whenever you have a spinning object in a fluid. It's similar to normal aerodynamic drag in that it is caused by a pressure difference defined by the shape of the boundary layer of the moving object. The spin deflects the wake so that instead of having a front-to-back pressure difference, the pressure difference will be across the ball. As mentioned, the Magnus force acts at a right angle to the forward motion of the object. It's the explanation for the curve of a curve ball.

Here's (http://farside.ph.utexas.edu/teaching/329/lectures/node71.html) a site with a blurb on it.

Paul7: In your calculation of the Magnus force, are you assuming a constant &omega; or do you have some model where the spin rate decays? Hope your simulation is up and running...

Paul7
Mar18-04, 04:31 AM
Tried implenting this using Palpatines equation but still cant get it to work right. The ball starts off correct initially then reaches a maximum height and then carries on going up and down in a sin wave like motion and never comes back to the groud.

I dont know as to whether the angular velocity should be reduced or not. If I just reduce it by a certain amount each time step the flight looks a lot better although the ball does not travel as far as it maybe should.

Is there any other forces applied to the ball that reduce the angular velocity? maybe I should just reduce it by a constant value or maybe base it on another factor? In both situations the ball also flies a lot higher than it should.

Once the ball is hit the initial values for the forces are 3N for the magnus and 1.4 for the drag, do these seem ok?


"Please note that at lower velocities the drag is NOT proportional to the square of velocity"

Could this be causing a problem. Should I change the equation when the velocity goes below a certain threshold?

Thanks alot for your help
Paul

Michael D. Sewell
Mar18-04, 02:04 PM
Try this website:
www.aeroballisticsonline.com

There are a couple of typos in the charts, but they're pretty obvious so they probably won't give you any problem. This site deals with velocities that are higher than what you need, but it should help you quite a bit. The math for these problems is cumbersome, but this is the method currently in use (numerical integration). The coefficient of aerodynamic drag varies greatly with velocity in high powered rifle bullets especially near mach 1. It won't change anywhere near as much for your golf ball. I said that the drag was not proportional to the square of velocity; it is also not directly proportional to velocity. It lies in between the two.
www.remington.com has a 30 day free trial on ballistics software. Also, try www.eskimo.com/~jbm or www.snipercountry.com I've done a lot of shooting, and I have a good working knowledge of the practical application of these concepts. If I can be of any further help to you, let me know.

-Mike

Paul7
Mar18-04, 02:34 PM
Ideally I dont particulary want to deal with all sorts of numerical integration. The simulation needs to run in real time so the fewer calculations needed the better. Is there any type of approximations that would produce the required results. It doesnt have to be 100% physically accurate just look as near the the real thing as possible.

Michael D. Sewell
Mar18-04, 02:57 PM
I'm not an expert on computers or golf. If I knew of an easier way to solve your problem, I would certainly tell you about it. The math isn't difficult, just a little time consuming. -Mike

Michael D. Sewell
Mar18-04, 03:06 PM
You might ask Russ Watters for a short cut or a swag, I'm sure he is pretty sharp on air flow at low velocities. But, be forewarned, he is also "afflicted with mathematics" and probably won't be too sympathetic about you not wanting to do numerical integration
-Mike

jamesrc
Mar18-04, 03:20 PM
Paul7,

Would you mind posting some of your pseudocode and/or the actual code you're using (also what language you're using)? If so, I'd be willing to take a look at it for you (without speaking for others, I'm sure they would too).

Paul7
Mar19-04, 03:29 AM
Thanks alot Jamesrc that'd be great. My code can be found at:

code (http://www.3dreal.co.uk/project/code.txt)

Its written in C. Should be pretty easy to follow even if your not familiar with it. The idle function is part of OpenGl that is used to update the display as often as possible but dont really need to worry about that.

If it is run just using the gravitational and drag contribution it works fine. Its when I add the magnus force that the flight goes crazy!

Thanks Paul

Chen
Mar19-04, 03:34 AM
w = Simulation.rps;
The RPS is the frequency of the rotations of the ball, it's not the angular velocity.

\omega = 2\pi f = \frac{2\pi}{T}

So the code should read
w = 2 * PI * Simulation.rps;

(If the balls rotates twice per second, the period of its rotations (T) is 0.5 second, i.e it takes him half a second to rotate fully. If the ball rotates fully in half a second, a given point on it traverses 360 degrees (2\pi radians) in half a second. From there we find the angular velocity.)

Paul7
Mar19-04, 04:59 AM
The simulation.rps is already in radians per second, its defined in another section of code earlier. Its not very clear sorry!

Simulation.rps = (2 * PI * 3000) / 60;

where 3000 is the initial rpm.

Chen
Mar19-04, 05:47 AM
Sorry, I thought RPS was Rotations Per Second and not Radians Per Second. Anyway, this value doesn't stay constant, does it? Where's the part that you modify its value?

Paul7
Mar19-04, 05:54 AM
Yeah I know thats the thing, I`m not entirely sure on this. Ive tried just reducing it by a constant value which gives okish results but the ball doesnt travel any where near far enough and is far too high. For example it should really go about 200m where mine only goes about 100m and it should be about 20m high, mines about 50m.

How would you best suggest I affect it?

Chen
Mar19-04, 07:10 AM
If it goes too high and too short, the constant deceleration of the angular velocity is probably too small. Try increasing it and see how the results change. I have not studied rigid body physics (yet), so someone else will need to answer that question, although I'm going to do some searches and maybe find something... [:)]

Chen
Mar19-04, 07:35 AM
Not sure if this will help but I'll post it anyway:
http://nuttybar.drama.uga.edu/pipermail/dirgames-l/2001-September/010572.html
http://farside.ph.utexas.edu/teaching/329/lectures/node72.html
http://farside.ph.utexas.edu/teaching/329/lectures/node72.html (Why do baseballs curve?)
http://math.etsu.edu/MultiCalc/Chap1/Chap1-6/exer.htm (35-36)
http://lennon.csufresno.edu/~nas31/nsa/pballResults.html

Chen
Mar19-04, 07:52 AM
The magnus force is always perpendicular to the velocity, right? This means that the work it does is 0, since the the angle between the force and the road is 90 and cos(90) is 0. So if it does no work, it also can't be held responsible for any changes in the ball's energies, kinetic or otherwise. The rotational energy should be:

\frac{1}{2}I\omega ^2

So in fact, the magnus force does not increase or decrease the ball's angular velocity, since that would change its rotational energy as well.

As I said I did not study rigid body physics so I'm not sure how right this is, so if anyone wishes to correct me please do.

Paul7
Mar19-04, 10:38 AM
From what I know I dont think the magnus force does affect the angular velocity, maybe the drag has some effect? or maybe theres some other forces affecting it?

jamesrc
Mar19-04, 02:24 PM
The drag will slow the angular speed of the ball down over the course of its flight. I've read that a reasonable estimate of the resistive torque would be:
k*FM*r, where r is the radius of the ball, FM is the Magnus force magnitude, and k is a constant for which you can use 1/10. (So, if you were so inclined, you could say
\alpha = \frac{-kF_Mr}{I}
where I is the inertia of the golf ball.)

Note that the direction of the Magnus force is given by the cross product of the direction of the spin vector and the direction of the velocity vector. So the way you have your equations, you are assuming that ithe golf ball has "backspin" only, i.e. the direction of the spin is suck that the direction of the Magnus force is in the direction you have shown in your first post. That's fine, as long as you're aware of the assumption -- you're model does not take into account the effects of any potential "sidespin."

All of that said, I'm not sure what is going wrong with your simulation.
Your numerical integration technique is pretty crude, but as long as your time step is small enough, you should still get a reasonable simulation. I've run code based on yours in MATLAB, assuming that your library of vector functions (like Vector3D_crossproduct and Vector3D_length and Vector3D_scale) works properly (I don't know if you wrote those yourself or if they were from some predefined library). The only thing left is to make sure your initial conditions are reasonable.

P.S. are you still getting that sine wave effect? I didn't see any evidence of that. Again, it could be your sampling time.

Sorry if that's not much help.

ray b
Mar19-04, 10:28 PM
side spin gives the hook or slice from a strait path
angle of the club head is = to the angle of flight ,higher is shorter, lower longer distance traveled

Loren Booda
Mar19-04, 10:54 PM
How about a golf ball with extruded pips as opposed to customary inverted pips? Or a golf ball with multiple, adjacent and shallow sinusoidal channels (extending the analogy to a hard ball)?

Paul7
Mar20-04, 06:42 AM
Thanks for that jamesrc thats just what I needed, only thing is am not too up on all this rotation stuff so am not sure what the inertia of the golf ball is. Have had a look around and it says the moment of inertia of a ball is 2/5 m r^2. Is this the same thing? Tried using this and get a value of alpha of 700 and something so that doesnt seem right.

Dont think is a problem with my vector library as have been using it for years and works fine.

Am aware that am only dealing with backspin. Will try to extend it later once get the basic flight working correctly.

My initial conditions are. Ball radius = 0.022, ball mass = 0.045, initial rpm = 3000, angle hit at = 8 degrees, initial velocity 70ms.
Think these are right, seem to be roughly same as many sites I`ve looked at.

Dont get the sine wave effect if reduce the angular velocity by a constant value. Ball just doesnt fly far enough and goes to high.

Thanks alot for the help.

jamesrc
Mar20-04, 02:19 PM
You've got the right inertia formula (there's no reason to include the dimples in the golf ball in the inertia calculation since our model makes other assumptions that make that kind of thing negligible).

When I use your initial conditions with my simulation, I get a hang time of ~9.1 s, a peak of ~40m and a range of ~230 m.

That's using a constant angular acceleration. When I put in the decaying spin rate, that knocks off about 80 m of the range and halves the hang time.

I also forgot to mention before that I think you have the Magnus force twice as high as it should be (at least according to where I've seen the Magnus Force in a form like yours). So when I include that and use the decaying spin rate based on our crude model of that, I get a ~9m peak, a ~141.5 m range, and ~3.4s of hang time.

How do those results compare with yours?

One more note: you probably already realize this, but as long as you're not considering lateral forces on the ball, this is just a 2d problem. If you're going to include 3D effects later, you're approaching it the right way.

Paul7
Mar20-04, 03:17 PM
I always thought the magnus force was too big but there doesnt seem to be anything wrong with the calculation. Have just tried dividing the force obtained by 5 and running the simulation and it works almost as required it travels about 180m and a height of 17m, this is with no spin reduction.

Can you see anything wrong with the way I am calculating the magnus force?

Fm = (2 * PI^2 * pair * v * r^4 * w) / (2 * r)

pair = 1.29 kg/m^3
initially v = 70.9 m/s
r = 0.022 m
w = 3000 rpm = 314 rad/s

therefore

Fm = (2 * PI^2 * 1.29 * 70.9 * 0.022^4 * 314) / (2 * 0.022)

= 3.01N

the weight of the ball is only 9.81 * 0.045 = 0.44N therefore this does seem an awful lot. Throughout the whole flight of the ball the lowest the magnus force gets is 1.7N so this cant be right.

Cant see anything wrong in wat ive done though?

jamesrc
Mar20-04, 03:30 PM
Check here (http://carini.physics.indiana.edu/E105/spinning-balls.html) for a discussion on the Magnus force; that suggests that you have an extra factor 2 in your expression for the magnus force. I don't play golf, but I thought the numbers I was getting were reasonable. I mean, 140m is a heck of a drive, isn't it?

Chen
Mar20-04, 03:45 PM
That page uses the same formula as you do, except that it uses the rotation frequency and not the angular velocity. So the formula should be:

F_M = \frac{\pi pr^3v\omega}{2}

That would make your Magnus force about 6.3 times weaker.

jamesrc
Mar20-04, 06:22 PM
Originally posted by Chen
That page uses the same formula as you do, except that it uses the rotation frequency and not the angular velocity. So the formula should be:

F_M = \frac{\pi pr^3v\omega}{2}

That would make your Magnus force about 6.3 times weaker.

Exactly what I was trying to say, but I looked at Paul7's posted formula too fast and did not compare them correctly. This is the formula I used in my simulation, where I got the results I posted before.

Paul7
Mar21-04, 11:56 AM
Thanks alot for all your help its much appreciated. Works really well now.

Tryin to do the response of the ball from the collision with the ground. Any one have any ideas on this. I need it to take into account the spin of the ball and the friction between it and the ground.

Have got the folowing formula for a collision between two bodies:

J = -vr(e+1)/[1/m1 + 1/m2 + n.(r1 X n)/ I1 + n.(r2 X n)/ I2]

where
J is the impulse in the normal direction
vr is the relative velocity along the line of action
I 1 and 2 are either impulses or more probably the inertias of the bodies, book doesnt eplain very well

v1(after) = v1(before) + [J n + (mu J) t] / m1
v2(after) = v2(before) + [-J n + (mu J) t] / m2
w1(after) = w1(before) + {r1 X [J n + (mu J) t]}/Icg
w2(after) = w2(before) + {r2 X [J n + (mu J) t]}/Icg

and here Icg is the inertia around the center of gravity i think
and mu is the coefficient of friction

As the ground has an infinite mass and no real radius am presuming that I can just assign a value of 0 to these and then get an equation of:

J = -vr(e+1)/[1/m1 + n.(r1 X n)/ I1]

v1(after) = v1(before) + [J n + (mu J) t] / m1
w1(after) = w1(before) + {r1 X [J n + (mu J) t]}/Icg


Am not entirely sure how to calculate the relative velocity in the book I have it states that for two bodies:

vr = (v1-v2) X normal

do you think that this is correct?
so for my case I just use vr = v1 X normal?
also will the inertias I1 and Icg just be 2/5 m r ^2?

Chen
Mar21-04, 01:33 PM
What is v1, v2, w1 and w2?

As the ground has an infinite mass and no real radius am presuming that I can just assign a value of 0 to these
Actually both the radius and mass of the ground are infinite since they are a lot bigger than the radius and mass of the ball.

Paul7
Mar21-04, 01:36 PM
v1 and v2 are the velocities of object 1 and 2 respectively and w 1 and 2 are their angular velocities

Paul7
Mar22-04, 02:11 PM
Just realised that r1 and r2 are the vectors from the center of mass of the objects to the collision point and are not the radius's as I first thought, if thats any help!