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 * Std_Beta;
127 if (eta_q_CY_beta_fac)
129 CY += CY_beta_save * eta_q_CY_beta_fac;
141 CY_p = uiuc_ice_filter(CY_p_clean,kCY_p);
143 /* CY_p must be mulitplied by b/2U
144 (see Roskam Control book, Part 1, pg. 147) */
145 CY_p_save = CY_p * P_body * b_2U;
148 CY += CY_p_save * eta_q_CY_p_fac;
160 CY_r = uiuc_ice_filter(CY_r_clean,kCY_r);
162 /* CY_r must be mulitplied by b/2U
163 (see Roskam Control book, Part 1, pg. 147) */
164 CY_r_save = CY_r * R_body * b_2U;
167 CY += CY_r_save * eta_q_CY_r_fac;
179 CY_da = uiuc_ice_filter(CY_da_clean,kCY_da);
181 CY_da_save = CY_da * aileron;
189 CY_dr = uiuc_ice_filter(CY_dr_clean,kCY_dr);
191 CY_dr_save = CY_dr * rudder;
194 CY += CY_dr_save * eta_q_CY_dr_fac;
206 CY_dra = uiuc_ice_filter(CY_dra_clean,kCY_dra);
208 CY_dra_save = CY_dra * rudder * Std_Alpha;
216 CY_bdot = uiuc_ice_filter(CY_bdot_clean,kCY_bdot);
218 CY_bdot_save = CY_bdot * Std_Beta_dot * b_2U;
224 CYfadaI = uiuc_2Dinterpolation(CYfada_aArray,
236 CYfbetadrI = uiuc_2Dinterpolation(CYfbetadr_betaArray,
239 CYfbetadr_nBetaArray,
248 if (CYfabetaf_nice == 1)
249 CYfabetafI = uiuc_3Dinterp_quick(CYfabetaf_fArray,
250 CYfabetaf_aArray_nice,
251 CYfabetaf_bArray_nice,
260 CYfabetafI = uiuc_3Dinterpolation(CYfabetaf_fArray,
264 CYfabetaf_nAlphaArray,
275 if (CYfadaf_nice == 1)
276 CYfadafI = uiuc_3Dinterp_quick(CYfadaf_fArray,
278 CYfadaf_daArray_nice,
287 CYfadafI = uiuc_3Dinterpolation(CYfadaf_fArray,
302 if (CYfadrf_nice == 1)
303 CYfadrfI = uiuc_3Dinterp_quick(CYfadrf_fArray,
305 CYfadrf_drArray_nice,
314 CYfadrfI = uiuc_3Dinterpolation(CYfadrf_fArray,
329 p_nondim = P_body * b_2U;
330 if (CYfapf_nice == 1)
331 CYfapfI = uiuc_3Dinterp_quick(CYfapf_fArray,
342 CYfapfI = uiuc_3Dinterpolation(CYfapf_fArray,
357 r_nondim = R_body * b_2U;
358 if (CYfarf_nice == 1)
359 CYfarfI = uiuc_3Dinterp_quick(CYfarf_fArray,
370 CYfarfI = uiuc_3Dinterpolation(CYfarf_fArray,
389 // end uiuc_coef_sideforce.cpp