1 /***************************************************************************
5 ----------------------------------------------------------------------------
7 FUNCTION: Linear aerodynamics model
9 ----------------------------------------------------------------------------
11 MODULE STATUS: developmental
13 ----------------------------------------------------------------------------
17 ----------------------------------------------------------------------------
22 ----------------------------------------------------------------------------
28 "Aerodynamics, Aeronautics and Flight Mechanics",
29 John Wiley & Sons,1995, ISBN 0-471-11087-6
31 any suggestions, corrections, aditional data, flames, everything to
35 This source is not checked in this configuration in any way.
38 ----------------------------------------------------------------------------
42 ----------------------------------------------------------------------------
46 ----------------------------------------------------------------------------
50 ----------------------------------------------------------------------------
54 --------------------------------------------------------------------------*/
62 #include "ls_generic.h"
63 #include "ls_cockpit.h"
64 #include "ls_constants.h"
71 /*float ** Cherokee (float t, VectorStanja &X, float *U)*/
74 Cza = -19149.0/(146.69*146.69*157.5/2.0*0.00238),
75 Czat = -73.4*4*146.69/0.00238/157.5/5.25,
76 Czq = -2.655*4*2400.0/32.2/0.00238/157.5/146.69/5.25,
77 Cma = -21662.0 *2/146.69/0.00238/157.5/146.69/5.25,
78 Cmat = -892.4 *4/146.69/0.00238/157.5/146.69/5.25,
79 Cmq = -2405.1 *4/0.00238/157.5/146.69/5.25/5.25,
80 Czde = -1050.49 *2/0.00238/157.5/146.69/146.69,
81 Cmde = -12771.9 *2/0.00238/157.5/146.69/146.69/5.25,
82 Clb = -12891.0/(146.69*146.69*157.5/2.0*0.00238)/30.0,
85 Cyb = -1169.8/(146.69*146.69*157.5/2.0*0.00238),
87 Cnb = 11127.2/(146.69*146.69*157.5/2.0*0.00238)/30.0,
90 Cyf = -14.072/(146.69*146.69*157.5/2.0*0.00238),
91 Cyps = 89.229/(146.69*146.69*157.5/2.0*0.00238),
92 Clf = -5812.4/(146.69*146.69*157.5/2.0*0.00238)/30.0, //%Clda ?
93 Cnf = -853.93/(146.69*146.69*157.5/2.0*0.00238)/30.0, //%Cnda ?
94 Cnps = -1149.0/(146.69*146.69*157.5/2.0*0.00238)/30.0, //%Cndr ?
95 Cyr = 1.923/(146.69*146.69*157.5/2.0*0.00238),
97 Cx0 = -0.4645/(157.5*0.3048*0.3048),
102 Clda = -5812.4/(146.69*146.69*157.5/2.0*0.00238)/30.0, // Clf
103 Cnda = -853.93/(146.69*146.69*157.5/2.0*0.00238)/30.0, // Cnf
104 Cndr = -1149.0/(146.69*146.69*157.5/2.0*0.00238)/30.0, // Cnps
107 Possible problems: convention about positive control surfaces offset
109 elevator = 0.0, // 20.0 * 180.0/57.3 * Long_control
110 aileron = 0.0, // 30.0 * 180.0/57.3 * Lat_control
111 rudder = 0.0, // 30.0 * 180.0/57.3 * Rudder_pedal,
114 // m = 2400/32.2, // mass
115 S = 157.5, // wing area
116 b = 30.0, // wing span
117 c = 5.25, // main aerodynamic chrod
119 // Ixyz[3] = {1070.0*14.59*0.3048*0.3048, 1249.0*14.59*0.3048*0.3048, 2312.0*14.59*0.3048*0.3048},
122 // *RetVal[4] = {&m, Ixyz, Fa, Ma};
126 V = 0.0, // V_rel_wind
127 qd = 0.0, // Density*V*V/2.0, //dinamicki tlak
134 /* derivatives are defined in "wind" axes so... */
135 p = P_body*Cos_alpha + R_body*Sin_alpha;
137 r = -P_body*Sin_alpha + R_body*Cos_alpha;
141 Cz = Cz0 + Cza*Std_Alpha + Czat*(Std_Alpha_dot*c/2.0/V) + Czq*(q*c/2.0/V) + Czde * elevator;
142 Cm = Cm0 + Cma*Std_Alpha + Cmat*(Std_Alpha_dot*c/2.0/V) + Cmq*(q*c/2.0/V) + Cmde * elevator;
144 Cx = Cx0 - (Cza*Std_Alpha)*(Cza*Std_Alpha)/(LS_PI*5.71*0.6);
145 Cl = Clb*Std_Beta + Clp*(p*b/2.0/V) + Clr*(r*b/2.0/V) + Clda * aileron;
147 Cy = Cyb*Std_Beta + Cyr*(r*b/2.0/V);
148 Cn = Cnb*Std_Beta + Cnp*(p*b/2.0/V) + Cnr*(r*b/2.0/V) + Cndr * rudder;
150 /* back to body axes */
156 Cx = CD - CL*Sin_alpha;
160 /* AD forces and moments */
165 M_l_aero = (Cl*Cos_alpha - Cn*Sin_alpha)*b*qd*S;
166 M_m_aero = Cm*c*qd*S;
167 M_n_aero = (Cl*Sin_alpha + Cn*Cos_alpha)*b*qd*S;