1 /**********************************************************************
3 FILENAME: uiuc_coef_roll.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic roll coefficient
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
15 REFERENCES: Roskam, Jan. Airplane Flight Dynamics and Automatic
16 Flight Controls, Part I. Lawrence, KS: DARcorporation,
19 ----------------------------------------------------------------------
21 HISTORY: 04/15/2000 initial release
22 10/25/2001 (RD) Added new variables needed for the non-
23 linear Twin Otter model at zero flaps
25 11/12/2001 (RD) Added new variables needed for the non-
26 linear Twin Otter model with flaps
27 (Clfxxf). Zero flap vairables removed.
28 02/13/2002 (RD) Added variables so linear aero model
29 values can be recorded
30 02/18/2002 (RD) Added uiuc_3Dinterp_quick() function
31 for a quicker 3D interpolation. Takes
32 advantage of "nice" data.
34 ----------------------------------------------------------------------
36 AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
37 Jeff Scott <jscott@mail.com>
38 Robert Deters <rdeters@uiuc.edu>
40 ----------------------------------------------------------------------
44 ----------------------------------------------------------------------
49 -roll coefficient components
53 ----------------------------------------------------------------------
57 ----------------------------------------------------------------------
59 CALLED BY: uiuc_coefficients.cpp
61 ----------------------------------------------------------------------
63 CALLS TO: uiuc_1Dinterpolation
69 ----------------------------------------------------------------------
71 COPYRIGHT: (C) 2000 by Michael Selig
73 This program is free software; you can redistribute it and/or
74 modify it under the terms of the GNU General Public License
75 as published by the Free Software Foundation.
77 This program is distributed in the hope that it will be useful,
78 but WITHOUT ANY WARRANTY; without even the implied warranty of
79 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
80 GNU General Public License for more details.
82 You should have received a copy of the GNU General Public License
83 along with this program; if not, write to the Free Software
84 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
85 USA or view http://www.gnu.org/copyleft/gpl.html.
87 **********************************************************************/
89 #include "uiuc_coef_roll.h"
101 command_list = aeroRollParts -> getCommands();
103 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
105 linetoken1 = aeroRollParts -> getToken(*command_line, 1);
106 linetoken2 = aeroRollParts -> getToken(*command_line, 2);
108 switch(Cl_map[linetoken2])
114 Clo = uiuc_ice_filter(Clo_clean,kClo);
124 Cl_beta = uiuc_ice_filter(Cl_beta_clean,kCl_beta);
126 Cl_beta_save = Cl_beta * Std_Beta;
127 if (eta_q_Cl_beta_fac)
129 Cl += Cl_beta_save * eta_q_Cl_beta_fac;
141 Cl_p = uiuc_ice_filter(Cl_p_clean,kCl_p);
143 /* Cl_p must be mulitplied by b/2U
144 (see Roskam Control book, Part 1, pg. 147) */
145 Cl_p_save = Cl_p * P_body * b_2U;
148 Cl += Cl_p_save * eta_q_Cl_p_fac;
160 Cl_r = uiuc_ice_filter(Cl_r_clean,kCl_r);
162 /* Cl_r must be mulitplied by b/2U
163 (see Roskam Control book, Part 1, pg. 147) */
164 Cl_r_save = Cl_r * R_body * b_2U;
167 Cl += Cl_r_save * eta_q_Cl_r_fac;
179 Cl_da = uiuc_ice_filter(Cl_da_clean,kCl_da);
181 Cl_da_save = Cl_da * aileron;
189 Cl_dr = uiuc_ice_filter(Cl_dr_clean,kCl_dr);
191 Cl_dr_save = Cl_dr * rudder;
194 Cl += Cl_dr_save * eta_q_Cl_dr_fac;
206 Cl_daa = uiuc_ice_filter(Cl_daa_clean,kCl_daa);
208 Cl_daa_save = Cl_daa * aileron * Std_Alpha;
214 ClfadaI = uiuc_2Dinterpolation(Clfada_aArray,
226 ClfbetadrI = uiuc_2Dinterpolation(Clfbetadr_betaArray,
229 Clfbetadr_nBetaArray,
238 if (Clfabetaf_nice == 1)
239 ClfabetafI = uiuc_3Dinterp_quick(Clfabetaf_fArray,
240 Clfabetaf_aArray_nice,
241 Clfabetaf_bArray_nice,
250 ClfabetafI = uiuc_3Dinterpolation(Clfabetaf_fArray,
254 Clfabetaf_nAlphaArray,
265 if (Clfadaf_nice == 1)
266 ClfadafI = uiuc_3Dinterp_quick(Clfadaf_fArray,
268 Clfadaf_daArray_nice,
277 ClfadafI = uiuc_3Dinterpolation(Clfadaf_fArray,
292 if (Clfadrf_nice == 1)
293 ClfadrfI = uiuc_3Dinterp_quick(Clfadrf_fArray,
295 Clfadrf_drArray_nice,
304 ClfadrfI = uiuc_3Dinterpolation(Clfadrf_fArray,
319 p_nondim = P_body * b_2U;
320 if (Clfapf_nice == 1)
321 ClfapfI = uiuc_3Dinterp_quick(Clfapf_fArray,
332 ClfapfI = uiuc_3Dinterpolation(Clfapf_fArray,
347 r_nondim = R_body * b_2U;
348 if (Clfarf_nice == 1)
349 ClfarfI = uiuc_3Dinterp_quick(Clfarf_fArray,
360 ClfarfI = uiuc_3Dinterpolation(Clfarf_fArray,
379 // end uiuc_coef_roll.cpp