# Air resistance in javelin throw

This topic is 3739 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, In the spirit of the olympics I decided to go for a 2D game of javelin throw. The basic physics of a flying object is of course simple, but I'm getting a little headache with air resistance. As air resistance is critical factor in realistic javelin simulation (unlike in e.g. hammer throw) I would like to get it right. The general overview of the physics is explained in http://ffden-2.phys.uaf.edu/211_fall2002.web.dir/Daniel_Lenord/javelin.html, but that does not include any calculations. I am modeling the javelin as a simple line with - mass (800g) - location of mass center (locX, locY) - headLength (meters from mass center to head) - tailLength (meters from mass center to tail) - angle (in radians) - speed (speedX, speedY) Here you can assume zero wind, so the speed is equal to air speed. I probably also need to add the location of the center of pressure, which is described in the above article. I guess this could be represented as a single number describing its distance (plus or minus) from the mass center. The problem can be divided in two parts: 1) Calculating the size of the force created by air resistance Due to the shape of a javelin there is of course a big difference in whether it is headed directly to the wind or something else. The area of the surface varies greatly depending of the position of the javelin in relation to its air speed. This means that the angle of the javelin must have a part in the formula calculating the size of the force. This is more like a mathematical problem, which I am more likely to be able to solve myself than the other part of the problem. 2) Calculating the effect of the force For realistic simulation it is not enough to only calculate the effect of the force to the overall speed, but also its effect to the angle has to be calculated. I don't have any solid clue on how to deal with this. A general solution is probably very complicated, but I'm hoping to cut some corners as we only need to deal with a single known object rather than a general shape. Any help is appreciated.

##### Share on other sites

Step 2 is a simple torque calculation:
1. calculate center of mass for the javelin (do this once during init, not every frame). You can simply make up some value here - if you know approximately where the center of mass is located for a javelin (I think around 1/3rd of the length from the front approximately).

2a. each simulation step, calculate the torque at N evenly distributed locations (try low values such as 5, then increase if the result looks bad) on the javelin, and sum their effects on rotational acceleration
OR
2b. find a closed form expression of 2a, with N set to infinity

3. apply the rotational acceleration

And: good luck to Pitkämäki! :)

##### Share on other sites
Hi Fluster,

Not sure if this will help, or hinder you, but this paper...

http://www.leshatton.org/Documents/jav2007a_paper.pdf

...includes full equations of motion for a javelin during flight. It may be way over the top for your needs in a 2D game, but might give you some useful pointers.

Will

##### Share on other sites
The force of fluid (air) resistancec is directly propotional to the square of the speed of the moving object.

Ie:
F = Dv^2

where D is a constant depending on the cross section area, shape and other properties of the flying object.

We know that force equals mass * acceleration and acceleration is the time derivative of velocity, so we get:
F = ma
ma = Dv^2
m*(dv/dt) = Dv^2

We end up having a differential equation. The problem is that using a simple solving method like Euler's method (Ie, your once per frame multiplication) for this equation, we end up having very unstable results. So, in order to get this equation properly solved, a more powerful integration technique is needed. There are lots of numerical integration techniques out there, Runge-Kutta being one of the stablest and widely used.

In javelin throw, the torque (rotational) effects of air resistance on the javelin are probably important too. Solving these may be a bit trickier. A good solution could be solving a line integral along the javelin, but this may be a bit tricky to solve.

Summa summarum: realistic air resistance modelling needs sophisticated numerical integration techniques. Whether or not your game requires a realistic model is another issue.

-Riku

##### Share on other sites
To follow up Diku's post, D also includes properties of the fluid. So, based on some drag coefficient, CD, if you have a coefficient (and you could use something small, say 0.05 for a javelin I think), you could approximate a drag force as:

Drag = 0.5 * CD * rho * Sref * Rel_Speed2

Where rho is the air density, Sref is a reference area (say cross section area of shaft of javelin), Rel_Speed is the relative air speed (== speed in your case), and CD is the drag coefficient.

The direction of the drag force is exactly opposite the velocity of the javelin, regardless of javelin orientation. (Er....this is so-called "Wind Coordinates". There are other approaches, e.g., body coordinates, and the paper referenced by WillC for example might represent things in body coordinates...I didn't check. But, wind coordinates are reasonably easy to deal with.)

Drag acts through a point that might be tricky to determine. The paper that WillC mentioned might offer advice there. (For a sphere, or an airplane wing, it's easier to estimate this.)

Hope that helps!

##### Share on other sites
Thank you for all.

The level of realism in the simulation I'm aiming is such that I would not need to add any fake forces/effects to make the flight look good. Without air resistance I would need to do some tricks to make the javelin land head first as otherwise it would not change its orientation during the flight. I'm also planning to create a control system where the player needs to adjust both the angle of the javelin and the angle of the throwing force, and it would be essential that failing to get these right causes the throw to be poor in realistic way.

I have now managed to calculate the force created by air resistance. Both the paper referenced and the formulas given helped in this. A fact is that most of the time the javelin is not aligned directly along its air speed and the effect of air therefore affects from up or down creating lift and rotation. There is no need for me to calculate the locations of the center of gravity and center of pressure as they are quite strictly stated in IAAF rules. So I will just place them where they need to be.

I still need some help with the torque calculation. If I've understood right, the total force F created by air resistance equals to the sum of two forces of which one pushes the center of the gravity and the other creates rotation. If I knew the sizes of these two components, I could easily calculate the results, but how do I calculate how much of the force is divided in each of these two components?

##### Share on other sites
The torque of the air resistance is not a separate force. It is the very same force that contributes to the linear velocity. The torque can be calculated by computing the force at different parts of the javelin. You can fake this by calculating a few samples of force on different parts of the javelin. For realistic results, you'd need to calculate an infinite number of samples using numerical integration (which may prove to be mathematically impossible or not feasible).

You need to develop some kind of model that will approximate the force on different parts of the javelin and compute the torque from that. So, computing a single air resistance force is not enough.

-Riku

##### Share on other sites
Yes, I will have to iterate/integrate over the javelin, but I was wondering how I should calculate on a single point and how to combine the results. It is the same force generating the torque and linear velocity, but it is not trivial how much of the resulting kinetic energy is used in torque and how much to the linear velocity. These should sum up to the total kinetic energy generated by air resistance, right?

But when I thought it for a while, I think I found the correct solution. I only need to divide the force vector of air resistance to two components of which one is aligned with the javelin and the other perpendicular with. The aligned force goes directly to linear velocity and the other one creates torque. And finally, when I sum up the torque in all points, some of the force in different sides of the center of mass will neutralize each other. The neutralized force shall not of course dissappear, but it will become the component that generates net lift and so it will become the second component to contribute to the linear velocity.

And I will choose iteration over integration here. As I only have one moving object, I can afford very dense iteration over both time and the points of javelin.

1. 1
2. 2
Rutin
17
3. 3
4. 4
5. 5

• 9
• 9
• 14
• 12
• 10
• ### Forum Statistics

• Total Topics
633271
• Total Posts
3011161
• ### Who's Online (See full list)

There are no registered users currently online

×

## Important Information

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!