1 /**********************************************************************
3 FILENAME: uiuc_engine.cpp
5 ----------------------------------------------------------------------
7 DESCRIPTION: determine the engine forces and moments
9 ----------------------------------------------------------------------
13 ----------------------------------------------------------------------
15 REFERENCES: based on portions of c172_engine.c, called from ls_model
17 ----------------------------------------------------------------------
19 HISTORY: 01/30/2000 initial release
21 ----------------------------------------------------------------------
23 AUTHOR(S): Bipin Sehgal <bsehgal@uiuc.edu>
24 Jeff Scott <jscott@mail.com>
25 Michael Selig <m-selig@uiuc.edu>
27 ----------------------------------------------------------------------
31 ----------------------------------------------------------------------
35 ----------------------------------------------------------------------
41 ----------------------------------------------------------------------
43 CALLED BY: uiuc_wrapper.cpp
45 ----------------------------------------------------------------------
49 ----------------------------------------------------------------------
51 COPYRIGHT: (C) 2000 by Michael Selig
53 This program is free software; you can redistribute it and/or
54 modify it under the terms of the GNU General Public License
55 as published by the Free Software Foundation.
57 This program is distributed in the hope that it will be useful,
58 but WITHOUT ANY WARRANTY; without even the implied warranty of
59 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
60 GNU General Public License for more details.
62 You should have received a copy of the GNU General Public License
63 along with this program; if not, write to the Free Software
64 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
65 USA or view http://www.gnu.org/copyleft/gpl.html.
67 **********************************************************************/
69 #include "uiuc_engine.h"
77 /* [] mss questions: why do this here ... and then undo it later?
78 ... does Throttle[3] get modified? */
79 Throttle[3] = Throttle_pct;
81 command_list = engineParts -> getCommands();
83 if (command_list.begin() == command_list.end())
85 cerr << "ERROR: Engine not specified. Aircraft cannot fly without the engine" << endl;
89 for (LIST command_line = command_list.begin(); command_line!=command_list.end(); ++command_line)
91 //cout << *command_line << endl;
93 linetoken1 = engineParts -> getToken(*command_line, 1); // function parameters gettoken(string,tokenNo);
94 linetoken2 = engineParts -> getToken(*command_line, 2); // 2 represents token No 2
96 switch(engine_map[linetoken2])
98 case simpleSingle_flag:
100 //c172 engine lines ... looks like 0.83 is just a thrust reduction
101 /* F_X_engine = Throttle[3]*350/0.83; */
102 /* F_Z_engine = Throttle[3]*4.9/0.83; */
103 /* M_m_engine = F_X_engine*0.734*cbar; */
104 F_X_engine = Throttle[3]*simpleSingleMaxThrust;
109 F_X_engine = Throttle[3]*350/0.83;
110 F_Z_engine = Throttle[3]*4.9/0.83;
111 M_m_engine = F_X_engine*0.734*cbar;
116 Throttle_pct = Throttle[3];
121 // end uiuc_engine.cpp