JSBSim Flight Dynamics Model 1.3.0 (09 Apr 2026)
An Open Source Flight Dynamics and Control Software Library in C++
Loading...
Searching...
No Matches
JSBSim Namespace Reference

Main namespace for the JSBSim Flight Dynamics Model. More...

Classes

class  aFunc
 
class  aFunc< func_t, 0 >
 
class  BaseException
 
class  BufferLogger
 
struct  CNumericLocale
 
class  Element
 
class  FGAccelerations
 Handles the calculation of accelerations. More...
 
class  FGAccelerometer
 Encapsulates a Accelerometer component for the flight control system. More...
 
class  FGActuator
 Encapsulates an Actuator component for the flight control system. More...
 
class  FGAerodynamics
 Encapsulates the aerodynamic calculations. More...
 
class  FGAircraft
 Encapsulates an Aircraft and its systems. More...
 
class  FGAngles
 Provides a way to determine the smallest included angle. More...
 
class  FGAtmosphere
 Models an empty, abstract base atmosphere class. More...
 
class  FGAuxiliary
 Encapsulates various uncategorized scheduled functions. More...
 
class  FGBallonet
 Models a ballonet inside a gas cell. More...
 
class  FGBrushLessDCMotor
 
class  FGBuoyantForces
 Encapsulates the Buoyant forces calculations. More...
 
class  FGColumnVector3
 This class implements a 3 element column vector. More...
 
class  FGCondition
 Encapsulates a condition, which is used in parts of JSBSim including switches. More...
 
class  FGDeadBand
 Models a deadband object. More...
 
class  FGDefaultGroundCallback
 
class  FGDistributor
 Encapsulates a distributor for the flight control system. More...
 
class  FGElectric
 Models an electric motor. More...
 
class  FGEngine
 Base class for all engines. More...
 
class  FGExternalForce
 Encapsulates code that models an individual arbitrary force, moment or a combination thereof. More...
 
class  FGExternalReactions
 Manages the external and/or arbitrary forces and moments. More...
 
class  FGFCS
 Encapsulates the Flight Control System (FCS) functionality. More...
 
class  FGFCSChannel
 
class  FGFCSComponent
 Base class for JSBSim Flight Control System Components. More...
 
class  FGFCSFunction
 Models a FCSFunction object. More...
 
class  FGFDMExec
 Encapsulates the JSBSim simulation executive. More...
 
class  FGfdmSocket
 The FGfdmSocket class enables JSBSim to communicate via sockets. More...
 
class  FGFilter
 Encapsulates a filter for the flight control system. More...
 
class  FGForce
 Utility class that aids in the conversion of forces between coordinate systems and calculation of moments. More...
 
class  FGFunction
 Represents a mathematical function. More...
 
class  FGFunctionValue
 Represents a property value on which a function is applied. More...
 
class  FGGain
 Encapsulates a gain component for the flight control system. More...
 
class  FGGasCell
 Models a gas cell. More...
 
class  FGGroundCallback
 This class provides callback slots to get ground specific data. More...
 
class  FGGroundReactions
 Manages ground reactions modeling. More...
 
class  FGGyro
 Encapsulates a Gyro component for the flight control system. More...
 
class  FGInertial
 Models inertial forces (e.g. More...
 
class  FGInitialCondition
 Initializes the simulation run. More...
 
class  FGInput
 Handles simulation input. More...
 
class  FGInputSocket
 Implements the input from a socket. More...
 
class  FGInputType
 Abstract class to provide functions generic to all the input directives. More...
 
class  FGJSBBase
 JSBSim Base class. More...
 
class  FGKinemat
 Encapsulates a kinematic (mechanical) component for the flight control system. More...
 
class  FGLGear
 Landing gear model. More...
 
class  FGLinearActuator
 Models a flight control system summing component. More...
 
class  FGLinearization
 Class used to create linear models from FGFDMExec instances. More...
 
class  FGLocation
 FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF). More...
 
class  FGLogConsole
 
class  FGLogger
 Logging backend interface. More...
 
class  FGLogging
 
class  FGMagnetometer
 Encapsulates a magnetometer component for the flight control system. More...
 
class  FGMars
 Models the Martian atmosphere. More...
 
class  FGMassBalance
 Models weight, balance and moment of inertia information. More...
 
class  FGMatrix33
 Handles matrix math operations. More...
 
class  FGModel
 Base class for all scheduled JSBSim models. More...
 
class  FGModelFunctions
 The model functions class provides the capability for loading, storing, and executing arbitrary functions. More...
 
class  FGModelLoader
 
class  FGMSIS
 Models the MSIS-00 atmosphere. More...
 
class  FGNozzle
 Models a rocket nozzle. More...
 
class  FGOutput
 Handles simulation output. More...
 
class  FGOutputFG
 Implements the output to a FlightGear socket. More...
 
class  FGOutputFile
 Abstract class that provide functions that are generic to all the outputs that are directed to a file. More...
 
class  FGOutputSocket
 Implements the output to a socket. More...
 
class  FGOutputTextFile
 Implements the output to a human readable text file. More...
 
class  FGOutputType
 Abstract class to provide functions generic to all the output directives. More...
 
class  FGParameter
 Represents various types of parameters. More...
 
class  FGParameterValue
 Represents a either a real value or a property value. More...
 
class  FGPID
 Encapsulates a PID control component for the flight control system. More...
 
class  FGPiston
 Models a Supercharged Piston engine. More...
 
class  FGPropagate
 Models the EOM and integration/propagation of state. More...
 
class  FGPropeller
 FGPropeller models a propeller given the tabular data for Ct (thrust) and Cp (power), indexed by the advance ratio "J". More...
 
class  FGPropertyReader
 
class  FGPropertyValue
 Represents a property value which can use late binding. More...
 
class  FGPropertyVector3
 
class  FGPropulsion
 Propulsion management class. More...
 
class  FGQuaternion
 Models the Quaternion representation of rotations. More...
 
class  FGRealValue
 Represents a real value. More...
 
class  FGRK4
 Classical RK4. More...
 
class  FGRKFehlberg
 Runge-Kutta-Fehlberg method. More...
 
class  FGRocket
 Models a generic rocket engine. More...
 
class  FGRotor
 Models a helicopter rotor. More...
 
class  FGRungeKutta
 Abstract base. More...
 
class  FGRungeKuttaProblem
 Minimalistic implementation of some Runge-Kutta methods. More...
 
class  FGScript
 Encapsulates the JSBSim scripting capability. More...
 
class  FGSensor
 Encapsulates a Sensor component for the flight control system. More...
 
class  FGSensorOrientation
 Encapsulates a SensorOrientation capability for a sensor. More...
 
class  FGSimplifiedTSFC
 
class  FGSpoolUp
 
class  FGStandardAtmosphere
 Models the 1976 U.S. More...
 
class  FGStateSpace
 
class  FGSummer
 Models a flight control system summing component. More...
 
class  FGSurface
 Base class for all surface properties. More...
 
class  FGSwitch
 Encapsulates a switch for the flight control system. More...
 
class  FGTable
 Lookup table class. More...
 
class  FGTank
 Models a fuel tank. More...
 
class  FGTemplateFunc
 
class  FGThruster
 Base class for specific thrusting devices such as propellers, nozzles, etc. More...
 
class  FGTransmission
 Utility class that handles power transmission in conjunction with FGRotor. More...
 
class  FGTrim
 The trimming routine for JSBSim. More...
 
class  FGTrimAxis
 
class  FGTurbine
 This class models a turbine engine. More...
 
class  FGTurboProp
 Turboprop engine model. More...
 
class  FGUDPInputSocket
 Implements a UDP input socket. More...
 
class  FGWaypoint
 Models a Waypoint object. More...
 
class  FGWinds
 Models atmospheric disturbances: winds, gusts, turbulence, downbursts, etc. More...
 
class  FGXMLFileRead
 
class  FGXMLLogging
 
class  FGXMLParse
 Encapsulates an XML parser based on the EasyXML parser from the SimGear library. More...
 
class  InvalidNumber
 
struct  LagrangeMultiplier
 
class  LogException
 
class  RandomNumberGenerator
 Random number generator. More...
 
class  TrimFailureException
 
class  WrongNumberOfArguments
 
class  XMLLogException
 

Typedefs

typedef SGSharedPtr< ElementElement_ptr
 
typedef std::vector< FGFCSComponent * > FCSCompVec
 Represents a <channel> in a control system definition.
 
using FGLogger_ptr = std::shared_ptr< FGLogger >
 
typedef SGSharedPtr< FGParameterFGParameter_ptr
 
typedef SGSharedPtr< FGParameterValueFGParameterValue_ptr
 
typedef SGSharedPtr< FGPropertyValueFGPropertyValue_ptr
 
typedef std::shared_ptr< FGTemplateFuncFGTemplateFunc_ptr
 
using setprecision_t = decltype(std::setprecision(0))
 
using setw_t = decltype(std::setw(0))
 
template<class T >
using Vector2D = std::vector< std::vector< T > >
 

Enumerations

enum  altitudeset { setasl , setagl }
 
enum  Control {
  tThrottle , tBeta , tAlpha , tElevator ,
  tAileron , tRudder , tAltAGL , tTheta ,
  tPhi , tGamma , tPitchTrim , tRollTrim ,
  tYawTrim , tHeading
}
 
enum  latitudeset { setgeoc , setgeod }
 
enum class  LogFormat {
  RESET , RED , BLUE , CYAN ,
  GREEN , DEFAULT , BOLD , NORMAL ,
  UNDERLINE_ON , UNDERLINE_OFF
}
 
enum class  LogLevel {
  BULK , DEBUG , INFO , WARN ,
  ERROR , FATAL , STDOUT
}
 
enum  OutputForm {
  ofRad =0 , ofDeg , ofNorm , ofMag ,
  NForms
}
 
enum  speedset {
  setvt , setvc , setve , setmach ,
  setuvw , setned , setvg
}
 
enum  State {
  tAll , tUdot , tVdot , tWdot ,
  tQdot , tPdot , tRdot , tHmgt ,
  tNlf
}
 Models an aircraft axis for purposes of trimming. More...
 
enum  TrimMode {
  tLongitudinal =0 , tFull , tGround , tPullup ,
  tCustom , tTurn , tNone
}
 

Functions

double atof_locale_c (const string &input)
 
SGPath CheckPathName (const SGPath &path, const SGPath &filename)
 
double DotProduct (const FGColumnVector3 &v1, const FGColumnVector3 &v2)
 Dot product of two vectors Compute and return the euclidean dot (or scalar) product of two vectors v1 and v2.
 
unsigned int FindNumColumns (const string &test_line)
 
bool GetBinary (double val, const string &ctxMsg)
 
string GetFullyQualifiedName (const SGPropertyNode *node)
 
FGLogger_ptr GetLogger (void)
 Returns the active logger for the current thread.
 
string GetPrintableName (const SGPropertyNode *node)
 
string GetRelativeName (const SGPropertyNode *node, const string &path)
 
bool is_number (const std::string &str)
 
FGFunctionmake_MathFn (double(*math_fn)(double), FGFDMExec *fdmex, Element *el, const string &prefix, FGPropertyValue *v)
 
shared_ptr< RandomNumberGeneratormakeRandomGenerator (Element *el, FGFDMExec *fdmex)
 
double operator* (const FGParameter_ptr &p, double v)
 
FGColumnVector3 operator* (double a, const FGPropertyVector3 &v)
 
FGColumnVector3 operator* (double scalar, const FGColumnVector3 &A)
 Scalar multiplication.
 
FGLocation operator* (double scalar, const FGLocation &l)
 Scalar multiplication.
 
FGMatrix33 operator* (double scalar, const FGMatrix33 &A)
 Scalar multiplication.
 
FGQuaternion operator* (double scalar, const FGQuaternion &q)
 Scalar multiplication.
 
double operator* (double v, const FGParameter_ptr &p)
 
ostream & operator<< (std::ostream &os, const FGColumnVector3 &col)
 Write vector to a stream.
 
ostream & operator<< (std::ostream &os, const FGMatrix33 &M)
 Write matrix to a stream.
 
std::ostream & operator<< (std::ostream &os, const FGQuaternion &q)
 Write quaternion to a stream.
 
std::ostream & operator<< (std::ostream &out, const FGStateSpace &ss)
 
std::ostream & operator<< (std::ostream &out, const FGStateSpace::Component &c)
 
std::ostream & operator<< (std::ostream &out, const FGStateSpace::ComponentVector &v)
 
std::ostream & operator<< (std::ostream &out, const std::vector< double > &vec)
 
std::ostream & operator<< (std::ostream &out, const std::vector< std::vector< double > > &vec2d)
 
istream & operator>> (std::istream &is, FGMatrix33 &M)
 Read matrix from a stream.
 
FGQuaternion QExp (const FGColumnVector3 &omega)
 Quaternion exponential.
 
std::string replace (std::string str, const std::string &oldstr, const std::string &newstr)
 
void SetLogger (FGLogger_ptr logger)
 Sets the active logger for the current thread.
 
std::vector< std::string > split (std::string str, char d)
 
constexpr double sqr (double x)
 simply square a value
 
std::string & to_lower (std::string &str)
 
std::string & to_upper (std::string &str)
 
std::string & trim (std::string &str)
 
std::string & trim_all_space (std::string &str)
 
std::string & trim_left (std::string &str)
 
std::string & trim_right (std::string &str)
 
template<typename func_t >
FGParameter_ptr VarArgsFn (const func_t &_f, FGFDMExec *fdmex, Element *el, const string &prefix, FGPropertyValue *v)
 

Variables

const std::string ControlNames []
 
short debug_lvl
 
thread_local FGLogger_ptr GlobalLogger = std::make_shared<FGLogConsole>()
 
constexpr double hptowatts = 745.7
 
const double invlog2val = 1.0/log10(2.0)
 
constexpr unsigned int MaxArgs = 9999
 
constexpr double NMtoftpound = 1.3558
 Models an electric brushless DC motor or more appropriately permanent magnet synchronous motor.
 
const std::string StateNames []
 
constexpr double WattperRPMtoftpound = 60 / (2 * M_PI * NMtoftpound)
 

Detailed Description

Main namespace for the JSBSim Flight Dynamics Model.

Typedef Documentation

◆ Element_ptr

typedef SGSharedPtr<Element> Element_ptr

Definition at line 137 of file FGXMLElement.h.

◆ FCSCompVec

typedef std::vector<FGFCSComponent*> FCSCompVec

Represents a <channel> in a control system definition.

The <channel> may be defined within a <system>, <autopilot> or <flight_control> element. Channels are a way to group sets of components that perform a specific purpose or algorithm. Created within a <system> tag, the channel is defined as follows <channel name="name" [execute="property"] [execrate="rate"]> name is the name of the channel - in the old way this would also be used to bind elements execute [optional] is the property that defines when to execute this channel; an on/off switch execrate [optional] is the rate at which the channel should execute. A value of 0 or 1 will execute the channel every frame, a value of 2 every other frame (half rate), a value of 4 is every 4th frame (quarter rate)

Definition at line 70 of file FGFCSChannel.h.

◆ FGLogger_ptr

using FGLogger_ptr = std::shared_ptr<FGLogger>

Definition at line 143 of file FGLog.h.

◆ FGParameter_ptr

typedef SGSharedPtr<FGParameter> FGParameter_ptr

Definition at line 72 of file FGParameter.h.

◆ FGParameterValue_ptr

typedef SGSharedPtr<FGParameterValue> FGParameterValue_ptr

Definition at line 107 of file FGParameterValue.h.

◆ FGPropertyValue_ptr

typedef SGSharedPtr<FGPropertyValue> FGPropertyValue_ptr

Definition at line 96 of file FGPropertyValue.h.

◆ FGTemplateFunc_ptr

typedef std::shared_ptr<FGTemplateFunc> FGTemplateFunc_ptr

Definition at line 77 of file FGTemplateFunc.h.

◆ setprecision_t

using setprecision_t = decltype(std::setprecision(0))

Definition at line 60 of file FGLog.h.

◆ setw_t

using setw_t = decltype(std::setw(0))

Definition at line 63 of file FGLog.h.

◆ Vector2D

template<class T >
using Vector2D = std::vector<std::vector<T> >

Definition at line 35 of file FGLinearization.h.

Enumeration Type Documentation

◆ altitudeset

enum altitudeset

Definition at line 71 of file FGInitialCondition.h.

71{ setasl, setagl } altitudeset;

◆ Control

enum Control

Definition at line 83 of file FGTrimAxis.h.

83 { tThrottle, tBeta, tAlpha, tElevator, tAileron, tRudder, tAltAGL,
84 tTheta, tPhi, tGamma, tPitchTrim, tRollTrim, tYawTrim, tHeading };

◆ latitudeset

enum latitudeset

Definition at line 72 of file FGInitialCondition.h.

72{ setgeoc, setgeod } latitudeset;

◆ LogFormat

enum class LogFormat
strong

Definition at line 76 of file FGLog.h.

76 {
77 RESET,
78 RED,
79 BLUE,
80 CYAN,
81 GREEN,
82 DEFAULT,
83 BOLD,
84 NORMAL,
85 UNDERLINE_ON,
86 UNDERLINE_OFF
87};

◆ LogLevel

enum class LogLevel
strong

Definition at line 66 of file FGLog.h.

66 {
67 BULK, // For frequent messages
68 DEBUG, // Less frequent debug type messages
69 INFO, // Informatory messages
70 WARN, // Possible impending problem
71 ERROR, // Problem that can be recovered
72 FATAL, // Fatal problem => an exception will be thrown
73 STDOUT // Standard output - unconditionally displayed.
74};

◆ OutputForm

enum OutputForm

Definition at line 57 of file FGFCS.h.

57{ ofRad=0, ofDeg, ofNorm, ofMag , NForms} OutputForm;

◆ speedset

enum speedset

Definition at line 70 of file FGInitialCondition.h.

70{ setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;

◆ State

enum State

Models an aircraft axis for purposes of trimming.

Definition at line 82 of file FGTrimAxis.h.

82{ tAll,tUdot,tVdot,tWdot,tQdot,tPdot,tRdot,tHmgt,tNlf };

◆ TrimMode

enum TrimMode

Definition at line 67 of file FGTrim.h.

67 { tLongitudinal=0, tFull, tGround, tPullup,
68 tCustom, tTurn, tNone } TrimMode;

Function Documentation

◆ atof_locale_c()

JSBSIM_API double atof_locale_c ( const string &  input)

Definition at line 86 of file string_utilities.cpp.

87{
88 static const std::regex number_format(R"(^\s*[+-]?(\d+(\.\d*)?|\.\d+)([eE][+-]?\d+)?\s*$)");
89 const char* first = input.c_str();
90
91 // Skip leading whitespaces
92 while (isspace(*first)) ++first;
93
94 if (!*first)
95 throw InvalidNumber("Expecting a numeric attribute value, but only got spaces");
96
97 if (!std::regex_match(input, number_format))
98 throw InvalidNumber("Expecting a numeric attribute value, but got: " + input);
99
100 CNumericLocale numeric_c;
101 errno = 0; // Reset the error code
102 double value = strtod_l(first, nullptr, numeric_c.Locale);
103
104 // Error management
105 std::stringstream s;
106
107 if (fabs(value) == HUGE_VAL && errno == ERANGE)
108 s << "This number is too large: " << input;
109 else if (fabs(value) == 0 && errno == EINVAL)
110 s << "Expecting a numeric attribute value, but got: " << input;
111 else
112 return value;
113
114 throw InvalidNumber(s.str());
115}

◆ CheckPathName()

SGPath CheckPathName ( const SGPath &  path,
const SGPath &  filename 
)

Definition at line 89 of file FGModelLoader.cpp.

89 {
90 SGPath fullName = path/filename.utf8Str();
91
92 if (fullName.extension() != "xml")
93 fullName.concat(".xml");
94
95 return fullName.exists() ? fullName : SGPath();
96}

◆ DotProduct()

double DotProduct ( const FGColumnVector3 v1,
const FGColumnVector3 v2 
)
inline

Dot product of two vectors Compute and return the euclidean dot (or scalar) product of two vectors v1 and v2.

Definition at line 258 of file FGColumnVector3.h.

258 {
259 return v1(1)*v2(1) + v1(2)*v2(2) + v1(3)*v2(3);
260}
+ Here is the caller graph for this function:

◆ FindNumColumns()

unsigned int FindNumColumns ( const string &  test_line)

Definition at line 99 of file FGTable.cpp.

100{
101 // determine number of data columns in table (first column is row lookup - don't count)
102 size_t position=0;
103 unsigned int nCols=0;
104 while ((position = test_line.find_first_not_of(" \t", position)) != string::npos) {
105 nCols++;
106 position = test_line.find_first_of(" \t", position);
107 }
108 return nCols;
109}

◆ GetBinary()

bool GetBinary ( double  val,
const string &  ctxMsg 
)

Definition at line 153 of file FGFunction.cpp.

154{
155 val = fabs(val);
156 if (val < 1E-9) return false;
157 else if (val-1 < 1E-9) return true;
158 else {
159 LogException err;
160 err << ctxMsg << LogFormat::RED << LogFormat::BOLD
161 << "Malformed conditional check in function definition.\n"
162 << LogFormat::RESET;
163 throw err;
164 }
165}

◆ GetFullyQualifiedName()

JSBSIM_API std::string GetFullyQualifiedName ( const SGPropertyNode node)

Definition at line 117 of file FGPropertyManager.cpp.

118{
119 string fqname = node->getDisplayName(true);
120 const SGPropertyNode* parent = node->getParent();
121 if (!parent) return "/"; // node is the root.
122
123 while(parent) {
124 fqname = parent->getDisplayName(true) + "/" + fqname;
125 parent = parent->getParent();
126 }
127
128 return fqname;
129}
A node in a property tree.
Definition props.hxx:747
SGPropertyNode * getParent()
Get a non-const pointer to the node's parent.
Definition props.hxx:832
std::string getDisplayName(bool simplify=false) const
Get the node's pretty display name, with subscript when needed.

◆ GetLogger()

JSBSIM_API FGLogger_ptr GetLogger ( void  )

Returns the active logger for the current thread.

See also
SetLogger

Definition at line 52 of file FGLog.cpp.

52{ return GlobalLogger; }

◆ GetPrintableName()

JSBSIM_API std::string GetPrintableName ( const SGPropertyNode node)

Definition at line 96 of file FGPropertyManager.cpp.

97{
98 string temp_string(node->getNameString());
99 size_t initial_location=0;
100 size_t found_location;
101
102 found_location = temp_string.rfind("/");
103 if (found_location != string::npos)
104 temp_string = temp_string.substr(found_location);
105
106 found_location = temp_string.find('_',initial_location);
107 while (found_location != string::npos) {
108 temp_string.replace(found_location,1," ");
109 initial_location = found_location+1;
110 found_location = temp_string.find('_',initial_location);
111 }
112 return temp_string;
113}
const std::string & getNameString() const
Get the node's simple name as a string.
Definition props.hxx:815

◆ GetRelativeName()

JSBSIM_API std::string GetRelativeName ( const SGPropertyNode node,
const string &  path 
)

Definition at line 133 of file FGPropertyManager.cpp.

134{
135 string temp_string = GetFullyQualifiedName(node);
136 size_t len = path.length();
137 if ( (len > 0) && (temp_string.substr(0,len) == path) ) {
138 temp_string = temp_string.erase(0,len);
139 }
140 return temp_string;
141}

◆ is_number()

JSBSIM_API bool is_number ( const std::string &  str)

Definition at line 164 of file string_utilities.cpp.

165{
166 try {
167 atof_locale_c(str);
168 } catch (InvalidNumber&) {
169 return false;
170 }
171
172 return true;
173}

◆ make_MathFn()

FGFunction * make_MathFn ( double(*)(double)  math_fn,
FGFDMExec fdmex,
Element el,
const string &  prefix,
FGPropertyValue v 
)

Definition at line 171 of file FGFunction.cpp.

173{
174 auto f = [math_fn](const std::vector<FGParameter_ptr> &p)->double {
175 return math_fn(p[0]->GetValue());
176 };
177 return new aFunc<decltype(f), 1>(f, fdmex, el, prefix, v);
178}

◆ makeRandomGenerator()

shared_ptr< RandomNumberGenerator > makeRandomGenerator ( Element el,
FGFDMExec fdmex 
)

Definition at line 300 of file FGFunction.cpp.

301{
302 string seed_attr = el->GetAttributeValue("seed");
303 if (seed_attr.empty())
304 return fdmex->GetRandomGenerator();
305 else if (seed_attr == "time_now")
306 return make_shared<RandomNumberGenerator>();
307 else {
308 unsigned int seed = atoi(seed_attr.c_str());
309 return make_shared<RandomNumberGenerator>(seed);
310 }
311}
std::string GetAttributeValue(const std::string &key)
Retrieves an attribute.

◆ operator*() [1/7]

double operator* ( const FGParameter_ptr &  p,
double  v 
)
inline

Definition at line 78 of file FGParameter.h.

78 {
79 return p->GetValue()*v;
80}

◆ operator*() [2/7]

FGColumnVector3 operator* ( double  a,
const FGPropertyVector3 v 
)
inline

Definition at line 89 of file FGExternalForce.h.

89 {
90 return v*a;
91}

◆ operator*() [3/7]

FGColumnVector3 operator* ( double  scalar,
const FGColumnVector3 A 
)
inline

Scalar multiplication.

Parameters
scalarscalar value to multiply with.
AVector to multiply. Multiply the Vector with a scalar value. Note: At this time, this operator MUST be inlined, or a multiple definition link error will occur.

Definition at line 267 of file FGColumnVector3.h.

267 {
268 // use already defined operation.
269 return A*scalar;
270}

◆ operator*() [4/7]

FGLocation operator* ( double  scalar,
const FGLocation l 
)
inline

Scalar multiplication.

Parameters
scalarscalar value to multiply with.
lVector to multiply.

Multiply the Vector with a scalar value.

Definition at line 542 of file FGLocation.h.

543{
544 return l.operator*(scalar);
545}

◆ operator*() [5/7]

FGMatrix33 operator* ( double  scalar,
const FGMatrix33 A 
)
inline

Scalar multiplication.

Parameters
scalarscalar value to multiply with.
AMatrix to multiply.

Multiply the Matrix with a scalar value.

Definition at line 444 of file FGMatrix33.h.

444 {
445 // use already defined operation.
446 return A*scalar;
447}

◆ operator*() [6/7]

FGQuaternion operator* ( double  scalar,
const FGQuaternion q 
)
inline

Scalar multiplication.

Parameters
scalarscalar value to multiply with.
qVector to multiply.

Multiply the Vector with a scalar value.

Definition at line 539 of file FGQuaternion.h.

539 {
540 return FGQuaternion(scalar*q.data[0], scalar*q.data[1], scalar*q.data[2], scalar*q.data[3]);
541}
Models the Quaternion representation of rotations.

◆ operator*() [7/7]

double operator* ( double  v,
const FGParameter_ptr &  p 
)
inline

Definition at line 74 of file FGParameter.h.

74 {
75 return v*p->GetValue();
76}

◆ operator<<() [1/8]

JSBSIM_API std::ostream & operator<< ( std::ostream &  os,
const FGColumnVector3 col 
)

Write vector to a stream.

Parameters
osStream to write to.
colvector to write. Write the vector to a stream.

Definition at line 76 of file FGColumnVector3.cpp.

77{
78 os << col(1) << " , " << col(2) << " , " << col(3);
79 return os;
80}
+ Here is the caller graph for this function:

◆ operator<<() [2/8]

JSBSIM_API std::ostream & operator<< ( std::ostream &  os,
const FGMatrix33 M 
)

Write matrix to a stream.

Parameters
osStream to write to.
MMatrix to write.

Write the matrix to a stream.

Definition at line 194 of file FGMatrix33.cpp.

195{
196 for (unsigned int i=1; i<=M.Rows(); i++) {
197 for (unsigned int j=1; j<=M.Cols(); j++) {
198 if (i == M.Rows() && j == M.Cols())
199 os << M(i,j);
200 else
201 os << M(i,j) << ", ";
202 }
203 }
204 return os;
205}
unsigned int Cols(void) const
Number of cloumns in the matrix.
Definition FGMatrix33.h:214
unsigned int Rows(void) const
Number of rows in the matrix.
Definition FGMatrix33.h:209
+ Here is the call graph for this function:

◆ operator<<() [3/8]

JSBSIM_API std::ostream & operator<< ( std::ostream &  os,
const FGQuaternion q 
)

Write quaternion to a stream.

Parameters
osStream to write to.
qQuaternion to write. Write the quaternion to a stream.

Definition at line 248 of file FGQuaternion.cpp.

249{
250 os << q(1) << " , " << q(2) << " , " << q(3) << " , " << q(4);
251 return os;
252}

◆ operator<<() [4/8]

std::ostream & operator<< ( std::ostream &  out,
const FGStateSpace ss 
)

Definition at line 135 of file FGStateSpace.cpp.

136{
137 out << "\nX:\n" << ss.x
138 << "\nU:\n" << ss.u
139 << "\nY:\n" << ss.y;
140 return out;
141}

◆ operator<<() [5/8]

std::ostream & operator<< ( std::ostream &  out,
const FGStateSpace::Component c 
)

Definition at line 117 of file FGStateSpace.cpp.

118{
119 out << "\t" << c.getName()
120 << "\t" << c.getUnit()
121 << "\t:\t" << c.get();
122 return out;
123}

◆ operator<<() [6/8]

std::ostream & operator<< ( std::ostream &  out,
const FGStateSpace::ComponentVector v 
)

Definition at line 125 of file FGStateSpace.cpp.

126{
127 for (unsigned int i=0; i< v.getSize(); i++)
128 {
129 out << *(v.getComp(i)) << "\n";
130 }
131 out << "";
132 return out;
133}

◆ operator<<() [7/8]

std::ostream & operator<< ( std::ostream &  out,
const std::vector< double > &  vec 
)

Definition at line 171 of file FGStateSpace.cpp.

172{
173 std::streamsize width = out.width();
174 size_t nI = vec.size();
175 out << std::left << std::setw(1) << "[" << std::right;
176 for (unsigned int i=0;i<nI;i++)
177 {
178 if (i==0) out << std::setw(width-1) << vec[i];
179 else out << std::setw(width) << vec[i];
180
181 if ( i==nI-1 ) out << "]";
182 else out << ";\n";
183 }
184 out << std::flush;
185 return out;
186}

◆ operator<<() [8/8]

std::ostream & operator<< ( std::ostream &  out,
const std::vector< std::vector< double > > &  vec2d 
)

Definition at line 143 of file FGStateSpace.cpp.

144{
145 std::streamsize width = out.width();
146 size_t nI = vec2d.size();
147 out << std::left << std::setw(1) << "[" << std::right;
148 for (unsigned int i=0;i<nI;i++)
149 {
150 //FGLogging log(LogLevel::DEBUG);
151 //log << "i: " << i << "\n";
152 size_t nJ = vec2d[i].size();
153 for (unsigned int j=0;j<nJ;j++)
154 {
155 //log << "j: " << j << "\n";
156 if (i==0 && j==0) out << std::setw(width-1) << vec2d[i][j];
157 else out << std::setw(width) << vec2d[i][j];
158
159 if (j==nJ-1)
160 {
161 if ( i==nI-1 ) out << "]";
162 else out << ";\n";
163 }
164 else out << ",";
165 }
166 out << std::flush;
167 }
168 return out;
169}

◆ operator>>()

JSBSIM_API std::istream & operator>> ( std::istream &  is,
FGMatrix33 M 
)

Read matrix from a stream.

Parameters
osStream to read from.
MMatrix to initialize with the values from the stream.

Read matrix from a stream.

Definition at line 209 of file FGMatrix33.cpp.

210{
211 for (unsigned int i=1; i<=M.Rows(); i++) {
212 for (unsigned int j=1; j<=M.Cols(); j++) {
213 is >> M(i,j);
214 }
215 }
216 return is;
217}
+ Here is the call graph for this function:

◆ QExp()

FGQuaternion QExp ( const FGColumnVector3 omega)
inline

Quaternion exponential.

Parameters
omegarotation velocity Calculate the unit quaternion which is the result of the exponentiation of the vector 'omega'.

Definition at line 548 of file FGQuaternion.h.

548 {
549 FGQuaternion qexp;
550 double angle = omega.Magnitude();
551 double sina_a = angle > 0.0 ? sin(angle)/angle : 1.0;
552
553 qexp.data[0] = cos(angle);
554 qexp.data[1] = omega(1) * sina_a;
555 qexp.data[2] = omega(2) * sina_a;
556 qexp.data[3] = omega(3) * sina_a;
557
558 return qexp;
559}
double Magnitude(void) const
Length of the vector.

◆ replace()

JSBSIM_API std::string replace ( std::string  str,
const std::string &  oldstr,
const std::string &  newstr 
)

Definition at line 198 of file string_utilities.cpp.

199{
200 std::string temp = str;
201 size_t old_idx = str.find(oldstr);
202 if (old_idx != std::string::npos) {
203 temp = str.replace(old_idx, 1, newstr);
204 }
205 return temp;
206}

◆ SetLogger()

JSBSIM_API void SetLogger ( FGLogger_ptr  logger)

Sets the active logger for the current thread.

The logger is stored in thread-local storage: all JSBSim instances running in this thread share this same FGLogger instance, while other threads keep their own independent logger instance.

See also
GetLogger

Definition at line 51 of file FGLog.cpp.

51{ GlobalLogger = logger; }

◆ split()

JSBSIM_API std::vector< std::string > split ( std::string  str,
char  d 
)

Definition at line 175 of file string_utilities.cpp.

176{
177 std::vector <std::string> str_array;
178 size_t index=0;
179 std::string temp = "";
180
181 trim(str);
182 index = str.find(d);
183 while (index != std::string::npos) {
184 temp = str.substr(0,index);
185 trim(temp);
186 if (!temp.empty()) str_array.push_back(temp);
187 str = str.erase(0,index+1);
188 index = str.find(d);
189 }
190 if (!str.empty()) {
191 temp = trim(str);
192 if (!temp.empty()) str_array.push_back(temp);
193 }
194
195 return str_array;
196}

◆ sqr()

static double sqr ( double  x)
inlineconstexpr

simply square a value

Definition at line 73 of file FGWinds.cpp.

73{ return x*x; }

◆ to_lower()

JSBSIM_API std::string & to_lower ( std::string &  str)

Definition at line 158 of file string_utilities.cpp.

159{
160 for (size_t i=0; i<str.size(); i++) str[i] = tolower(str[i]);
161 return str;
162}

◆ to_upper()

JSBSIM_API std::string & to_upper ( std::string &  str)

Definition at line 152 of file string_utilities.cpp.

153{
154 for (size_t i=0; i<str.size(); i++) str[i] = toupper(str[i]);
155 return str;
156}

◆ trim()

JSBSIM_API std::string & trim ( std::string &  str)

Definition at line 134 of file string_utilities.cpp.

135{
136 if (str.empty()) return str;
137 std::string temp_str = trim_right(str);
138 return str = trim_left(temp_str);
139}

◆ trim_all_space()

JSBSIM_API std::string & trim_all_space ( std::string &  str)

Definition at line 141 of file string_utilities.cpp.

142{
143 for (size_t i=0; i<str.size(); i++) {
144 if (isspace((unsigned char)str[i])) {
145 str = str.erase(i,1);
146 --i;
147 }
148 }
149 return str;
150}

◆ trim_left()

JSBSIM_API std::string & trim_left ( std::string &  str)

Definition at line 118 of file string_utilities.cpp.

119{
120 while (!str.empty() && isspace((unsigned char)str[0])) {
121 str = str.erase(0,1);
122 }
123 return str;
124}

◆ trim_right()

JSBSIM_API std::string & trim_right ( std::string &  str)

Definition at line 126 of file string_utilities.cpp.

127{
128 while (!str.empty() && isspace((unsigned char)str[str.size()-1])) {
129 str = str.erase(str.size()-1,1);
130 }
131 return str;
132}

◆ VarArgsFn()

template<typename func_t >
FGParameter_ptr VarArgsFn ( const func_t &  _f,
FGFDMExec fdmex,
Element el,
const string &  prefix,
FGPropertyValue v 
)

Definition at line 186 of file FGFunction.cpp.

188{
189 try {
190 return new aFunc<func_t, 2>(_f, fdmex, el, prefix, v, MaxArgs);
191 }
192 catch(WrongNumberOfArguments& e) {
193 if ((e.GetElement() == el) && (e.NumberOfArguments() == 1)) {
194 FGXMLLogging log(el, LogLevel::WARN);
195 log << LogFormat::RED
196 << "<" << el->GetName()
197 << "> only has one argument which makes it a no-op.\n"
198 << "Its argument will be evaluated but <" << el->GetName()
199 << "> will not be applied to the result.\n" << LogFormat::RESET;
200 return e.FirstParameter();
201 }
202 else
203 throw e;
204 }
205}
const std::string & GetName(void) const
Retrieves the element name.

Variable Documentation

◆ ControlNames

const std::string ControlNames[]
Initial value:
= { "Throttle","Sideslip","Angle of Attack",
"Elevator","Ailerons","Rudder",
"Altitude AGL", "Pitch Angle",
"Roll Angle", "Flight Path Angle",
"Pitch Trim", "Roll Trim", "Yaw Trim",
"Heading"
}

Definition at line 60 of file FGTrimAxis.h.

60 { "Throttle","Sideslip","Angle of Attack",
61 "Elevator","Ailerons","Rudder",
62 "Altitude AGL", "Pitch Angle",
63 "Roll Angle", "Flight Path Angle",
64 "Pitch Trim", "Roll Trim", "Yaw Trim",
65 "Heading"
66 };

◆ GlobalLogger

thread_local FGLogger_ptr GlobalLogger = std::make_shared<FGLogConsole>()

Definition at line 49 of file FGLog.cpp.

◆ hptowatts

constexpr double hptowatts = 745.7
constexpr

Definition at line 74 of file FGBrushLessDCMotor.h.

◆ invlog2val

const double invlog2val = 1.0/log10(2.0)

Definition at line 52 of file FGFunction.cpp.

◆ MaxArgs

constexpr unsigned int MaxArgs = 9999
constexpr

Definition at line 53 of file FGFunction.cpp.

◆ NMtoftpound

constexpr double NMtoftpound = 1.3558
constexpr

Models an electric brushless DC motor or more appropriately permanent magnet synchronous motor.

as alternative to basic electric motor. BLDC motor code is based on basic "3 constant motor equations" It require 3 basic physical motor properties (available from manufactures): Kv speed motor constant [RPM/Volt] Rm internal coil resistance [Ohms] I0 no load current [Amperes] additional inputs : maxvolts nominal voltage from battery

Input format : <brushless_dc_motor> <maxvolts units="VOLTS"> {number} </maxvolts> <velocityconstant units="RPM/V"> {number} </velocityconstant> <coilresistance units="OHMS"> {number} </coilresistance> <noloadcurrent units="AMPERES"> {number} </noloadcurrent> </brushless_dc_motor>

Definition at line 73 of file FGBrushLessDCMotor.h.

◆ StateNames

const std::string StateNames[]
Initial value:
= { "all","udot","vdot","wdot","qdot","pdot",
"rdot","hmgt","nlf"
}

Definition at line 57 of file FGTrimAxis.h.

57 { "all","udot","vdot","wdot","qdot","pdot",
58 "rdot","hmgt","nlf"
59 };

◆ WattperRPMtoftpound

constexpr double WattperRPMtoftpound = 60 / (2 * M_PI * NMtoftpound)
constexpr

Definition at line 75 of file FGBrushLessDCMotor.h.