Well, both physics and mathematics have vanished into the nether regions of my brain, but you need (as I was taught more than 10 years ago):
A) <delta> s = v(0)*t + 1/2*a*t^2
'<delta> s' is distance (your gun's ceiling; the <delta> should be the Greek letter)
'v(0)' is the speed at t=o and is your upward speed (which is, if I'm correct, the muzzle velovity multipled by the sinus of the angle of the gun)
't' is time
a is acceleration (which when firing a shell upward becomes decelleration equal to the gravity 'g' which is 9.81 meters per second per second)
and
B) v(t) = v(0) + a*t
v(t) is your speed at time t
First you need to know the velocity of your shell as well as the angle of your gun.
Taking my Wesworld 25mm Model 1918 gun, it has a muzzle velocity of 715 m/s and a maximum elevation of 80 degrees.
The upward speed is muzzle velocity multipied by the sinus of 80 which gives us:
v(up) = 715 * 0.985 = 704 meters per second.
Next you have to calculate to see when the shell speed comes to 0 meters per second.
With the shell having an upward speed of 704 meters per second, you will get the next with formula B:
0 = 704 + - 9.8*t
moving the -9.8*t in fron of the '=' gives us:
9.8*t = 704
To get 't', you have to divid both sides by 9.8 which gives you:
t = 704/9.8 = 71.8 seconds
... so after 71.8 seconds, your shell has slowed down to 0 meters per second.
Now that you know 't', you can use it in formula 'A' which gives you
<delta> s = 704*71.8 + 1/2*-9.8*71.8^2 = 50,547 - 25,261 = 25,286 meters (= 82,959 feet).
One problem: I haven't taken drag into account (not sure how to incorporate that into the problem; I would have to look that stuff up somewhere) so the ceiling of the gun is much higher than it should be. So in a vacuum, with only gravity slowing the shell down, you will get this shell to 82,959 feet.
But when adding drag... I would have to look it up.
... but I think the best way to get the ceiling of your AA gun is by using Big Gun as I mentioned above cause I get the impression the drag formula is already incorporated into that program.
Walter
*_*