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 * Std_Beta;
127 if (eta_q_Cn_beta_fac)
129 Cn += Cn_beta_save * eta_q_Cn_beta_fac;
141 Cn_p = uiuc_ice_filter(Cn_p_clean,kCn_p);
143 /* Cn_p must be mulitplied by b/2U
144 (see Roskam Control book, Part 1, pg. 147) */
145 Cn_p_save = Cn_p * P_body * b_2U;
148 Cn += Cn_p_save * eta_q_Cn_p_fac;
160 Cn_r = uiuc_ice_filter(Cn_r_clean,kCn_r);
162 /* Cn_r must be mulitplied by b/2U
163 (see Roskam Control book, Part 1, pg. 147) */
164 Cn_r_save = Cn_r * R_body * b_2U;
167 Cn += Cn_r_save * eta_q_Cn_r_fac;
179 Cn_da = uiuc_ice_filter(Cn_da_clean,kCn_da);
181 Cn_da_save = Cn_da * aileron;
189 Cn_dr = uiuc_ice_filter(Cn_dr_clean,kCn_dr);
191 Cn_dr_save = Cn_dr * rudder;
194 Cn += Cn_dr_save * eta_q_Cn_dr_fac;
206 Cn_q = uiuc_ice_filter(Cn_q_clean,kCn_q);
208 Cn_q_save = Cn_q * Q_body * cbar_2U;
216 Cn_b3 = uiuc_ice_filter(Cn_b3_clean,kCn_b3);
218 Cn_b3_save = Cn_b3 * Std_Beta * Std_Beta * Std_Beta;
224 CnfadaI = uiuc_2Dinterpolation(Cnfada_aArray,
236 CnfbetadrI = uiuc_2Dinterpolation(Cnfbetadr_betaArray,
239 Cnfbetadr_nBetaArray,
248 if (Cnfabetaf_nice == 1)
249 CnfabetafI = uiuc_3Dinterp_quick(Cnfabetaf_fArray,
250 Cnfabetaf_aArray_nice,
251 Cnfabetaf_bArray_nice,
260 CnfabetafI = uiuc_3Dinterpolation(Cnfabetaf_fArray,
264 Cnfabetaf_nAlphaArray,
275 if (Cnfadaf_nice == 1)
276 CnfadafI = uiuc_3Dinterp_quick(Cnfadaf_fArray,
278 Cnfadaf_daArray_nice,
287 CnfadafI = uiuc_3Dinterpolation(Cnfadaf_fArray,
302 if (Cnfadrf_nice == 1)
303 CnfadrfI = uiuc_3Dinterp_quick(Cnfadrf_fArray,
305 Cnfadrf_drArray_nice,
314 CnfadrfI = uiuc_3Dinterpolation(Cnfadrf_fArray,
329 p_nondim = P_body * b_2U;
330 if (Cnfapf_nice == 1)
331 CnfapfI = uiuc_3Dinterp_quick(Cnfapf_fArray,
342 CnfapfI = uiuc_3Dinterpolation(Cnfapf_fArray,
357 r_nondim = R_body * b_2U;
358 if (Cnfarf_nice == 1)
359 CnfarfI = uiuc_3Dinterp_quick(Cnfarf_fArray,
370 CnfarfI = uiuc_3Dinterpolation(Cnfarf_fArray,
389 // end uiuc_coef_yaw.cpp