**Introduction.**

Vehicles, like many other objects, follow Newtonian Physics. The principle equation is the Newton's Second Law, stating that ΣF = ma. That is, sum of all forces acting on the object is proportional to acceleration. It is, therefore, useful to know the exact value of m for a vehicle. Furthermore, in addition to any forces applied due to the engine, which can be disabled, and forces applied by the script, every vehicle is persistently acted on by two forces. These forces are weight and drag. Weight is constant, depending on mass and acceleration due to gravity. Drag varies based on vehicle velocity and drag multiplier. In general, drag can have rather complex dependence on velocity, but in simulations it is often represented with simple linear or quadratic dependence on velocity.

Based on Cerbera's detailed study Handling - Acceleration Experiments and believing that the drag model is going to be essentially the same, I have settled on quadratic drag. With that and above considerations, the goal of the study is to find the coefficients under which the expression guiding motion of the vehicle is given by a simple formula.

ma = F - kv² - mg [1]

Where F is the sum of all external forces applied to the vehicle by the script, k is the drag coefficient, m is mass of the vehicle, v is its velocity, a is the acceleration, and g is acceleration due to gravity.

**Methodology.**

For the testing, Shamal was used with the following handling data.

CODE |

SHAMAL 8000.0 10.0 75 0.0 0.0 -0.5 0.0 1 2.00 4.0 40.0 0.4 0.60 0.7 35.0 0.65 0.60 8.0 0.10 0.5 5.0 1.3 1.3 0.05 -0.14 0.0 0.5 1.2 0.8 0.8 1.5 3.0 45000 06004000 00400000 13 |

The mass is set to 8 tons, corresponding to fully loaded weight of Learjet 55, and drag multiplier is left at the default value. Engine thrust, at 32kN max total, and wing lift based on aerodynamic computations are added by the script to allow flight. Flight recorder code was added to the script, logging the time, aircraft position and velocity as reported by the script, and sum of all forces applied to the aircraft by the script. The last three are vectors with 3 components each, resulting in 10 entries per simulation tick. Time was logged in milliseconds, and the rest in units natural to the engine, being meters, meters per second, and Newtons respectively.

Collected data was analyzed in several stages. First, 2000 entries corresponding to roughly 70 seconds of flight time were used, discarding the first 30 seconds of simulation that included grounded time. Grounded time was discarded since there is no reasonable way to account for interaction forces between aircraft and runway.

Next, the acceleration data was derived from velocity data. Since acceleration is not tracked by engine internally, it had to be differentiated numerically, resulting in a fair deal of noise. The differentiation method used was 8th order central finite difference equation. Such high order was used to slightly average out effects of the noise, which, unfortunately, was only somewhat successful.

Finally, data was fitted to equation [1] by minimizing absolute χ² error to obtain effective mass and drag coefficient.

**Data and Results.**

First, it is important to note that time difference between script ticks is not consistent. Fortunately, it has no impact on forces, but it has to be taken into account any time a quantity is acquired by differentiation, as was done with acceleration in this study.

Time vs number of ticks.

Position and velocity data logged during flight.

Position. I was not trying to fly straight.

Velocity. It is somewhat noisy, which results in difficulties deriving acceleration.

Derived acceleration data. Lots of noise, but still usable.

The first round of fitting data produced g slightly over 10. Given the noise levels above and high average errors, it seems likely that the standard value g=9.8m/s² is being used by the game. Fixing the value at 9.8 and running the fits for m and k only, produced the following results.

CODE |

{m -> 15773.7, k -> 15.8415} |

With RMSE of roughly 20kN, or about 20% relative error. The RMSE is huge, which suggests that the values above aren't very precisely determined. Because the mass in handling is set to 8,000, and drag multiplier to 10.0, it seems plausible from above data that the values are actually 16,000 and 15.0 respectively, giving multipliers of 2.0 and 1.5 respectively.

There are two tests to this conjecture. First, we can extrapolate drag under assumptions that the above fit for the mass is correct. That is, determine what force is required to produce the observed acceleration once we take into account the weight of the object. The following drag distribution is produced.

Extracted drag.

Here, it is plotted against aircraft velocity. In red, D=kv² model is plotted with k=15.

Drag vs Velocity

It appears that assumption k=15 is well within error. The final test of the fits is to extract the weight of the aircraft by subtracting modeled drag and forces applied by simulation from the acceleration in z direction. In red is the expected weight under g=9.8m/s² and m=16,000kg.

Weight

Again, there is a lot of noise, but assumptions are well within the error.

**Conclusions.**

Based on Cerbera's earlier studies of effects of mass and drag multiplier on handling of the vehicles, and assuming that the same qualitative behavior holds for IV simulation, it is concluded that the mass of the vehicle, as relevant to the forces applied by the ScriptHook, is twice the mass stated in the handling.dat. While the drag multiplier used by the simulation appears to be 1.5 times the multiplier stated in handling.dat. It is not clear if these discrepancies are entirely due to the engine or are in part caused by artifacts of ScriptHook, but using the above multipliers for flight computations does produce correct results.

**Acknowledgments.**

Thanks are due to aru for developing GTA IV C++ Script Hook and to Cerbera for previous work on vehicle handling.