1 /**********************************************************************
3 FILENAME: uiuc_icing_demo.cpp
5 ----------------------------------------------------------------------
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
17 ----------------------------------------------------------------------
19 HISTORY: 12/02/2002 initial release - originally in
22 ----------------------------------------------------------------------
24 AUTHOR(S): Robert Deters <rdeters@uiuc.edu>
26 ----------------------------------------------------------------------
30 ----------------------------------------------------------------------
34 ----------------------------------------------------------------------
38 ----------------------------------------------------------------------
40 CALLED BY: uiuc_coefficients
42 ----------------------------------------------------------------------
46 ----------------------------------------------------------------------
48 COPYRIGHT: (C) 2002 by Michael Selig
50 This program is free software; you can redistribute it and/or
51 modify it under the terms of the GNU General Public License
52 as published by the Free Software Foundation.
54 This program is distributed in the hope that it will be useful,
55 but WITHOUT ANY WARRANTY; without even the implied warranty of
56 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 GNU General Public License for more details.
59 You should have received a copy of the GNU General Public License
60 along with this program; if not, write to the Free Software
61 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
63 **********************************************************************/
65 #include "uiuc_icing_demo.h"
67 void uiuc_icing_demo()
69 // Envelope protection values
70 if (demo_eps_alpha_max) {
71 double time = Simtime - demo_eps_alpha_max_startTime;
72 eps_alpha_max = uiuc_1Dinterpolation(demo_eps_alpha_max_timeArray,
73 demo_eps_alpha_max_daArray,
74 demo_eps_alpha_max_ntime,
77 if (demo_eps_pitch_max) {
78 double time = Simtime - demo_eps_pitch_max_startTime;
79 eps_pitch_max = uiuc_1Dinterpolation(demo_eps_pitch_max_timeArray,
80 demo_eps_pitch_max_daArray,
81 demo_eps_pitch_max_ntime,
84 if (demo_eps_pitch_min) {
85 double time = Simtime - demo_eps_pitch_min_startTime;
86 eps_pitch_min = uiuc_1Dinterpolation(demo_eps_pitch_min_timeArray,
87 demo_eps_pitch_min_daArray,
88 demo_eps_pitch_min_ntime,
91 if (demo_eps_roll_max) {
92 double time = Simtime - demo_eps_roll_max_startTime;
93 eps_roll_max = uiuc_1Dinterpolation(demo_eps_roll_max_timeArray,
94 demo_eps_roll_max_daArray,
95 demo_eps_roll_max_ntime,
98 if (demo_eps_thrust_min) {
99 double time = Simtime - demo_eps_thrust_min_startTime;
100 eps_thrust_min = uiuc_1Dinterpolation(demo_eps_thrust_min_timeArray,
101 demo_eps_thrust_min_daArray,
102 demo_eps_thrust_min_ntime,
105 if (demo_eps_airspeed_max) {
106 double time = Simtime - demo_eps_airspeed_max_startTime;
107 eps_airspeed_max = uiuc_1Dinterpolation(demo_eps_airspeed_max_timeArray,
108 demo_eps_airspeed_max_daArray,
109 demo_eps_airspeed_max_ntime,
112 if (demo_eps_airspeed_min) {
113 double time = Simtime - demo_eps_airspeed_min_startTime;
114 eps_airspeed_min = uiuc_1Dinterpolation(demo_eps_airspeed_min_timeArray,
115 demo_eps_airspeed_min_daArray,
116 demo_eps_airspeed_min_ntime,
119 if (demo_eps_flap_max) {
120 double time = Simtime - demo_eps_flap_max_startTime;
121 eps_flap_max = uiuc_1Dinterpolation(demo_eps_flap_max_timeArray,
122 demo_eps_flap_max_daArray,
123 demo_eps_flap_max_ntime,
126 if (demo_eps_pitch_input) {
127 double time = Simtime - demo_eps_pitch_input_startTime;
128 eps_pitch_input = uiuc_1Dinterpolation(demo_eps_pitch_input_timeArray,
129 demo_eps_pitch_input_daArray,
130 demo_eps_pitch_input_ntime,
135 if (demo_boot_cycle_tail) {
136 double time = Simtime - demo_boot_cycle_tail_startTime;
137 boot_cycle_tail = uiuc_1Dinterpolation(demo_boot_cycle_tail_timeArray,
138 demo_boot_cycle_tail_daArray,
139 demo_boot_cycle_tail_ntime,
142 if (demo_boot_cycle_wing_left) {
143 double time = Simtime - demo_boot_cycle_wing_left_startTime;
144 boot_cycle_wing_left = uiuc_1Dinterpolation(demo_boot_cycle_wing_left_timeArray,
145 demo_boot_cycle_wing_left_daArray,
146 demo_boot_cycle_wing_left_ntime,
149 if (demo_boot_cycle_wing_right) {
150 double time = Simtime - demo_boot_cycle_wing_right_startTime;
151 boot_cycle_wing_right = uiuc_1Dinterpolation(demo_boot_cycle_wing_right_timeArray,
152 demo_boot_cycle_wing_right_daArray,
153 demo_boot_cycle_wing_right_ntime,
159 double time = Simtime - demo_ice_tail_startTime;
160 ice_tail = uiuc_1Dinterpolation(demo_ice_tail_timeArray,
161 demo_ice_tail_daArray,
166 double time = Simtime - demo_ice_left_startTime;
167 ice_left = uiuc_1Dinterpolation(demo_ice_left_timeArray,
168 demo_ice_left_daArray,
172 if (demo_ice_right) {
173 double time = Simtime - demo_ice_right_startTime;
174 ice_right = uiuc_1Dinterpolation(demo_ice_right_timeArray,
175 demo_ice_right_daArray,
176 demo_ice_right_ntime,
182 double time = Simtime - demo_ap_pah_on_startTime;
183 ap_pah_on = uiuc_1Dinterpolation(demo_ap_pah_on_timeArray,
184 demo_ap_pah_on_daArray,
185 demo_ap_pah_on_ntime,
189 double time = Simtime - demo_ap_alh_on_startTime;
190 ap_alh_on = uiuc_1Dinterpolation(demo_ap_alh_on_timeArray,
191 demo_ap_alh_on_daArray,
192 demo_ap_alh_on_ntime,
196 double time = Simtime - demo_ap_rah_on_startTime;
197 ap_rah_on = uiuc_1Dinterpolation(demo_ap_rah_on_timeArray,
198 demo_ap_rah_on_daArray,
199 demo_ap_rah_on_ntime,
203 double time = Simtime - demo_ap_hh_on_startTime;
204 ap_hh_on = uiuc_1Dinterpolation(demo_ap_hh_on_timeArray,
205 demo_ap_hh_on_daArray,
209 if (demo_ap_Theta_ref){
210 double time = Simtime - demo_ap_Theta_ref_startTime;
211 ap_Theta_ref_rad = uiuc_1Dinterpolation(demo_ap_Theta_ref_timeArray,
212 demo_ap_Theta_ref_daArray,
213 demo_ap_Theta_ref_ntime,
216 if (demo_ap_alt_ref){
217 double time = Simtime - demo_ap_alt_ref_startTime;
218 ap_alt_ref_ft = uiuc_1Dinterpolation(demo_ap_alt_ref_timeArray,
219 demo_ap_alt_ref_daArray,
220 demo_ap_alt_ref_ntime,
223 if (demo_ap_Phi_ref){
224 double time = Simtime - demo_ap_Phi_ref_startTime;
225 ap_Phi_ref_rad = uiuc_1Dinterpolation(demo_ap_Phi_ref_timeArray,
226 demo_ap_Phi_ref_daArray,
227 demo_ap_Phi_ref_ntime,
230 if (demo_ap_Psi_ref){
231 double time = Simtime - demo_ap_Psi_ref_startTime;
232 ap_Psi_ref_rad = uiuc_1Dinterpolation(demo_ap_Psi_ref_timeArray,
233 demo_ap_Psi_ref_daArray,
234 demo_ap_Psi_ref_ntime,