How many significant digits should I use for simulating aircraft equations of motion? I have coded the equations of motion in Matlab, and I am using the ode45 function to simulate the nonlinear dynamics of F/A-18 Hornet without any controller (just the airframe). I have given initial conditions as trim conditions.

d2r = pi/180;           % degree to rad

V       =  438.653328;  % Airspeed , ft/s
beta    =  0*d2r;       % Sideslip Angle, rad
alpha   =  10*d2r;      % Angle-of-attack, rad

p       =  0*d2r;       % Roll rate, rad/s
q       =  0*d2r;       % Pitch rate, rad/s
r       =  0*d2r;       % Yaw rate, rad/s

phi     =  0*d2r;       % Roll Angle, rad
theta   =  10*d2r;      % Pitch Angle, rad
psi     =  0*d2r;       % Yaw Angle, rad

pN = 0;                 % X position in Earth Frame, ft
pE = 0;                 % Y position in Earth Frame, ft
h = -25000;             % Z position in Earth Frame, ft


During the first iteration, C_m has a very positive small value (1e-10), which leads to some pitching moment when multiplied by S, c, and qbar (even though it's small). But, as time keeps on increasing, this value of C_m goes on increasing and as a result, a large moment is created. Due to the high precision of Matlab, the pitching moment coefficient is not for the given trim condition.

My question is: should I round off the values of C_m to 3 or 4 digits? By rounding off, the C_m will be zero and I get M as zero.

The below figure shows how velocity is varying with time when the aforementioned initial conditions are given. 

This figure is obtained after rounding off C_m to 4 significant digits.



This figure is obtained without rounding off C_m to 4 significant digits.


Alpha and theta values without rounding off C_m.
From your description, it's not an issue with the aerodynamic coefficients. If as you have described previously that you're modeling F-18, then the airframe should be unstable longitudinally. A 1e-10 deviation (assuming it applies to body rates, body speeds, etc. as well) is well-within typical trim error bound; in fact, a deviation is unavoidable when dealing with computational floating point. But if it's longitudinally unstable, any deviation will magnify over time exponentially.