AKA, "Am I doing this right?!"
Note: I promise I didn't actually multiple post this many times, I'm just making use of the divider as a logical separation between edits!
So, some background:
I'm currently doing some design work with pneumatic rifles, and I want to actually go about this the *right* way - that is to say, I want to actually put some engineering skills to work - and hence want to describe the system mathematically.
The gas under consideration is compressed air, and the temperatures follow the normal range of ambient outside temperatures in North America during anything but winter - aka, roughly 0-30 degrees centigrade. SO, given the fact that projectile acceleration to approximately 315 feet per second (I apologize in advance for the wankered units!) takes extremely little time, I thought it appropriate to assume an adiabatic condition. Since the temperature and pressure range are both moderate, I therefore grabbed the formulae for ideal gas adiabatic expansion and work from hyperphysics.
After a little manipulation, I wrote an expression for the optimum length of a barrel for ideal adiabatic expansion to equalize with the ambient atmospheric pressure. I then substituted this equation for length in the adiabatic WORK equation (again, from hyperphysics) to get the final volume. I was then left with an implicit function in terms of initial pressure and initial volume that described the conditions necessary to accelerate the projectile (3.2 grams) to its final muzzle energy (130.5 lbs-in).
Then, I fired up MATLAB and started writing a little bit of code...
syms x y;
syms p0 v0 A k pAtm W0;
outputVars = [x y 1.400 .3685 14.696 130.5];
workingVars = [p0 v0 k A pAtm W0];
bL = v0 / A * (( p0 / pAtm) ^ (1 / k) - 1);
deltaW = p0 * v0 * ((v0 + A * bL ) ^ (1 - k) - v0 ^ (1 - k)) / (1 - k) - W0;
ezBarrel = subs(deltaW,workingVars,outputVars);
ezplot(ezBarrel,[0 850 0 15]);
...just to see that everything was working out nicely.
WELL, my code told me that .3117 cubic inches of 200psi compressed air should be enough. That, in turn, gives a barrel length of 4.68 inches - which would be completely fine, if I were sure it was correct! But I'm not, so I fired up the Gas Gun Design Tool (GGDT - nifty little app) with settings that as closely approximated this situation as the program would allow!
For example, I used a burst disc valve with a 100% flow coefficient; barrel diameter, valve diameter, and reservoir diameter were all equal, etc etc. I then had GGDT optimize for barrel length - essentially repeating my former calculations with different programming and fewer assumptions.
The results: ideal barrel length of 7.14 in (instead of 4.68), end muzzle velocity of 238 feet/second (instead of 315), with roughly the same initial volume and pressure. It did, however, give me an energy efficiency of only 13%.
My question is: should I assume the discrepancy in the numbers is due to the differences in the situations being described between the GGDT and my numbers, or is there some gross error that I've missed?
Also, if it would help, I can post up my calculations so you can all see the equations (and how I got them).
Merged post follows:
Consecutive posts merged*cough* *cough*
I think I figured it out... I missed an exponent when copying an equation down. I should say, I missed it TWICE, since I double-checked everything I was doing. I won't know for sure until I get home from work, but the barrel length is MUCH closer (7.3495 inches).
If anyone wants to see the derivations and such (or the end curve), let me know and I'll post them up; otherwise, consider the question answered!
*doh!*
Merged post follows:
Still no diceWell, re-ran the numbers in GGDT. They still don't jive with each other. I tried a number of different data points; it seems like the lower the pressure, the more accurate the velocity prediction is, and the less likely the barrel prediction is. I also checked again to make sure that I entered everything into MATLAB correctly, and I did.
So, the question still stands.
Merged post follows:
My mathsMy maths:
Okay, managed to turn it into a .pdf:
Derivation