A programmer asks a (silly) physics question
Physics and electronics discussion, revision, exam and homework help.
-
Re: A programmer asks a (silly) physics question
The horizontal speed is only affected by air resistance yes...
As for how you'd calculate it... I do believe it would vary as the ball slowed down. The resistance is caused by a difference in pressure in front of the ball (higher) and behind (turbulent and lower). -
Re: A programmer asks a (silly) physics question
So I think from memory the best description of air resistance is that the acceleration is proportional to the speed squared.
And if that is the case, you can't really separate it into vertical and horizontal components so easily.
So basically you need to solve two differential equations which would be something like

and

Then solve for
and
using something like a runge kutta method.
Last edited by jk5430; 31-07-2012 at 10:52. -
Re: A programmer asks a (silly) physics questionThis won't work as it is. As you can see if you put g=0 and the x component of velocity= something then this would cause the ball to accelerate in the negative y direction (not what happens).(Original post by jk5430)
So I think from memory the best description of air resistance is that the acceleration is proportional to the speed squared.
And if that is the case, you can't really separate it into vertical and horizontal components so easily.
So basically you need to solve two differential equations which would be something like

and

Then solve for
and
using something like a runge kutta method.
I think this is right: (multiplied by sin & cos of the angles in the resistance bit)


also you put g in the x direction which is just plain wrong
EDIT: for small velocities you can use a term that's linear in velocity in which case you replace
by
it's an easier one to code so it might be worth trying that first.
Last edited by mf2004; 31-07-2012 at 12:07. -
Re: A programmer asks a (silly) physics questionOne way of doing this numerically (for a "rough" calculation) is to(Original post by beepbeeprichie)
Ok, so I almost feel embarrassed about asking this ( I studied A-level physics):
Is the horizontal acceleration of a ball through the air only retarded by air resistance?
How can I roughly calculate this value (say for a tennis ball)?
1. split the motion into horizontal and vertical components
2. the vertical (downwards) component is governed by Fy=mg - kvy2
3. the horizontal component is governed by Fx=-kvx2
This assumes the drag force is proportional to the velocity squared. (k is the constant)
See here for a discussion of this
http://en.wikipedia.org/wiki/Drag_(physics)
The two acceleration components are then equal to F/m
After that it's a simple matter of just setting up your "loop" time interval and calculating the horizontal and vertical velocity and displacement components using standard SUVAT equations.Last edited by Stonebridge; 31-07-2012 at 17:47. -
Re: A programmer asks a (silly) physics questionAh, yes thank you! that's what happens when you do math in the morning...(Original post by mf2004)
This won't work as it is. As you can see if you put g=0 and the x component of velocity= something then this would cause the ball to accelerate in the negative y direction (not what happens).
I think this is right: (multiplied by sin & cos of the angles in the resistance bit)


also you put g in the x direction which is just plain wrong
EDIT: for small velocities you can use a term that's linear in velocity in which case you replace
by
it's an easier one to code so it might be worth trying that first.
