1 /**********************************************************************
3 FILENAME: uiuc_coef_yaw.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: computes aggregated aerodynamic yaw 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 (Cnfxxf). 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 -yaw 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_yaw.h"
101 command_list = aeroYawParts -> getCommands();
103 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
105 linetoken1 = aeroYawParts -> getToken(*command_line, 1);
106 linetoken2 = aeroYawParts -> getToken(*command_line, 2);
108 switch(Cn_map[linetoken2])
114 Cno = uiuc_ice_filter(Cno_clean,kCno);
124 Cn_beta = uiuc_ice_filter(Cn_beta_clean,kCn_beta);
126 Cn_beta_save = Cn_beta * Beta;
127 // Cn += Cn_beta * Beta;
128 if (eta_q_Cn_beta_fac)
130 Cn += Cn_beta_save * eta_q_Cn_beta_fac;
142 Cn_p = uiuc_ice_filter(Cn_p_clean,kCn_p);
144 /* Cn_p must be mulitplied by b/2U
145 (see Roskam Control book, Part 1, pg. 147) */
146 Cn_p_save = Cn_p * P_body * b_2U;
147 // Cn += Cn_p * P_body * b_2U;
150 Cn += Cn_p_save * eta_q_Cn_p_fac;
162 Cn_r = uiuc_ice_filter(Cn_r_clean,kCn_r);
164 /* Cn_r must be mulitplied by b/2U
165 (see Roskam Control book, Part 1, pg. 147) */
166 Cn_r_save = Cn_r * R_body * b_2U;
167 // Cn += Cn_r * R_body * b_2U;
170 Cn += Cn_r_save * eta_q_Cn_r_fac;
182 Cn_da = uiuc_ice_filter(Cn_da_clean,kCn_da);
184 Cn_da_save = Cn_da * aileron;
185 Cn += Cn_da * aileron;
192 Cn_dr = uiuc_ice_filter(Cn_dr_clean,kCn_dr);
194 Cn_dr_save = Cn_dr * rudder;
195 // Cn += Cn_dr * rudder;
198 Cn += Cn_dr_save * eta_q_Cn_dr_fac;
210 Cn_q = uiuc_ice_filter(Cn_q_clean,kCn_q);
212 Cn_q_save = Cn_q * Q_body * cbar_2U;
213 Cn += Cn_q * Q_body * cbar_2U;
220 Cn_b3 = uiuc_ice_filter(Cn_b3_clean,kCn_b3);
222 Cn_b3_save = Cn_b3 * Beta * Beta * Beta;
223 Cn += Cn_b3 * Beta * Beta * Beta;
228 CnfadaI = uiuc_2Dinterpolation(Cnfada_aArray,
240 CnfbetadrI = uiuc_2Dinterpolation(Cnfbetadr_betaArray,
243 Cnfbetadr_nBetaArray,
252 if (Cnfabetaf_nice == 1)
253 CnfabetafI = uiuc_3Dinterp_quick(Cnfabetaf_fArray,
254 Cnfabetaf_aArray_nice,
255 Cnfabetaf_bArray_nice,
264 CnfabetafI = uiuc_3Dinterpolation(Cnfabetaf_fArray,
268 Cnfabetaf_nAlphaArray,
279 if (Cnfadaf_nice == 1)
280 CnfadafI = uiuc_3Dinterp_quick(Cnfadaf_fArray,
282 Cnfadaf_daArray_nice,
291 CnfadafI = uiuc_3Dinterpolation(Cnfadaf_fArray,
306 if (Cnfadrf_nice == 1)
307 CnfadrfI = uiuc_3Dinterp_quick(Cnfadrf_fArray,
309 Cnfadrf_drArray_nice,
318 CnfadrfI = uiuc_3Dinterpolation(Cnfadrf_fArray,
333 p_nondim = P_body * b_2U;
334 if (Cnfapf_nice == 1)
335 CnfapfI = uiuc_3Dinterp_quick(Cnfapf_fArray,
346 CnfapfI = uiuc_3Dinterpolation(Cnfapf_fArray,
361 r_nondim = R_body * b_2U;
362 if (Cnfarf_nice == 1)
363 CnfarfI = uiuc_3Dinterp_quick(Cnfarf_fArray,
374 CnfarfI = uiuc_3Dinterpolation(Cnfarf_fArray,
393 // end uiuc_coef_yaw.cpp