1 /**********************************************************************
3 FILENAME: uiuc_coef_sideforce.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic sideforce 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 (CYfxxf). 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 -sideforce 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
86 **********************************************************************/
88 #include "uiuc_coef_sideforce.h"
91 void uiuc_coef_sideforce()
100 command_list = aeroSideforceParts -> getCommands();
102 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
104 linetoken1 = aeroSideforceParts -> getToken(*command_line, 1);
105 linetoken2 = aeroSideforceParts -> getToken(*command_line, 2);
107 switch(CY_map[linetoken2])
113 CYo = uiuc_ice_filter(CYo_clean,kCYo);
123 CY_beta = uiuc_ice_filter(CY_beta_clean,kCY_beta);
125 CY_beta_save = CY_beta * Std_Beta;
126 if (eta_q_CY_beta_fac)
128 CY += CY_beta_save * eta_q_CY_beta_fac;
140 CY_p = uiuc_ice_filter(CY_p_clean,kCY_p);
142 /* CY_p must be mulitplied by b/2U
143 (see Roskam Control book, Part 1, pg. 147) */
144 CY_p_save = CY_p * P_body * b_2U;
147 CY += CY_p_save * eta_q_CY_p_fac;
159 CY_r = uiuc_ice_filter(CY_r_clean,kCY_r);
161 /* CY_r must be mulitplied by b/2U
162 (see Roskam Control book, Part 1, pg. 147) */
163 CY_r_save = CY_r * R_body * b_2U;
166 CY += CY_r_save * eta_q_CY_r_fac;
178 CY_da = uiuc_ice_filter(CY_da_clean,kCY_da);
180 CY_da_save = CY_da * aileron;
188 CY_dr = uiuc_ice_filter(CY_dr_clean,kCY_dr);
190 CY_dr_save = CY_dr * rudder;
193 CY += CY_dr_save * eta_q_CY_dr_fac;
205 CY_dra = uiuc_ice_filter(CY_dra_clean,kCY_dra);
207 CY_dra_save = CY_dra * rudder * Std_Alpha;
215 CY_bdot = uiuc_ice_filter(CY_bdot_clean,kCY_bdot);
217 CY_bdot_save = CY_bdot * Std_Beta_dot * b_2U;
223 CYfadaI = uiuc_2Dinterpolation(CYfada_aArray,
235 CYfbetadrI = uiuc_2Dinterpolation(CYfbetadr_betaArray,
238 CYfbetadr_nBetaArray,
247 if (CYfabetaf_nice == 1)
248 CYfabetafI = uiuc_3Dinterp_quick(CYfabetaf_fArray,
249 CYfabetaf_aArray_nice,
250 CYfabetaf_bArray_nice,
259 CYfabetafI = uiuc_3Dinterpolation(CYfabetaf_fArray,
263 CYfabetaf_nAlphaArray,
274 if (CYfadaf_nice == 1)
275 CYfadafI = uiuc_3Dinterp_quick(CYfadaf_fArray,
277 CYfadaf_daArray_nice,
286 CYfadafI = uiuc_3Dinterpolation(CYfadaf_fArray,
301 if (CYfadrf_nice == 1)
302 CYfadrfI = uiuc_3Dinterp_quick(CYfadrf_fArray,
304 CYfadrf_drArray_nice,
313 CYfadrfI = uiuc_3Dinterpolation(CYfadrf_fArray,
328 p_nondim = P_body * b_2U;
329 if (CYfapf_nice == 1)
330 CYfapfI = uiuc_3Dinterp_quick(CYfapf_fArray,
341 CYfapfI = uiuc_3Dinterpolation(CYfapf_fArray,
356 r_nondim = R_body * b_2U;
357 if (CYfarf_nice == 1)
358 CYfarfI = uiuc_3Dinterp_quick(CYfarf_fArray,
369 CYfarfI = uiuc_3Dinterpolation(CYfarf_fArray,
388 // end uiuc_coef_sideforce.cpp