JSBSim Flight Dynamics Model 1.2.4 (07 Feb 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
FGAuxiliary.h
1/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGAuxiliary.h
4 Author: Jon Berndt
5 Date started: 01/26/99
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
26HISTORY
27--------------------------------------------------------------------------------
2811/22/98 JSB Created
29 1/1/00 TP Added calcs and getters for VTAS, VCAS, VEAS, Vground, in knots
30
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
32SENTRY
33%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
34
35#ifndef FGAUXILIARY_H
36#define FGAUXILIARY_H
37
38/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39INCLUDES
40%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41
42#include "FGModel.h"
43#include "math/FGLocation.h"
44
45/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46FORWARD DECLARATIONS
47%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
48
49namespace JSBSim {
50
51class FGInitialCondition;
52
53/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54CLASS DOCUMENTATION
55%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
56
98/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99CLASS DECLARATION
100%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
101
102class JSBSIM_API FGAuxiliary : public FGModel {
103public:
106 explicit FGAuxiliary(FGFDMExec* Executive);
107
109 ~FGAuxiliary();
110
111 bool InitModel(void) override;
112
121 bool Run(bool Holding) override;
122
123// GET functions
124
132 double PitotTotalPressure(double mach, double pressure) const;
133
140 double MachFromImpactPressure(double qc, double p) const;
141
149 double VcalibratedFromMach(double mach, double pressure) const;
150
158 double MachFromVcalibrated(double vcas, double pressure) const;
159
160 // Atmospheric parameters GET functions
162 double GetVcalibratedFPS(void) const { return vcas; }
164 double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
166 double GetVequivalentFPS(void) const { return veas; }
168 double GetVequivalentKTS(void) const { return veas*fpstokts; }
170 double GetVtrueFPS() const { return Vt; }
172 double GetVtrueKTS() const { return Vt * fpstokts; }
173
178 double GetTotalPressure(void) const { return pt; }
179
188 double GetTotalTemperature(void) const { return tat; }
189 double GetTAT_C(void) const { return tatc; }
190
191 double GetPilotAccel(int idx) const { return vPilotAccel(idx); }
192 double GetNpilot(int idx) const { return vPilotAccelN(idx); }
193 double GetAeroPQR(int axis) const { return vAeroPQR(axis); }
194 double GetEulerRates(int axis) const { return vEulerRates(axis); }
195
196 const FGColumnVector3& GetPilotAccel (void) const { return vPilotAccel; }
197 const FGColumnVector3& GetNpilot (void) const { return vPilotAccelN; }
198 const FGColumnVector3& GetNcg (void) const { return vNcg; }
199 double GetNcg (int idx) const { return vNcg(idx); }
200 double GetNlf (void) const;
201 const FGColumnVector3& GetAeroPQR (void) const { return vAeroPQR; }
202 const FGColumnVector3& GetEulerRates (void) const { return vEulerRates; }
203 const FGColumnVector3& GetAeroUVW (void) const { return vAeroUVW; }
204 const FGLocation& GetLocationVRP(void) const { return vLocationVRP; }
205
206 double GetAeroUVW (int idx) const { return vAeroUVW(idx); }
207 double Getalpha (void) const { return alpha; }
208 double Getbeta (void) const { return beta; }
209 double Getadot (void) const { return adot; }
210 double Getbdot (void) const { return bdot; }
211 double GetMagBeta (void) const { return fabs(beta); }
212
213 double Getalpha (int unit) const { if (unit == inDegrees) return alpha*radtodeg;
214 else return BadUnits(); }
215 double Getbeta (int unit) const { if (unit == inDegrees) return beta*radtodeg;
216 else return BadUnits(); }
217 double Getadot (int unit) const { if (unit == inDegrees) return adot*radtodeg;
218 else return BadUnits(); }
219 double Getbdot (int unit) const { if (unit == inDegrees) return bdot*radtodeg;
220 else return BadUnits(); }
221 double GetMagBeta (int unit) const { if (unit == inDegrees) return fabs(beta)*radtodeg;
222 else return BadUnits(); }
223
227 const FGMatrix33& GetTw2b(void) const { return mTw2b; }
228
232 const FGMatrix33& GetTb2w(void) const { return mTb2w; }
233
234 double Getqbar (void) const { return qbar; }
235 double GetqbarUW (void) const { return qbarUW; }
236 double GetqbarUV (void) const { return qbarUV; }
237 double GetReynoldsNumber(void) const { return Re; }
238
241 double GetVt (void) const { return Vt; }
242
247 double GetVground (void) const { return Vground; }
248
250 double GetMach (void) const { return Mach; }
251
253 double GetMachU (void) const { return MachU; }
254
256 double GetNx (void) const { return Nx; }
257
259 double GetNy (void) const { return Ny; }
260
262 double GetNz (void) const { return Nz; }
263
264 const FGColumnVector3& GetNwcg(void) const { return vNwcg; }
265
266 double GetHOverBCG(void) const { return hoverbcg; }
267 double GetHOverBMAC(void) const { return hoverbmac; }
268
269 double GetGamma(void) const { return gamma; }
270 double GetGroundTrack(void) const { return psigt; }
271
272 double GetGamma(int unit) const {
273 if (unit == inDegrees) return gamma*radtodeg;
274 else return BadUnits();
275 }
276
277 double GetLongitudeRelativePosition (void) const;
278 double GetLatitudeRelativePosition (void) const;
279 double GetDistanceRelativePosition (void) const;
280
281 void SetInitialState(const FGInitialCondition*);
282
289 double GetNEUPositionFromStart(int idx) const { return (GetNEUPositionFromStart())(idx); }
290 const FGColumnVector3& GetNEUPositionFromStart() const;
291
292 void SetAeroPQR(const FGColumnVector3& tt) { vAeroPQR = tt; }
293
294 struct Inputs {
295 double Pressure;
296 double Density;
297 double Temperature;
298 double StdDaySLsoundspeed;
299 double SoundSpeed;
300 double KinematicViscosity;
301 double DistanceAGL;
302 double Wingspan;
303 double Wingchord;
304 double StandardGravity;
305 double Mass;
306 FGMatrix33 Tl2b;
307 FGMatrix33 Tb2l;
308 FGColumnVector3 vPQR;
309 FGColumnVector3 vPQRi;
310 FGColumnVector3 vPQRidot;
311 FGColumnVector3 vUVW;
312 FGColumnVector3 vUVWdot;
313 FGColumnVector3 vVel;
314 FGColumnVector3 vBodyAccel;
315 FGColumnVector3 ToEyePt;
316 FGColumnVector3 RPBody;
317 FGColumnVector3 VRPBody;
318 FGColumnVector3 vFw;
319 FGLocation vLocation;
320 double CosTht;
321 double SinTht;
322 double CosPhi;
323 double SinPhi;
324 FGColumnVector3 TotalWindNED;
325 FGColumnVector3 TurbPQR;
326 } in;
327
328private:
329 double vcas, veas;
330 double pt, tat, tatc; // Don't add a getter for pt!
331
332 FGMatrix33 mTw2b;
333 FGMatrix33 mTb2w;
334
335 FGColumnVector3 vPilotAccel;
336 FGColumnVector3 vPilotAccelN;
337 FGColumnVector3 vNcg;
338 FGColumnVector3 vNwcg;
339 FGColumnVector3 vAeroPQR;
340 FGColumnVector3 vAeroUVW;
341 FGColumnVector3 vEulerRates;
342 FGColumnVector3 vMachUVW;
343 FGLocation vLocationVRP;
344
345 FGLocation NEUStartLocation;
346 mutable FGColumnVector3 vNEUFromStart;
347 mutable bool NEUCalcValid;
348
349 double Vt, Vground;
350 double Mach, MachU;
351 double qbar, qbarUW, qbarUV;
352 double Re; // Reynolds Number = V*c/mu
353 double alpha, beta;
354 double adot,bdot;
355 double psigt, gamma;
356 double Nx, Ny, Nz;
357
358 double hoverbcg, hoverbmac;
359
360 void UpdateWindMatrices(void);
361
362 void CalculateRelativePosition(void);
363
364 void bind(void);
365 double BadUnits(void) const;
366 void Debug(int from) override;
367};
368
369} // namespace JSBSim
370
371//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
372#endif
Encapsulates various uncategorized scheduled functions.
double GetNEUPositionFromStart(int idx) const
The North East Up (NEU) frame is a local tangential frame fixed in the ECEF frame (i....
const FGMatrix33 & GetTb2w(void) const
Calculates and returns the body-to-wind axis transformation matrix.
double GetVtrueFPS() const
Returns the true airspeed in feet per second.
double GetVcalibratedFPS(void) const
Returns Calibrated airspeed in feet/second.
const FGMatrix33 & GetTw2b(void) const
Calculates and returns the wind-to-body axis transformation matrix.
double GetVground(void) const
Gets the ground speed in feet per second.
double GetVcalibratedKTS(void) const
Returns Calibrated airspeed in knots.
double GetMach(void) const
Gets the Mach number.
double GetTotalPressure(void) const
Returns the total pressure.
double GetVtrueKTS() const
Returns the true airspeed in knots.
double GetNz(void) const
The vertical acceleration in g's of the aircraft center of gravity.
double GetVequivalentFPS(void) const
Returns equivalent airspeed in feet/second.
double GetMachU(void) const
The mach number calculated using the vehicle X axis velocity.
double GetTotalTemperature(void) const
Returns the total temperature.
double GetVt(void) const
Gets the magnitude of total vehicle velocity including wind effects in feet per second.
double GetNy(void) const
The lateral acceleration in g's of the aircraft center of gravity.
double GetNx(void) const
The longitudinal acceleration in g's of the aircraft center of gravity.
double GetVequivalentKTS(void) const
Returns equivalent airspeed in knots.
This class implements a 3 element column vector.
Encapsulates the JSBSim simulation executive.
Definition FGFDMExec.h:184
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF).
Definition FGLocation.h:152
Handles matrix math operations.
Definition FGMatrix33.h:70
Base class for all scheduled JSBSim models.
Definition FGModel.h:70