JSBSim Flight Dynamics Model  1.1.11 (13 Feb 2022)
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
11  Software Foundation; either version 2 of the License, or (at your option) any
12  later 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
20  with this program; if not, write to the Free Software Foundation, Inc., 59
21  Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be
24  found on 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 FORWARD DECLARATIONS
48 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 
50 namespace JSBSim {
51 
52 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 CLASS DOCUMENTATION
54 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
55 
98 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99 CLASS DECLARATION
100 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
101 
102 class FGAircraft : public FGModel {
103 public:
106  FGAircraft(FGFDMExec *Executive);
107 
109  ~FGAircraft() override;
110 
119  bool Run(bool Holding) override;
120 
121  bool InitModel(void) override;
122 
127  bool Load(Element* el) override;
128 
131  const std::string& GetAircraftName(void) const { return AircraftName; }
132 
134  double GetWingArea(void) const { return WingArea; }
136  double GetWingSpan(void) const { return WingSpan; }
138  double Getcbar(void) const { return cbar; }
139  double GetWingIncidence(void) const { return WingIncidence; }
140  double GetWingIncidenceDeg(void) const { return WingIncidence*radtodeg; }
141  double GetHTailArea(void) const { return HTailArea; }
142  double GetHTailArm(void) const { return HTailArm; }
143  double GetVTailArea(void) const { return VTailArea; }
144  double GetVTailArm(void) const { return VTailArm; }
145  double Getlbarh(void) const { return lbarh; } // HTailArm / cbar
146  double Getlbarv(void) const { return lbarv; } // VTailArm / cbar
147  double Getvbarh(void) const { return vbarh; } // H. Tail Volume
148  double Getvbarv(void) const { return vbarv; } // V. Tail Volume
149  const FGColumnVector3& GetMoments(void) const { return vMoments; }
150  double GetMoments(int idx) const { return vMoments(idx); }
151  const FGColumnVector3& GetForces(void) const { return vForces; }
152  double GetForces(int idx) const { return vForces(idx); }
155  const FGColumnVector3& GetXYZrp(void) const { return vXYZrp; }
156  const FGColumnVector3& GetXYZvrp(void) const { return vXYZvrp; }
157  const FGColumnVector3& GetXYZep(void) const { return vXYZep; }
158  double GetXYZrp(int idx) const { return vXYZrp(idx); }
159  double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
160  double GetXYZep(int idx) const { return vXYZep(idx); }
161  void SetAircraftName(const std::string& name) {AircraftName = name;}
162 
163  void SetXYZrp(int idx, double value) {vXYZrp(idx) = value;}
164 
165  void SetWingArea(double S) {WingArea = S;}
166 
167  struct Inputs {
168  FGColumnVector3 AeroForce;
169  FGColumnVector3 PropForce;
170  FGColumnVector3 GroundForce;
171  FGColumnVector3 ExternalForce;
172  FGColumnVector3 BuoyantForce;
173  FGColumnVector3 AeroMoment;
174  FGColumnVector3 PropMoment;
175  FGColumnVector3 GroundMoment;
176  FGColumnVector3 ExternalMoment;
177  FGColumnVector3 BuoyantMoment;
178  } in;
179 
180 private:
181  FGColumnVector3 vMoments;
182  FGColumnVector3 vForces;
183  FGColumnVector3 vXYZrp;
184  FGColumnVector3 vXYZvrp;
185  FGColumnVector3 vXYZep;
186  FGColumnVector3 vDXYZcg;
187 
188  double WingArea, WingSpan, cbar, WingIncidence;
189  double HTailArea, VTailArea, HTailArm, VTailArm;
190  double lbarh,lbarv,vbarh,vbarv;
191  std::string AircraftName;
192 
193  void bind(void);
194  void unbind(void);
195  void Debug(int from) override;
196 };
197 
198 } // namespace JSBSim
199 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
200 #endif
JSBSim::FGFDMExec
Encapsulates the JSBSim simulation executive.
Definition: FGFDMExec.h:185
JSBSim::FGColumnVector3
This class implements a 3 element column vector.
Definition: FGColumnVector3.h:63
JSBSim::FGModel
Base class for all scheduled JSBSim models.
Definition: FGModel.h:68
JSBSim::FGAircraft::Inputs
Definition: FGAircraft.h:167
JSBSim::FGAircraft::GetXYZrp
const FGColumnVector3 & GetXYZrp(void) const
Gets the the aero reference point (RP) coordinates.
Definition: FGAircraft.h:155
JSBSim::FGAircraft::GetAircraftName
const std::string & GetAircraftName(void) const
Gets the aircraft name.
Definition: FGAircraft.h:131
JSBSim::FGAircraft::GetWingSpan
double GetWingSpan(void) const
Gets the wing span.
Definition: FGAircraft.h:136
JSBSim::FGAircraft::Run
bool Run(bool Holding) override
Runs the Aircraft model; called by the Executive Can pass in a value indicating if the executive is d...
Definition: FGAircraft.cpp:90
JSBSim::FGAircraft::FGAircraft
FGAircraft(FGFDMExec *Executive)
Constructor.
Definition: FGAircraft.cpp:52
JSBSim::FGAircraft
Encapsulates an Aircraft and its systems.
Definition: FGAircraft.h:102
JSBSim::FGAircraft::GetWingArea
double GetWingArea(void) const
Gets the wing area.
Definition: FGAircraft.h:134
JSBSim::FGAircraft::~FGAircraft
~FGAircraft() override
Destructor.
Definition: FGAircraft.cpp:71
JSBSim::FGAircraft::Load
bool Load(Element *el) override
Loads the aircraft.
Definition: FGAircraft.cpp:116
JSBSim::FGAircraft::Getcbar
double Getcbar(void) const
Gets the average wing chord.
Definition: FGAircraft.h:138
JSBSim::Element
Definition: FGXMLElement.h:143