You are Here: Home

# A programmer asks a (silly) physics question Tweet

Physics and electronics discussion, revision, exam and homework help.

Announcements Posted on
Enter our travel-writing competition for the chance to win a Nikon 1 J3 camera 21-05-2013
IMPORTANT: You must wait until midnight (morning exams)/4.30AM (afternoon exams) to discuss Edexcel exams and until 1pm/6pm the following day for STEP and IB exams. Please read before posting, including for rules for practical and oral exams. 28-04-2013
1. A programmer asks a (silly) physics question
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)?
2. Re: A programmer asks a (silly) physics question
LOL you said retarded.

3. 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).
4. Re: A programmer asks a (silly) physics question
Relative to the air, erm... probably. If the wind velocity isn't zero, then there will be an effect relative to the ground.

For a tennis game, it'd be interesting to know just how much the ball slows down across the court.
5. 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.
6. Re: A programmer asks a (silly) physics question
(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.
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.
Last edited by mf2004; 31-07-2012 at 12:07.
7. Re: A programmer asks a (silly) physics question
(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)?
One way of doing this numerically (for a "rough" calculation) is to
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.
8. Re: A programmer asks a (silly) physics question
(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.
Ah, yes thank you! that's what happens when you do math in the morning...
9. Re: A programmer asks a (silly) physics question
For slow moving projectiles you could assume that drag is proportional to speed, then you would be able to solve analytically.