1 /*******************************************************************************
7 ------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19 You should have received a copy of the GNU General Public License along with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
23 Further information about the GNU General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
29 *******************************************************************************/
31 /*******************************************************************************
33 *******************************************************************************/
38 /*******************************************************************************
39 COMMENTS, REFERENCES, and NOTES
40 ********************************************************************************
41 [1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
42 Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
44 [2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
46 [3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
47 NASA-Ames", NASA CR-2497, January 1975
48 [4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
49 Wiley & Sons, 1979 ISBN 0-471-03032-5
50 [5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
51 1982 ISBN 0-471-08936-2
53 The aerodynamic coefficients used in this model are:
56 CL0 - Reference lift at zero alpha
57 CD0 - Reference drag at zero alpha
58 CDM - Drag due to Mach
59 CLa - Lift curve slope (w.r.t. alpha)
60 CDa - Drag curve slope (w.r.t. alpha)
61 CLq - Lift due to pitch rate
62 CLM - Lift due to Mach
63 CLadt - Lift due to alpha rate
65 Cmadt - Moment due to alpha rate
66 Cm0 - Reference moment at zero alpha
67 Cma - Pitching moment slope (w.r.t. alpha)
68 Cmq - Pitch damping (pitch moment due to pitch rate)
69 CmM - Moment due to Mach
72 Cyb - Side force due to sideslip
73 Cyr - Side force due to yaw rate
75 Clb - Dihedral effect (roll moment due to sideslip)
76 Clp - Roll damping (roll moment due to roll rate)
77 Clr - Roll moment due to yaw rate
78 Cnb - Weathercocking stability (yaw moment due to sideslip)
79 Cnp - Rudder adverse yaw (yaw moment due to roll rate)
80 Cnr - Yaw damping (yaw moment due to yaw rate)
83 ClDe - Lift due to elevator
84 CdDe - Drag due to elevator
85 CyDr - Side force due to rudder
86 CyDa - Side force due to aileron
88 CmDe - Pitch moment due to elevator
89 ClDa - Roll moment due to aileron
90 ClDr - Roll moment due to rudder
91 CnDr - Yaw moment due to rudder
92 CnDa - Yaw moment due to aileron
94 ********************************************************************************
96 *******************************************************************************/
102 #include "FGCoefficient.h"
103 #include "FGEngine.h"
105 //#include "FGMatrix.h"
107 /*******************************************************************************
109 *******************************************************************************/
111 /*******************************************************************************
113 *******************************************************************************/
116 class FGAircraft : public FGModel
123 bool LoadAircraft(char*);
124 char* GetAircraftName(void) {return AircraftName;}
125 inline void SetGearUp(bool tt) {GearUp = tt;}
126 inline bool GetGearUp(void) {return GearUp;}
127 inline float GetWingArea(void) {return WingArea;}
128 inline float GetWingSpan(void) {return WingSpan;}
129 inline float Getcbar(void) {return cbar;}
130 inline FGEngine* GetEngine(int tt) {return Engine[tt];}
131 inline FGTank* GetTank(int tt) {return Tank[tt];}
150 char AircraftName[50];
151 float Ixx, Iyy, Izz, Ixz, m;
156 float WingArea, WingSpan, cbar;
157 float g, phi, tht, psi;
163 int numSelectedOxiTanks;
164 int numSelectedFuelTanks;
166 FGEngine *Engine[10];
168 FGCoefficient *Coeff[6][10];
173 enum Param {LiftCoeff,
188 extern FGAircraft* Aircraft;
190 FGAircraft* Aircraft;
193 /******************************************************************************/