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;
128 if (eta_q_CY_beta_fac)
130 CY += CY_beta_save * eta_q_CY_beta_fac;
142 CY_p = uiuc_ice_filter(CY_p_clean,kCY_p);
144 /* CY_p must be mulitplied by b/2U
145 (see Roskam Control book, Part 1, pg. 147) */
146 CY_p_save = CY_p * P_body * b_2U;
147 // CY += CY_p * P_body * b_2U;
150 CY += CY_p_save * eta_q_CY_p_fac;
162 CY_r = uiuc_ice_filter(CY_r_clean,kCY_r);
164 /* CY_r must be mulitplied by b/2U
165 (see Roskam Control book, Part 1, pg. 147) */
166 CY_r_save = CY_r * R_body * b_2U;
167 // CY += CY_r * R_body * b_2U;
170 CY += CY_r_save * eta_q_CY_r_fac;
182 CY_da = uiuc_ice_filter(CY_da_clean,kCY_da);
184 CY_da_save = CY_da * aileron;
185 CY += CY_da * aileron;
192 CY_dr = uiuc_ice_filter(CY_dr_clean,kCY_dr);
194 CY_dr_save = CY_dr * rudder;
195 // CY += CY_dr * rudder;
198 CY += CY_dr_save * eta_q_CY_dr_fac;
210 CY_dra = uiuc_ice_filter(CY_dra_clean,kCY_dra);
212 CY_dra_save = CY_dra * rudder * Alpha;
213 CY += CY_dra * rudder * Alpha;
220 CY_bdot = uiuc_ice_filter(CY_bdot_clean,kCY_bdot);
222 CY_bdot_save = CY_bdot * Beta_dot * b_2U;
223 CY += CY_bdot * Beta_dot * b_2U;
228 CYfadaI = uiuc_2Dinterpolation(CYfada_aArray,
240 CYfbetadrI = uiuc_2Dinterpolation(CYfbetadr_betaArray,
243 CYfbetadr_nBetaArray,
252 if (CYfabetaf_nice == 1)
253 CYfabetafI = uiuc_3Dinterp_quick(CYfabetaf_fArray,
254 CYfabetaf_aArray_nice,
255 CYfabetaf_bArray_nice,
264 CYfabetafI = uiuc_3Dinterpolation(CYfabetaf_fArray,
268 CYfabetaf_nAlphaArray,
279 if (CYfadaf_nice == 1)
280 CYfadafI = uiuc_3Dinterp_quick(CYfadaf_fArray,
282 CYfadaf_daArray_nice,
291 CYfadafI = uiuc_3Dinterpolation(CYfadaf_fArray,
306 if (CYfadrf_nice == 1)
307 CYfadrfI = uiuc_3Dinterp_quick(CYfadrf_fArray,
309 CYfadrf_drArray_nice,
318 CYfadrfI = uiuc_3Dinterpolation(CYfadrf_fArray,
333 p_nondim = P_body * b_2U;
334 if (CYfapf_nice == 1)
335 CYfapfI = uiuc_3Dinterp_quick(CYfapf_fArray,
346 CYfapfI = uiuc_3Dinterpolation(CYfapf_fArray,
361 r_nondim = R_body * b_2U;
362 if (CYfarf_nice == 1)
363 CYfarfI = uiuc_3Dinterp_quick(CYfarf_fArray,
374 CYfarfI = uiuc_3Dinterpolation(CYfarf_fArray,
393 // end uiuc_coef_sideforce.cpp