JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGAircraft.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGAircraft.h
4  Author: Jon S. Berndt
5  Date started: 12/12/98
6 
7  ------------- Copyright (C) 1999 Jon S. Berndt (jon@jsbsim.org) -------------
8 
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
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 Lesser General Public License for more
17  details.
18 
19  You should have received a copy of the GNU Lesser 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.
22 
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/12/98 JSB Created
29 
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 
34 #ifndef FGAIRCRAFT_H
35 #define FGAIRCRAFT_H
36 
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40 
41 #include <string>
42 
43 #include "FGModel.h"
44 #include "math/FGMatrix33.h"
45 
46 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 DEFINITIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 
50 #define ID_AIRCRAFT "$Id: FGAircraft.h,v 1.25 2015/07/12 19:34:08 bcoconni Exp $"
51 
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 FORWARD DECLARATIONS
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55 
56 namespace JSBSim {
57 
58 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
59 CLASS DOCUMENTATION
60 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
61 
106 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
107 CLASS DECLARATION
108 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
109 
110 class FGAircraft : public FGModel {
111 public:
114  FGAircraft(FGFDMExec *Executive);
115 
117  ~FGAircraft();
118 
127  bool Run(bool Holding);
128 
129  bool InitModel(void);
130 
135  bool Load(Element* el);
136 
139  const std::string& GetAircraftName(void) const { return AircraftName; }
140 
142  double GetWingArea(void) const { return WingArea; }
144  double GetWingSpan(void) const { return WingSpan; }
146  double Getcbar(void) const { return cbar; }
147  double GetPitotAngle(void) const { return PitotAngle; }
148  double GetWingIncidence(void) const { return WingIncidence; }
149  double GetWingIncidenceDeg(void) const { return WingIncidence*radtodeg; }
150  double GetHTailArea(void) const { return HTailArea; }
151  double GetHTailArm(void) const { return HTailArm; }
152  double GetVTailArea(void) const { return VTailArea; }
153  double GetVTailArm(void) const { return VTailArm; }
154  double Getlbarh(void) const { return lbarh; } // HTailArm / cbar
155  double Getlbarv(void) const { return lbarv; } // VTailArm / cbar
156  double Getvbarh(void) const { return vbarh; } // H. Tail Volume
157  double Getvbarv(void) const { return vbarv; } // V. Tail Volume
158  const FGColumnVector3& GetMoments(void) const { return vMoments; }
159  double GetMoments(int idx) const { return vMoments(idx); }
160  const FGColumnVector3& GetForces(void) const { return vForces; }
161  double GetForces(int idx) const { return vForces(idx); }
162  const FGColumnVector3& GetXYZrp(void) const { return vXYZrp; }
163  const FGColumnVector3& GetXYZvrp(void) const { return vXYZvrp; }
164  const FGColumnVector3& GetXYZep(void) const { return vXYZep; }
165  double GetXYZrp(int idx) const { return vXYZrp(idx); }
166  double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
167  double GetXYZep(int idx) const { return vXYZep(idx); }
168  void SetAircraftName(const std::string& name) {AircraftName = name;}
169 
170  void SetXYZrp(int idx, double value) {vXYZrp(idx) = value;}
171 
172  void SetWingArea(double S) {WingArea = S;}
173 
174  void bind(void);
175  void unbind(void);
176 
177  struct Inputs {
178  FGColumnVector3 AeroForce;
179  FGColumnVector3 PropForce;
180  FGColumnVector3 GroundForce;
181  FGColumnVector3 ExternalForce;
182  FGColumnVector3 BuoyantForce;
183  FGColumnVector3 AeroMoment;
184  FGColumnVector3 PropMoment;
185  FGColumnVector3 GroundMoment;
186  FGColumnVector3 ExternalMoment;
187  FGColumnVector3 BuoyantMoment;
188  } in;
189 
190 private:
191  FGColumnVector3 vMoments;
192  FGColumnVector3 vForces;
193  FGColumnVector3 vXYZrp;
194  FGColumnVector3 vXYZvrp;
195  FGColumnVector3 vXYZep;
196  FGColumnVector3 vDXYZcg;
197 
198  double WingArea, WingSpan, cbar, WingIncidence;
199  double HTailArea, VTailArea, HTailArm, VTailArm;
200  double lbarh,lbarv,vbarh,vbarv,PitotAngle;
201  std::string AircraftName;
202 
203  void Debug(int from);
204 };
205 
206 } // namespace JSBSim
207 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
208 #endif
209 
Encapsulates an Aircraft and its systems.
Definition: FGAircraft.h:110
const std::string & GetAircraftName(void) const
Gets the aircraft name.
Definition: FGAircraft.h:139
double GetWingSpan(void) const
Gets the wing span.
Definition: FGAircraft.h:144
FGAircraft(FGFDMExec *Executive)
Constructor.
Definition: FGAircraft.cpp:70
Base class for all scheduled JSBSim models.
Definition: FGModel.h:74
~FGAircraft()
Destructor.
Definition: FGAircraft.cpp:90
This class implements a 3 element column vector.
double Getcbar(void) const
Gets the average wing chord.
Definition: FGAircraft.h:146
bool Load(Element *el)
Loads the aircraft.
Definition: FGAircraft.cpp:135
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:189
bool Run(bool Holding)
Runs the Aircraft model; called by the Executive Can pass in a value indicating if the executive is d...
Definition: FGAircraft.cpp:109
double GetWingArea(void) const
Gets the wing area.
Definition: FGAircraft.h:142