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;
134 Cn_p = uiuc_ice_filter(Cn_p_clean,kCn_p);
136 /* Cn_p must be mulitplied by b/2U
137 (see Roskam Control book, Part 1, pg. 147) */
138 Cn_p_save = Cn_p * P_body * b_2U;
139 Cn += Cn_p * P_body * b_2U;
146 Cn_r = uiuc_ice_filter(Cn_r_clean,kCn_r);
148 /* Cn_r must be mulitplied by b/2U
149 (see Roskam Control book, Part 1, pg. 147) */
150 Cn_r_save = Cn_r * R_body * b_2U;
151 Cn += Cn_r * R_body * b_2U;
158 Cn_da = uiuc_ice_filter(Cn_da_clean,kCn_da);
160 Cn_da_save = Cn_da * aileron;
161 Cn += Cn_da * aileron;
168 Cn_dr = uiuc_ice_filter(Cn_dr_clean,kCn_dr);
170 Cn_dr_save = Cn_dr * rudder;
171 Cn += Cn_dr * rudder;
178 Cn_q = uiuc_ice_filter(Cn_q_clean,kCn_q);
180 Cn_q_save = Cn_q * Q_body * cbar_2U;
181 Cn += Cn_q * Q_body * cbar_2U;
188 Cn_b3 = uiuc_ice_filter(Cn_b3_clean,kCn_b3);
190 Cn_b3_save = Cn_b3 * Beta * Beta * Beta;
191 Cn += Cn_b3 * Beta * Beta * Beta;
196 CnfadaI = uiuc_2Dinterpolation(Cnfada_aArray,
208 CnfbetadrI = uiuc_2Dinterpolation(Cnfbetadr_betaArray,
211 Cnfbetadr_nBetaArray,
220 if (Cnfabetaf_nice == 1)
221 CnfabetafI = uiuc_3Dinterp_quick(Cnfabetaf_fArray,
222 Cnfabetaf_aArray_nice,
223 Cnfabetaf_bArray_nice,
232 CnfabetafI = uiuc_3Dinterpolation(Cnfabetaf_fArray,
236 Cnfabetaf_nAlphaArray,
247 if (Cnfadaf_nice == 1)
248 CnfadafI = uiuc_3Dinterp_quick(Cnfadaf_fArray,
250 Cnfadaf_daArray_nice,
259 CnfadafI = uiuc_3Dinterpolation(Cnfadaf_fArray,
274 if (Cnfadrf_nice == 1)
275 CnfadrfI = uiuc_3Dinterp_quick(Cnfadrf_fArray,
277 Cnfadrf_drArray_nice,
286 CnfadrfI = uiuc_3Dinterpolation(Cnfadrf_fArray,
301 p_nondim = P_body * b_2U;
302 if (Cnfapf_nice == 1)
303 CnfapfI = uiuc_3Dinterp_quick(Cnfapf_fArray,
314 CnfapfI = uiuc_3Dinterpolation(Cnfapf_fArray,
329 r_nondim = R_body * b_2U;
330 if (Cnfarf_nice == 1)
331 CnfarfI = uiuc_3Dinterp_quick(Cnfarf_fArray,
342 CnfarfI = uiuc_3Dinterpolation(Cnfarf_fArray,
361 // end uiuc_coef_yaw.cpp