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., 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_sideforce.h"
92 void uiuc_coef_sideforce()
101 command_list = aeroSideforceParts -> getCommands();
103 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
105 linetoken1 = aeroSideforceParts -> getToken(*command_line, 1);
106 linetoken2 = aeroSideforceParts -> getToken(*command_line, 2);
108 switch(CY_map[linetoken2])
114 CYo = uiuc_ice_filter(CYo_clean,kCYo);
124 CY_beta = uiuc_ice_filter(CY_beta_clean,kCY_beta);
126 CY_beta_save = CY_beta * Beta;
127 CY += CY_beta * Beta;
134 CY_p = uiuc_ice_filter(CY_p_clean,kCY_p);
136 /* CY_p must be mulitplied by b/2U
137 (see Roskam Control book, Part 1, pg. 147) */
138 CY_p_save = CY_p * P_body * b_2U;
139 CY += CY_p * P_body * b_2U;
146 CY_r = uiuc_ice_filter(CY_r_clean,kCY_r);
148 /* CY_r must be mulitplied by b/2U
149 (see Roskam Control book, Part 1, pg. 147) */
150 CY_r_save = CY_r * R_body * b_2U;
151 CY += CY_r * R_body * b_2U;
158 CY_da = uiuc_ice_filter(CY_da_clean,kCY_da);
160 CY_da_save = CY_da * aileron;
161 CY += CY_da * aileron;
168 CY_dr = uiuc_ice_filter(CY_dr_clean,kCY_dr);
170 CY_dr_save = CY_dr * rudder;
171 CY += CY_dr * rudder;
178 CY_dra = uiuc_ice_filter(CY_dra_clean,kCY_dra);
180 CY_dra_save = CY_dra * rudder * Alpha;
181 CY += CY_dra * rudder * Alpha;
188 CY_bdot = uiuc_ice_filter(CY_bdot_clean,kCY_bdot);
190 CY_bdot_save = CY_bdot * Beta_dot * b_2U;
191 CY += CY_bdot * Beta_dot * b_2U;
196 CYfadaI = uiuc_2Dinterpolation(CYfada_aArray,
208 CYfbetadrI = uiuc_2Dinterpolation(CYfbetadr_betaArray,
211 CYfbetadr_nBetaArray,
220 if (CYfabetaf_nice == 1)
221 CYfabetafI = uiuc_3Dinterp_quick(CYfabetaf_fArray,
222 CYfabetaf_aArray_nice,
223 CYfabetaf_bArray_nice,
232 CYfabetafI = uiuc_3Dinterpolation(CYfabetaf_fArray,
236 CYfabetaf_nAlphaArray,
247 if (CYfadaf_nice == 1)
248 CYfadafI = uiuc_3Dinterp_quick(CYfadaf_fArray,
250 CYfadaf_daArray_nice,
259 CYfadafI = uiuc_3Dinterpolation(CYfadaf_fArray,
274 if (CYfadrf_nice == 1)
275 CYfadrfI = uiuc_3Dinterp_quick(CYfadrf_fArray,
277 CYfadrf_drArray_nice,
286 CYfadrfI = uiuc_3Dinterpolation(CYfadrf_fArray,
301 p_nondim = P_body * b_2U;
302 if (CYfapf_nice == 1)
303 CYfapfI = uiuc_3Dinterp_quick(CYfapf_fArray,
314 CYfapfI = uiuc_3Dinterpolation(CYfapf_fArray,
329 r_nondim = R_body * b_2U;
330 if (CYfarf_nice == 1)
331 CYfarfI = uiuc_3Dinterp_quick(CYfarf_fArray,
342 CYfarfI = uiuc_3Dinterpolation(CYfarf_fArray,
361 // end uiuc_coef_sideforce.cpp