Ballistics - calculating initial velocity

Click For Summary

Discussion Overview

The discussion revolves around calculating the initial velocity required for a projectile to hit a target at a known distance, considering the effects of drag. Participants explore both simplified models without drag and more complex scenarios that include drag, discussing the implications of these factors on the calculations.

Discussion Character

  • Exploratory
  • Technical explanation
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant describes a programming task to calculate initial velocity for a projectile, noting limited knowledge in physics and mathematics.
  • Another participant points out that incorporating drag complicates the problem, suggesting it transforms from a kinematics issue to a differential equation problem, and raises questions about the nature of drag as a force.
  • A third participant provides equations for projectile motion without drag, detailing how to calculate horizontal and vertical positions over time, and derives an expression for initial velocity based on these parameters.
  • One participant shares their experience of successfully creating a script without drag but acknowledges that it falls short of the target, emphasizing the need to include drag in the calculations.
  • Another participant discusses a simplified drag model used in the physics engine, proposing a formula for (de-)acceleration based on drag and suggesting a constant value for drag coefficient.
  • A later post requests a real-world formula for calculating initial velocity, given specific parameters related to the projectile and conditions of the launch.

Areas of Agreement / Disagreement

Participants do not reach a consensus on how to effectively incorporate drag into the calculations. There are multiple competing views on the complexity of the problem and the appropriate models to use.

Contextual Notes

Participants express uncertainty regarding the assumptions needed for the calculations, such as the exact nature of the drag force and the constants involved in the drag formula. There is also mention of limitations in the physics engine's ability to account for various factors affecting drag.

Einherj
Messages
3
Reaction score
0
Hello all,

This is my first post so be gentle. :smile:

I am programming a ballistics related script to a predefined physics engine. I am no physicist nor a mathematician so my knowledge in these things is quite limited.

To the point:
I need to calculate the initial velocity needed to shoot a projectile for it to land to known distance. Let's assume that we are using a flat surface. The physics engine uses a quite simplified drag formula which is something like this:
D = Dc * V^2, where Dc is the predefined drag coefficient for that projectile.

We know...
... the angle of the gun
... the distance to the target.
... the drag coefficient for the projectile

I would provide you with more information, but frankly I don't know what info is needed to make this work. Please ask me for anything you need to make this function.

Thanks for your responses in advance.
 
Physics news on Phys.org
Okaaay...It seems to me that the inclusion of the drag force severely complicates the problem and changes it from an elementary kinematics problem to a rather sticky differential equation problem. I don't know offhand how you'd attempt it without calculus. I've made a couple of assumptions:

1. D is a FORCE...right?
2. D always acts in a direction opposing that of the particle's velocity.

Using Newton's 2nd law, we can set up the equation of motion:

\vec{F} = -mg\hat{y} - D_c |\vec{v}|^2 \hat{v} = m\vec{a}

-mg\hat{y} - D_c |\vec{v}|^2 \left(\frac{\vec{v}}{|\vec{v}|}\right) = m\vec{a}

-mg\hat{y} - D_c |\vec{v}| \vec{v} = m\vec{a}

-mg\hat{y} - D_c \sqrt{v_x^2 + v_y^2} (v_x\hat{x} + v_y\hat{y}) = m\vec{a}

Now we can write a separate equation for the horizontal component and the vertical component (dropping the unit vectors). We can also express the velocities as the first derivatives of the corresponding particle trajectories, and the accelerations as the second derivatives of the particle trajectories:

-D_c \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2} \frac{dx}{dt} = m\frac{d^2x}{dt^2}

-mg - D_c \sqrt{\left(\frac{dx}{dt}\right)^2 + \left(\frac{dy}{dt}\right)^2} \frac{dy}{dt} = m\frac{d^2y}{dt^2}

These ODE's look really ugly to solve. They're coupled, and they're non-linear. So I'm stuck here. Am I over-complicating this? Does anyone else have any insight?
 
Without the drag, the differential equations are easy to solve, and the results are:

horizontal position:

x(t) = x_0 + v_{x_0}t = (v_0 \cos\theta)t

vertical position:

y(t) = y_0 + v_{y_0}t - \frac{1}{2}gt^2 = (v_0 \sin\theta)t - \frac{1}{2}gt^2

At a specified launch angle and initial velocity, the projectile is only going to spend a certain time airborne. In fact, it's vertical position will increase, reach a maximum, and then decrease until it hits the ground. To find this time airborne, we set

y(t) = 0 \Longrightarrow \frac{1}{2}gt^2 = (v_0 \sin\theta) t

t = \frac{2v_0 \sin \theta}{g}

Now, the question is, how much horizontal distance does the projectile traverse during this time airborne? If the target is a distance d away, then we WANT it to be equal to d:

x\left(\frac{2v_0 \sin \theta}{g} \right) = d

(v_0 \cos\theta)\left(\frac{2v_0 \sin \theta}{g} \right) = d

Solve for v0:

v_0 = \sqrt{\frac{gd}{2\cos \theta \sin \theta}} \ \ \ \ \ \ \ (\textrm{no drag})

Now you have the magnitude of the initial velocity in terms of the known parameters, which is what you need in order to write the program.
 
Thanks for those cepheid.

I have been able to create a script using the model without drag, but as expected the projectiles fall short from their target. So it's crucial to be able to add the drag factor in.

This is what someone else has concluded with the same physics engine:
I figured that it would be too complicated for the engine to calculate the reference area of the projectile, to use different fluid densities depending on the atmospheric pressure etc. I pretty much assumed that the makers had chosen to use a drag formula looking something like this: Fd = v² * k (where k is just one big constant representing all the constant elements).

Since F = m * a
we can set up a formula like this:
m * a = v² * k

So the formula for the (de-)acceleration of the projectile is:
a = (v² * k) / m

Since the mass of the projectile is constant we might as well let m be a part of k too. Sic:
a = v² * k

Now the only part left was to find out what k was. This can be found from the engine's config files and it seems that k is around -0.0005, but it varies between projectiles.

I don't know if that helps at all, but the more the merrier or something like that. :smile:
 
Last edited:
real world equivalent

The real world formula for calculating the initial velocity would help too.
If these facts are known:

- we are on earth
- the surface is flat
- mass of the projectile
- drag coefficient of the projectile
- angle of the gun
- landing distance

what would be the formula for calculating the initial velocity?
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 16 ·
Replies
16
Views
4K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 60 ·
3
Replies
60
Views
7K
  • · Replies 6 ·
Replies
6
Views
15K
  • · Replies 4 ·
Replies
4
Views
2K