Calculation of elevation: differential equations method

Looking for a versatile way of finding the needed elevation to hit the target that would not require pre-tabulated range-elevation data, I came up with this method. It integrates the system of differential equations of motion used by the game to simulate the projectile, and does it within one frame. It does accumulate error with time, but I found its performance more than satisfactory when used with tank cannons at distances up to 5 km, as well as helicopter cannons. Slower ammunition and higher distances generate a noticeable error. The script is meant to work with a laser rangefinder script, taking distance to target and relative target elevation from it (could be altered to take vector to target instead, doesn't really matter). I'm not sure I will be able to continue with this project, so I'm posting it here in case someone becomes interested.