Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Calculating bullet velocity reduction over time

  1. Nov 16, 2012 #1
    I'm developing a 2 Dimensional iOS war game, so think guns bullets damage hit points etc. I'm trying to write a function that calculates the Velocity of a bullet at a certain distance, so that I can calculate the force of the bullet at a certain distance.

    So let's say the that Rifle A is firing Bullet A that weights 45 grains (0.002916 kg) with a muzzle velocity of 940 m/s.

    I know that my force at the muzzle is 1288 Joules. (940^2) * (1/2) * (0.002916 kg) = 1288 J.

    How do I determine the force 100 yards away from the muzzle? To simplify, let's ignore wind and say that air is just sitting still... Let's say my soldier is shooting at an enemy that's 100 meters away. How do I calculate the force that's hitting the enemy? I'm assuming I would need some equation that takes into consideration the bullet's reduction in velocity, so the bullet's mass (which I have) and possibly the size/dimensions for air resistence? Would I need the bullet's ballistic coefficient(BC)? Let's say for example this bullet's BC is 0.132. How would I calculate this?

    Let me know if you need any more information, thanks for looking.

    PS: This is a useful link, but I'm having trouble deciding what formulas to use: http://en.wikipedia.org/wiki/Ballistic_coefficient

    Very useful image:
    http://en.wikipedia.org/wiki/File:Effect_of_BC_on_Energy_Retained.jpg
     
    Last edited: Nov 16, 2012
  2. jcsd
  3. Nov 16, 2012 #2
    You may find this helpful.

    http://en.wikipedia.org/wiki/External_ballistics

    "The deceleration due to drag that a projectile with mass m, velocity v, and diameter d will experience is proportional to 1/BC, 1/m, v² and d²"

    "Due to the practical inability to know in advance and compensate for all the variables of flight, no software simulation, however advanced, will yield predictions that will always perfectly match real world trajectories. It is however possible to obtain predictions that are very close to actual flight behaviour."

    I am sure you can work out a workable approximation for your game though.

    There is also a balistic calculator here.

    http://www.jbmballistics.com/cgi-bin/jbmtraj-5.1.cgi
     
    Last edited: Nov 16, 2012
  4. Nov 16, 2012 #3

    K^2

    User Avatar
    Science Advisor

    First of all, 1288J is bullet's energy, not force. But, to a good estimate, damage is proportional to energy, so you can use bullet's energy to scale damage. You're on the right track.

    The bullet's velocity drops at a rate proportional to v². In other words, the equation of motion can be written down as v' = - kv². That gives you a solution for v(t).

    [tex]v(t) = \frac{v_0}{1+ktv_0}[/tex]

    Where v0=v(0), and t=0 is time bullet left the muzzle. k is coefficient specific to the bullet, so I'll talk about it further down. Of course, you want the velocity at a given range. You can integrate this equation to find position as a function of time.

    [tex]x(t) = \frac{ln(1+ktv_0)}{k}[/tex]

    And if you want time of flight for distance traveled x(t)=d, substitution into the above gives you the solution.

    [tex]t = \frac{e^{kd}-1}{kv_0}[/tex]

    Note that for small d, such that kd<<1, the above is approximately t = d/v0, which it would be if velocity was constant. As range increases, time of flight grows exponentially.

    Once you computed time of flight for the range, you can substitute t into formula for velocity and compute energy of the bullet at impact, which will tell you how much damage is inflicted in proportion to your base line.

    There are additional corrections you can make once you know time of flight. I don't know how detailed your game is, but you can compute bullet drop and wind correction from time of flight. Bullet drop is very straight forward. To a very good precision, you can assume that bullet is in free fall during time of flight. So if you find straight line impact point, the correction h from that is given by this formula.

    [tex]h = -\frac{1}{2}gt^2[/tex]

    Where t is time of flight and g is acceleration due to gravity. (Naturally, you'd have to come up with a good way to account for it if this results in bullet missing target.)

    Wind correction is also very similar. It's a little tricky explaining why this formula works, but the wind carries bullet off target by the distance a feather would be carried by the wind in time difference between actual time of flight and vacuum time of flight. In other words, if wind velocity is given by vector w, the correction vector r is given by this formula.

    [tex]\vec{r} = \vec{w}\left(t-\frac{d}{v_0}\right)[/tex]



    Alright. So all of this is great, but this leaves us with question of what the factor k is equal to. That will be different for every bullet. There are several ways of obtaining that factor.

    First, if you have ballistic computations for a bullet you are interested in, like from the ballistic computer linked above, you can try to find the value k that makes your results more or less agree with these of ballistic computer.

    You can also hunt down the ballistic coefficient for the ammo you are interested in. Ammo manufacturers tend to have that information. You can also try Wikipedia or just a straight up Google search for ballistic coefficients. Once you know ballistic coefficient B, you can use it to find bullet's drag coefficient Cd.

    [tex]C_d = C_G \frac{M}{B d^2}[/tex]

    CG is a pre-determined factor of the G1 model used by manufacturers. CG = 0.5191. M is mass of the bullet, and d is bullet's diameter. (You can use caliber for diameter, it's close enough.) Note that B is often given in lb/in², in which case, you want to use pounds for mass of the bullet and inches for its diameter. So check units. This is also why you want to compute Cd here and substitute the value in further rather than simplify it. It will prevent you from making mistakes on units.

    Since k is coefficient of acceleration, it's really given by Fd/(Mv²). Since we are using quadratic drag formula, this is going to simplify a bit.

    [tex]F_d = \frac{1}{2}\rho C_d A v^2[/tex]

    And therefore, we have equation for k.

    [tex]k = \frac{1}{2M}\rho C_d A[/tex]

    Here, ρ is the air density and A is the cross-sectional area of your bullet given by A = πd²/4. Note that here you want to use metric units for ρ, M, and d, which is why you want to substitute a value for Cd rather than the equation.

    If you find values for B in metric units, or convert them before hand, then of course, you can just simplify all these equations.


    I think that's everything you need, but post if you need anything else.


    P.S. If you absolutely cannot find the ballistic coefficient for your ammo, B=0.5 lb/in² is a good guess.
     
    Last edited: Nov 16, 2012
  5. Nov 19, 2012 #4
    Thanks for the help everyone. You have provided me with some excellent resources. I'll need some time to study this information, and program it into my application. I'll try to reply back with an update!

    Thanks again!

    Lamp
     
  6. Nov 19, 2012 #5
    I did find a spreadsheet with some brands/specs of ammunition with BC values. It's a good way to help me estimate basted on ammunition types/shapes/grains.
     
  7. Nov 19, 2012 #6
  8. Jan 10, 2013 #7
    Hi guys, my game is progressing very well! Here's a glimps of the game in action:

    https://www.dropbox.com/el/?r=/s/sf...ABNuWcYbfodXs2JMLely37u78tD0QUPFWQ4mpXqfP-6cA

    This is going to be one fun and addictive game! I haven't implemented the new physics yet, but I'm very close to the point where I can. My temporary cheap physics have been good enough for this past month or two of development, but soon the real deal will be in! Thanks again for your help guys
     
  9. Jan 25, 2013 #8
    Hey K^2. When calculating Drag Coefficient. Where you said "CG is a pre-determined factor of the G1 model used by manufacturers. CG = 0.5191." Does this CG value have any units? I'm using a B that has kg/m^2 rather than lb/in^2. And I'm using a d of m rather than in. Will that effect CG at all, or is it still 0.5191?

    Thanks
     
  10. Jan 26, 2013 #9

    K^2

    User Avatar
    Science Advisor

    No. CG has no units. So long as value you got for B has the same units as your mass and diameter, you are in good shape. So if B is in kg/m², diameter is in m, and mass of the bullet is in kg, you have exactly the same value for CG.
     
  11. Jan 26, 2013 #10
    Great, thanks!

    How will penetration work? I'll give an example. An M4 with a muzzle velocity of 885 m/s fires a 45 grain 5.56mm round at 50 yards towards its target. Through the physics equations you've provided I've determined that the Kinetic Energy is 930.6 J. I probably require way to many unknown variables to accurately determine the actual penetration of the target. For example: did the bullet hit bone, tissue, organs. What size bone, etc... I think this is where I'll make big estimations in order to greatly simplify penetration (since it's only a 2D game).

    Now that I have the kinetic energy calculated correctly, what do I need to know about penetration of the target in order to calculate the following example? -> "Well a FMJ round would completely penetrate the target, but a Hollow Point round does not penetrate the target. Its tip expands upon impact doing more damage and expend 100% of the Kinetic energy into the target thus doing more damage".

    http://en.wikipedia.org/wiki/File:Halvmantlad_.jpg
    6.5x55mm Swedish before and after expanding. The long base and small expanded diameter show that this is a bullet designed for deep penetration on large game. The bullet in the photo traveled more than halfway through a moose before coming to rest.
     
  12. Jan 26, 2013 #11

    K^2

    User Avatar
    Science Advisor

    I can suggest a very crude estimate. For each round, set up several threshold energies. You will probably want penetration, fragmentation, and through-and-through penetration for both fragmented and non-fragmented round. If the round went through-and-through, some predetermined maximum amount of damage is dealt, depending on whether it fragmented. Otherwise, the fraction of that damage proportional to fraction of energy available is dealt.

    Qualitatively, that's pretty close to what happens. Damage will be proportional to energy. Of course, you'd have to take into account whether you hit some important organ separately. Quantitatively, I'm not sure how much of data you'd need is available. You can probably find some info on target penetration. But gauging damage seems to be more of an educated guess.

    If you want to model it more precisely, I don't think I can help you. This is, basically, the extent of my knowledge on the subject.
     
  13. Jan 27, 2013 #12
    That makes sense. I appreciate the input. I can make something really cool out of this. An educated estimation is exactly what i'm going for here.

    Thanks a bunch!
     
  14. Nov 23, 2013 #13
    I'm hoping some can help me figure out the formulas posted by K^2. I'm inputting the data into Excel, but regardless of what I do, k is equal to 710.3603158 for any values of M and d other than 0. I've been trying to get this to work for several days now, without any luck, and would very much appreciate if anyone can point out my error.
     

    Attached Files:

  15. Nov 23, 2013 #14
    I don't have the time to dig into your excel sheet right now, but if you're looking to translate his formula's into excel I've already done that and would be happy to share it with you. This should save you a big headache!
     

    Attached Files:

  16. Nov 23, 2013 #15
    Thank you for your reply. I've tried out your Excel sheet, but it seems to have the same problem that mine does; changing the caliber and the weight of the projective does not have any effect on the result.
     
  17. Nov 23, 2013 #16
    When I change Grain (weight) my numbers are updating. But when I change caliber(diameter) the results do not update... It's possible K^2 made some generalizations to simplify things for us and as a result caliber won't be taken into effect here...
     
  18. Nov 23, 2013 #17
    Even so, it should be reflected in the velocity, which it isn't. I hope he'll get back to us.
     
  19. Nov 24, 2014 #18
    Hi! I found this thread searching for something similar and came upon this great answer, but I must add a question. How did you come to this solution? It looks an awful lot like the first equations general solution from here: http://en.wikipedia.org/wiki/Nonlinear_system#Nonlinear_differential_equations
    but I can't understand how you get it all together. As this thread still isnt all that old I decided to ask here instead of a new one.
    Which is the step by step solution to find this? I took a class in differential equations years ago and even dug up my old book but I can't make anything sensible out of this.
    If anyone knows, please explain to me.
    Thanks!
     
  20. Nov 24, 2014 #19
    In reality the drag coefficent also depends on velocity
     
  21. Nov 24, 2014 #20
    I dramatically simplified my solution here. I'm now using what I call "Voodoo Ballistics Physics". Here is the source code in its current form if you're interested (C#). I'm basically giving weapons some values like "Damage, Penetration, Fragmentation, etc", and then just doing an extremely simplified version of the calculations. I also give objects (such as walls, windows, cars, etc) properties that determine how much bullet resistance they have per pixel. Let me know if you have any specific questions I can answer about the source code.

    https://www.dropbox.com/sh/1c4ppfi62xg5nea/AADZacqIn0mLb-tZk8FaJn3Ta?dl=0

    You'll mostly want to look at BulletTravel.cs, Library_BallisticsPhysics.cs, MyWeapon.cs, MyBullet.cs, and BulletBFObjectCollision.cs. The rest are useful as well. Basically how it works: Create an instance of class BulletTravel. Notice that when you create it calls a function named " ExecuteBulletTravel" which literally does everything for you (notice it calls a lot of functions in Library_BallisticsPhysics.

    Look at the arguments in BulletTravel.cs (see below) It comes off as a little complicated but it makes sense when you think about it. I have two sourceLocation's, one for the actual bullet source location and another for where the bullet animation begins. I want the bullet to start more towards the center of the soldier but I want the animation to begin on the barrel of the gun. I had to do this so that if the gun barrel was accidentally sticking through a wall then he'd be accidentally shooting through that wall! You provide a destination location of where the soldier is trying to shoot to (whether it makes it there or not, maybe it hits a wall and stops). The destination Z position is a part of the simulated 3d environment in the 2d game. The numOfBullets is if you want to animate multiple bullets but only actually fire 1 real bullet (makes things look more dramatic and saves on CPU usage.

    public BulletTravel ( MySoldier soldierWhoShot, PointF sourceLocation, PointF sourceLocation_ForAnimations, PointF destinationLocation,float destinationZposition,int numOfBullets,bool doPlayAnimationCompletionSoundEffect )
    {
    .....
    }

    Here's a video of the gameplay as of October 2014:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Calculating bullet velocity reduction over time
  1. Bullet velocity (Replies: 3)

  2. Bullet velocities (Replies: 9)

Loading...