2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
Header: FGAircraft.h
|
|
|
|
Author: Jon S. Berndt
|
|
|
|
Date started: 12/12/98
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
This program is free software; you can redistribute it and/or modify it under
|
|
|
|
the terms of the GNU General Public License as published by the Free Software
|
|
|
|
Foundation; either version 2 of the License, or (at your option) any later
|
|
|
|
version.
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
This program is distributed in the hope that it will be useful, but WITHOUT
|
|
|
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
|
|
|
details.
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
You should have received a copy of the GNU General Public License along with
|
|
|
|
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
|
|
Place - Suite 330, Boston, MA 02111-1307, USA.
|
2001-03-30 01:04:50 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
Further information about the GNU General Public License can also be found on
|
|
|
|
the world wide web at http://www.gnu.org.
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
HISTORY
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
12/12/98 JSB Created
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-06-17 20:07:19 +00:00
|
|
|
SENTRY
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-06-17 20:07:19 +00:00
|
|
|
|
|
|
|
#ifndef FGAIRCRAFT_H
|
|
|
|
#define FGAIRCRAFT_H
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-06-17 20:07:19 +00:00
|
|
|
INCLUDES
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-06-17 20:07:19 +00:00
|
|
|
|
|
|
|
#ifdef FGFS
|
2000-02-15 03:30:01 +00:00
|
|
|
# include <simgear/compiler.h>
|
2001-03-30 01:04:50 +00:00
|
|
|
# ifdef FG_HAVE_STD_INCLUDES
|
1999-12-20 20:24:49 +00:00
|
|
|
# include <vector>
|
2000-10-09 21:16:21 +00:00
|
|
|
# include <iterator>
|
2000-04-24 23:49:06 +00:00
|
|
|
# include <map>
|
1999-06-17 20:07:19 +00:00
|
|
|
# else
|
1999-12-20 20:24:49 +00:00
|
|
|
# include <vector.h>
|
2000-10-09 21:16:21 +00:00
|
|
|
# include <iterator.h>
|
2000-04-24 23:49:06 +00:00
|
|
|
# include <map.h>
|
1999-06-17 20:07:19 +00:00
|
|
|
# endif
|
|
|
|
#else
|
1999-12-20 20:24:49 +00:00
|
|
|
# include <vector>
|
2000-10-09 21:16:21 +00:00
|
|
|
# include <iterator>
|
2000-04-24 23:49:06 +00:00
|
|
|
# include <map>
|
1999-06-17 20:07:19 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "FGModel.h"
|
|
|
|
#include "FGCoefficient.h"
|
2001-03-30 01:04:50 +00:00
|
|
|
#include "FGPropulsion.h"
|
1999-12-20 20:24:49 +00:00
|
|
|
#include "FGLGear.h"
|
2000-04-24 23:49:06 +00:00
|
|
|
#include "FGConfigFile.h"
|
|
|
|
#include "FGMatrix.h"
|
1999-06-17 20:07:19 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
DEFINITIONS
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
|
|
2001-03-30 01:04:50 +00:00
|
|
|
#define ID_AIRCRAFT "$Id$"
|
2000-10-13 23:34:54 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
FORWARD DECLARATIONS
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
|
|
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
|
|
|
|
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
|
|
|
CLASS DOCUMENTATION
|
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-06-17 20:07:19 +00:00
|
|
|
|
2000-10-10 17:44:35 +00:00
|
|
|
/** Encapsulates an Aircraft and its systems.
|
2000-11-03 23:02:47 +00:00
|
|
|
Owns all the parts (other classes) which make up this aircraft. This includes
|
|
|
|
the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
|
|
|
|
landing gear, etc. These constituent parts may actually run as separate
|
|
|
|
JSBSim models themselves, but the responsibility for initializing them and
|
2001-03-30 01:04:50 +00:00
|
|
|
for retrieving their force and moment contributions falls to FGAircraft.<br>
|
|
|
|
When an aircraft model is loaded the config file is parsed and for each of the
|
|
|
|
sections of the config file (propulsion, flight control, etc.) the
|
|
|
|
corresponding "ReadXXX()" method is called. From within this method the
|
|
|
|
"Load()" method of that system is called (e.g. LoadFCS).
|
2000-10-10 17:44:35 +00:00
|
|
|
@author Jon S. Berndt
|
|
|
|
@version $Id$
|
2000-10-14 02:10:10 +00:00
|
|
|
@see
|
2000-11-03 23:02:47 +00:00
|
|
|
<ol><li>Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
2000-10-14 02:10:10 +00:00
|
|
|
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
2000-11-03 23:02:47 +00:00
|
|
|
School, January 1994</li>
|
|
|
|
<li>D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
|
|
|
JSC 12960, July 1977</li>
|
|
|
|
<li>Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
|
|
|
NASA-Ames", NASA CR-2497, January 1975</li>
|
|
|
|
<li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
|
|
|
Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
|
|
|
|
<li>Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
|
|
|
1982 ISBN 0-471-08936-2</li></ol>
|
|
|
|
*/
|
2000-10-10 17:44:35 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-06-17 20:07:19 +00:00
|
|
|
CLASS DECLARATION
|
2000-11-03 23:02:47 +00:00
|
|
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
1999-06-17 20:07:19 +00:00
|
|
|
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
class FGAircraft : public FGModel {
|
2000-04-24 23:49:06 +00:00
|
|
|
enum {eL=1, eM, eN};
|
|
|
|
enum {eX=1, eY, eZ};
|
|
|
|
enum {eP=1, eQ, eR};
|
|
|
|
enum {ePhi=1, eTht, ePsi};
|
2000-05-02 18:25:30 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
public:
|
2000-10-10 17:44:35 +00:00
|
|
|
/** Constructor
|
2000-11-03 23:02:47 +00:00
|
|
|
@param Executive a pointer to the parent executive object */
|
2000-10-10 17:44:35 +00:00
|
|
|
FGAircraft(FGFDMExec *Executive);
|
2000-10-14 02:10:10 +00:00
|
|
|
|
2000-10-10 17:44:35 +00:00
|
|
|
/// Destructor
|
2001-03-30 01:04:50 +00:00
|
|
|
~FGAircraft();
|
1999-06-17 20:07:19 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/** Runs the Aircraft model; called by the Executive
|
2000-10-10 17:44:35 +00:00
|
|
|
@see JSBSim.cpp documentation
|
2000-11-03 23:02:47 +00:00
|
|
|
@return false if no error */
|
1999-06-17 20:07:19 +00:00
|
|
|
bool Run(void);
|
2000-10-14 02:10:10 +00:00
|
|
|
|
2000-10-10 17:44:35 +00:00
|
|
|
/** Loads the aircraft.
|
|
|
|
The executive calls this method to load the aircraft into JSBSim.
|
|
|
|
@param apath path to the aircraft files (e.g. "aircraft/X15/")
|
|
|
|
@param epath path to engine files (e.g. "engine/")
|
|
|
|
@param acname name of aircraft (e.g. "X15")
|
2000-11-03 23:02:47 +00:00
|
|
|
@return true if succesful */
|
2000-10-10 17:44:35 +00:00
|
|
|
bool LoadAircraft(string apath, string epath, string acname);
|
2000-10-14 02:10:10 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/** Gets the aircraft name
|
|
|
|
@return the name of the aircraft as a string type */
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline string GetAircraftName(void) { return AircraftName; }
|
2000-10-14 02:10:10 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/** Gets the gear status
|
|
|
|
@return true if gear is not deployed */
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline bool GetGearUp(void) { return GearUp; }
|
2000-11-03 23:02:47 +00:00
|
|
|
/** Gets the number of gear units defined for the aircraft
|
|
|
|
@return number of gear units defined */
|
2000-10-02 23:07:30 +00:00
|
|
|
inline int GetNumGearUnits(void) { return lGear.size(); }
|
2000-11-03 23:02:47 +00:00
|
|
|
/** Gets a gear instance
|
|
|
|
@param gear index of gear instance
|
|
|
|
@return a pointer to the FGLGear instance of the gear unit requested */
|
|
|
|
inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
|
|
|
|
/// Gets the wing area
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline float GetWingArea(void) { return WingArea; }
|
2000-11-03 23:02:47 +00:00
|
|
|
/// Gets the wing span
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline float GetWingSpan(void) { return WingSpan; }
|
2000-11-03 23:02:47 +00:00
|
|
|
/// Gets the average wing chord
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline float Getcbar(void) { return cbar; }
|
|
|
|
inline float GetWeight(void) { return Weight; }
|
|
|
|
inline float GetMass(void) { return Mass; }
|
|
|
|
inline FGColumnVector GetMoments(void) { return vMoments; }
|
|
|
|
inline FGColumnVector GetForces(void) { return vForces; }
|
|
|
|
inline FGColumnVector GetvFs(void) { return vFs; }
|
|
|
|
inline float GetIxx(void) { return Ixx; }
|
|
|
|
inline float GetIyy(void) { return Iyy; }
|
|
|
|
inline float GetIzz(void) { return Izz; }
|
|
|
|
inline float GetIxz(void) { return Ixz; }
|
|
|
|
inline FGColumnVector GetXYZcg(void) { return vXYZcg; }
|
2000-07-06 21:02:46 +00:00
|
|
|
inline FGColumnVector GetXYZrp(void) { return vXYZrp; }
|
2000-07-25 21:41:59 +00:00
|
|
|
inline FGColumnVector GetXYZep(void) { return vXYZep; }
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline float GetNlf(void) { return nlf; }
|
|
|
|
inline float GetAlphaCLMax(void) { return alphaclmax; }
|
|
|
|
inline float GetAlphaCLMin(void) { return alphaclmin; }
|
2000-05-27 05:48:14 +00:00
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
inline void SetGearUp(bool tt) { GearUp = tt; }
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
inline void SetAlphaCLMax(float tt) { alphaclmax=tt; }
|
|
|
|
inline void SetAlphaCLMin(float tt) { alphaclmin=tt; }
|
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
inline FGCoefficient* GetCoeff(int axis, int idx) { return Coeff[axis][idx]; }
|
2000-05-02 18:25:30 +00:00
|
|
|
string GetCoefficientStrings(void);
|
|
|
|
string GetCoefficientValues(void);
|
2000-05-27 05:48:14 +00:00
|
|
|
string GetGroundReactionStrings(void);
|
|
|
|
string GetGroundReactionValues(void);
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
/// Subsystem types for specifying which will be output in the FDM data logging
|
|
|
|
enum SubSystems {
|
|
|
|
/** Subsystem: Simulation (= 1) */ ssSimulation = 1,
|
|
|
|
/** Subsystem: Aerosurfaces (= 2) */ ssAerosurfaces = 2,
|
|
|
|
/** Subsystem: Body rates (= 4) */ ssRates = 4,
|
|
|
|
/** Subsystem: Velocities (= 8) */ ssVelocities = 8,
|
|
|
|
/** Subsystem: Forces (= 16) */ ssForces = 16,
|
|
|
|
/** Subsystem: Moments (= 32) */ ssMoments = 32,
|
|
|
|
/** Subsystem: Atmosphere (= 64) */ ssAtmosphere = 64,
|
|
|
|
/** Subsystem: Mass Properties (= 128) */ ssMassProps = 128,
|
|
|
|
/** Subsystem: Coefficients (= 256) */ ssCoefficients = 256,
|
|
|
|
/** Subsystem: Position (= 512) */ ssPosition = 512,
|
2000-11-14 20:31:58 +00:00
|
|
|
/** Subsystem: Ground Reactions (= 1024) */ ssGroundReactions = 1024,
|
|
|
|
/** Subsystem: Ground Reactions (= 2048) */ ssFCS = 2048
|
2000-11-03 23:02:47 +00:00
|
|
|
} subsystems;
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
1999-06-17 20:07:19 +00:00
|
|
|
private:
|
|
|
|
void GetState(void);
|
1999-12-20 20:24:49 +00:00
|
|
|
void FMAero(void);
|
|
|
|
void FMGear(void);
|
|
|
|
void FMMass(void);
|
|
|
|
void FMProp(void);
|
1999-06-17 20:07:19 +00:00
|
|
|
void MassChange(void);
|
2000-04-24 23:49:06 +00:00
|
|
|
FGColumnVector vMoments;
|
|
|
|
FGColumnVector vForces;
|
2000-05-02 18:25:30 +00:00
|
|
|
FGColumnVector vFs;
|
2000-04-24 23:49:06 +00:00
|
|
|
FGColumnVector vXYZrp;
|
|
|
|
FGColumnVector vbaseXYZcg;
|
|
|
|
FGColumnVector vXYZcg;
|
|
|
|
FGColumnVector vXYZep;
|
|
|
|
FGColumnVector vEuler;
|
1999-09-28 14:19:34 +00:00
|
|
|
float baseIxx, baseIyy, baseIzz, baseIxz, EmptyMass, Mass;
|
|
|
|
float Ixx, Iyy, Izz, Ixz;
|
1999-06-17 20:07:19 +00:00
|
|
|
float alpha, beta;
|
|
|
|
float WingArea, WingSpan, cbar;
|
|
|
|
float Weight, EmptyWeight;
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
float nlf,alphaclmax,alphaclmin;
|
1999-06-17 20:07:19 +00:00
|
|
|
float dt;
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
string CFGVersion;
|
2000-04-24 23:49:06 +00:00
|
|
|
string AircraftName;
|
Updates from the Jon and Tony show.
Tony submitted:
JSBsim:
Added trimming routine, it is longitudinal & in-air only at this point
Added support for taking wind & weather data from external source
Added support for flaps.
Added independently settable pitch trim
Added alphamin and max to config file, stall modeling and warning to
follow
c172.cfg:
Flaps!
Adjusted Cmo, model should be speed stable now
FG:
Hooked up Christian's weather code, should be using it soon.
Hooked up the trimming routine. Note that the X-15 will not trim.
This is not a model or trimming routine deficiency, just the
nature of the X-15
The trimming routine sets the pitch trim and and throttle at startup.
The throttle is set using Norman's code for the autothrottle so the
autothrottle is on by default. --notrim will turn it off.
Added --vc, --mach, and --notrim switches
(vc is airspeed in knots)
uBody, vBody, and wBody are still supported, last one entered
on the command line counts, i.e. you can set vc or mach or u,v,
and w but any combination will be ignored.
2000-05-16 21:35:11 +00:00
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
typedef map<string,int> AxisIndex;
|
|
|
|
AxisIndex AxisIdx;
|
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
typedef vector<FGCoefficient*> CoeffArray;
|
2001-03-30 01:04:50 +00:00
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
CoeffArray* Coeff;
|
2000-04-24 23:49:06 +00:00
|
|
|
|
2000-10-02 23:07:30 +00:00
|
|
|
void DisplayCoeffFactors(vector <eParam> multipliers);
|
1999-06-17 20:07:19 +00:00
|
|
|
|
|
|
|
bool GearUp;
|
|
|
|
|
|
|
|
string Axis[6];
|
2000-10-10 17:44:35 +00:00
|
|
|
vector <FGLGear> lGear;
|
2000-10-09 21:16:21 +00:00
|
|
|
|
2000-04-24 23:49:06 +00:00
|
|
|
string AircraftPath;
|
|
|
|
string EnginePath;
|
|
|
|
void ReadMetrics(FGConfigFile*);
|
|
|
|
void ReadPropulsion(FGConfigFile*);
|
|
|
|
void ReadFlightControls(FGConfigFile*);
|
|
|
|
void ReadAerodynamics(FGConfigFile*);
|
|
|
|
void ReadUndercarriage(FGConfigFile*);
|
|
|
|
void ReadPrologue(FGConfigFile*);
|
2000-05-02 18:25:30 +00:00
|
|
|
void ReadOutput(FGConfigFile*);
|
2001-03-30 01:04:50 +00:00
|
|
|
void Debug(void);
|
1999-06-17 20:07:19 +00:00
|
|
|
};
|
|
|
|
|
2000-11-03 23:02:47 +00:00
|
|
|
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
1999-06-17 20:07:19 +00:00
|
|
|
#endif
|
2001-03-30 01:04:50 +00:00
|
|
|
|