Finding firing angle of a projectile with drag.

  • Context: Graduate 
  • Thread starter Thread starter SirHall
  • Start date Start date
  • Tags Tags
    Angle Drag Projectile
Click For Summary

Discussion Overview

The discussion revolves around determining the firing angle of a projectile to hit a target at a specified distance while accounting for drag or air friction. Participants explore the complexities of modeling projectile motion under the influence of drag, including the mathematical formulations involved and the challenges of implementing these in a computer simulation.

Discussion Character

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

Main Points Raised

  • One participant presents a formula for calculating the firing angle based on initial velocity and gravitational acceleration, but seeks to modify it to include drag effects.
  • Several participants inquire about the method of modeling drag, with one suggesting that drag is typically proportional to the square of the velocity, complicating the calculations.
  • Another participant discusses the need to account for how drag affects the projectile's motion differently along the X and Y axes, noting that the drag force would shorten the distance traveled.
  • There is mention of using differential equations to model the motion of the projectile under drag, with a focus on breaking down the equations into components.
  • One participant expresses the goal of creating a formula for an AI to accurately fire a projectile at varying target coordinates, acknowledging the complexity introduced by drag.
  • Another participant emphasizes that there is no simple formula for this problem and suggests that numerical methods may be necessary for solving the system of differential equations involved.

Areas of Agreement / Disagreement

Participants generally agree on the complexity of the problem and the necessity of accounting for drag in projectile motion. However, there is no consensus on a specific formula or method to achieve the desired calculations, with multiple competing views on how to model drag and its effects.

Contextual Notes

Participants note that the linear drag model may not be suitable for the intended purpose and that approximations must be justified. The discussion highlights the challenges of accurately modeling projectile motion in a real-world context.

SirHall
Messages
22
Reaction score
1
To find the firing angle to hit a target at a given distance using the initial velocity and gravitational acceleration, we use the formula:
Angle = Firing
XDist = Distance the target is from the gun along the X axis
YDist = Distance the target is from the gun along the Y axis

Angle = radtodeg(arctan((power(Velocity, 2) + sqrt(abs(power(Velocity, 4) - Gravity * (Gravity * power(XDist, 2) + 2 * YDist * power(Velocity, 2))))) / (Gravity * XDist)))

However, I am trying to figure out a way to tell the formula to also account for drag/air friction. My main attempt was to add the distance the projectile loses to the XDist and YDist values, however I think that my scripts aren't exactly correct.
Any help would be greatly appreciated.
 

Attachments

  • Angle to fire Projectile.png
    Angle to fire Projectile.png
    1.6 KB · Views: 721
Physics news on Phys.org
Welcome to PF;
How are you modelling the drag?
Are you trying to do this on a spreadsheet?

Note: you will find it much easier to use LaTeX markup to write equations.
There is a primer here.
 
Simon Bridge said:
Welcome to PF;
How are you modelling the drag?
Are you trying to do this on a spreadsheet?

Note: you will find it much easier to use LaTeX markup to write equations.
There is a primer here.
Well, my main attempt was to try:
XDist = XDist + (XDist * 'airFriction')
YDist = YDist + (YDist * 'airFriction')
But I realized that this would only work if air friction was linear and if Speed = Speed - friction and not in a rel world evironment where drag is affected by speed aswell.
So, I took a look at the drag/air friction equation and it was actually very similar to what I have.
I use ForceDrag = -Velocity*Constant
In this case 'Constant' = 0.47
Therefore as the projectile moves through the air, speeding up and slowing down, the drag would shorten the distance the projectile travels.
If it's okay, I'm basically looking for a formula that determines how much distance will be lost due to air friction so I can add that distance onto the end of where the target is aiming, to compensate for said air friction.
Thanks for the LaTeX suggestion by the way.

EDIT: Projectiles only 'speed up and slow down' along the Y-Axis, while they simply slow down on the X-Axis.
 
Last edited:
SirHall said:
Well, my main attempt was to try:
XDist = XDist + (XDist * 'airFriction')
YDist = YDist + (YDist * 'airFriction')
But I realized that this would only work if air friction was linear and if Speed = Speed - friction and not in a real world evironment where drag is affected by speed aswell.
If I understand you correctly, XDist is the horizontal distance traveled without air resistance?
...so 'airFriction would be between 0 and -1 in that model.

So, I took a look at the drag/air friction equation and it was actually very similar to what I have.
I use ForceDrag = -Velocity*Constant
Drag would normally be proportional to the square of the velocity... unless there is something about the circumstances where you can safely take a 1st order approximation?

In this case 'Constant' = 0.47
Because ... ?

Therefore as the projectile moves through the air, speeding up and slowing down, the drag would shorten the distance the projectile travels.
If it's okay, I'm basically looking for a formula that determines how much distance will be lost due to air friction so I can add that distance onto the end of where the target is aiming, to compensate for said air friction.
Thanks for the LaTeX suggestion by the way.

You should start off the equations of motion ...
##\sum \vec F = m\vec a \implies -mg\hat\jmath -\sigma v\vec v = m\dot{\vec v}:## ## \vec v(0) = u\hat\imath\cos\theta + u\hat\jmath\sin\theta,## ## \vec r(0)=x_0\hat\imath + y_0\hat\jmath##
... where ##\sigma## is the drag coefficiant for the object in question.
Something like that?

Breaking that into components:

##m\ddot x +\sigma (\dot x^2+\dot y^2)\cos\theta = 0##
##m\ddot y + \sigma(\dot x^2+\dot y^2)\sin\theta +mg = 0##
... giving coupled differential equations.

You have to solve the system to give an expression for the final position, then, for it to work the way you ask, you need to subtract off the solution without drag.
If the idea is to do a computer simulation where the changes in position are very small, then you may get away with a 1st order version of the solution.
However, without knowing what you are trying to do, there is little more I can do to help.
 
Last edited:
Well thanks for that. Yes a computer simulation is what I'm using this for.
For more detail, I'm trying to figure out a formula that'll allow an AI to fire a projectile at the correct angle to land on a target at any given distance(Assuming it is within range). If the target's y was always equal to the cannon's y this would be simpler, but the AI is programmed to fire at targets at any x and y coordinate(y points downwards). In my specific case, the 'Constant' or C was set to 0.47 as it was simply a distinct number and I chose it just to make sure I didn't confuse it with anything else. Though in Fd = -VC, 'C' would 'act as' the Drag Coefficient. Also yes, XDist is the distance between the cannon and the target but only along the x axis. (Pretty much the difference between their x positions)

Also looked at the drag equation again, and slightly daunted as to how would I find the distance lost in a simple formula.

Will be testing the distances between projectiles with and without the air friction applied.
 

Attachments

  • daum_equation_1479185531420.png
    daum_equation_1479185531420.png
    2.6 KB · Views: 715
So far it looks like you have target coordinates, and muzzle velocity. You want the program to calculate the angle to hit the target coordinate dead on.
There is no simple formula ... and you should justify any approximations you make (ie. the linear drag model is very bad for the proposed purpose.)

The AI would probably solve the system of DE's numerically - pick your favorite method - or you could hand-solve the equations to find an analytic solution.

Note: I very seldom read pics.
 
Simon Bridge said:
So far it looks like you have target coordinates, and muzzle velocity. You want the program to calculate the angle to hit the target coordinate dead on.
There is no simple formula ... and you should justify any approximations you make (ie. the linear drag model is very bad for the proposed purpose.)

The AI would probably solve the system of DE's numerically - pick your favorite method - or you could hand-solve the equations to find an analytic solution.

Note: I very seldom read pics.
I see, thank you very much sir.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
9K
  • · Replies 3 ·
Replies
3
Views
16K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
7K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K