How can I accurately plot the trajectory of a spinning ball on a spreadsheet?

In summary: I think it may be possible to do the same thing using those equations.But I'm not 100% sure.In summary, Tony is trying to find the trajectory of a tennis ball using the equations of motion. He has difficulty with integrals and is looking for help from someone who is more knowledgeable about the subject.
  • #1
RLst
3
0
Hi everyone,

Firstly, sorry if this seems a bit rushed, I don’t have much time in between shifts at work. You may have to refer to my links. But if needed, I will add more information later on.

I've been racking my head over this for the last month or so.

I’m kinda doing a private personal project where I need to create a spreadsheet that plots the trajectory of a ball i.e. tennis ball on a graph in the spreadsheet, where the x and y axes of the graph represents the x and y positions of the ball.

The ball needs to be subjected to 3 forces: gravity, air resistance and magnus force (ball spin).

For now, I will assume the spin on the ball will be constant during it’s entire flight path and I’m also ignoring what happens when it bounces on the ground.

I’d like to find the acceleration of the ball, then derive velocity from that, then the displacement/position. All values will be shown on the spreadsheet.

The inputs data will be:
  • Initial velocity of ball (m/s)
  • Initial angle of trajectory (degrees)
  • Spin applied on the ball (rad/s OR rpm)
  • Ball radius -> area (m)
  • Ball mass (kg
Here are 2 of the references I've been able to find that are the most simplest to me and have helped me the most:
1. Ball trajectory excerpt - Rod Cross
http://www.physics.usyd.edu.au/~cross/TRAJECTORIES/42. Ball Trajectories.pdf
2. Mangeshrai
http://mccabeme.myweb.port.ac.uk/projects2012/MangeshRai.pdf

I’m fairly certain my solution probably lies in the equations of motion in the first article, but unfortunately the math is just a step or two beyond me. I can feel that answer is so close but my trial and error efforts have so far given me results.

Also, the k constant/variable seems to be slightly different on each article, so makes it more difficult to wrap my head around.

Any help would be greatly, greatly appreciated :)

Thank you,
Tony
 
Physics news on Phys.org
  • #2
You'll want a simpler model then - say: modelling weight W, drag D, and magnus effect M ... drag depends on velocity, and magnus effect depends on spin.
Decide on what models you want for those ... say: if +y is up and motion is restricted to the x-y plane:
##\vec W = -mg\hat\jmath##
##\vec D = -\sigma v \vec v## (quadratic drag)
##\vec M = k\vec S\times\vec v## ... this give a lift force perpendicular to velocity ##\vec v## and spin ##\vec S##.
##k## and ##\sigma## are the strength of the effect, which you include empirically or just tweek until it feels right.
Commonly ##k = \frac{1}{2}\rho C_D A##... but then ##C_D##, the coefficient of drag, becomes the empirical parameter.

After that there is just the initial condition ... the velocity and position at time = 0 - and ##\sum \vec F = m \vec a##.
Which you want to work as a difference equation for the computer simulation.
 
  • Like
Likes RLst
  • #3
Hi Simon, thanks for your input. I've seen those formulas in that kinda format somewhere before when I was doing research, so definitely on the right track.

Unfortunately some of the things and symbols in your reply is a little bit over my head... but I'll do my best to try and understand.

FYI, my level of maths and physics is maybe year 11 high school (Australia) @ B or C+ grade, so not the best. Sorry, you might have to dumb down some concepts for me to understand.

So first of all, yes, +Y is up and motion is restricted to the XY plane. X+ is right and so on etc.

Pretty much everything is solved and completed and in plain sight in the first article "42. Ball trajectories".

I can input the initial angle, initial speed, ball mass, etc and get drag and magnus forces... but how do you determine how much displacement or velocity change when a certain x amount of drag or magnus force is applied on the ball?

Since F = ma ∴ a = ##\frac {F}{m}## right?

Then I think my friend said to get velocity from acceleration, you need to integrate... which for me is my roadblock. I can maybe do basic year 10 integrals with some revision, but integrals of gravity+drag+magnus all combined is just way beyond me at the moment.

Ultimately, I just need vx, vy and then the corresponding displacement x, y equations (with reference to time) that I can input into my spreadsheet.
The equations will be something like this:
vx(n) = blah.blah.v(n-1).t - this.that.v(n-1) cos θ...

Attached is what my spreadsheet looks like so far.

I got it off the web somewhere, but the original only took into account gravity and drag, no magnus force.
This is pretty easy since the equations are just the basic physics formulas you see in textbooks i.e. v = at, s = v + at2, etc.
But as soon as I tried to add magnus force to it, it becomes insane and I can no longer keep up with the math.

In the second article I linked (Mangesrai), there was a few equations on page 50. I tried to input the monstrous equation 6.12 and the result was the dotted curve as seen in my spreadsheet. However, adjusting the spin parameters on the spreadsheet essentially does nothing.

In the article it references tait variables of k1 and k2... I just don't get what this is talking about. Also, this only yields the displacement and not velocity at time t.

Simon Bridge said:
After that there is just the initial condition ... the velocity and position at time = 0 - and F⃗ =ma∑F→=ma→\sum \vec F = m \vec a.
Which you want to work as a difference equation for the computer simulation.

Not sure what you mean here, don't quite understand the maths notations. Are you saying I should find all the various forces separately and then just subtract them accordingly? Then convert to acceleration, velocity and finally displacement?

Few other things:
• Cd for a tennis ball is 0.55 according to my first link, so I'll set that as a constant and go with that for the whole project
• For tennis balls there are no chaos drag theory thingy happening where once the ball reaches a high enough velocity, the drag force goes down significantly. A tennis ball would never reach those speeds on court and also I think the fuzz on it prevents such phenomenon from happening.
• Tennis ball is 67mm in diameter and mass of 57gm.
 

Attachments

  • Screen Shot 2016-01-22 at 03.55.17.png
    Screen Shot 2016-01-22 at 03.55.17.png
    42.1 KB · Views: 918
  • #4
RLst said:
Hi Simon, thanks for your input. I've seen those formulas in that kinda format somewhere before when I was doing research, so definitely on the right track.

Unfortunately some of the things and symbols in your reply is a little bit over my head... but I'll do my best to try and understand.

FYI, my level of maths and physics is maybe year 11 high school (Australia) @ B or C+ grade, so not the best. Sorry, you might have to dumb down some concepts for me to understand.
... or you may have some learning to do ;)

So first of all, yes, +Y is up and motion is restricted to the XY plane. X+ is right and so on etc.

Pretty much everything is solved and completed and in plain sight in the first article "42. Ball trajectories".

I can input the initial angle, initial speed, ball mass, etc and get drag and magnus forces... but how do you determine how much displacement or velocity change when a certain x amount of drag or magnus force is applied on the ball?
... OK so you already have a way to find the forces ... force is a vector though, so you need magnitude and direction for this to work.
So let's say ##\vec W## = weight (this is the force of gravity on an object), ##\vec D##=drag, and ##\vec M##=magnus

Since F = ma ∴ a = ##\frac {F}{m}## right?
... that is correct if F is the total force vector and a is the acceleration vector.
Properly, for your case: ##\vec W + \vec D + \vec M = m\vec a##
In my prev notation, I was using i,j,k to indicate unit (magnitude 1) vectors pointing along +x,+y, and +z respectively. The "^" on top indicates a unit vector, where an arrow or boldface indicates a regular vector. If you don't know about vectors and vector components, you should stop here and revise: you cannot proceed without that knowledge.

Then I think my friend said to get velocity from acceleration, you need to integrate... which for me is my roadblock. I can maybe do basic year 10 integrals with some revision, but integrals of gravity+drag+magnus all combined is just way beyond me at the moment.
You only need things in the form of a difference equation ... so if T is a small time interval you can use the kinematic (suvat) equations.
You may just want to try modelling basic ballistic motion to start with, to get used to the methods.

If you decide on a small time interval T, and look at times ##t=0,T, 2T,3T,\cdots ,nT, \cdots , NT## so we have N+1 points of time, which you put in cells in your spreadsheet, Then you can get the next velocity from the previous one by doing ##v_{n+1} = v_n + a_n T##
Here ##v_{n}## is shorthand for ##v(t_n)## and ##t_n = nT: n=0,1,2,3,\cdots, N## you follow?
For this to work, you need to know ##v_0## ... the initial velocity.

This is all magnitudes, so you have to do this for x and y components.
After that ##x_{n+1} = x_n + v_{xn} T##

This process is a form of numerical integration.

In the article it references tait variables of k1 and k2... I just don't get what this is talking about. Also, this only yields the displacement and not velocity at time t.
... you don't need to know, and I didn't look. The variables will be to account for the relationships between physical quantities - or just to tune the equations - and you can go right from acceleration-time data to displacement time data if you want: just use algebra to include the v-t step.
You want position-time though.

Concentrate on doing your own simulation - don't wast time trying to understand other people's.

Are you saying I should find all the various forces separately and then just subtract them accordingly? Then convert to acceleration, velocity and finally displacement?
Find all the forces separately, then take the vector sum of them, divide by mass, gets acceleration as a vector. From there find velocity and then position. That's not how I'd do it but it is probably the easiest way for you to think about it.

Few other things:
• Cd for a tennis ball is 0.55 according to my first link, so I'll set that as a constant and go with that for the whole project
• For tennis balls there are no chaos drag theory thingy happening where once the ball reaches a high enough velocity, the drag force goes down significantly. A tennis ball would never reach those speeds on court and also I think the fuzz on it prevents such phenomenon from happening.
• Tennis ball is 67mm in diameter and mass of 57gm.
OK - so you also need the density of the ball. The area A in the drag force equation is ##A=\pi r^2## ... but you seem to have a better drag equation for a tennis ball so use that.
The main thing is to remember that forces are vectors.
 
  • Like
Likes RLst
  • #5
Simon Bridge said:
... or you may have some learning to do ;)
Thanks Simon, that's what I'm here for ;)

Simon Bridge said:
... that is correct if F is the total force vector and a is the acceleration vector.
Properly, for your case: ⃗W+⃗D+⃗M=m⃗aW→+D→+M→=ma→\vec W + \vec D + \vec M = m\vec a
In my prev notation, I was using i,j,k to indicate unit (magnitude 1) vectors pointing along +x,+y, and +z respectively. The "^" on top indicates a unit vector, where an arrow or boldface indicates a regular vector. If you don't know about vectors and vector components, you should stop here and revise: you cannot proceed without that knowledge.
I have a ok understanding of vectors so shouldn't be a problem. What I'm doing though is splitting up the forces into x and y components for each force with sin and cos, and solving each component of the force vector separately.

Simon Bridge said:
You only need things in the form of a difference equation ... so if T is a small time interval you can use the kinematic (suvat) equations.
You may just want to try modelling basic ballistic motion to start with, to get used to the methods.

If you decide on a small time interval T, and look at times t=0,T,2T,3T,⋯,nT,⋯,NTt=0,T,2T,3T,⋯,nT,⋯,NTt=0,T, 2T,3T,\cdots ,nT, \cdots , NT so we have N+1 points of time, which you put in cells in your spreadsheet, Then you can get the next velocity from the previous one by doing vn+1=vn+anTvn+1=vn+anTv_{n+1} = v_n + a_n T
Here vnvnv_{n} is shorthand for v(tn)v(tn)v(t_n) and tn=nT:n=0,1,2,3,⋯,Ntn=nT:n=0,1,2,3,⋯,Nt_n = nT: n=0,1,2,3,\cdots, N you follow?
For this to work, you need to know v0v0v_0 ... the initial velocity.

This is all magnitudes, so you have to do this for x and y components.
After that xn+1=xn+vxnTxn+1=xn+vxnTx_{n+1} = x_n + v_{xn} T

This process is a form of numerical integration.
Yep, this is what I ended up doing. I used your simplified WDM method and it seems to work well. I calculated the forces, one for x components, one for y components... added them up, divided the whole thing by m, then used the suvat equations as you mentioned to get ##\vec v## and ##\vec s##. Everything is plotted on a graph showing the trajectory of the ball.
Everything seems to work well. . I may post of the spreadsheet later.
I did had slight difficulty finding good k and σ values, but got there eventually through trial and error as you mentioned.
Ideally would've like to use the formulas and values that have been worked out by other people, so that the simulation is as real world as possible. But my attempts were futile and kept coming up with unusual results.
My main concern is the accuracy. If time interval ##T## is relatively large, the results get a bit inaccurate. If I decrease ##T##, then it becomes more accurate at the expense of computational power. My project does require the least amount of CPU usage as possible... but it should suffice for now.

Simon Bridge said:
... you don't need to know, and I didn't look. The variables will be to account for the relationships between physical quantities - or just to tune the equations - and you can go right from acceleration-time data to displacement time data if you want: just use algebra to include the v-t step.
You want position-time though.

Concentrate on doing your own simulation - don't wast time trying to understand other people's.
Gotcha, good to know.

Simon Bridge said:
Find all the forces separately, then take the vector sum of them, divide by mass, gets acceleration as a vector. From there find velocity and then position. That's not how I'd do it but it is probably the easiest way for you to think about it.
Can I ask how you would go about doing it? Would your method do away with the inaccuracies of large T time intervals?

Simon Bridge said:
OK - so you also need the density of the ball. The area A in the drag force equation is A=πr2A=πr2A=\pi r^2 ... but you seem to have a better drag equation for a tennis ball so use that.
What is the density of the ball in this case, and why would I need it? I have the initial velocity + angle of the ball. There is no bounce or rebound to take into effect (yet).

Simon Bridge said:
The main thing is to remember that forces are vectors.
Yes, I do realize this. In my first post I simply wrote the variables without notations etc. But I do realize that each force, does have a magnitude and direction. I'm breaking them down into x and y components in my case as I think it's easier for my project.
 
  • #6
RLst said:
What I'm doing though is splitting up the forces into x and y components for each force with sin and cos, and solving each component of the force vector separately.
You'll have found that the x and y components depend on each other when air resistance is not neglected.

Everything seems to work well. . I may post of the spreadsheet later.
There will be people around interested in it.
I don't use spreadsheets for simulation since GNU-Octave is free. Matlab and Mathematica get used a lot too.

I did had slight difficulty finding good k and σ values, but got there eventually through trial and error as you mentioned.
Ideally would've like to use the formulas and values that have been worked out by other people, so that the simulation is as real world as possible. But my attempts were futile and kept coming up with unusual results.
... calculations by other people will be assuming things specific to their models - to be accurate to life you should measure them. You have access to a tennis ball.

My main concern is the accuracy. If time interval ##T## is relatively large, the results get a bit inaccurate. If I decrease ##T##, then it becomes more accurate at the expense of computational power. My project does require the least amount of CPU usage as possible... but it should suffice for now.
It is common to do initial models in a script language like Matlab, just to get the maths right - then do high detail maths using a programming language like C++. There are also a lot of tricks for reducing the computation power needed. Even with all those it is not uncommon to run a program overnight to get a few minutes simulation.

Can I ask how you would go about doing it? Would your method do away with the inaccuracies of large T time intervals?
Whole University papers are taught on the subject.
I'd try to use matrix methods... I'd normally work through the error due to finite time-steps by getting a bigger computer xD but there are tricks like having a variable time-step: shorter for times of high curvature.

What is the density of the ball in this case, and why would I need it? I have the initial velocity + angle of the ball. There is no bounce or rebound to take into effect (yet).
If you were to calculate the drag from the drag equation, like you said you wanted, then you'd need the density of the ball because it is in the drag equation.

But it looks like you've done well with what you know now.
 
  • Like
Likes RLst

What is the effect of spin on the trajectory of a ball?

The effect of spin on the trajectory of a ball is dependent on the direction and magnitude of the spin. When a ball is spinning, it creates a lift force that can cause the ball to curve in the direction of the spin. This is known as the Magnus effect. The greater the spin, the greater the lift force and the more the ball will curve.

How does backspin affect the trajectory of a ball?

Backspin is when the top of the ball is spinning towards the back of the ball. This creates a high-pressure zone on top of the ball and a low-pressure zone on the bottom, causing the ball to rise and stay in the air for a longer period of time. This results in a higher trajectory for the ball.

What happens to a ball's trajectory when it has side spin?

When a ball has side spin, it creates a sideways force that causes the ball to curve in the direction of the spin. This is known as the sidespin effect. The amount of curve will depend on the direction and magnitude of the spin. This type of spin is often used in sports like tennis and baseball to create more unpredictable shots.

Can a ball's trajectory be affected by both backspin and sidespin?

Yes, a ball's trajectory can be affected by both backspin and sidespin. This is known as a combination spin. The resulting trajectory will depend on the direction and magnitude of both spins and can result in a curved path in multiple directions.

How does air resistance affect the trajectory of a spinning ball?

Air resistance, also known as drag, can have a significant impact on the trajectory of a spinning ball. As the ball moves through the air, the air resistance acts in the opposite direction of the ball's motion, causing it to slow down and ultimately fall to the ground. The amount of spin on the ball can also affect the amount of drag it experiences, with more spin resulting in more drag and a shorter trajectory.

Similar threads

Replies
14
Views
1K
Replies
1
Views
794
Replies
6
Views
1K
Replies
25
Views
2K
Replies
1
Views
939
  • Advanced Physics Homework Help
Replies
1
Views
2K
Replies
36
Views
20K
Replies
4
Views
7K
Replies
6
Views
712
  • Classical Physics
Replies
20
Views
1K
Back
Top