Curt Olson:
Sync with most current JSBSim CVS.
This commit is contained in:
parent
8e5a884428
commit
95440173ca
82 changed files with 1502 additions and 1085 deletions
|
@ -107,7 +107,7 @@ bool FGAerodynamics::Run(void)
|
|||
if (!FGModel::Run()) {
|
||||
|
||||
twovel = 2*Translation->GetVt();
|
||||
if (twovel > 0) {
|
||||
if (twovel != 0) {
|
||||
bi2vel = Aircraft->GetWingSpan() / twovel;
|
||||
ci2vel = Aircraft->Getcbar() / twovel;
|
||||
}
|
||||
|
|
|
@ -80,9 +80,17 @@ CLASS DOCUMENTATION
|
|||
This class owns and contains the list of coefficients that define the
|
||||
aerodynamic properties of this aircraft. Here also, such unique phenomena
|
||||
as ground effect and maximum lift curve tailoff are handled.
|
||||
@author Jon S. Berndt
|
||||
@author Tony Peden
|
||||
@version $Id$
|
||||
@config
|
||||
<pre>
|
||||
\<AERODYNAMICS>
|
||||
\<AXIS NAME="{LIFT|DRAG|SIDE|ROLL|PITCH|YAW}">
|
||||
{Coefficient definitions}
|
||||
\</AXIS>
|
||||
{Additional axis definitions}
|
||||
\</AERODYNAMICS> </pre>
|
||||
|
||||
@author Jon S. Berndt, Tony Peden
|
||||
$Id$
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -232,6 +232,10 @@ bool FGAircraft::Load(FGConfigFile* AC_cfg)
|
|||
} else if (parameter == "AC_AERORP") {
|
||||
*AC_cfg >> vXYZrp(eX) >> vXYZrp(eY) >> vXYZrp(eZ);
|
||||
if (debug_lvl > 0) cout << " Ref Pt (x, y, z): " << vXYZrp << endl;
|
||||
} else if (parameter == "AC_VRP") {
|
||||
*AC_cfg >> vXYZvrp(eX) >> vXYZvrp(eY) >> vXYZvrp(eZ);
|
||||
if (debug_lvl > 0) cout << " Visual Ref Pt (x, y, z): " << vXYZvrp << endl;
|
||||
Position->SetVRP(vXYZvrp);
|
||||
} else if (parameter == "AC_POINTMASS") {
|
||||
*AC_cfg >> pmWt >> pmX >> pmY >> pmZ;
|
||||
MassBalance->AddPointMass(pmWt, pmX, pmY, pmZ);
|
||||
|
@ -306,6 +310,12 @@ void FGAircraft::bind(void)
|
|||
(PMF)&FGAircraft::GetXYZep);
|
||||
PropertyManager->Tie("metrics/eyepoint-z-ft", this,3,
|
||||
(PMF)&FGAircraft::GetXYZep);
|
||||
PropertyManager->Tie("metrics/visualrefpoint-x-in", this,1,
|
||||
(PMF)&FGAircraft::GetXYZvrp);
|
||||
PropertyManager->Tie("metrics/visualrefpoint-y-in", this,2,
|
||||
(PMF)&FGAircraft::GetXYZvrp);
|
||||
PropertyManager->Tie("metrics/visualrefpoint-z-in", this,3,
|
||||
(PMF)&FGAircraft::GetXYZvrp);
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -336,6 +346,9 @@ void FGAircraft::unbind(void)
|
|||
PropertyManager->Untie("metrics/eyepoint-x-ft");
|
||||
PropertyManager->Untie("metrics/eyepoint-y-ft");
|
||||
PropertyManager->Untie("metrics/eyepoint-z-ft");
|
||||
PropertyManager->Untie("metrics/visualrefpoint-x-in");
|
||||
PropertyManager->Untie("metrics/visualrefpoint-y-in");
|
||||
PropertyManager->Untie("metrics/visualrefpoint-z-in");
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -73,10 +73,6 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
|
@ -85,26 +81,20 @@ CLASS DOCUMENTATION
|
|||
the Engines, Tanks, Propellers, Nozzles, Aerodynamic and Mass properties,
|
||||
landing gear, etc. These constituent parts may actually run as separate
|
||||
JSBSim models themselves, but the responsibility for initializing them and
|
||||
for retrieving their force and moment contributions falls to FGAircraft.<br>
|
||||
|
||||
for retrieving their force and moment contributions falls to FGAircraft.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see
|
||||
<ol><li>Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
@see Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||
School, January 1994</li>
|
||||
<li>D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977</li>
|
||||
<li>Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975</li>
|
||||
<li>Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5</li>
|
||||
<li>Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2</li></ol>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAircraft.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
School, January 1994
|
||||
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977
|
||||
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975
|
||||
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -155,10 +145,14 @@ public:
|
|||
inline FGColumnVector3& GetForces(void) { return vForces; }
|
||||
inline double GetForces(int idx) const { return vForces(idx); }
|
||||
inline FGColumnVector3& GetBodyAccel(void) { return vBodyAccel; }
|
||||
inline double GetBodyAccel(int idx) { return vBodyAccel(idx); }
|
||||
inline FGColumnVector3& GetNcg (void) { return vNcg; }
|
||||
inline double GetNcg(int idx) { return vNcg(idx); }
|
||||
inline FGColumnVector3& GetXYZrp(void) { return vXYZrp; }
|
||||
inline FGColumnVector3& GetXYZvrp(void) { return vXYZvrp; }
|
||||
inline FGColumnVector3& GetXYZep(void) { return vXYZep; }
|
||||
inline double GetXYZrp(int idx) const { return vXYZrp(idx); }
|
||||
inline double GetXYZvrp(int idx) const { return vXYZvrp(idx); }
|
||||
inline double GetXYZep(int idx) const { return vXYZep(idx); }
|
||||
inline void SetAircraftName(string name) {AircraftName = name;}
|
||||
|
||||
|
@ -173,6 +167,7 @@ private:
|
|||
FGColumnVector3 vMoments;
|
||||
FGColumnVector3 vForces;
|
||||
FGColumnVector3 vXYZrp;
|
||||
FGColumnVector3 vXYZvrp;
|
||||
FGColumnVector3 vXYZep;
|
||||
FGColumnVector3 vEuler;
|
||||
FGColumnVector3 vDXYZcg;
|
||||
|
|
|
@ -156,9 +156,9 @@ bool FGAtmosphere::Run(void)
|
|||
|
||||
Debug(2);
|
||||
|
||||
return false;
|
||||
return false;
|
||||
} else { // skip Run() execution this time
|
||||
return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*******************************************************************************
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
Header: FGAtmosphere.h
|
||||
Author: Jon Berndt
|
||||
|
@ -27,21 +27,20 @@
|
|||
HISTORY
|
||||
--------------------------------------------------------------------------------
|
||||
11/24/98 JSB Created
|
||||
07/23/99 TP Added implementation of 1959 Standard Atmosphere
|
||||
Moved calculation of Mach number to FGTranslation
|
||||
Updated to '76 model
|
||||
07/23/99 TP Added implementation of 1959 Standard Atmosphere
|
||||
Moved calculation of Mach number to FGTranslation
|
||||
Updated to '76 model
|
||||
|
||||
|
||||
********************************************************************************
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
*******************************************************************************/
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#ifndef FGAtmosphere_H
|
||||
#define FGAtmosphere_H
|
||||
|
||||
/*******************************************************************************
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
INCLUDES
|
||||
*******************************************************************************/
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#include "FGModel.h"
|
||||
#include "FGMatrix33.h"
|
||||
|
@ -61,28 +60,19 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
[1] Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
|
||||
1989, ISBN 0-07-001641-0
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models the standard atmosphere.
|
||||
@author Tony Peden, Jon Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAtmosphere.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAtmosphere.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
@see Anderson, John D. "Introduction to Flight, Third Edition", McGraw-Hill,
|
||||
1989, ISBN 0-07-001641-0
|
||||
*/
|
||||
|
||||
/******************************************************************************
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
*******************************************************************************/
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
class FGAtmosphere : public FGModel {
|
||||
public:
|
||||
|
@ -159,7 +149,7 @@ public:
|
|||
void unbind(void);
|
||||
|
||||
|
||||
private:
|
||||
protected:
|
||||
double rho;
|
||||
|
||||
enum tType {ttStandard, ttBerndt, ttNone} turbType;
|
||||
|
@ -196,6 +186,6 @@ private:
|
|||
|
||||
} // namespace JSBSim
|
||||
|
||||
/******************************************************************************/
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
#endif
|
||||
|
||||
|
|
|
@ -98,28 +98,33 @@ bool FGAuxiliary::Run()
|
|||
if (!FGModel::Run()) {
|
||||
GetState();
|
||||
|
||||
//caculate total temperature assuming isentropic flow
|
||||
//calculate total temperature assuming isentropic flow
|
||||
tat=sat*(1 + 0.2*mach*mach);
|
||||
tatc=RankineToCelsius(tat);
|
||||
|
||||
if (mach < 1) { //calculate total pressure assuming isentropic flow
|
||||
pt=p*pow((1 + 0.2*mach*mach),3.5);
|
||||
pt=p*pow((1 + 0.2*machU*machU),3.5);
|
||||
} else {
|
||||
// shock in front of pitot tube, we'll assume its normal and use
|
||||
// the Rayleigh Pitot Tube Formula, i.e. the ratio of total
|
||||
// pressure behind the shock to the static pressure in front
|
||||
|
||||
B = 5.76*mach*mach/(5.6*mach*mach - 0.8);
|
||||
B = 5.76*machU*machU/(5.6*machU*machU - 0.8);
|
||||
|
||||
// The denominator above is zero for Mach ~ 0.38, for which
|
||||
// we'll never be here, so we're safe
|
||||
|
||||
D = (2.8*mach*mach-0.4)*0.4167;
|
||||
D = (2.8*machU*machU-0.4)*0.4167;
|
||||
pt = p*pow(B,3.5)*D;
|
||||
}
|
||||
|
||||
A = pow(((pt-p)/psl+1),0.28571);
|
||||
vcas = sqrt(7*psl/rhosl*(A-1));
|
||||
veas = sqrt(2*qbar/rhosl);
|
||||
if (machU > 0.0) {
|
||||
vcas = sqrt(7*psl/rhosl*(A-1));
|
||||
veas = sqrt(2*qbar/rhosl);
|
||||
} else {
|
||||
vcas = veas = 0.0;
|
||||
}
|
||||
|
||||
// Pilot sensed accelerations are calculated here. This is used
|
||||
// for the coordinated turn ball instrument. Motion base platforms sometimes
|
||||
|
@ -222,8 +227,12 @@ void FGAuxiliary::bind(void)
|
|||
&FGAuxiliary::GetVequivalentFPS);
|
||||
PropertyManager->Tie("velocities/ve-kts", this,
|
||||
&FGAuxiliary::GetVequivalentKTS);
|
||||
PropertyManager->Tie("velocities/machU", this,
|
||||
&FGAuxiliary::GetMachU);
|
||||
PropertyManager->Tie("velocities/tat-r", this,
|
||||
&FGAuxiliary::GetTotalTemperature);
|
||||
PropertyManager->Tie("velocities/tat-c", this,
|
||||
&FGAuxiliary::GetTAT_C);
|
||||
PropertyManager->Tie("velocities/pt-lbs_sqft", this,
|
||||
&FGAuxiliary::GetTotalPressure);
|
||||
|
||||
|
@ -257,6 +266,9 @@ void FGAuxiliary::unbind(void)
|
|||
PropertyManager->Untie("velocities/vc-kts");
|
||||
PropertyManager->Untie("velocities/ve-fps");
|
||||
PropertyManager->Untie("velocities/ve-kts");
|
||||
PropertyManager->Untie("velocities/machU");
|
||||
PropertyManager->Untie("velocities/tat-r");
|
||||
PropertyManager->Untie("velocities/tat-c");
|
||||
PropertyManager->Untie("accelerations/a-pilot-x-ft_sec2");
|
||||
PropertyManager->Untie("accelerations/a-pilot-y-ft_sec2");
|
||||
PropertyManager->Untie("accelerations/a-pilot-z-ft_sec2");
|
||||
|
@ -275,6 +287,7 @@ void FGAuxiliary::GetState(void)
|
|||
{
|
||||
qbar = Translation->Getqbar();
|
||||
mach = Translation->GetMach();
|
||||
machU= Translation->GetMachU();
|
||||
p = Atmosphere->GetPressure();
|
||||
rhosl = Atmosphere->GetDensitySL();
|
||||
psl = Atmosphere->GetPressureSL();
|
||||
|
|
|
@ -56,10 +56,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -67,10 +63,6 @@ CLASS DOCUMENTATION
|
|||
/** Encapsulates various uncategorized scheduled functions.
|
||||
@author Tony Peden, Jon Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAuxiliary.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGAuxiliary.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -81,7 +73,7 @@ class FGAuxiliary : public FGModel {
|
|||
public:
|
||||
/** Constructor
|
||||
@param Executive a pointer to the parent executive object */
|
||||
FGAuxiliary(FGFDMExec*);
|
||||
FGAuxiliary(FGFDMExec* Executive);
|
||||
/// Destructor
|
||||
~FGAuxiliary();
|
||||
|
||||
|
@ -94,8 +86,10 @@ public:
|
|||
inline double GetVcalibratedKTS(void) const { return vcas*fpstokts; }
|
||||
inline double GetVequivalentFPS(void) const { return veas; }
|
||||
inline double GetVequivalentKTS(void) const { return veas*fpstokts; }
|
||||
inline double GetMachU(void) const { return machU; }
|
||||
|
||||
inline double GetTotalTemperature(void) const { return tat; }
|
||||
inline double GetTAT_C(void) const { return tatc; }
|
||||
|
||||
// total pressure above is freestream total pressure for subsonic only
|
||||
// for supersonic it is the 1D total pressure behind a normal shock
|
||||
|
@ -118,7 +112,8 @@ private:
|
|||
double vcas;
|
||||
double veas;
|
||||
double mach;
|
||||
double qbar,rhosl,rho,p,psl,pt,tat,sat;
|
||||
double machU;
|
||||
double qbar,rhosl,rho,p,psl,pt,tat,sat,tatc;
|
||||
|
||||
// Don't add a getter for pt!
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ INCLUDES
|
|||
#include "FGPropertyManager.h"
|
||||
|
||||
#ifndef FGFS
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iomanip.h>
|
||||
# else
|
||||
# include <iomanip>
|
||||
|
|
|
@ -75,13 +75,6 @@ class FGAuxiliary;
|
|||
class FGOutput;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
Note that the coefficients need not be calculated each delta-t. This is
|
||||
something that may be fixed someday.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
|
@ -92,10 +85,6 @@ CLASS DOCUMENTATION
|
|||
is called and the coefficient values are calculated.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGCoefficient.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -148,8 +137,7 @@ public:
|
|||
|
||||
/** Outputs coefficient information.
|
||||
Non-dimensionalizing parameter descriptions are output
|
||||
for each aero coefficient defined.
|
||||
@param multipliers the list of multipliers for this coefficient.*/
|
||||
for each aero coefficient defined. */
|
||||
virtual void DisplayCoeffFactors(void);
|
||||
|
||||
/// Returns the name of the coefficient.
|
||||
|
|
|
@ -33,14 +33,18 @@ INCLUDES
|
|||
SG_USING_STD(endl);
|
||||
#else
|
||||
# include <string>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <fstream.h>
|
||||
# include <math.h>
|
||||
# include <iostream.h>
|
||||
# include <math.h>
|
||||
# else
|
||||
# include <fstream>
|
||||
# include <cmath>
|
||||
# include <iostream>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# include <math.h>
|
||||
# else
|
||||
# include <cmath>
|
||||
# endif
|
||||
using std::ostream;
|
||||
using std::istream;
|
||||
using std::cerr;
|
||||
|
@ -65,7 +69,16 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DECLARATION: FGColumnVector3
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** This class implements a 3 dimensional vector.
|
||||
@author Jon S. Berndt, Tony Peden, et. al.
|
||||
@version $Id$
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
class FGColumnVector3 : public FGJSBBase
|
||||
|
|
|
@ -33,13 +33,17 @@ INCLUDES
|
|||
SG_USING_STD(endl);
|
||||
#else
|
||||
# include <string>
|
||||
# if defined (sgi) && !defined(__GNUC__)
|
||||
# if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <fstream.h>
|
||||
# include <math.h>
|
||||
# include <iostream.h>
|
||||
# include <math.h>
|
||||
# else
|
||||
# include <fstream>
|
||||
# if defined (sgi) && !defined(__GNUC__)
|
||||
# include <math.h>
|
||||
# else
|
||||
# include <cmath>
|
||||
# endif
|
||||
# include <iostream>
|
||||
using std::ostream;
|
||||
using std::istream;
|
||||
|
@ -65,7 +69,16 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DECLARATION: FGColumnVector4
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** This class implements a 4 dimensional vector.
|
||||
@author Jon S. Berndt, Tony Peden, et. al.
|
||||
@version $Id$
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
class FGColumnVector4 : public FGJSBBase
|
||||
|
|
|
@ -32,7 +32,7 @@ CLASS IMPLEMENTATION
|
|||
|
||||
FGConfigFile::FGConfigFile(string cfgFileName)
|
||||
{
|
||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
||||
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||
cfgfile.open(cfgFileName.c_str(), ios::in );
|
||||
#else
|
||||
cfgfile.open(cfgFileName.c_str(), ios::in | ios::binary );
|
||||
|
@ -40,7 +40,7 @@ FGConfigFile::FGConfigFile(string cfgFileName)
|
|||
CommentsOn = false;
|
||||
CurrentIndex = 0;
|
||||
Opened = true;
|
||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
||||
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||
if (!cfgfile.fail() && !cfgfile.eof()) GetNextConfigLine();
|
||||
#else
|
||||
if (cfgfile.is_open()) GetNextConfigLine();
|
||||
|
@ -214,7 +214,7 @@ string FGConfigFile::GetLine(void)
|
|||
}
|
||||
} else {
|
||||
if ((test = cfgfile.get()) != EOF) { // get *next* character
|
||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
||||
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||
if (test >= 0x20 || test == 0x09) cfgfile.putback(test);
|
||||
#else
|
||||
if (test >= 0x20 || test == 0x09) cfgfile.unget();
|
||||
|
|
|
@ -53,7 +53,7 @@ INCLUDES
|
|||
SG_USING_STD(cout);
|
||||
#else
|
||||
# include <string>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <fstream.h>
|
||||
# include <iostream.h>
|
||||
# else
|
||||
|
@ -61,11 +61,11 @@ INCLUDES
|
|||
# include <iostream>
|
||||
using std::ostream;
|
||||
using std::istream;
|
||||
using std::ifstream;
|
||||
using std::ios;
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
using std::cout;
|
||||
using std::ifstream;
|
||||
using std::endl;
|
||||
# endif
|
||||
using std::string;
|
||||
#endif
|
||||
|
@ -84,10 +84,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -96,10 +92,6 @@ CLASS DOCUMENTATION
|
|||
JSBSim config files are in XML format.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGConfigFile.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGConfigFile.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -124,9 +116,10 @@ public:
|
|||
string GetCurrentLine(void) { return CurrentLine; }
|
||||
|
||||
/** Returns the value of the tag supplied.
|
||||
@param
|
||||
@return */
|
||||
string GetValue(string);
|
||||
@param tag the tag for the value that is desired.
|
||||
@return tthe value of the tag supplied.*/
|
||||
string GetValue(string tag);
|
||||
|
||||
string GetValue(void);
|
||||
string GetCommentString(void) {return CommentString;}
|
||||
string GetLineComment(void) {return LineComment;}
|
||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
|||
# include <fstream.h>
|
||||
# endif
|
||||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <fstream.h>
|
||||
# else
|
||||
# include <fstream>
|
||||
|
@ -67,45 +67,40 @@ CLASS IMPLEMENTATION
|
|||
|
||||
|
||||
FGEngine::FGEngine(FGFDMExec* exec)
|
||||
: Name(""),
|
||||
Type(etUnknown),
|
||||
X(0), Y(0), Z(0),
|
||||
EnginePitch(0), EngineYaw(0),
|
||||
SLFuelFlowMax(0), SLOxiFlowMax(0),
|
||||
MaxThrottle(1.0), MinThrottle(0.0),
|
||||
Thrust(0.0),
|
||||
Throttle(0.0),
|
||||
Mixture(1.0),
|
||||
Magnetos(0),
|
||||
Starter(false),
|
||||
FuelNeed(0.0), OxidizerNeed(0.0),
|
||||
Starved(false), Flameout(false), Running(false), Cranking(false),
|
||||
Augmentation(false), Injection(false), Ignition(false),
|
||||
Reversed(false), Cutoff(true), Nitrous(false),
|
||||
PctPower(0.0),
|
||||
EngineNumber(-1),
|
||||
TrimMode(false),
|
||||
FuelFlow_gph(0.0),
|
||||
ManifoldPressure_inHg(0.0),
|
||||
ExhaustGasTemp_degK(0.0),
|
||||
CylinderHeadTemp_degK(0.0),
|
||||
OilPressure_psi(0.0),
|
||||
OilTemp_degK(0.0),
|
||||
FuelFlow_pph(0.0),
|
||||
N1(0.0), N2(0.0), EGT_degC(0.0),
|
||||
InletPosition(0.0), NozzlePosition(0.0),
|
||||
FDMExec(exec),
|
||||
State(FDMExec->GetState()),
|
||||
Atmosphere(FDMExec->GetAtmosphere()),
|
||||
FCS(FDMExec->GetFCS()),
|
||||
Propulsion(FDMExec->GetPropulsion()),
|
||||
Aircraft(FDMExec->GetAircraft()),
|
||||
Translation(FDMExec->GetTranslation()),
|
||||
Rotation(FDMExec->GetRotation()),
|
||||
Position(FDMExec->GetPosition()),
|
||||
Auxiliary(FDMExec->GetAuxiliary()),
|
||||
Output(FDMExec->GetOutput())
|
||||
{
|
||||
Name.clear();
|
||||
Type = etUnknown;
|
||||
X = Y = Z = 0.0;
|
||||
EnginePitch = EngineYaw = 0.0;
|
||||
SLFuelFlowMax = SLOxiFlowMax = 0.0;
|
||||
MaxThrottle = 1.0;
|
||||
MinThrottle = 0.0;
|
||||
Thrust = 0.0;
|
||||
Throttle = 0.0;
|
||||
Mixture = 1.0;
|
||||
Starter = false;
|
||||
FuelNeed = OxidizerNeed = 0.0;
|
||||
Starved = Running = Cranking = false;
|
||||
PctPower = 0.0;
|
||||
EngineNumber = -1;
|
||||
TrimMode = false;
|
||||
FuelFlow_gph = 0.0;
|
||||
FuelFlow_pph = 0.0;
|
||||
|
||||
FDMExec = exec;
|
||||
State = FDMExec->GetState();
|
||||
Atmosphere = FDMExec->GetAtmosphere();
|
||||
FCS = FDMExec->GetFCS();
|
||||
Propulsion = FDMExec->GetPropulsion();
|
||||
Aircraft = FDMExec->GetAircraft();
|
||||
Translation = FDMExec->GetTranslation();
|
||||
Rotation = FDMExec->GetRotation();
|
||||
Position = FDMExec->GetPosition();
|
||||
Auxiliary = FDMExec->GetAuxiliary();
|
||||
Output = FDMExec->GetOutput();
|
||||
|
||||
PropertyManager = FDMExec->GetPropertyManager();
|
||||
|
||||
Debug(0);
|
||||
}
|
||||
|
||||
|
@ -144,21 +139,24 @@ void FGEngine::ConsumeFuel(void)
|
|||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGEngine::CalcFuelNeed(void) {
|
||||
double FGEngine::CalcFuelNeed(void)
|
||||
{
|
||||
FuelNeed = SLFuelFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
||||
return FuelNeed;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGEngine::CalcOxidizerNeed(void) {
|
||||
double FGEngine::CalcOxidizerNeed(void)
|
||||
{
|
||||
OxidizerNeed = SLOxiFlowMax*PctPower*State->Getdt()*Propulsion->GetRate();
|
||||
return OxidizerNeed;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw) {
|
||||
void FGEngine::SetPlacement(double x, double y, double z, double pitch, double yaw)
|
||||
{
|
||||
X = x;
|
||||
Y = y;
|
||||
Z = z;
|
||||
|
|
|
@ -59,6 +59,7 @@ INCLUDES
|
|||
#endif
|
||||
|
||||
#include "FGJSBBase.h"
|
||||
#include "FGPropertyManager.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
|
@ -87,10 +88,6 @@ class FGPosition;
|
|||
class FGAuxiliary;
|
||||
class FGOutput;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -114,55 +111,22 @@ public:
|
|||
|
||||
enum EngineType {etUnknown, etRocket, etPiston, etTurbine, etSimTurbine};
|
||||
|
||||
EngineType GetType(void) { return Type; }
|
||||
virtual string GetName(void) { return Name; }
|
||||
|
||||
// Engine controls
|
||||
virtual double GetThrottleMin(void) { return MinThrottle; }
|
||||
virtual double GetThrottleMax(void) { return MaxThrottle; }
|
||||
virtual double GetThrottle(void) { return Throttle; }
|
||||
virtual double GetMixture(void) { return Mixture; }
|
||||
virtual int GetMagnetos(void) { return Magnetos; }
|
||||
virtual bool GetStarter(void) { return Starter; }
|
||||
virtual double GetThrust(void) { return Thrust; }
|
||||
virtual bool GetStarved(void) { return Starved; }
|
||||
virtual bool GetFlameout(void) { return Flameout; }
|
||||
virtual bool GetRunning(void) { return Running; }
|
||||
virtual bool GetCranking(void) { return Cranking; }
|
||||
virtual int GetType(void) { return Type; }
|
||||
virtual string GetName(void) { return Name; }
|
||||
virtual double GetN1(void) { return N1; }
|
||||
virtual double GetN2(void) { return N2; }
|
||||
virtual double GetEGT(void) { return EGT_degC; }
|
||||
virtual double GetEPR(void) { return EPR; }
|
||||
virtual double GetInlet(void) { return InletPosition; }
|
||||
virtual double GetNozzle(void) { return NozzlePosition; }
|
||||
virtual bool GetAugmentation(void) { return Augmentation; }
|
||||
virtual bool GetInjection(void) { return Injection; }
|
||||
virtual int GetIgnition(void) { return Ignition; }
|
||||
virtual bool GetReversed(void) { return Reversed; }
|
||||
virtual bool GetCutoff(void) { return Cutoff; }
|
||||
virtual bool GetNitrous(void) { return Nitrous; }
|
||||
|
||||
virtual double getFuelFlow_gph () const {
|
||||
return FuelFlow_gph;
|
||||
}
|
||||
|
||||
virtual double getManifoldPressure_inHg () const {
|
||||
return ManifoldPressure_inHg;
|
||||
}
|
||||
virtual double getExhaustGasTemp_degF () const {
|
||||
return (ExhaustGasTemp_degK - 273) * (9.0 / 5.0) + 32.0;
|
||||
}
|
||||
virtual double getCylinderHeadTemp_degF () const {
|
||||
return (CylinderHeadTemp_degK - 273) * (9.0 / 5.0) + 32.0;
|
||||
}
|
||||
virtual double getOilPressure_psi () const {
|
||||
return OilPressure_psi;
|
||||
}
|
||||
virtual double getOilTemp_degF () const {
|
||||
return (OilTemp_degK - 273.0) * (9.0 / 5.0) + 32.0;
|
||||
}
|
||||
|
||||
virtual double getFuelFlow_pph () const {
|
||||
return FuelFlow_pph;
|
||||
}
|
||||
virtual double getFuelFlow_gph () const {return FuelFlow_gph;}
|
||||
virtual double getFuelFlow_pph () const {return FuelFlow_pph;}
|
||||
virtual double GetThrust(void) { return Thrust; }
|
||||
virtual bool GetStarved(void) { return Starved; }
|
||||
virtual bool GetRunning(void) { return Running; }
|
||||
virtual bool GetCranking(void) { return Cranking; }
|
||||
|
||||
virtual void SetStarved(bool tt) { Starved = tt; }
|
||||
virtual void SetStarved(void) { Starved = true; }
|
||||
|
@ -171,14 +135,7 @@ public:
|
|||
virtual void SetName(string name) { Name = name; }
|
||||
virtual void AddFeedTank(int tkID);
|
||||
|
||||
virtual void SetMagnetos(int m) { Magnetos = m; }
|
||||
virtual void SetStarter(bool s) { Starter = s; }
|
||||
virtual void SetAugmentation(bool a) { Augmentation = a; }
|
||||
virtual void SetInjection(bool i) { Injection = i; }
|
||||
virtual void SetIgnition(int ig) { Ignition = ig; }
|
||||
virtual void SetReverse(bool r) { Reversed = r; }
|
||||
virtual void SetCutoff(bool c) { Cutoff = c; }
|
||||
virtual void SetNitrous(bool n) { Nitrous = n; }
|
||||
|
||||
/** Calculates the thrust of the engine, and other engine functions.
|
||||
@param PowerRequired this is the power required to run the thrusting device
|
||||
|
@ -218,6 +175,7 @@ public:
|
|||
virtual void SetTrimMode(bool state) {TrimMode = state;}
|
||||
|
||||
protected:
|
||||
FGPropertyManager* PropertyManager;
|
||||
string Name;
|
||||
EngineType Type;
|
||||
double X, Y, Z;
|
||||
|
@ -231,38 +189,18 @@ protected:
|
|||
double Thrust;
|
||||
double Throttle;
|
||||
double Mixture;
|
||||
int Magnetos;
|
||||
bool Starter;
|
||||
double FuelNeed, OxidizerNeed;
|
||||
bool Starved;
|
||||
bool Flameout;
|
||||
bool Running;
|
||||
bool Cranking;
|
||||
double FuelNeed;
|
||||
double OxidizerNeed;
|
||||
double PctPower;
|
||||
int EngineNumber;
|
||||
bool Starter;
|
||||
bool Starved;
|
||||
bool Running;
|
||||
bool Cranking;
|
||||
bool TrimMode;
|
||||
|
||||
double FuelFlow_gph;
|
||||
double ManifoldPressure_inHg;
|
||||
double ExhaustGasTemp_degK;
|
||||
double CylinderHeadTemp_degK;
|
||||
double OilPressure_psi;
|
||||
double OilTemp_degK;
|
||||
|
||||
double FuelFlow_pph;
|
||||
double N1;
|
||||
double N2;
|
||||
double EGT_degC;
|
||||
double EPR;
|
||||
double BleedDemand;
|
||||
double InletPosition;
|
||||
double NozzlePosition;
|
||||
bool Augmentation;
|
||||
bool Injection;
|
||||
int Ignition;
|
||||
bool Reversed;
|
||||
bool Cutoff;
|
||||
bool Nitrous;
|
||||
|
||||
FGFDMExec* FDMExec;
|
||||
FGState* State;
|
||||
|
@ -277,7 +215,7 @@ protected:
|
|||
FGOutput* Output;
|
||||
|
||||
vector <int> SourceTanks;
|
||||
virtual void Debug(int from);
|
||||
void Debug(int from);
|
||||
};
|
||||
}
|
||||
#include "FGState.h"
|
||||
|
|
|
@ -70,18 +70,12 @@ namespace JSBSim {
|
|||
typedef enum { iDe=0, iDaL, iDaR, iDr, iDsb, iDsp, iDf, NNorm } FcIdx;
|
||||
typedef enum { ofRad=0, ofNorm, ofMag , NForms} OutputForm;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates the Flight Control System (FCS) functionality.
|
||||
<ul><li>\URL[Source Code]{FGFCS.cpp.html}</li>
|
||||
<li>\URL[Header File]{FGFCS.h.html}</li></ul>
|
||||
This class owns and contains the list of \URL[components]{FGFCSComponent.html}
|
||||
This class owns and contains the list of FGFCSComponents
|
||||
that define the control system for this aircraft. The config file for the
|
||||
aircraft contains a description of the control path that starts at an input
|
||||
or command and ends at an effector, e.g. an aerosurface. The FCS components
|
||||
|
@ -152,10 +146,6 @@ CLASS DOCUMENTATION
|
|||
@see FGGradient
|
||||
@see FGFilter
|
||||
@see FGDeadBand
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFCS.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFCS.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
|||
# include STL_IOSTREAM
|
||||
# include STL_ITERATOR
|
||||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iostream.h>
|
||||
# else
|
||||
# include <iostream>
|
||||
|
@ -500,6 +500,7 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
|
|||
scratch = AC_cfg->GetValue("VERSION").c_str();
|
||||
|
||||
CFGVersion = AC_cfg->GetValue("VERSION");
|
||||
Release = AC_cfg->GetValue("RELEASE");
|
||||
|
||||
if (debug_lvl > 0)
|
||||
cout << " Version: " << highint << CFGVersion
|
||||
|
@ -511,6 +512,25 @@ bool FGFDMExec::ReadPrologue(FGConfigFile* AC_cfg)
|
|||
cerr << " You have version: " << CFGVersion << endl << fgdef << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Release == "ALPHA") {
|
||||
system("banner ALPHA");
|
||||
cout << endl << endl
|
||||
<< highint << "This aircraft model is an " << fgred << Release
|
||||
<< reset << highint << " release!!!" << endl << endl << reset
|
||||
<< "This aircraft model may not even properly load, and probably"
|
||||
<< " will not fly as expected." << endl << endl
|
||||
<< fgred << highint << "Use this model for development purposes ONLY!!!"
|
||||
<< normint << endl << endl;
|
||||
} else if (Release == "BETA") {
|
||||
system("banner BETA");
|
||||
cout << endl << endl
|
||||
<< highint << "This aircraft model is a " << fgred << Release
|
||||
<< reset << highint << " release!!!" << endl << endl << reset
|
||||
<< "This aircraft model probably will not fly as expected." << endl << endl
|
||||
<< fgblue << highint << "Use this model for development purposes ONLY!!!"
|
||||
<< normint << reset << endl << endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -46,8 +46,8 @@ INCLUDES
|
|||
#include "FGJSBBase.h"
|
||||
#include "FGPropertyManager.h"
|
||||
|
||||
|
||||
#include <vector>
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -60,23 +60,12 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates the JSBSim simulation executive.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFDMExec.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
|
||||
@doc This class is the interface class through which all other simulation classes
|
||||
This class is the interface class through which all other simulation classes
|
||||
are instantiated, initialized, and run. When integrated with FlightGear (or
|
||||
other flight simulator) this class is typically instantiated by an interface
|
||||
class on the simulator side.
|
||||
|
@ -109,6 +98,8 @@ CLASS DOCUMENTATION
|
|||
a message is printed out when they go out of bounds</li>
|
||||
</ol>
|
||||
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -178,20 +169,20 @@ public:
|
|||
|
||||
|
||||
/** Sets the path to the engine config file directories.
|
||||
@param EnginePath path to the directory under which engine config
|
||||
@param path path to the directory under which engine config
|
||||
files are kept, for instance "engine"
|
||||
*/
|
||||
bool SetEnginePath(string path) { EnginePath = path; return true; }
|
||||
|
||||
/** Sets the path to the aircraft config file directories.
|
||||
@param AircraftPath path to the aircraft directory. For instance:
|
||||
@param path path to the aircraft directory. For instance:
|
||||
"aircraft". Under aircraft, then, would be directories for various
|
||||
modeled aircraft such as C172/, x15/, etc.
|
||||
*/
|
||||
bool SetAircraftPath(string path) { AircraftPath = path; return true; }
|
||||
|
||||
/** Sets the path to the autopilot config file directories.
|
||||
@param ControlPath path to the control directory. For instance:
|
||||
@param path path to the control directory. For instance:
|
||||
"control".
|
||||
*/
|
||||
bool SetControlPath(string path) { ControlPath = path; return true; }
|
||||
|
@ -285,6 +276,7 @@ private:
|
|||
string ControlPath;
|
||||
|
||||
string CFGVersion;
|
||||
string Release;
|
||||
|
||||
FGState* State;
|
||||
FGAtmosphere* Atmosphere;
|
||||
|
|
|
@ -51,7 +51,7 @@ INCLUDES
|
|||
#include "FGFDMExec.h"
|
||||
|
||||
#ifndef FGFS
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iomanip.h>
|
||||
# else
|
||||
# include <iomanip>
|
||||
|
|
|
@ -76,21 +76,12 @@ class FGAuxiliary;
|
|||
class FGOutput;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** This class encapsulates the functionality needed to manage a factor group
|
||||
i.e. factor*(coeff1 + coeff2 + coeff3)
|
||||
@author Tony Peden
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFactorGroup.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -57,24 +57,24 @@ SENTRY
|
|||
INCLUDES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_FORCE "$Id$"
|
||||
|
||||
#include "FGFDMExec.h"
|
||||
#include "FGJSBBase.h"
|
||||
#include "FGMatrix33.h"
|
||||
#include "FGColumnVector3.h"
|
||||
#include "FGColumnVector4.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_FORCE "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
09/13/00 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -61,8 +57,19 @@ INCLUDES
|
|||
|
||||
#define ID_GROUNDREACTIONS "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Manages ground reactions modeling.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -83,11 +90,10 @@ public:
|
|||
string GetGroundReactionValues(void);
|
||||
|
||||
inline int GetNumGearUnits(void) const { return lGear.size(); }
|
||||
|
||||
/** Gets a gear instance
|
||||
@param gear index of gear instance
|
||||
@return a pointer to the FGLGear instance of the gear unit requested */
|
||||
|
||||
|
||||
inline FGLGear* GetGearUnit(int gear) { return &(lGear[gear]); }
|
||||
|
||||
void bind(void);
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
09/13/00 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -59,10 +55,25 @@ INCLUDES
|
|||
#include "FGColumnVector3.h"
|
||||
#include "FGColumnVector4.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_INERTIAL "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models inertial forces (e.g. centripetal and coriolis accelerations).
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*******************************************************************************
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
Header: FGInitialCondition.h
|
||||
Author: Tony Peden
|
||||
|
@ -36,16 +36,16 @@ angles, and altitude. This class does not attempt to trim the model i.e.
|
|||
the sim will most likely start in a very dynamic state (unless, of course,
|
||||
you have chosen your IC's wisely) even after setting it up with this class.
|
||||
|
||||
********************************************************************************
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
*******************************************************************************/
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#ifndef FGINITIALCONDITION_H
|
||||
#define FGINITIALCONDITION_H
|
||||
|
||||
/*******************************************************************************
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
INCLUDES
|
||||
*******************************************************************************/
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#include "FGFDMExec.h"
|
||||
#include "FGJSBBase.h"
|
||||
|
@ -60,18 +60,14 @@ DEFINITIONS
|
|||
|
||||
#define ID_INITIALCONDITION "$Id$"
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
|
||||
typedef enum { setwned, setwmd, setwhc } windset;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
namespace JSBSim {
|
||||
|
||||
typedef enum { setvt, setvc, setve, setmach, setuvw, setned, setvg } speedset;
|
||||
typedef enum { setwned, setwmd, setwhc } windset;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
|
@ -89,9 +85,7 @@ CLASS DOCUMENTATION
|
|||
FGInitialCondition fgic=new FGInitialCondition(FDMExec);
|
||||
fgic->SetVcalibratedKtsIC()
|
||||
fgic->SetAltitudeFtIC();
|
||||
.
|
||||
.
|
||||
.
|
||||
|
||||
//to directly into Run
|
||||
FDMExec->GetState()->Initialize(fgic)
|
||||
delete fgic;
|
||||
|
@ -102,36 +96,32 @@ CLASS DOCUMENTATION
|
|||
|
||||
Speed:
|
||||
|
||||
Since vc, ve, vt, and mach all represent speed, the remaining
|
||||
three are recalculated each time one of them is set (using the
|
||||
current altitude). The most recent speed set is remembered so
|
||||
that if and when altitude is reset, the last set speed is used
|
||||
to recalculate the remaining three. Setting any of the body
|
||||
components forces a recalculation of vt and vt then becomes the
|
||||
most recent speed set.
|
||||
Since vc, ve, vt, and mach all represent speed, the remaining
|
||||
three are recalculated each time one of them is set (using the
|
||||
current altitude). The most recent speed set is remembered so
|
||||
that if and when altitude is reset, the last set speed is used
|
||||
to recalculate the remaining three. Setting any of the body
|
||||
components forces a recalculation of vt and vt then becomes the
|
||||
most recent speed set.
|
||||
|
||||
Alpha,Gamma, and Theta:
|
||||
|
||||
This class assumes that it will be used to set up the sim for a
|
||||
steady, zero pitch rate condition. Since any two of those angles
|
||||
steady, zero pitch rate condition. Since any two of those angles
|
||||
specifies the third gamma (flight path angle) is favored when setting
|
||||
alpha and theta and alpha is favored when setting gamma. i.e.
|
||||
|
||||
set alpha : recalculate theta using gamma as currently set
|
||||
set theta : recalculate alpha using gamma as currently set
|
||||
set gamma : recalculate theta using alpha as currently set
|
||||
- set alpha : recalculate theta using gamma as currently set
|
||||
- set theta : recalculate alpha using gamma as currently set
|
||||
- set gamma : recalculate theta using alpha as currently set
|
||||
|
||||
The idea being that gamma is most interesting to pilots (since it
|
||||
is indicative of climb rate).
|
||||
|
||||
Setting climb rate is, for the purpose of this discussion,
|
||||
considered equivalent to setting gamma.
|
||||
@author Anthony K. Peden
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGInitialCondition.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGInitialCondition.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
The idea being that gamma is most interesting to pilots (since it
|
||||
is indicative of climb rate).
|
||||
|
||||
Setting climb rate is, for the purpose of this discussion,
|
||||
considered equivalent to setting gamma.
|
||||
@author Tony Peden
|
||||
@version "$Id$"
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -69,7 +69,7 @@ const double FGJSBBase::in3tom3 = 1.638706E-5;
|
|||
const double FGJSBBase::Reng = 1716.0;
|
||||
const double FGJSBBase::SHRatio = 1.40;
|
||||
const string FGJSBBase::needed_cfg_version = "1.60";
|
||||
const string FGJSBBase::JSBSim_version = "0.9.4";
|
||||
const string FGJSBBase::JSBSim_version = "0.9.5";
|
||||
|
||||
std::queue <FGJSBBase::Message*> FGJSBBase::Messages;
|
||||
FGJSBBase::Message FGJSBBase::localMsg;
|
||||
|
|
|
@ -79,8 +79,8 @@ using std::max;
|
|||
|
||||
static char *gcvt(double number, size_t ndigit, char *buf)
|
||||
{
|
||||
sprintf(buf, "%f", number);
|
||||
return buf;
|
||||
sprintf(buf, "%f", number);
|
||||
return buf;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -96,10 +96,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -216,6 +212,13 @@ public:
|
|||
void disableHighLighting(void);
|
||||
|
||||
static short debug_lvl;
|
||||
double KelvinToFahrenheit (double kelvin) {
|
||||
return 1.8*kelvin - 459.4;
|
||||
}
|
||||
|
||||
double RankineToCelsius (double rankine) {
|
||||
return (rankine - 491.67)/1.8;
|
||||
}
|
||||
|
||||
protected:
|
||||
static Message localMsg;
|
||||
|
|
|
@ -39,7 +39,7 @@ INCLUDES
|
|||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#include "FGLGear.h"
|
||||
#include <algorithm>
|
||||
//#include <algorithm>
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
|
@ -208,7 +208,9 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
{
|
||||
double SteerGain = 0;
|
||||
double SinWheel, CosWheel;
|
||||
double deltaT;
|
||||
double deltaSlip;
|
||||
double deltaT = State->Getdt()*Aircraft->GetRate();
|
||||
double maxdeltaSlip = 0.5*deltaT;
|
||||
|
||||
vForce.InitMatrix();
|
||||
vMoment.InitMatrix();
|
||||
|
@ -250,7 +252,7 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
|
||||
if (compressLength > 0.00) {
|
||||
|
||||
WOW = true;// Weight-On-Wheels is true
|
||||
WOW = true; // Weight-On-Wheels is true
|
||||
|
||||
// The next equation should really use the vector to the contact patch of the tire
|
||||
// including the strut compression and not vWhlBodyVec. Will fix this later.
|
||||
|
@ -300,30 +302,26 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
|
||||
switch (eBrakeGrp) {
|
||||
case bgLeft:
|
||||
SteerGain = 0.10;
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgLeft)) +
|
||||
staticFCoeff*FCS->GetBrake(bgLeft) );
|
||||
break;
|
||||
case bgRight:
|
||||
SteerGain = 0.10;
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgRight)) +
|
||||
staticFCoeff*FCS->GetBrake(bgRight) );
|
||||
break;
|
||||
case bgCenter:
|
||||
SteerGain = 0.10;
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||
break;
|
||||
case bgNose:
|
||||
SteerGain = -0.50;
|
||||
BrakeFCoeff = rollingFCoeff;
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||
break;
|
||||
case bgTail:
|
||||
SteerGain = -0.10;
|
||||
BrakeFCoeff = rollingFCoeff;
|
||||
BrakeFCoeff = ( rollingFCoeff*(1.0 - FCS->GetBrake(bgCenter)) +
|
||||
staticFCoeff*FCS->GetBrake(bgCenter) );
|
||||
break;
|
||||
case bgNone:
|
||||
SteerGain = 0.0;
|
||||
BrakeFCoeff = rollingFCoeff;
|
||||
break;
|
||||
default:
|
||||
|
@ -333,7 +331,7 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
|
||||
switch (eSteerType) {
|
||||
case stSteer:
|
||||
SteerAngle = SteerGain*FCS->GetDrCmd()*0.349; // 20 deg
|
||||
SteerAngle = -maxSteerAngle * FCS->GetDrCmd() * 0.01745;
|
||||
break;
|
||||
case stFixed:
|
||||
SteerAngle = 0.0;
|
||||
|
@ -360,18 +358,34 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
|
||||
if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) {
|
||||
WheelSlip = 0.0;
|
||||
} else if (fabs(RollingWhlVel) < 0.10) {
|
||||
} else if (fabs(RollingWhlVel) < 1.0) {
|
||||
WheelSlip = 0.05*radtodeg*atan2(SideWhlVel, RollingWhlVel) + 0.95*WheelSlip;
|
||||
} else {
|
||||
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||
}
|
||||
/*
|
||||
if (RollingWhlVel == 0.0 && SideWhlVel == 0.0) {
|
||||
WheelSlip = 0.0;
|
||||
} else if (RollingWhlVel < 1.0) {
|
||||
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||
deltaSlip = WheelSlip - lastWheelSlip;
|
||||
if (fabs(deltaSlip) > maxdeltaSlip) {
|
||||
if (WheelSlip > lastWheelSlip) {
|
||||
WheelSlip = lastWheelSlip + maxdeltaSlip;
|
||||
} else if (WheelSlip < lastWheelSlip) {
|
||||
WheelSlip = lastWheelSlip - maxdeltaSlip;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
WheelSlip = radtodeg*atan2(SideWhlVel, RollingWhlVel);
|
||||
}
|
||||
|
||||
if ((WheelSlip < 0.0 && lastWheelSlip > 0.0) ||
|
||||
(WheelSlip > 0.0 && lastWheelSlip < 0.0))
|
||||
{
|
||||
WheelSlip = 0.0;
|
||||
}
|
||||
|
||||
*/
|
||||
lastWheelSlip = WheelSlip;
|
||||
|
||||
// Compute the sideforce coefficients using similar assumptions to LaRCSim for now.
|
||||
|
@ -433,7 +447,7 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
vForce = State->GetTl2b() * vLocalForce;
|
||||
vMoment = vWhlBodyVec * vForce;
|
||||
|
||||
} else {
|
||||
} else { // Gear is NOT compressed
|
||||
|
||||
WOW = false;
|
||||
|
||||
|
@ -448,8 +462,6 @@ FGColumnVector3& FGLGear::Force(void)
|
|||
compressLength = 0.0; // reset compressLength to zero for data output validity
|
||||
}
|
||||
|
||||
deltaT = State->Getdt()*Aircraft->GetRate();
|
||||
|
||||
if (FirstContact) LandingDistanceTraveled += Position->GetVground()*deltaT;
|
||||
|
||||
if (StartedGroundRun) {
|
||||
|
|
|
@ -70,10 +70,6 @@ class FGState;
|
|||
class FGMassBalance;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
|
@ -171,10 +167,6 @@ CLASS DOCUMENTATION
|
|||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
@see W. A. Ragsdale, "A Generic Landing Gear Dynamics Model for LASRS++",
|
||||
AIAA-2000-4303
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGLGear.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGLGear.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
09/12/2000 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -46,10 +42,25 @@ INCLUDES
|
|||
#include "FGPropulsion.h"
|
||||
#include <vector>
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_MASSBALANCE "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONSS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models weight and balance information.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -35,13 +35,18 @@ INCLUDES
|
|||
SG_USING_STD(endl);
|
||||
#else
|
||||
# include <string>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# include <fstream.h>
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
include <fstream.h>
|
||||
include <iostream.h>
|
||||
# include <math.h>
|
||||
# include <iostream.h>
|
||||
# else
|
||||
# include <fstream>
|
||||
# include <cmath>
|
||||
# include <iostream>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# include <math.h>
|
||||
# else
|
||||
# include <cmath>
|
||||
# endif
|
||||
# include <iostream>
|
||||
using std::ostream;
|
||||
using std::istream;
|
||||
|
@ -69,6 +74,13 @@ namespace JSBSim {
|
|||
|
||||
class FGColumnVector3;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Exception convenience class.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DECLARATION: MatrixException
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -79,6 +91,13 @@ public:
|
|||
string Message;
|
||||
};
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Handles matrix math operations.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DECLARATION: FGMatrix33
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -49,7 +49,7 @@ INCLUDES
|
|||
# include <iostream.h>
|
||||
# endif
|
||||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iostream.h>
|
||||
# else
|
||||
# include <iostream>
|
||||
|
@ -58,12 +58,12 @@ INCLUDES
|
|||
|
||||
#include <string>
|
||||
|
||||
#define ID_MODEL "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_MODEL "$Id$"
|
||||
|
||||
using namespace std;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -89,20 +89,12 @@ class FGAuxiliary;
|
|||
class FGOutput;
|
||||
class FGConfigFile;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Base class for all scheduled JSBSim models
|
||||
@author Jon S. Berndt
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGModel.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -70,6 +70,7 @@ FGNozzle::FGNozzle(FGFDMExec* FDMExec, FGConfigFile* Nzl_cfg) : FGThruster(FDMEx
|
|||
}
|
||||
|
||||
Thrust = 0;
|
||||
ReverserAngle = 0.0;
|
||||
Type = ttNozzle;
|
||||
Area2 = (Diameter*Diameter/4.0)*M_PI;
|
||||
AreaT = Area2/ExpR;
|
||||
|
@ -90,7 +91,7 @@ double FGNozzle::Calculate(double CfPc)
|
|||
{
|
||||
double pAtm = fdmex->GetAtmosphere()->GetPressure();
|
||||
Thrust = max((double)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
|
||||
vFn(1) = Thrust;
|
||||
vFn(1) = Thrust * cos(ReverserAngle);
|
||||
|
||||
return Thrust;
|
||||
}
|
||||
|
|
|
@ -52,19 +52,13 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models a rocket nozzle.
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGNozzle.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGNozzle.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -83,6 +77,7 @@ public:
|
|||
double GetPowerRequired(void);
|
||||
|
||||
private:
|
||||
double ReverserAngle;
|
||||
double PE;
|
||||
double ExpR;
|
||||
double nzlEff;
|
||||
|
|
|
@ -45,7 +45,7 @@ INCLUDES
|
|||
# include STL_IOSTREAM
|
||||
# include STL_FSTREAM
|
||||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iostream.h>
|
||||
# include <fstream.h>
|
||||
# else
|
||||
|
@ -56,10 +56,25 @@ INCLUDES
|
|||
|
||||
#include "FGfdmSocket.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_OUTPUT "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Handles simulation output.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -60,13 +60,6 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
|||
{
|
||||
string token;
|
||||
|
||||
MinManifoldPressure_inHg = 6.5;
|
||||
MaxManifoldPressure_inHg = 28.5;
|
||||
Displacement = 360;
|
||||
MaxHP = 200;
|
||||
Cycles = 2;
|
||||
IdleRPM = 600;
|
||||
|
||||
Name = Eng_cfg->GetValue("NAME");
|
||||
Eng_cfg->GetNextConfigLine();
|
||||
while (Eng_cfg->GetValue() != string("/FG_PISTON")) {
|
||||
|
@ -86,7 +79,17 @@ FGPiston::FGPiston(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec),
|
|||
crank_counter = 0;
|
||||
EngineNumber = 0;
|
||||
OilTemp_degK = 298;
|
||||
MinManifoldPressure_inHg = 6.5;
|
||||
MaxManifoldPressure_inHg = 28.5;
|
||||
ManifoldPressure_inHg = Atmosphere->GetPressure() * psftoinhg; // psf to in Hg
|
||||
CylinderHeadTemp_degK = 0.0;
|
||||
Displacement = 360;
|
||||
MaxHP = 200;
|
||||
Cycles = 2;
|
||||
IdleRPM = 600;
|
||||
Magnetos = 0;
|
||||
ExhaustGasTemp_degK = 0.0;
|
||||
EGT_degC = 0.0;
|
||||
|
||||
dt = State->Getdt();
|
||||
|
||||
|
@ -150,7 +153,8 @@ double FGPiston::Calculate(double PowerRequired)
|
|||
p_amb_sea_level = Atmosphere->GetPressureSL() * 48;
|
||||
T_amb = Atmosphere->GetTemperature() * (5.0 / 9.0); // convert from Rankine to Kelvin
|
||||
|
||||
RPM = Propulsion->GetThruster(EngineNumber)->GetRPM();
|
||||
RPM = Propulsion->GetThruster(EngineNumber)->GetRPM() *
|
||||
Propulsion->GetThruster(EngineNumber)->GetGearRatio();
|
||||
|
||||
IAS = Auxiliary->GetVcalibratedKTS();
|
||||
|
||||
|
@ -334,29 +338,34 @@ void FGPiston::doFuelFlow(void)
|
|||
void FGPiston::doEnginePower(void)
|
||||
{
|
||||
ManifoldPressure_inHg *= p_amb / p_amb_sea_level;
|
||||
|
||||
if (Running) {
|
||||
double ManXRPM = ManifoldPressure_inHg * RPM;
|
||||
// FIXME: this needs to be generalized
|
||||
double T_amb_degF = KelvinToFahrenheit(T_amb);
|
||||
double T_amb_sea_lev_degF = KelvinToFahrenheit(288);
|
||||
|
||||
// FIXME: this needs to be generalized
|
||||
Percentage_Power = (6e-9 * ManXRPM * ManXRPM) + (8e-4 * ManXRPM) - 1.0;
|
||||
double T_amb_degF = (T_amb * 1.8) - 459.67;
|
||||
double T_amb_sea_lev_degF = (288 * 1.8) - 459.67;
|
||||
Percentage_Power =
|
||||
Percentage_Power + ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
|
||||
Percentage_Power += ((T_amb_sea_lev_degF - T_amb_degF) * 7 /120);
|
||||
|
||||
double Percentage_of_best_power_mixture_power =
|
||||
Power_Mixture_Correlation->GetValue(14.7 / equivalence_ratio);
|
||||
Percentage_Power =
|
||||
Percentage_Power * Percentage_of_best_power_mixture_power / 100.0;
|
||||
if (Percentage_Power < 0.0)
|
||||
Percentage_Power = 0.0;
|
||||
else if (Percentage_Power > 100.0)
|
||||
Percentage_Power = 100.0;
|
||||
|
||||
Percentage_Power *= Percentage_of_best_power_mixture_power / 100.0;
|
||||
|
||||
if (Percentage_Power < 0.0) Percentage_Power = 0.0;
|
||||
else if (Percentage_Power > 100.0) Percentage_Power = 100.0;
|
||||
|
||||
HP = Percentage_Power * MaxHP / 100.0;
|
||||
} else {
|
||||
|
||||
} else {
|
||||
|
||||
// Power output when the engine is not running
|
||||
if (Cranking) {
|
||||
if (RPM < 10) {
|
||||
HP = 3.0; // This is a hack to prevent overshooting the idle rpm in the first time step
|
||||
// It may possibly need to be changed if the prop model is changed.
|
||||
HP = 3.0; // This is a hack to prevent overshooting the idle rpm in
|
||||
// the first time step. It may possibly need to be changed
|
||||
// if the prop model is changed.
|
||||
} else if (RPM < 480) {
|
||||
HP = 3.0 + ((480 - RPM) / 10.0);
|
||||
// This is a guess - would be nice to find a proper starter moter torque curve
|
||||
|
|
|
@ -28,10 +28,6 @@ HISTORY
|
|||
09/12/2000 JSB Created
|
||||
10/01/2001 DPM Modified to use equations from Dave Luff's piston model.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -60,22 +56,14 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DOCUMENTATION
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models Dave Luff's engine model as ported into JSBSim by David Megginson.
|
||||
@author Jon S. Berndt (Engine framework code and framework-related mods)
|
||||
@author Dave Luff (engine operational code)
|
||||
@author David Megginson (porting and additional code)
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPiston.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPiston.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
@version "$Id$"
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -94,6 +82,18 @@ public:
|
|||
double GetPowerAvailable(void) {return PowerAvailable;}
|
||||
double CalcFuelNeed(void);
|
||||
|
||||
void SetMagnetos(int magnetos) {Magnetos = magnetos;}
|
||||
|
||||
double GetEGT(void) { return EGT_degC; }
|
||||
int GetMagnetos(void) {return Magnetos;}
|
||||
|
||||
double getExhaustGasTemp_degF(void) {return KelvinToFahrenheit(ExhaustGasTemp_degK);}
|
||||
double getManifoldPressure_inHg(void) const {return ManifoldPressure_inHg;}
|
||||
double getCylinderHeadTemp_degF(void) {return KelvinToFahrenheit(CylinderHeadTemp_degK);}
|
||||
double getOilPressure_psi(void) const {return OilPressure_psi;}
|
||||
double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
|
||||
double getRPM(void) {return RPM;}
|
||||
|
||||
private:
|
||||
int crank_counter;
|
||||
|
||||
|
@ -147,12 +147,13 @@ private:
|
|||
double T_amb; // degrees Kelvin
|
||||
double RPM; // revolutions per minute
|
||||
double IAS; // knots
|
||||
bool Magneto_Left;
|
||||
bool Magneto_Right;
|
||||
int Magnetos;
|
||||
|
||||
//
|
||||
// Outputs (in addition to those in FGEngine).
|
||||
//
|
||||
bool Magneto_Left;
|
||||
bool Magneto_Right;
|
||||
double rho_air;
|
||||
double volumetric_efficiency;
|
||||
double m_dot_air;
|
||||
|
@ -161,6 +162,12 @@ private:
|
|||
double Percentage_Power;
|
||||
double HP;
|
||||
double combustion_efficiency;
|
||||
double ExhaustGasTemp_degK;
|
||||
double EGT_degC;
|
||||
double ManifoldPressure_inHg;
|
||||
double CylinderHeadTemp_degK;
|
||||
double OilPressure_psi;
|
||||
double OilTemp_degK;
|
||||
|
||||
void Debug(int from);
|
||||
};
|
||||
|
|
|
@ -65,7 +65,11 @@ INCLUDES
|
|||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# include <math.h>
|
||||
# include <iomanip.h>
|
||||
# if (_COMPILER_VERSION < 740)
|
||||
# include <iomanip.h>
|
||||
# else
|
||||
# include <iomanip>
|
||||
# endif
|
||||
# else
|
||||
# include <cmath>
|
||||
# include <iomanip>
|
||||
|
@ -104,13 +108,16 @@ FGPosition::FGPosition(FGFDMExec* fdmex) : FGModel(fdmex)
|
|||
Name = "FGPosition";
|
||||
LongitudeDot = LatitudeDot = RadiusDot = 0.0;
|
||||
|
||||
for (int i=0;i<3;i++) {
|
||||
for (int i=0;i<4;i++) {
|
||||
LatitudeDot_prev[i] = 0.0;
|
||||
LongitudeDot_prev[i] = 0.0;
|
||||
RadiusDot_prev[i] = 0.0;
|
||||
}
|
||||
|
||||
|
||||
vVRPoffset.InitMatrix();
|
||||
|
||||
Longitude = Latitude = 0.0;
|
||||
LongitudeVRP = LatitudeVRP = 0.0;
|
||||
gamma = Vt = Vground = 0.0;
|
||||
hoverbmac = hoverbcg = 0.0;
|
||||
psigt = 0.0;
|
||||
|
@ -155,7 +162,6 @@ bool FGPosition::Run(void)
|
|||
{
|
||||
double cosLat;
|
||||
double hdot_Vt;
|
||||
FGColumnVector3 vMac;
|
||||
|
||||
if (!FGModel::Run()) {
|
||||
GetState();
|
||||
|
@ -178,6 +184,23 @@ bool FGPosition::Run(void)
|
|||
|
||||
h = Radius - SeaLevelRadius; // Geocentric
|
||||
|
||||
vVRPoffset = State->GetTb2l() * (vVRP - MassBalance->GetXYZcg());
|
||||
vVRPoffset /= 12.0; // converted to feet
|
||||
|
||||
// vVRP - the vector to the Visual Reference Point - now contains the
|
||||
// offset from the CG to the VRP, in units of feet, in the Local coordinate
|
||||
// frame, where X points north, Y points East, and Z points down. This needs
|
||||
// to be converted to Lat/Lon/Alt, now.
|
||||
|
||||
if (cosLat != 0)
|
||||
LongitudeVRP = vVRPoffset(eEast) / (Radius * cosLat) + Longitude;
|
||||
|
||||
LatitudeVRP = vVRPoffset(eNorth) / Radius + Latitude;
|
||||
hVRP = vVRPoffset(eDown) + h;
|
||||
/*
|
||||
cout << "Lat/Lon/Alt : " << Latitude << " / " << Longitude << " / " << h << endl;
|
||||
cout << "Lat/Lon/Alt VRP: " << LatitudeVRP << " / " << LongitudeVRP << " / " << hVRP << endl << endl;
|
||||
*/
|
||||
DistanceAGL = Radius - RunwayRadius; // Geocentric
|
||||
|
||||
hoverbcg = DistanceAGL/b;
|
||||
|
|
|
@ -56,20 +56,12 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DOCUMENTATION
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models the lateral and longitudinal translational EOM.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPosition.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -80,7 +72,7 @@ class FGPosition : public FGModel {
|
|||
public:
|
||||
/** Constructor
|
||||
@param Executive a pointer to the parent executive object */
|
||||
FGPosition(FGFDMExec*);
|
||||
FGPosition(FGFDMExec* Executive);
|
||||
|
||||
/// Destructor
|
||||
~FGPosition();
|
||||
|
@ -100,10 +92,13 @@ public:
|
|||
inline double GetVground(void) const { return Vground; }
|
||||
inline double GetGroundTrack(void) const { return psigt; }
|
||||
inline double Geth(void) const { return h; }
|
||||
inline double GethVRP(void) const { return hVRP; }
|
||||
inline double Gethdot(void) const { return RadiusDot; }
|
||||
inline double GetLatitude(void) const { return Latitude; }
|
||||
inline double GetLatitudeVRP(void) const { return LatitudeVRP; }
|
||||
inline double GetLatitudeDot(void) const { return LatitudeDot; }
|
||||
inline double GetLongitude(void) const { return Longitude; }
|
||||
inline double GetLongitudeVRP(void) const { return LongitudeVRP; }
|
||||
inline double GetLongitudeDot(void) const { return LongitudeDot; }
|
||||
inline double GetRunwayRadius(void) const { return RunwayRadius; }
|
||||
inline double GetDistanceAGL(void) const { return DistanceAGL; }
|
||||
|
@ -124,6 +119,7 @@ public:
|
|||
inline void SetRunwayNormal(double fgx, double fgy, double fgz ) {
|
||||
vRunwayNormal << fgx << fgy << fgz;
|
||||
}
|
||||
void SetVRP(FGColumnVector3& vrp) {vVRP = vrp;}
|
||||
|
||||
void bind(void);
|
||||
void unbind(void);
|
||||
|
@ -132,11 +128,15 @@ private:
|
|||
FGColumnVector3 vVel;
|
||||
FGColumnVector3 vVelDot;
|
||||
FGColumnVector3 vRunwayNormal;
|
||||
FGColumnVector3 vVRP;
|
||||
FGColumnVector3 vVRPoffset;
|
||||
FGColumnVector3 vMac;
|
||||
|
||||
double Radius, h;
|
||||
double Radius, h, hVRP;
|
||||
double LatitudeDot, LongitudeDot, RadiusDot;
|
||||
double LatitudeDot_prev[3], LongitudeDot_prev[3], RadiusDot_prev[3];
|
||||
double LatitudeDot_prev[4], LongitudeDot_prev[4], RadiusDot_prev[4];
|
||||
double Longitude, Latitude;
|
||||
double LongitudeVRP, LatitudeVRP;
|
||||
double dt;
|
||||
double RunwayRadius;
|
||||
double DistanceAGL;
|
||||
|
|
|
@ -58,6 +58,7 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
|
|||
int rows, cols;
|
||||
|
||||
MaxPitch = MinPitch = P_Factor = Sense = Pitch = 0.0;
|
||||
GearRatio = 1.0;
|
||||
|
||||
Name = Prop_cfg->GetValue("NAME");
|
||||
Prop_cfg->GetNextConfigLine();
|
||||
|
@ -70,6 +71,8 @@ FGPropeller::FGPropeller(FGFDMExec* exec, FGConfigFile* Prop_cfg) : FGThruster(e
|
|||
Diameter /= 12.0;
|
||||
} else if (token == "NUMBLADES") {
|
||||
*Prop_cfg >> numBlades;
|
||||
} else if (token == "GEARRATIO") {
|
||||
*Prop_cfg >> GearRatio;
|
||||
} else if (token == "MINPITCH") {
|
||||
*Prop_cfg >> MinPitch;
|
||||
} else if (token == "MAXPITCH") {
|
||||
|
@ -176,7 +179,7 @@ double FGPropeller::Calculate(double PowerAvailable)
|
|||
|
||||
if (omega <= 5) omega = 1.0;
|
||||
|
||||
ExcessTorque = PowerAvailable / omega;
|
||||
ExcessTorque = PowerAvailable / omega * GearRatio;
|
||||
RPM = (RPS + ((ExcessTorque / Ixx) / (2.0 * M_PI)) * deltaT) * 60.0;
|
||||
|
||||
// The friction from the engine should
|
||||
|
@ -217,7 +220,7 @@ double FGPropeller::GetPowerRequired(void)
|
|||
else if (Pitch > MaxPitch) Pitch = MaxPitch;
|
||||
|
||||
} else {
|
||||
Pitch = MaxPitch - (MaxPitch - MinPitch) * advance;
|
||||
Pitch = MinPitch + (MaxPitch - MinPitch) * advance;
|
||||
}
|
||||
cPReq = cPower->GetValue(J, Pitch);
|
||||
}
|
||||
|
|
|
@ -55,10 +55,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -83,10 +79,6 @@ CLASS DOCUMENTATION
|
|||
@see FGEngine
|
||||
@see FGThruster
|
||||
@see FGTable
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropeller.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropeller.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -126,7 +126,7 @@ string FGPropertyManager::GetFullyQualifiedName(void) {
|
|||
}
|
||||
fqname+= stack[0];
|
||||
return fqname;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -53,19 +53,11 @@ using namespace std;
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Class wrapper for property handling.
|
||||
@author David Megginson, Tony Peden
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropertyManager.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -382,7 +374,7 @@ class FGPropertyManager : public SGPropertyNode {
|
|||
void Untie (const string &name);
|
||||
|
||||
|
||||
// Templates cause ambiguity here
|
||||
// Templates cause ambiguity here
|
||||
|
||||
/**
|
||||
* Tie a property to an external bool variable.
|
||||
|
@ -508,9 +500,11 @@ class FGPropertyManager : public SGPropertyNode {
|
|||
bool useDefault = true)
|
||||
{
|
||||
if (!tie(name.c_str(), SGRawValueFunctions<V>(getter, setter),
|
||||
useDefault))
|
||||
useDefault))
|
||||
{
|
||||
cout <<
|
||||
"Failed to tie property " << name << " to functions" << endl;
|
||||
"Failed to tie property " << name << " to functions" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -537,12 +531,11 @@ class FGPropertyManager : public SGPropertyNode {
|
|||
void (*setter)(int, V) = 0, bool useDefault = true)
|
||||
{
|
||||
if (!tie(name.c_str(),
|
||||
SGRawValueFunctionsIndexed<V>(index,
|
||||
getter,
|
||||
setter),
|
||||
useDefault))
|
||||
SGRawValueFunctionsIndexed<V>(index, getter, setter), useDefault))
|
||||
{
|
||||
cout <<
|
||||
"Failed to tie property " << name << " to indexed functions" << endl;
|
||||
"Failed to tie property " << name << " to indexed functions" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -570,10 +563,11 @@ class FGPropertyManager : public SGPropertyNode {
|
|||
void (T::*setter)(V) = 0, bool useDefault = true)
|
||||
{
|
||||
if (!tie(name.c_str(),
|
||||
SGRawValueMethods<T,V>(*obj, getter, setter),
|
||||
useDefault))
|
||||
SGRawValueMethods<T,V>(*obj, getter, setter), useDefault))
|
||||
{
|
||||
cout <<
|
||||
"Failed to tie property " << name << " to object methods" << endl;
|
||||
"Failed to tie property " << name << " to object methods" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -601,13 +595,11 @@ class FGPropertyManager : public SGPropertyNode {
|
|||
bool useDefault = true)
|
||||
{
|
||||
if (!tie(name.c_str(),
|
||||
SGRawValueMethodsIndexed<T,V>(*obj,
|
||||
index,
|
||||
getter,
|
||||
setter),
|
||||
useDefault))
|
||||
SGRawValueMethodsIndexed<T,V>(*obj, index, getter, setter), useDefault))
|
||||
{
|
||||
cout <<
|
||||
"Failed to tie property " << name << " to indexed object methods" << endl;
|
||||
"Failed to tie property " << name << " to indexed object methods" << endl;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -79,12 +79,15 @@ CLASS IMPLEMENTATION
|
|||
FGPropulsion::FGPropulsion(FGFDMExec* exec) : FGModel(exec)
|
||||
{
|
||||
Name = "FGPropulsion";
|
||||
|
||||
numSelectedFuelTanks = numSelectedOxiTanks = 0;
|
||||
numTanks = numEngines = numThrusters = 0;
|
||||
numOxiTanks = numFuelTanks = 0;
|
||||
dt = 0.0;
|
||||
ActiveEngine = -1; // -1: ALL, 0: Engine 1, 1: Engine 2 ...
|
||||
|
||||
bind();
|
||||
|
||||
Debug(0);
|
||||
}
|
||||
|
||||
|
@ -381,6 +384,8 @@ string FGPropulsion::GetPropulsionStrings(void)
|
|||
case FGEngine::etTurbine:
|
||||
break;
|
||||
case FGEngine::etSimTurbine:
|
||||
PropulsionStrings += (Engines[i]->GetName() + "_N1[" + buffer + "], ");
|
||||
PropulsionStrings += (Engines[i]->GetName() + "_N2[" + buffer + "]");
|
||||
break;
|
||||
default:
|
||||
PropulsionStrings += "INVALID ENGINE TYPE";
|
||||
|
@ -406,6 +411,9 @@ string FGPropulsion::GetPropulsionStrings(void)
|
|||
PropulsionStrings += (Thrusters[i]->GetName() + "_Pitch[" + buffer + "], ");
|
||||
PropulsionStrings += (Thrusters[i]->GetName() + "_RPM[" + buffer + "]");
|
||||
break;
|
||||
case FGThruster::ttDirect:
|
||||
PropulsionStrings += (Thrusters[i]->GetName() + "_Thrust[" + buffer + "]");
|
||||
break;
|
||||
default:
|
||||
PropulsionStrings += "INVALID THRUSTER TYPE";
|
||||
break;
|
||||
|
@ -437,6 +445,8 @@ string FGPropulsion::GetPropulsionValues(void)
|
|||
case FGEngine::etTurbine:
|
||||
break;
|
||||
case FGEngine::etSimTurbine:
|
||||
PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN1(), 10, buff))) + ", ";
|
||||
PropulsionValues += (string(gcvt(((FGSimTurbine*)Engines[i])->GetN2(), 10, buff)));
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -448,6 +458,9 @@ string FGPropulsion::GetPropulsionValues(void)
|
|||
break;
|
||||
case FGThruster::ttRotor:
|
||||
break;
|
||||
case FGThruster::ttDirect:
|
||||
PropulsionValues += (string(gcvt(((FGThruster*)Thrusters[i])->GetThrust(), 10, buff)));
|
||||
break;
|
||||
case FGThruster::ttPropeller:
|
||||
FGPropeller* Propeller = (FGPropeller*)Thrusters[i];
|
||||
FGColumnVector3 vPFactor = Propeller->GetPFactor();
|
||||
|
@ -564,12 +577,12 @@ double FGPropulsion::GetTanksIxy(const FGColumnVector3& vXYZcg)
|
|||
|
||||
void FGPropulsion::SetMagnetos(int setting)
|
||||
{
|
||||
if (ActiveEngine == -1) {
|
||||
if (ActiveEngine < 0) {
|
||||
for (unsigned i=0; i<Engines.size(); i++) {
|
||||
Engines[i]->SetMagnetos(setting);
|
||||
((FGPiston*)Engines[i])->SetMagnetos(setting);
|
||||
}
|
||||
} else {
|
||||
Engines[ActiveEngine]->SetMagnetos(setting);
|
||||
((FGPiston*)Engines[ActiveEngine])->SetMagnetos(setting);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -577,9 +590,12 @@ void FGPropulsion::SetMagnetos(int setting)
|
|||
|
||||
void FGPropulsion::SetStarter(int setting)
|
||||
{
|
||||
if (ActiveEngine == -1) {
|
||||
if (ActiveEngine < 0) {
|
||||
for (unsigned i=0; i<Engines.size(); i++) {
|
||||
Engines[i]->SetStarter(setting);
|
||||
if (setting == 0)
|
||||
Engines[i]->SetStarter(false);
|
||||
else
|
||||
Engines[i]->SetStarter(true);
|
||||
}
|
||||
} else {
|
||||
if (setting == 0)
|
||||
|
@ -591,9 +607,28 @@ void FGPropulsion::SetStarter(int setting)
|
|||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void FGPropulsion::SetCutoff(int setting)
|
||||
{
|
||||
if (ActiveEngine < 0) {
|
||||
for (unsigned i=0; i<Engines.size(); i++) {
|
||||
if (setting == 0)
|
||||
((FGSimTurbine*)Engines[i])->SetCutoff(false);
|
||||
else
|
||||
((FGSimTurbine*)Engines[i])->SetCutoff(true);
|
||||
}
|
||||
} else {
|
||||
if (setting == 0)
|
||||
((FGSimTurbine*)Engines[ActiveEngine])->SetCutoff(false);
|
||||
else
|
||||
((FGSimTurbine*)Engines[ActiveEngine])->SetCutoff(true);
|
||||
}
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void FGPropulsion::SetActiveEngine(int engine)
|
||||
{
|
||||
if ( unsigned(engine) > Engines.size())
|
||||
if (engine >= Engines.size() || engine < 0)
|
||||
ActiveEngine = -1;
|
||||
else
|
||||
ActiveEngine = engine;
|
||||
|
@ -605,28 +640,14 @@ void FGPropulsion::bind(void)
|
|||
{
|
||||
typedef double (FGPropulsion::*PMF)(int) const;
|
||||
typedef int (FGPropulsion::*iPMF)(void) const;
|
||||
/* PropertyManager->Tie("propulsion/num-engines", this,
|
||||
&FGPropulsion::GetNumEngines);
|
||||
PropertyManager->Tie("propulsion/num-tanks", this,
|
||||
&FGPropulsion::GetNumTanks); */
|
||||
|
||||
PropertyManager->Tie("propulsion/magneto_cmd", this,
|
||||
(iPMF)0,
|
||||
&FGPropulsion::SetMagnetos,
|
||||
true);
|
||||
(iPMF)0, &FGPropulsion::SetMagnetos, true);
|
||||
PropertyManager->Tie("propulsion/starter_cmd", this,
|
||||
(iPMF)0,
|
||||
&FGPropulsion::SetStarter,
|
||||
true);
|
||||
PropertyManager->Tie("propulsion/active_engine", this,
|
||||
(iPMF)0,
|
||||
&FGPropulsion::SetActiveEngine,
|
||||
true);
|
||||
(iPMF)0, &FGPropulsion::SetStarter, true);
|
||||
PropertyManager->Tie("propulsion/cutoff_cmd", this,
|
||||
(iPMF)0, &FGPropulsion::SetCutoff, true);
|
||||
|
||||
PropertyManager->Tie("propulsion/num-sel-fuel-tanks", this,
|
||||
&FGPropulsion::GetnumSelectedFuelTanks);
|
||||
PropertyManager->Tie("propulsion/num-sel-ox-tanks", this,
|
||||
&FGPropulsion::GetnumSelectedOxiTanks);
|
||||
PropertyManager->Tie("forces/fbx-prop-lbs", this,1,
|
||||
(PMF)&FGPropulsion::GetForces);
|
||||
PropertyManager->Tie("forces/fby-prop-lbs", this,2,
|
||||
|
@ -639,20 +660,18 @@ void FGPropulsion::bind(void)
|
|||
(PMF)&FGPropulsion::GetMoments);
|
||||
PropertyManager->Tie("moments/n-prop-lbsft", this,3,
|
||||
(PMF)&FGPropulsion::GetMoments);
|
||||
//PropertyManager->Tie("propulsion/tanks-weight-lbs", this,
|
||||
// &FGPropulsion::GetTanksWeight);
|
||||
|
||||
PropertyManager->Tie("propulsion/active_engine", this,
|
||||
&FGPropulsion::GetActiveEngine, &FGPropulsion::SetActiveEngine, true);
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
void FGPropulsion::unbind(void)
|
||||
{
|
||||
/* PropertyManager->Untie("propulsion/num-engines");
|
||||
PropertyManager->Untie("propulsion/num-tanks"); */
|
||||
PropertyManager->Untie("propulsion/num-sel-fuel-tanks");
|
||||
PropertyManager->Untie("propulsion/num-sel-ox-tanks");
|
||||
PropertyManager->Untie("propulsion/magneto_cmd");
|
||||
PropertyManager->Untie("propulsion/starter_cmd");
|
||||
PropertyManager->Untie("propulsion/cutoff_cmd");
|
||||
PropertyManager->Untie("propulsion/active_engine");
|
||||
PropertyManager->Untie("forces/fbx-prop-lbs");
|
||||
PropertyManager->Untie("forces/fby-prop-lbs");
|
||||
|
@ -660,7 +679,6 @@ void FGPropulsion::unbind(void)
|
|||
PropertyManager->Untie("moments/l-prop-lbsft");
|
||||
PropertyManager->Untie("moments/m-prop-lbsft");
|
||||
PropertyManager->Untie("moments/n-prop-lbsft");
|
||||
//PropertyManager->Untie("propulsion/tanks-weight-lbs");
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -74,27 +74,33 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Propulsion management class.
|
||||
FGPropulsion manages all aspects of propulsive force generation, including
|
||||
containment of engines, tanks, and thruster class instances in STL vectors,
|
||||
and the interaction and communication between them.
|
||||
The Propulsion class is the container for the entire propulsion system, which is
|
||||
comprised of engines, tanks, and "thrusters" (the device that transforms the
|
||||
engine power into a force that acts on the aircraft, such as a nozzle or
|
||||
propeller). Once the Propulsion class gets the config file, it reads in
|
||||
information which is specific to a type of engine. Then:
|
||||
|
||||
-# The appropriate engine type instance is created
|
||||
-# A thruster object is instantiated, and is linked to the engine
|
||||
-# At least one tank object is created, and is linked to an engine.
|
||||
|
||||
At Run time each engines Calculate() method is called to return the excess power
|
||||
generated during that iteration. The drag from the previous iteration is sub-
|
||||
tracted to give the excess power available for thrust this pass. That quantity
|
||||
is passed to the thrusters associated with a particular engine - perhaps with a
|
||||
scaling mechanism (gearing?) to allow the engine to give its associated thrust-
|
||||
ers specific distributed portions of the excess power.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see FGEngine
|
||||
@see FGTank
|
||||
@see FGThruster
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGPropulsion.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
@see
|
||||
FGEngine
|
||||
FGTank
|
||||
FGThruster
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -144,7 +150,7 @@ public:
|
|||
if (index <= Engines.size()-1) return Engines[index];
|
||||
else return 0L; }
|
||||
|
||||
// Retrieves the number of tanks defined for the aircraft.
|
||||
/// Retrieves the number of tanks defined for the aircraft.
|
||||
inline unsigned int GetNumTanks(void) const {return Tanks.size();}
|
||||
|
||||
/** Retrieves a tank object pointer from the list of tanks.
|
||||
|
@ -192,9 +198,17 @@ public:
|
|||
double GetTanksIzz(const FGColumnVector3& vXYZcg);
|
||||
double GetTanksIxz(const FGColumnVector3& vXYZcg);
|
||||
double GetTanksIxy(const FGColumnVector3& vXYZcg);
|
||||
|
||||
|
||||
inline int GetActiveEngine(void) const
|
||||
{
|
||||
return ActiveEngine;
|
||||
}
|
||||
|
||||
inline int GetActiveEngine(void);
|
||||
|
||||
void SetMagnetos(int setting);
|
||||
void SetStarter(int setting);
|
||||
void SetCutoff(int setting=0);
|
||||
void SetActiveEngine(int engine);
|
||||
|
||||
void bind();
|
||||
|
|
|
@ -73,6 +73,7 @@ FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
|
|||
|
||||
EngineNumber = 0;
|
||||
Type = etRocket;
|
||||
Flameout = false;
|
||||
|
||||
PC = 0.0;
|
||||
kFactor = (2.0*SHR*SHR/(SHR-1.0))*pow(2.0/(SHR+1), (SHR+1)/(SHR-1));
|
||||
|
@ -80,7 +81,7 @@ FGRocket::FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg) : FGEngine(exec)
|
|||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
FGRocket::~FGRocket()
|
||||
FGRocket::~FGRocket(void)
|
||||
{
|
||||
Debug(1);
|
||||
}
|
||||
|
@ -91,7 +92,7 @@ double FGRocket::Calculate(double pe)
|
|||
{
|
||||
double Cf=0;
|
||||
|
||||
ConsumeFuel();
|
||||
if (!Flameout && !Starved) ConsumeFuel();
|
||||
|
||||
Throttle = FCS->GetThrottlePos(EngineNumber);
|
||||
|
||||
|
|
|
@ -53,10 +53,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -70,9 +66,9 @@ CLASS DOCUMENTATION
|
|||
<li>Variance (in percent, from 0 to 1.0, nominally 0.05)</li>
|
||||
</ul>
|
||||
Additionally, the following control inputs, operating characteristics, and
|
||||
location are required, as with all other engine types:</font>
|
||||
location are required, as with all other engine types:
|
||||
<ul>
|
||||
<li>Throttle setting (in percent, from 0 to 1.0)</font></li>
|
||||
<li>Throttle setting (in percent, from 0 to 1.0)</li>
|
||||
<li>Maximum allowable throttle setting</li>
|
||||
<li>Minimum working throttle setting</li>
|
||||
<li>Sea level fuel flow at maximum thrust</li>
|
||||
|
@ -89,17 +85,13 @@ CLASS DOCUMENTATION
|
|||
determined.
|
||||
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see FGNozzle
|
||||
@see FGThruster
|
||||
@see FGForce
|
||||
@see FGEngine
|
||||
@see FGPropulsion
|
||||
@see FGTank
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGRocket.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGRocket.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
$Id$
|
||||
@see FGNozzle,
|
||||
FGThruster,
|
||||
FGForce,
|
||||
FGEngine,
|
||||
FGPropulsion,
|
||||
FGTank
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -115,7 +107,7 @@ public:
|
|||
FGRocket(FGFDMExec* exec, FGConfigFile* Eng_cfg);
|
||||
|
||||
/** Destructor */
|
||||
~FGRocket();
|
||||
~FGRocket(void);
|
||||
|
||||
/** Determines the thrust coefficient.
|
||||
This routine takes the nozzle exit pressure and calculates the thrust
|
||||
|
@ -128,6 +120,12 @@ public:
|
|||
@return chamber pressure in psf. */
|
||||
double GetChamberPressure(void) {return PC;}
|
||||
|
||||
/** Gets the flame-out status.
|
||||
The engine will "flame out" if the throttle is set below the minimum
|
||||
sustainable setting.
|
||||
@return true if engine has flamed out. */
|
||||
bool GetFlameout(void) {return Flameout;}
|
||||
|
||||
private:
|
||||
double SHR;
|
||||
double maxPC;
|
||||
|
@ -135,6 +133,8 @@ private:
|
|||
double kFactor;
|
||||
double Variance;
|
||||
double PC;
|
||||
bool Flameout;
|
||||
|
||||
void Debug(int from);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ FGRotation::FGRotation(FGFDMExec* fdmex) : FGModel(fdmex)
|
|||
vPQRdot_prev[0].InitMatrix();
|
||||
vPQRdot_prev[1].InitMatrix();
|
||||
vPQRdot_prev[2].InitMatrix();
|
||||
vPQRdot_prev[3].InitMatrix();
|
||||
|
||||
bind();
|
||||
|
||||
|
|
|
@ -27,24 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
12/02/98 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||
School, January 1994
|
||||
[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977
|
||||
[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975
|
||||
[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2
|
||||
|
||||
The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||
or Y-P-R, or Z-Y-X, if you prefer.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -72,10 +54,38 @@ INCLUDES
|
|||
#include "FGColumnVector3.h"
|
||||
#include "FGColumnVector4.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_ROTATION "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models the rotational portion of the Equations of Motion.
|
||||
Note: The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||
or Y-P-R, or Z-Y-X, if you prefer.
|
||||
@see Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||
School, January 1994
|
||||
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977
|
||||
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975
|
||||
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -127,7 +137,7 @@ private:
|
|||
FGColumnVector3 vPQR;
|
||||
FGColumnVector3 vAeroPQR;
|
||||
FGColumnVector3 vPQRdot;
|
||||
FGColumnVector3 vPQRdot_prev[3];
|
||||
FGColumnVector3 vPQRdot_prev[4];
|
||||
FGColumnVector3 vMoments;
|
||||
FGColumnVector3 vEuler;
|
||||
FGColumnVector3 vEulerRates;
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
08/24/00 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -44,10 +40,25 @@ INCLUDES
|
|||
|
||||
#include "FGThruster.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_ROTOR "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models a rotor (such as for a helicopter); NOT YET IMPLEMENTED.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -46,7 +46,7 @@ INCLUDES
|
|||
# include STL_IOSTREAM
|
||||
# include STL_ITERATOR
|
||||
#else
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iostream.h>
|
||||
# else
|
||||
# include <iostream>
|
||||
|
|
|
@ -54,27 +54,16 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates the JSBSim scripting capability.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGScript.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGScript.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
|
||||
<h4>Scripting support provided via FGScript.</h4>
|
||||
|
||||
<p>There is simple scripting support provided in the FGScript
|
||||
class. Commands are specified using the <u>Simple Scripting
|
||||
Directives for JSBSim</u> (SSDJ). The script file is in XML
|
||||
class. Commands are specified using the <em>Simple Scripting
|
||||
Directives for JSBSim</em> (SSDJ). The script file is in XML
|
||||
format. A test condition (or conditions) can be set up in the
|
||||
script and when the condition evaluates to true, the specified
|
||||
action[s] is/are taken. A test condition can be <em>persistent</em>,
|
||||
|
@ -128,6 +117,8 @@ CLASS DOCUMENTATION
|
|||
to be used are specified in the "use" lines. Next,
|
||||
comes the "run" section, where the conditions are
|
||||
described in "when" clauses.</p>
|
||||
@author Jon S. Berndt
|
||||
@version "$Id$"
|
||||
|
||||
*/
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ CLASS IMPLEMENTATION
|
|||
FGSimTurbine::FGSimTurbine(FGFDMExec* exec, FGConfigFile* cfg) : FGEngine(exec)
|
||||
{
|
||||
SetDefaults();
|
||||
FGEngine::Type=etSimTurbine;
|
||||
|
||||
Load(cfg);
|
||||
Debug(0);
|
||||
}
|
||||
|
@ -83,7 +83,7 @@ double FGSimTurbine::Calculate(double dummy)
|
|||
phase = tpRun;
|
||||
N2 = IdleN2;
|
||||
N1 = IdleN1;
|
||||
OilTemp_degK = TAT + 10;
|
||||
OilTemp_degK = 366.0;
|
||||
Cutoff = false;
|
||||
}
|
||||
else {
|
||||
|
@ -121,121 +121,125 @@ double FGSimTurbine::Calculate(double dummy)
|
|||
|
||||
double FGSimTurbine::Off(void)
|
||||
{
|
||||
double qbar = Translation->Getqbar();
|
||||
Running = false;
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
|
||||
N1 = Seek(&N1, qbar/10.0, N1/2.0, N1/2.0);
|
||||
N2 = Seek(&N2, qbar/15.0, N2/2.0, N2/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||
EPR = Seek(&EPR, 1.0, 0.2, 0.2);
|
||||
return 0.0;
|
||||
double qbar = Translation->Getqbar();
|
||||
Running = false;
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, 0, 1000.0, 10000.0);
|
||||
N1 = Seek(&N1, qbar/10.0, N1/2.0, N1/2.0);
|
||||
N2 = Seek(&N2, qbar/15.0, N2/2.0, N2/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||
EPR = Seek(&EPR, 1.0, 0.2, 0.2);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGSimTurbine::Run(void)
|
||||
{
|
||||
double idlethrust, milthrust, thrust;
|
||||
double N2norm; // 0.0 = idle N2, 1.0 = maximum N2
|
||||
idlethrust = MilThrust * ThrustTables[0]->TotalValue();
|
||||
milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
|
||||
double idlethrust, milthrust, thrust;
|
||||
double N2norm; // 0.0 = idle N2, 1.0 = maximum N2
|
||||
idlethrust = MilThrust * ThrustTables[0]->TotalValue();
|
||||
milthrust = (MilThrust - idlethrust) * ThrustTables[1]->TotalValue();
|
||||
|
||||
Running = true;
|
||||
Starter = false;
|
||||
|
||||
Running = true;
|
||||
Starter = false;
|
||||
|
||||
N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
|
||||
N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
|
||||
N2norm = (N2 - IdleN2) / N2_factor;
|
||||
thrust = idlethrust + (milthrust * N2norm * N2norm);
|
||||
thrust = thrust * (1.0 - BleedDemand);
|
||||
EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
|
||||
EPR = 1.0 + thrust/MilThrust;
|
||||
if (!Augmentation) {
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * TSFC, 1000.0, 100000);
|
||||
if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
|
||||
}
|
||||
if (Reversed) thrust = thrust * -0.2;
|
||||
N2 = Seek(&N2, IdleN2 + ThrottleCmd * N2_factor, delay, delay * 3.0);
|
||||
N1 = Seek(&N1, IdleN1 + ThrottleCmd * N1_factor, delay, delay * 2.4);
|
||||
N2norm = (N2 - IdleN2) / N2_factor;
|
||||
thrust = idlethrust + (milthrust * N2norm * N2norm);
|
||||
thrust = thrust * (1.0 - BleedDemand);
|
||||
EGT_degC = TAT + 363.1 + ThrottleCmd * 357.1;
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
OilTemp_degK = Seek(&OilTemp_degK, 366.0, 1.2, 0.1);
|
||||
EPR = 1.0 + thrust/MilThrust;
|
||||
|
||||
if (AugMethod == 1) {
|
||||
if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;}
|
||||
else {Augmentation = false;}
|
||||
}
|
||||
if (!Augmentation) {
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * TSFC, 1000.0, 100000);
|
||||
if (FuelFlow_pph < IdleFF) FuelFlow_pph = IdleFF;
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0 - N2norm, 0.8, 0.8);
|
||||
}
|
||||
|
||||
if ((Augmented == 1) && Augmentation) {
|
||||
thrust = MaxThrust * ThrustTables[2]->TotalValue();
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||
}
|
||||
if (AugMethod == 1) {
|
||||
if ((ThrottleCmd > 0.99) && (N2 > 97.0)) {Augmentation = true;}
|
||||
else {Augmentation = false;}
|
||||
}
|
||||
|
||||
if ((Injected == 1) && Injection)
|
||||
thrust = thrust * ThrustTables[3]->TotalValue();
|
||||
if ((Augmented == 1) && Augmentation) {
|
||||
thrust = MaxThrust * ThrustTables[2]->TotalValue();
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, thrust * ATSFC, 5000.0, 10000.0);
|
||||
NozzlePosition = Seek(&NozzlePosition, 1.0, 0.8, 0.8);
|
||||
}
|
||||
|
||||
ConsumeFuel();
|
||||
if (Cutoff) phase = tpOff;
|
||||
if (Starved) phase = tpOff;
|
||||
return thrust;
|
||||
if ((Injected == 1) && Injection)
|
||||
thrust = thrust * ThrustTables[3]->TotalValue();
|
||||
|
||||
ConsumeFuel();
|
||||
if (Cutoff) phase = tpOff;
|
||||
if (Starved) phase = tpOff;
|
||||
|
||||
return thrust;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGSimTurbine::SpinUp(void)
|
||||
{
|
||||
Running = false;
|
||||
FuelFlow_pph = 0.0;
|
||||
N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
|
||||
N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||
EPR = 1.0;
|
||||
NozzlePosition = 1.0;
|
||||
return 0.0;
|
||||
Running = false;
|
||||
FuelFlow_pph = 0.0;
|
||||
N2 = Seek(&N2, 25.18, 3.0, N2/2.0);
|
||||
N1 = Seek(&N1, 5.21, 1.0, N1/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT, 11.7, 7.3);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
OilTemp_degK = Seek(&OilTemp_degK, TAT + 273.0, 0.2, 0.2);
|
||||
EPR = 1.0;
|
||||
NozzlePosition = 1.0;
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGSimTurbine::Start(void)
|
||||
{
|
||||
if ((N2 > 15.0) && !Starved) { // minimum 15% N2 needed for start
|
||||
Cranking = true; // provided for sound effects signal
|
||||
if (N2 < IdleN2) {
|
||||
N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
|
||||
N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
}
|
||||
else {
|
||||
phase = tpRun;
|
||||
Running = true;
|
||||
Starter = false;
|
||||
Cranking = false;
|
||||
}
|
||||
if ((N2 > 15.0) && !Starved) { // minimum 15% N2 needed for start
|
||||
Cranking = true; // provided for sound effects signal
|
||||
if (N2 < IdleN2) {
|
||||
N2 = Seek(&N2, IdleN2, 2.0, N2/2.0);
|
||||
N1 = Seek(&N1, IdleN1, 1.4, N1/2.0);
|
||||
EGT_degC = Seek(&EGT_degC, TAT + 363.1, 21.3, 7.3);
|
||||
FuelFlow_pph = Seek(&FuelFlow_pph, IdleFF, 103.7, 103.7);
|
||||
OilPressure_psi = N2 * 0.62;
|
||||
}
|
||||
else { // no start if N2 < 15%
|
||||
phase = tpOff;
|
||||
else {
|
||||
phase = tpRun;
|
||||
Running = true;
|
||||
Starter = false;
|
||||
}
|
||||
return 0.0;
|
||||
Cranking = false;
|
||||
}
|
||||
}
|
||||
else { // no start if N2 < 15%
|
||||
phase = tpOff;
|
||||
Starter = false;
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
double FGSimTurbine::Stall(void)
|
||||
{
|
||||
double qbar = Translation->Getqbar();
|
||||
EGT_degC = TAT + 903.14;
|
||||
FuelFlow_pph = IdleFF;
|
||||
N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
|
||||
N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
|
||||
if (ThrottleCmd == 0) phase = tpRun; // clear the stall with throttle
|
||||
return 0.0;
|
||||
double qbar = Translation->Getqbar();
|
||||
EGT_degC = TAT + 903.14;
|
||||
FuelFlow_pph = IdleFF;
|
||||
N1 = Seek(&N1, qbar/10.0, 0, N1/10.0);
|
||||
N2 = Seek(&N2, qbar/15.0, 0, N2/10.0);
|
||||
if (ThrottleCmd == 0) phase = tpRun; // clear the stall with throttle
|
||||
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -297,7 +301,8 @@ double FGSimTurbine::Seek(double *var, double target, double accel, double decel
|
|||
|
||||
void FGSimTurbine::SetDefaults(void)
|
||||
{
|
||||
Name = "None_Defined";
|
||||
Name = "Not defined";
|
||||
Type = etSimTurbine;
|
||||
MilThrust = 10000.0;
|
||||
MaxThrust = 10000.0;
|
||||
BypassRatio = 0.0;
|
||||
|
@ -317,47 +322,59 @@ void FGSimTurbine::SetDefaults(void)
|
|||
Augmentation = false;
|
||||
Injection = false;
|
||||
Reversed = false;
|
||||
Cutoff = true;
|
||||
phase = tpOff;
|
||||
Stalled = false;
|
||||
Seized = false;
|
||||
Overtemp = false;
|
||||
Fire = false;
|
||||
EGT_degC = 0.0;
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
bool FGSimTurbine::Load(FGConfigFile *Eng_cfg)
|
||||
{
|
||||
int i;
|
||||
string token;
|
||||
|
||||
Name = Eng_cfg->GetValue("NAME");
|
||||
cout << Name << endl;
|
||||
Eng_cfg->GetNextConfigLine();
|
||||
*Eng_cfg >> token >> MilThrust;
|
||||
*Eng_cfg >> token >> MaxThrust;
|
||||
*Eng_cfg >> token >> BypassRatio;
|
||||
*Eng_cfg >> token >> TSFC;
|
||||
*Eng_cfg >> token >> ATSFC;
|
||||
*Eng_cfg >> token >> IdleN1;
|
||||
*Eng_cfg >> token >> IdleN2;
|
||||
*Eng_cfg >> token >> MaxN1;
|
||||
*Eng_cfg >> token >> MaxN2;
|
||||
*Eng_cfg >> token >> Augmented;
|
||||
*Eng_cfg >> token >> AugMethod;
|
||||
*Eng_cfg >> token >> Injected;
|
||||
i=0;
|
||||
while( Eng_cfg->GetValue() != string("/FG_SIMTURBINE") && i < 10){
|
||||
ThrustTables.push_back( new FGCoefficient(FDMExec) );
|
||||
ThrustTables.back()->Load(Eng_cfg);
|
||||
i++;
|
||||
int counter=0;
|
||||
|
||||
while (Eng_cfg->GetValue() != string("/FG_SIMTURBINE")) {
|
||||
*Eng_cfg >> token;
|
||||
|
||||
if (token[0] == '<') token.erase(0,1); // Tables are read "<TABLE"
|
||||
|
||||
if (token == "MILTHRUST") *Eng_cfg >> MilThrust;
|
||||
else if (token == "MAXTHRUST") *Eng_cfg >> MaxThrust;
|
||||
else if (token == "BYPASSRATIO") *Eng_cfg >> BypassRatio;
|
||||
else if (token == "TSFC") *Eng_cfg >> TSFC;
|
||||
else if (token == "ATSFC") *Eng_cfg >> ATSFC;
|
||||
else if (token == "IDLEN1") *Eng_cfg >> IdleN1;
|
||||
else if (token == "IDLEN2") *Eng_cfg >> IdleN2;
|
||||
else if (token == "MAXN1") *Eng_cfg >> MaxN1;
|
||||
else if (token == "MAXN2") *Eng_cfg >> MaxN2;
|
||||
else if (token == "AUGMENTED") *Eng_cfg >> Augmented;
|
||||
else if (token == "AUGMETHOD") *Eng_cfg >> AugMethod;
|
||||
else if (token == "INJECTED") *Eng_cfg >> Injected;
|
||||
else if (token == "MINTHROTTLE") *Eng_cfg >> MinThrottle;
|
||||
else if (token == "TABLE") {
|
||||
if (counter++ == 0) Debug(2); // print engine specs prior to table read
|
||||
ThrustTables.push_back( new FGCoefficient(FDMExec) );
|
||||
ThrustTables.back()->Load(Eng_cfg);
|
||||
}
|
||||
else cerr << "Unhandled token in Engine config file: " << token << endl;
|
||||
}
|
||||
|
||||
// pre-calculations and initializations
|
||||
delay= 60.0 / (BypassRatio + 3.0);
|
||||
|
||||
// Pre-calculations and initializations
|
||||
|
||||
delay = 60.0 / (BypassRatio + 3.0);
|
||||
N1_factor = MaxN1 - IdleN1;
|
||||
N2_factor = MaxN2 - IdleN2;
|
||||
OilTemp_degK = (Auxiliary->GetTotalTemperature() - 491.69) * 0.5555556 + 273.0;
|
||||
IdleFF = pow(MilThrust, 0.2) * 107.0; // just an estimate
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -389,6 +406,24 @@ void FGSimTurbine::Debug(int from)
|
|||
if (from == 0) { // Constructor
|
||||
|
||||
}
|
||||
if (from == 2) { // called from Load()
|
||||
cout << "\n Engine Name: " << Name << endl;
|
||||
cout << " MilThrust: " << MilThrust << endl;
|
||||
cout << " MaxThrust: " << MaxThrust << endl;
|
||||
cout << " BypassRatio: " << BypassRatio << endl;
|
||||
cout << " TSFC: " << TSFC << endl;
|
||||
cout << " ATSFC: " << ATSFC << endl;
|
||||
cout << " IdleN1: " << IdleN1 << endl;
|
||||
cout << " IdleN2: " << IdleN2 << endl;
|
||||
cout << " MaxN1: " << MaxN1 << endl;
|
||||
cout << " MaxN2: " << MaxN2 << endl;
|
||||
cout << " Augmented: " << Augmented << endl;
|
||||
cout << " AugMethod: " << AugMethod << endl;
|
||||
cout << " Injected: " << Injected << endl;
|
||||
cout << " MinThrottle: " << MinThrottle << endl;
|
||||
|
||||
cout << endl;
|
||||
}
|
||||
}
|
||||
if (debug_lvl & 2 ) { // Instantiation/Destruction notification
|
||||
if (from == 0) cout << "Instantiated: FGSimTurbine" << endl;
|
||||
|
|
|
@ -29,10 +29,6 @@ HISTORY
|
|||
09/22/2003 DPC Added starting, stopping, new framework
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
|
@ -69,24 +65,67 @@ CLASS DOCUMENTATION
|
|||
case the engine will go to the Run phase. Once an engine is in the Off phase
|
||||
the full starting procedure (or airstart) must be used to get it running.
|
||||
<P>
|
||||
-STARTING (on ground):
|
||||
-# Set the control FGEngine::Starter to true. The engine will spin up to
|
||||
a maximum of about %25 N2 (%5.2 N1). This simulates the action of a
|
||||
pneumatic starter.
|
||||
-# After reaching %15 N2 set the control FGEngine::Cutoff to false. If fuel
|
||||
is available the engine will now accelerate to idle. The starter will
|
||||
automatically be set to false after the start cycle.
|
||||
- STARTING (on ground):
|
||||
-# Set the control FGEngine::Starter to true. The engine will spin up to
|
||||
a maximum of about %25 N2 (%5.2 N1). This simulates the action of a
|
||||
pneumatic starter.
|
||||
-# After reaching %15 N2 set the control FGEngine::Cutoff to false. If fuel
|
||||
is available the engine will now accelerate to idle. The starter will
|
||||
automatically be set to false after the start cycle.
|
||||
<P>
|
||||
-STARTING (in air):
|
||||
-# Increase speed to obtain a minimum of %15 N2. If this is not possible,
|
||||
the starter may be used to assist.
|
||||
-# Place the control FGEngine::Cutoff to false.
|
||||
- STARTING (in air):
|
||||
-# Increase speed to obtain a minimum of %15 N2. If this is not possible,
|
||||
the starter may be used to assist.
|
||||
-# Place the control FGEngine::Cutoff to false.
|
||||
<P>
|
||||
Ignition is assumed to be on anytime the Cutoff control is set to false,
|
||||
therefore a seperate ignition system is not modeled.
|
||||
|
||||
Configuration File Format
|
||||
<pre>
|
||||
\<FG_SIMTURBINE NAME="<name>">
|
||||
MILTHRUST \<thrust>
|
||||
MAXTHRUST \<thrust>
|
||||
BYPASSRATIO \<bypass ratio>
|
||||
TSFC \<thrust specific fuel consumption>
|
||||
ATSFC \<afterburning thrust specific fuel consumption>
|
||||
IDLEN1 \<idle N1>
|
||||
IDLEN2 \<idle N2>
|
||||
MAXN1 \<max N1>
|
||||
MAXN2 \<max N2>
|
||||
AUGMENTED \<0|1>
|
||||
AUGMETHOD \<0|1>
|
||||
INJECTED \<0|1>
|
||||
...
|
||||
\</FG_SIMTURBINE>
|
||||
</pre>
|
||||
Definition of the turbine engine configuration file parameters:
|
||||
<pre>
|
||||
<b>MILTHRUST</b> - Maximum thrust, static, at sea level, lbf.
|
||||
<b>MAXTHRUST</b> - Afterburning thrust, static, at sea level, lbf
|
||||
[this value will be ignored when AUGMENTED is zero (false)].
|
||||
<b>BYPASSRATIO</b> - Ratio of bypass air flow to core air flow.
|
||||
<b>TSFC</b> - Thrust-specific fuel consumption, lbm/hr/lbf
|
||||
[i.e. fuel flow divided by thrust].
|
||||
<b>ATSFC</b> - Afterburning TSFC, lbm/hr/lbf
|
||||
[this value will be ignored when AUGMENTED is zero (false)]
|
||||
<b>IDLEN1</b> - Fan rotor rpm (% of max) at idle
|
||||
<b>IDLEN2</b> - Core rotor rpm (% of max) at idle
|
||||
<b>MAXN1</b> - Fan rotor rpm (% of max) at full throttle [not always 100!]
|
||||
<b>MAXN2</b> - Core rotor rpm (% of max) at full throttle [not always 100!]
|
||||
<b>AUGMENTED</b>
|
||||
0 == afterburner not installed
|
||||
1 == afterburner installed
|
||||
<b>AUGMETHOD</b>
|
||||
0 == afterburner activated by property /engines/engine[n]/augmentation
|
||||
1 == afterburner activated by pushing throttle above 99% position
|
||||
[this item will be ignored when AUGMENTED == 0]
|
||||
<b>INJECTED</b>
|
||||
0 == Water injection not installed
|
||||
1 == Water injection installed
|
||||
</pre>
|
||||
@author David P. Culp
|
||||
@version $Id$
|
||||
@version "$Id$"
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -97,25 +136,49 @@ class FGSimTurbine : public FGEngine
|
|||
{
|
||||
public:
|
||||
/** Constructor
|
||||
@param exec pointer to executive structure
|
||||
@param Eng_Cfg pointer to engine config file instance */
|
||||
FGSimTurbine(FGFDMExec* exec, FGConfigFile* Eng_cfg);
|
||||
@param Executive pointer to executive structure
|
||||
@param Eng_cfg pointer to engine config file instance */
|
||||
FGSimTurbine(FGFDMExec* Executive, FGConfigFile* Eng_cfg);
|
||||
/// Destructor
|
||||
~FGSimTurbine();
|
||||
|
||||
enum phaseType { tpOff, tpRun, tpSpinUp, tpStart, tpStall, tpSeize, tpTrim };
|
||||
|
||||
double Calculate(double);
|
||||
double Calculate(double PowerRequired);
|
||||
double CalcFuelNeed(void);
|
||||
double GetPowerAvailable(void);
|
||||
double Seek(double* var, double target, double accel, double decel);
|
||||
|
||||
virtual phaseType GetPhase(void) { return phase; }
|
||||
virtual void SetPhase( phaseType p ) { phase = p; }
|
||||
phaseType GetPhase(void) { return phase; }
|
||||
|
||||
bool GetOvertemp(void) {return Overtemp; }
|
||||
bool GetInjection(void) {return Injection;}
|
||||
bool GetFire(void) { return Fire; }
|
||||
bool GetAugmentation(void) {return Augmentation;}
|
||||
bool GetReversed(void) { return Reversed; }
|
||||
bool GetCutoff(void) { return Cutoff; }
|
||||
int GetIgnition(void) {return Ignition;}
|
||||
|
||||
double GetInlet(void) { return InletPosition; }
|
||||
double GetNozzle(void) { return NozzlePosition; }
|
||||
double GetBleedDemand(void) {return BleedDemand;}
|
||||
double GetN1(void) {return N1;}
|
||||
double GetN2(void) {return N2;}
|
||||
double GetEPR(void) {return EPR;}
|
||||
double GetEGT(void) {return EGT_degC;}
|
||||
|
||||
double getOilPressure_psi () const {return OilPressure_psi;}
|
||||
double getOilTemp_degF (void) {return KelvinToFahrenheit(OilTemp_degK);}
|
||||
|
||||
void SetInjection(bool injection) {Injection = injection;}
|
||||
void SetIgnition(int ignition) {Ignition = ignition;}
|
||||
void SetAugmentation(bool augmentation) {Augmentation = augmentation;}
|
||||
void SetPhase( phaseType p ) { phase = p; }
|
||||
void SetEPR(double epr) {EPR = epr;}
|
||||
void SetBleedDemand(double bleedDemand) {BleedDemand = bleedDemand;}
|
||||
void SetReverse(bool reversed) { Reversed = reversed; }
|
||||
void SetCutoff(bool cutoff) { Cutoff = cutoff; }
|
||||
|
||||
virtual bool GetOvertemp(void) { return Overtemp; }
|
||||
virtual bool GetFire(void) { return Fire; }
|
||||
|
||||
private:
|
||||
|
||||
typedef vector<FGCoefficient*> CoeffArray;
|
||||
|
@ -129,6 +192,8 @@ private:
|
|||
double ATSFC; ///< Augmented TSFC (lbm/hr/lbf)
|
||||
double IdleN1; ///< Idle N1
|
||||
double IdleN2; ///< Idle N2
|
||||
double N1; ///< N1
|
||||
double N2; ///< N2
|
||||
double MaxN1; ///< N1 at 100% throttle
|
||||
double MaxN2; ///< N2 at 100% throttle
|
||||
double IdleFF; ///< Idle Fuel Flow (lbm/hr)
|
||||
|
@ -142,10 +207,22 @@ private:
|
|||
bool Seized; ///< true if inner spool is seized
|
||||
bool Overtemp; ///< true if EGT exceeds limits
|
||||
bool Fire; ///< true if engine fire detected
|
||||
int Augmented; ///< = 1 if augmentation installed
|
||||
bool Injection;
|
||||
bool Augmentation;
|
||||
bool Reversed;
|
||||
bool Cutoff;
|
||||
int Injected; ///< = 1 if water injection installed
|
||||
int Ignition;
|
||||
int Augmented; ///< = 1 if augmentation installed
|
||||
int AugMethod; ///< = 0 if using property /engine[n]/augmentation
|
||||
///< = 1 if using last 1% of throttle movement
|
||||
double EGT_degC;
|
||||
double EPR;
|
||||
double OilPressure_psi;
|
||||
double OilTemp_degK;
|
||||
double BleedDemand;
|
||||
double InletPosition;
|
||||
double NozzlePosition;
|
||||
|
||||
double Off(void);
|
||||
double Run(void);
|
||||
|
|
|
@ -86,7 +86,7 @@ FGState::FGState(FGFDMExec* fdex)
|
|||
Propulsion = FDMExec->GetPropulsion();
|
||||
PropertyManager = FDMExec->GetPropertyManager();
|
||||
|
||||
for(int i=0;i<3;i++) vQdot_prev[i].InitMatrix();
|
||||
for(int i=0;i<4;i++) vQdot_prev[i].InitMatrix();
|
||||
|
||||
bind();
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ INCLUDES
|
|||
#include "FGGroundReactions.h"
|
||||
#include "FGPropulsion.h"
|
||||
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -89,10 +88,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -100,10 +95,6 @@ CLASS DOCUMENTATION
|
|||
/** Encapsulates the calculation of aircraft state.
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGState.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGState.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -214,7 +205,7 @@ public:
|
|||
|
||||
// ======================================= General Purpose INTEGRATOR
|
||||
|
||||
enum iType {AB4, AB3, AB2, AM3, EULER, TRAPZ};
|
||||
enum iType {AB4, AB3, AB2, AM3, AM4, EULER, TRAPZ};
|
||||
|
||||
/** Multi-method integrator.
|
||||
@param type Type of intergation scheme to use. Can be one of:
|
||||
|
@ -223,6 +214,7 @@ public:
|
|||
<li>AB3 - Adams-Bashforth, third order</li>
|
||||
<li>AB2 - Adams-Bashforth, second order</li>
|
||||
<li>AM3 - Adams Moulton, third order</li>
|
||||
<li>AM4 - Adams Moulton, fourth order</li>
|
||||
<li>EULER - Euler</li>
|
||||
<li>TRAPZ - Trapezoidal</li>
|
||||
</ul>
|
||||
|
@ -243,23 +235,35 @@ public:
|
|||
|
||||
switch (type) {
|
||||
case AB4:
|
||||
vResult = (delta_t/24.0)*( 55.0 * vTDeriv
|
||||
- 59.0 * vLastArray[0]
|
||||
+ 37.0 * vLastArray[1]
|
||||
- 9.0 * vLastArray[2] );
|
||||
vResult = (delta_t/24.0)*( 55.0 * vLastArray[0]
|
||||
- 59.0 * vLastArray[1]
|
||||
+ 37.0 * vLastArray[2]
|
||||
- 9.0 * vLastArray[3] );
|
||||
vLastArray[3] = vLastArray[2];
|
||||
vLastArray[2] = vLastArray[1];
|
||||
vLastArray[1] = vLastArray[0];
|
||||
vLastArray[0] = vTDeriv;
|
||||
break;
|
||||
case AB3:
|
||||
vResult = (delta_t/12.0)*( 23.0 * vTDeriv
|
||||
- 16.0 * vLastArray[0]
|
||||
+ 5.0 * vLastArray[1] );
|
||||
vResult = (delta_t/12.0)*( 23.0 * vLastArray[0]
|
||||
- 16.0 * vLastArray[1]
|
||||
+ 5.0 * vLastArray[2] );
|
||||
vLastArray[2] = vLastArray[1];
|
||||
vLastArray[1] = vLastArray[0];
|
||||
vLastArray[0] = vTDeriv;
|
||||
break;
|
||||
case AB2:
|
||||
vResult = (delta_t/2.0)*( 3.0 * vTDeriv - vLastArray[0] );
|
||||
vResult = (delta_t/2.0)*( 3.0 * vLastArray[0] - vLastArray[1] );
|
||||
vLastArray[1] = vLastArray[0];
|
||||
vLastArray[0] = vTDeriv;
|
||||
break;
|
||||
case AM4:
|
||||
vResult = (delta_t/24.0)*( 9.0 * vTDeriv
|
||||
+ 19.0 * vLastArray[0]
|
||||
- 5.0 * vLastArray[1]
|
||||
+ 1.0 * vLastArray[2] );
|
||||
vLastArray[2] = vLastArray[1];
|
||||
vLastArray[1] = vLastArray[0];
|
||||
vLastArray[0] = vTDeriv;
|
||||
break;
|
||||
case AM3:
|
||||
|
@ -341,7 +345,7 @@ private:
|
|||
FGMatrix33 mTs2b;
|
||||
FGMatrix33 mTb2s;
|
||||
FGColumnVector4 vQtrn;
|
||||
FGColumnVector4 vQdot_prev[3];
|
||||
FGColumnVector4 vQdot_prev[4];
|
||||
FGColumnVector4 vQdot;
|
||||
FGColumnVector3 vUVW;
|
||||
FGColumnVector3 vLocalVelNED;
|
||||
|
|
|
@ -38,7 +38,7 @@ INCLUDES
|
|||
|
||||
#include "FGTable.h"
|
||||
|
||||
#if defined ( sgi ) && !defined( __GNUC__ )
|
||||
#if defined ( sgi ) && !defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||
#include <iomanip.h>
|
||||
#else
|
||||
#include <iomanip>
|
||||
|
@ -249,7 +249,7 @@ void FGTable::Print(void)
|
|||
if (Type == tt1D) startRow = 1;
|
||||
else startRow = 0;
|
||||
|
||||
#if defined (sgi) && !defined(__GNUC__)
|
||||
#if defined (sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
unsigned long flags = cout.setf(ios::fixed);
|
||||
#else
|
||||
ios::fmtflags flags = cout.setf(ios::fixed); // set up output stream
|
||||
|
|
|
@ -53,10 +53,6 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -67,10 +63,6 @@ CLASS DOCUMENTATION
|
|||
@version $Id$
|
||||
@see FGCoefficient
|
||||
@see FGPropeller
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTable.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTable.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -38,7 +38,7 @@ INCLUDES
|
|||
|
||||
#include "FGTank.h"
|
||||
|
||||
#if !defined ( sgi ) || defined( __GNUC__ )
|
||||
#if !defined ( sgi ) || defined( __GNUC__ ) && (_COMPILER_VERSION < 740)
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
using std::cout;
|
||||
|
|
|
@ -57,7 +57,7 @@ INCLUDES
|
|||
#else
|
||||
# include <string>
|
||||
using std::string;
|
||||
# if !defined(sgi) || defined(__GNUC__)
|
||||
# if !defined(sgi) || defined(__GNUC__) || (_COMPILER_VERSION >= 740)
|
||||
using std::cerr;
|
||||
using std::endl;
|
||||
using std::cout;
|
||||
|
@ -65,13 +65,24 @@ INCLUDES
|
|||
#endif
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINES
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_TANK "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models a fuel tank.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -50,6 +50,7 @@ CLASS IMPLEMENTATION
|
|||
FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
|
||||
ThrusterNumber(0)
|
||||
{
|
||||
Type = ttDirect;
|
||||
SetTransformType(FGForce::tCustom);
|
||||
|
||||
Debug(0);
|
||||
|
@ -57,12 +58,15 @@ FGThruster::FGThruster(FGFDMExec *FDMExec) : FGForce(FDMExec),
|
|||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
FGThruster::FGThruster(FGFDMExec *FDMExec,
|
||||
FGConfigFile *Eng_cfg ): FGForce(FDMExec) {
|
||||
ThrusterNumber=0;
|
||||
SetTransformType(FGForce::tCustom);
|
||||
Name=Eng_cfg->GetValue();
|
||||
Debug(0);
|
||||
FGThruster::FGThruster(FGFDMExec *FDMExec,
|
||||
FGConfigFile *Eng_cfg ): FGForce(FDMExec)
|
||||
{
|
||||
ThrusterNumber = 0;
|
||||
Type = ttDirect;
|
||||
SetTransformType(FGForce::tCustom);
|
||||
Name = Eng_cfg->GetValue();
|
||||
GearRatio = 1.0;
|
||||
Debug(0);
|
||||
}
|
||||
|
||||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
08/24/00 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -45,14 +41,18 @@ INCLUDES
|
|||
#include "FGForce.h"
|
||||
#include "FGConfigFile.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_THRUSTER "$Id$"
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -75,9 +75,9 @@ public:
|
|||
/// Destructor
|
||||
virtual ~FGThruster();
|
||||
|
||||
enum eType {ttNozzle, ttRotor, ttPropeller};
|
||||
enum eType {ttNozzle, ttRotor, ttPropeller, ttDirect};
|
||||
|
||||
virtual double Calculate(double Thrust) { vFn(1)=Thrust; return 0.0; }
|
||||
virtual double Calculate(double tt) { Thrust = tt; vFn(1) = Thrust; return 0.0; }
|
||||
void SetName(string name) {Name = name;}
|
||||
void SetThrusterNumber(int nn) {ThrusterNumber = nn;}
|
||||
virtual void SetRPM(double rpm) {};
|
||||
|
@ -88,6 +88,7 @@ public:
|
|||
string GetName(void) {return Name;}
|
||||
int GetThrusterNumber(void) {return ThrusterNumber;}
|
||||
virtual double GetRPM(void) { return 0.0; };
|
||||
double GetGearRatio(void) {return GearRatio; }
|
||||
|
||||
protected:
|
||||
eType Type;
|
||||
|
@ -96,6 +97,7 @@ protected:
|
|||
double Thrust;
|
||||
double PowerRequired;
|
||||
double deltaT;
|
||||
double GearRatio;
|
||||
virtual void Debug(int from);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -95,6 +95,7 @@ FGTranslation::FGTranslation(FGFDMExec* fdmex) : FGModel(fdmex)
|
|||
vUVWdot_prev[0].InitMatrix();
|
||||
vUVWdot_prev[1].InitMatrix();
|
||||
vUVWdot_prev[2].InitMatrix();
|
||||
vUVWdot_prev[3].InitMatrix();
|
||||
|
||||
bind();
|
||||
Debug(0);
|
||||
|
@ -160,6 +161,9 @@ bool FGTranslation::Run(void)
|
|||
qbarUW = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eW)*vAeroUVW(eW));
|
||||
qbarUV = 0.5*Atmosphere->GetDensity()*(vAeroUVW(eU)*vAeroUVW(eU) + vAeroUVW(eV)*vAeroUVW(eV));
|
||||
Mach = Vt / State->Geta();
|
||||
vMachUVW(eU) = vAeroUVW(eU) / State->Geta();
|
||||
vMachUVW(eV) = vAeroUVW(eV) / State->Geta();
|
||||
vMachUVW(eW) = vAeroUVW(eW) / State->Geta();
|
||||
|
||||
if (debug_lvl > 1) Debug(1);
|
||||
|
||||
|
|
|
@ -27,24 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
12/02/98 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
[1] Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||
School, January 1994
|
||||
[2] D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977
|
||||
[3] Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975
|
||||
[4] Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
[5] Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2
|
||||
|
||||
The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||
or Y-P-R, or Z-Y-X, if you prefer.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -76,10 +58,38 @@ INCLUDES
|
|||
#include "FGColumnVector3.h"
|
||||
#include "FGColumnVector4.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_TRANSLATION "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models the translation aspects of the EOM.
|
||||
Note: The order of rotations used in this class corresponds to a 3-2-1 sequence,
|
||||
or Y-P-R, or Z-Y-X, if you prefer.
|
||||
@see Cooke, Zyda, Pratt, and McGhee, "NPSNET: Flight Simulation Dynamic Modeling
|
||||
Using Quaternions", Presence, Vol. 1, No. 4, pp. 404-420 Naval Postgraduate
|
||||
School, January 1994
|
||||
@see D. M. Henderson, "Euler Angles, Quaternions, and Transformation Matrices",
|
||||
JSC 12960, July 1977
|
||||
@see Richard E. McFarland, "A Standard Kinematic Model for Flight Simulation at
|
||||
NASA-Ames", NASA CR-2497, January 1975
|
||||
@see Barnes W. McCormick, "Aerodynamics, Aeronautics, and Flight Mechanics",
|
||||
Wiley & Sons, 1979 ISBN 0-471-03032-5
|
||||
@see Bernard Etkin, "Dynamics of Flight, Stability and Control", Wiley & Sons,
|
||||
1982 ISBN 0-471-08936-2
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -104,6 +114,7 @@ public:
|
|||
double GetqbarUV (void) const { return qbarUV; }
|
||||
inline double GetVt (void) const { return Vt; }
|
||||
double GetMach (void) const { return Mach; }
|
||||
double GetMachU(void) const { return vMachUVW(eU); }
|
||||
double Getadot (void) const { return adot; }
|
||||
double Getbdot (void) const { return bdot; }
|
||||
|
||||
|
@ -130,9 +141,10 @@ public:
|
|||
private:
|
||||
FGColumnVector3 vUVW;
|
||||
FGColumnVector3 vUVWdot;
|
||||
FGColumnVector3 vUVWdot_prev[3];
|
||||
FGColumnVector3 vUVWdot_prev[4];
|
||||
FGMatrix33 mVel;
|
||||
FGColumnVector3 vAeroUVW;
|
||||
FGColumnVector3 vMachUVW;
|
||||
|
||||
double Vt, Mach;
|
||||
double qbar, qbarUW, qbarUV;
|
||||
|
|
|
@ -66,20 +66,16 @@ DEFINITIONS
|
|||
#define snprintf _snprintf
|
||||
#endif
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
typedef enum { tLongitudinal, tFull, tGround, tPullup,
|
||||
tCustom, tNone, tTurn
|
||||
} TrimMode;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -97,30 +93,25 @@ CLASS DOCUMENTATION
|
|||
last three are used for on-ground trimming. The state-control pairs used in
|
||||
a given trim are completely user configurable and several pre-defined modes
|
||||
are provided as well. They are:
|
||||
<ul>
|
||||
<li> tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator</li>
|
||||
<li> tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
|
||||
and heading minus ground track (hmgt) with beta</li>
|
||||
<li> tPullup: tLongitudinal but adjust alpha to achieve load factor input
|
||||
with SetTargetNlf()
|
||||
|
||||
<li> tGround: wdot with altitude, qdot with theta, and pdot with phi</li>
|
||||
- tLongitudinal: Trim wdot with alpha, udot with thrust, qdot with elevator
|
||||
- tFull: tLongitudinal + vdot with phi, pdot with aileron, rdot with rudder
|
||||
and heading minus ground track (hmgt) with beta
|
||||
- tPullup: tLongitudinal but adjust alpha to achieve load factor input
|
||||
with SetTargetNlf()
|
||||
- tGround: wdot with altitude, qdot with theta, and pdot with phi
|
||||
|
||||
The remaining modes include <b>tCustom</b>, which is completely user defined and
|
||||
<b>tNone</b>.
|
||||
</ul>
|
||||
|
||||
|
||||
Note that trims can (and do) fail for reasons that are completely outside
|
||||
the control of the trimming routine itself. The most common problem is the
|
||||
initial conditions: is the model capable of steady state flight
|
||||
at those conditions? Check the speed, altitude, configuration (flaps,
|
||||
gear, etc.), weight, cg, and anything else that may be relevant.
|
||||
|
||||
Example usage:
|
||||
Example usage:<pre>
|
||||
FGFDMExec* FDMExec = new FGFDMExec();
|
||||
.
|
||||
.
|
||||
.
|
||||
|
||||
FGInitialCondition* fgic = new FGInitialCondition(FDMExec);
|
||||
FGTrim *fgt(FDMExec,fgic,tFull);
|
||||
fgic->SetVcaibratedKtsIC(100);
|
||||
|
@ -129,13 +120,9 @@ CLASS DOCUMENTATION
|
|||
if( !fgt->DoTrim() ) {
|
||||
cout << "Trim Failed" << endl;
|
||||
}
|
||||
fgt->ReportState();
|
||||
fgt->ReportState(); </pre>
|
||||
@author Tony Peden
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTrim.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGTrim.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
@version "$Id$"
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -197,11 +184,11 @@ private:
|
|||
public:
|
||||
/** Initializes the trimming class
|
||||
@param FDMExec pointer to a JSBSim executive object.
|
||||
@param FGIC pointer to a FGInitialCondition object
|
||||
@param tm trim mode
|
||||
*/
|
||||
FGTrim(FGFDMExec *FDMExec, TrimMode tt=tGround );
|
||||
FGTrim(FGFDMExec *FDMExec, TrimMode tm=tGround );
|
||||
|
||||
~FGTrim(void);
|
||||
~FGTrim(void);
|
||||
|
||||
/** Execute the trim
|
||||
*/
|
||||
|
@ -219,10 +206,10 @@ public:
|
|||
void TrimStats();
|
||||
|
||||
/** Clear all state-control pairs and set a predefined trim mode
|
||||
@param TrimMode the set of axes to trim. Can be:
|
||||
@param tm the set of axes to trim. Can be:
|
||||
tLongitudinal, tFull, tGround, tCustom, or tNone
|
||||
*/
|
||||
void SetMode(TrimMode tt);
|
||||
void SetMode(TrimMode tm);
|
||||
|
||||
/** Clear all state-control pairs from the current configuration.
|
||||
The trimming routine must have at least one state-control pair
|
||||
|
@ -247,14 +234,14 @@ public:
|
|||
|
||||
/** Change the control used to zero a state previously configured
|
||||
@param state the accel or other condition to zero
|
||||
@param control the control used to zero the state
|
||||
@param new_control the control used to zero the state
|
||||
*/
|
||||
bool EditState( State state, Control new_control );
|
||||
|
||||
/** automatically switch to trimming longitudinal acceleration with
|
||||
flight path angle (gamma) once it becomes apparent that there
|
||||
is not enough/too much thrust.
|
||||
@param gamma_fallback true to enable fallback
|
||||
@param bb true to enable fallback
|
||||
*/
|
||||
inline void SetGammaFallback(bool bb) { gamma_fallback=bb; }
|
||||
|
||||
|
|
|
@ -44,10 +44,18 @@ INCLUDES
|
|||
#include "FGJSBBase.h"
|
||||
#include "FGInitialCondition.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_TRIMAXIS "$Id$"
|
||||
|
||||
#define DEFAULT_TOLERANCE 0.001
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
const string StateNames[10]= { "all","udot","vdot","wdot","qdot","pdot","rdot",
|
||||
|
@ -63,6 +71,13 @@ const string ControlNames[14]= { "Throttle","Sideslip","Angle of Attack",
|
|||
|
||||
class FGInitialCondition;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Models an aircraft axis for purposes of trimming.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -27,10 +27,6 @@ HISTORY
|
|||
--------------------------------------------------------------------------------
|
||||
08/23/2002 JSB Created
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -49,6 +45,10 @@ INCLUDES
|
|||
|
||||
#define ID_TURBINE "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -46,8 +46,16 @@ DEFINES
|
|||
|
||||
#define ID_UTILITY "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -53,7 +53,7 @@ FGfdmSocket::FGfdmSocket(string address, int port)
|
|||
size = 0;
|
||||
connected = false;
|
||||
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||
#if defined(__BORLANDC__) || defined(_MSC_VER) || defined(__MINGW32__)
|
||||
WSADATA wsaData;
|
||||
int wsaReturnCode;
|
||||
wsaReturnCode = WSAStartup(MAKEWORD(1,1), &wsaData);
|
||||
|
|
|
@ -34,10 +34,6 @@ SENTRY
|
|||
#ifndef FGfdmSocket_H
|
||||
#define FGfdmSocket_H
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
INCLUDES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -53,7 +49,7 @@ INCLUDES
|
|||
SG_USING_STD(endl);
|
||||
#else
|
||||
# include <string>
|
||||
# if defined(sgi) && !defined(__GNUC__)
|
||||
# if defined(sgi) && !defined(__GNUC__) && (_COMPILER_VERSION < 740)
|
||||
# include <iostream.h>
|
||||
# include <fstream.h>
|
||||
# else
|
||||
|
@ -82,8 +78,19 @@ DEFINITIONS
|
|||
|
||||
#define ID_FDMSOCKET "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates a socket object.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
|
||||
#include <simgear/compiler.h>
|
||||
|
||||
#include <stdio.h> // size_t
|
||||
#ifdef SG_MATH_EXCEPTION_CLASH
|
||||
# include <math.h>
|
||||
#endif
|
||||
|
@ -60,6 +61,8 @@
|
|||
#include <FDM/JSBSim/FGAerodynamics.h>
|
||||
#include <FDM/JSBSim/FGLGear.h>
|
||||
#include <FDM/JSBSim/FGPropertyManager.h>
|
||||
#include <FDM/JSBSim/FGEngine.h>
|
||||
#include <FDM/JSBSim/FGRotor.h>
|
||||
#include "JSBSim.hxx"
|
||||
|
||||
static inline double
|
||||
|
@ -157,12 +160,15 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
|
||||
init_gear();
|
||||
|
||||
// Set initial fuel levels if provided.
|
||||
// Set initial fuel levels if provided.
|
||||
for (unsigned int i = 0; i < Propulsion->GetNumTanks(); i++) {
|
||||
SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
|
||||
if (node->getChild("level-gal_us", 0, false) != 0)
|
||||
Propulsion->GetTank(i)
|
||||
->SetContents(node->getDoubleValue("level-gal_us") * 6.6);
|
||||
if (node->getChild("level-gal_us", 0, false) != 0) {
|
||||
Propulsion->GetTank(i)->SetContents(node->getDoubleValue("level-gal_us") * 6.6);
|
||||
} else {
|
||||
node->setDoubleValue("level-lb", Propulsion->GetTank(i)->GetContents());
|
||||
node->setDoubleValue("level-gal_us", Propulsion->GetTank(i)->GetContents() / 6.6);
|
||||
}
|
||||
}
|
||||
|
||||
fgSetDouble("/fdm/trim/pitch-trim", FCS->GetPitchTrimCmd());
|
||||
|
@ -195,7 +201,6 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
=fgGetNode("/surface-positions/speedbrake-pos-norm",true);
|
||||
spoilers_pos_pct=fgGetNode("/surface-positions/spoilers-pos-norm",true);
|
||||
|
||||
|
||||
elevator_pos_pct->setDoubleValue(0);
|
||||
left_aileron_pos_pct->setDoubleValue(0);
|
||||
right_aileron_pos_pct->setDoubleValue(0);
|
||||
|
@ -213,12 +218,18 @@ FGJSBsim::FGJSBsim( double dt )
|
|||
wind_from_north= fgGetNode("/environment/wind-from-north-fps",true);
|
||||
wind_from_east = fgGetNode("/environment/wind-from-east-fps" ,true);
|
||||
wind_from_down = fgGetNode("/environment/wind-from-down-fps" ,true);
|
||||
|
||||
|
||||
for (unsigned int i = 0; i < Propulsion->GetNumEngines(); i++) {
|
||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||
Propulsion->GetThruster(i)->SetRPM(node->getDoubleValue("rpm") /
|
||||
Propulsion->GetThruster(i)->GetGearRatio());
|
||||
}
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
FGJSBsim::~FGJSBsim(void) {
|
||||
delete fdmex;
|
||||
FGJSBsim::~FGJSBsim(void)
|
||||
{
|
||||
delete fdmex;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
@ -226,8 +237,8 @@ FGJSBsim::~FGJSBsim(void) {
|
|||
// Initialize the JSBsim flight model, dt is the time increment for
|
||||
// each subsequent iteration through the EOM
|
||||
|
||||
void FGJSBsim::init() {
|
||||
|
||||
void FGJSBsim::init()
|
||||
{
|
||||
double tmp;
|
||||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "Starting and initializing JSBsim" );
|
||||
|
@ -268,10 +279,9 @@ void FGJSBsim::init() {
|
|||
<< ", " << fdmex->GetAtmosphere()->GetDensity() );
|
||||
|
||||
common_init();
|
||||
copy_to_JSBsim();
|
||||
|
||||
|
||||
fdmex->RunIC(); //loop JSBSim once w/o integrating
|
||||
copy_to_JSBsim();
|
||||
fdmex->RunIC(); //loop JSBSim once w/o integrating
|
||||
copy_from_JSBsim(); //update the bus
|
||||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, " Initialized JSBSim with:" );
|
||||
|
@ -322,18 +332,14 @@ void FGJSBsim::init() {
|
|||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, "FGControls::get_gear_down()= " <<
|
||||
globals->get_controls()->get_gear_down() );
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
// Run an iteration of the EOM (equations of motion)
|
||||
|
||||
void
|
||||
FGJSBsim::update( double dt ) {
|
||||
|
||||
void FGJSBsim::update( double dt )
|
||||
{
|
||||
if (is_suspended())
|
||||
return;
|
||||
|
||||
|
@ -361,7 +367,7 @@ FGJSBsim::update( double dt ) {
|
|||
}
|
||||
|
||||
for ( i=0; i < multiloop; i++ ) {
|
||||
fdmex->Run();
|
||||
fdmex->Run();
|
||||
}
|
||||
|
||||
FGJSBBase::Message* msg;
|
||||
|
@ -395,7 +401,8 @@ FGJSBsim::update( double dt ) {
|
|||
|
||||
// Convert from the FGInterface struct to the JSBsim generic_ struct
|
||||
|
||||
bool FGJSBsim::copy_to_JSBsim() {
|
||||
bool FGJSBsim::copy_to_JSBsim()
|
||||
{
|
||||
double tmp;
|
||||
unsigned int i;
|
||||
|
||||
|
@ -411,30 +418,52 @@ bool FGJSBsim::copy_to_JSBsim() {
|
|||
FCS->SetDsbCmd( globals->get_controls()->get_speedbrake() );
|
||||
FCS->SetDspCmd( globals->get_controls()->get_spoilers() );
|
||||
|
||||
// Parking brake sets minimum braking
|
||||
// level for mains.
|
||||
// Parking brake sets minimum braking
|
||||
// level for mains.
|
||||
double parking_brake = globals->get_controls()->get_brake_parking();
|
||||
FCS->SetLBrake(FMAX(globals->get_controls()->get_brake_left(), parking_brake));
|
||||
FCS->SetRBrake(FMAX(globals->get_controls()->get_brake_right(), parking_brake));
|
||||
FCS->SetCBrake( 0.0 );
|
||||
// FCS->SetCBrake( globals->get_controls()->get_brake(2) );
|
||||
|
||||
FCS->SetGearCmd( globals->get_controls()->get_gear_down());
|
||||
for (i = 0; i < Propulsion->GetNumEngines(); i++) {
|
||||
FGEngine * eng = Propulsion->GetEngine(i);
|
||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||
|
||||
FCS->SetThrottleCmd(i, globals->get_controls()->get_throttle(i));
|
||||
FCS->SetMixtureCmd(i, globals->get_controls()->get_mixture(i));
|
||||
FCS->SetPropAdvanceCmd(i, globals->get_controls()->get_prop_advance(i));
|
||||
Propulsion->GetThruster(i)->SetRPM(node->getDoubleValue("rpm"));
|
||||
eng->SetMagnetos( globals->get_controls()->get_magnetos(i) );
|
||||
|
||||
switch (Propulsion->GetEngine(i)->GetType()) {
|
||||
case FGEngine::etPiston:
|
||||
{ // FGPiston code block
|
||||
FGPiston* eng = (FGPiston*)Propulsion->GetEngine(i);
|
||||
eng->SetMagnetos( globals->get_controls()->get_magnetos(i) );
|
||||
break;
|
||||
} // end FGPiston code block
|
||||
case FGEngine::etSimTurbine:
|
||||
{ // FGSimTurbine code block
|
||||
FGSimTurbine* eng = (FGSimTurbine*)Propulsion->GetEngine(i);
|
||||
eng->SetAugmentation( globals->get_controls()->get_augmentation(i) );
|
||||
eng->SetReverse( globals->get_controls()->get_reverser(i) );
|
||||
eng->SetInjection( globals->get_controls()->get_water_injection(i) );
|
||||
eng->SetCutoff( globals->get_controls()->get_cutoff(i) );
|
||||
eng->SetIgnition( globals->get_controls()->get_ignition(i) );
|
||||
break;
|
||||
} // end FGSimTurbine code block
|
||||
case FGEngine::etRocket:
|
||||
{ // FGRocket code block
|
||||
FGRocket* eng = (FGRocket*)Propulsion->GetEngine(i);
|
||||
break;
|
||||
} // end FGRocket code block
|
||||
}
|
||||
|
||||
{ // FGEngine code block
|
||||
FGEngine* eng = Propulsion->GetEngine(i);
|
||||
|
||||
eng->SetStarter( globals->get_controls()->get_starter(i) );
|
||||
eng->SetAugmentation( globals->get_controls()->get_augmentation(i) );
|
||||
eng->SetReverse( globals->get_controls()->get_reverser(i) );
|
||||
eng->SetInjection( globals->get_controls()->get_water_injection(i) );
|
||||
eng->SetIgnition( globals->get_controls()->get_ignition(i) );
|
||||
eng->SetCutoff( globals->get_controls()->get_cutoff(i) );
|
||||
eng->SetNitrous( globals->get_controls()->get_nitrous_injection(i) );
|
||||
eng->SetRunning( node->getBoolValue("running") );
|
||||
} // end FGEngine code block
|
||||
}
|
||||
|
||||
_set_Runway_altitude( cur_fdm_state->get_Runway_altitude() );
|
||||
|
@ -475,7 +504,8 @@ bool FGJSBsim::copy_to_JSBsim() {
|
|||
|
||||
// Convert from the JSBsim generic_ struct to the FGInterface struct
|
||||
|
||||
bool FGJSBsim::copy_from_JSBsim() {
|
||||
bool FGJSBsim::copy_from_JSBsim()
|
||||
{
|
||||
unsigned int i, j;
|
||||
|
||||
_set_Inertias( MassBalance->GetMass(),
|
||||
|
@ -488,25 +518,17 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
MassBalance->GetXYZcg(2),
|
||||
MassBalance->GetXYZcg(3) );
|
||||
|
||||
_set_Accels_Body( Aircraft->GetBodyAccel()(1),
|
||||
Aircraft->GetBodyAccel()(2),
|
||||
Aircraft->GetBodyAccel()(3) );
|
||||
_set_Accels_Body( Aircraft->GetBodyAccel(1),
|
||||
Aircraft->GetBodyAccel(2),
|
||||
Aircraft->GetBodyAccel(3) );
|
||||
|
||||
//_set_Accels_CG_Body( Aircraft->GetBodyAccel()(1),
|
||||
// Aircraft->GetBodyAccel()(2),
|
||||
// Aircraft->GetBodyAccel()(3) );
|
||||
//
|
||||
_set_Accels_CG_Body_N ( Aircraft->GetNcg()(1),
|
||||
Aircraft->GetNcg()(2),
|
||||
Aircraft->GetNcg()(3) );
|
||||
_set_Accels_CG_Body_N ( Aircraft->GetNcg(1),
|
||||
Aircraft->GetNcg(2),
|
||||
Aircraft->GetNcg(3) );
|
||||
|
||||
_set_Accels_Pilot_Body( Auxiliary->GetPilotAccel()(1),
|
||||
Auxiliary->GetPilotAccel()(2),
|
||||
Auxiliary->GetPilotAccel()(3) );
|
||||
|
||||
// _set_Accels_Pilot_Body_N( Auxiliary->GetPilotAccel()(1)/32.1739,
|
||||
// Auxiliary->GetNpilot(2)/32.1739,
|
||||
// Auxiliary->GetNpilot(3)/32.1739 );
|
||||
_set_Accels_Pilot_Body( Auxiliary->GetPilotAccel(1),
|
||||
Auxiliary->GetPilotAccel(2),
|
||||
Auxiliary->GetPilotAccel(3) );
|
||||
|
||||
_set_Nlf( Aircraft->GetNlf() );
|
||||
|
||||
|
@ -524,8 +546,6 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
|
||||
_set_V_equiv_kts( Auxiliary->GetVequivalentKTS() );
|
||||
|
||||
// _set_V_calibrated( Auxiliary->GetVcalibratedFPS() );
|
||||
|
||||
_set_V_calibrated_kts( Auxiliary->GetVcalibratedKTS() );
|
||||
|
||||
_set_V_ground_speed( Position->GetVground() );
|
||||
|
@ -546,9 +566,15 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
|
||||
// Positions
|
||||
_updateGeocentricPosition( Position->GetLatitude(),
|
||||
Position->GetLongitude(),
|
||||
Position->Geth() );
|
||||
Position->GetLongitude(),
|
||||
Position->Geth() );
|
||||
|
||||
// Positions of Visual Reference Point
|
||||
/*
|
||||
_updateGeocentricPosition( Position->GetLatitudeVRP(),
|
||||
Position->GetLongitudeVRP(),
|
||||
Position->GethVRP() );
|
||||
*/
|
||||
_set_Altitude_AGL( Position->GetDistanceAGL() );
|
||||
|
||||
_set_Euler_Angles( Rotation->Getphi(),
|
||||
|
@ -560,7 +586,6 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
|
||||
|
||||
_set_Gamma_vert_rad( Position->GetGamma() );
|
||||
// set_Gamma_horiz_rad( Gamma_horiz_rad );
|
||||
|
||||
_set_Earth_position_angle( Auxiliary->GetEarthPositionAngle() );
|
||||
|
||||
|
@ -573,69 +598,108 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
}
|
||||
}
|
||||
|
||||
// Copy the engine values from JSBSim.
|
||||
for( i=0; i < Propulsion->GetNumEngines(); i++ ) {
|
||||
// Copy the engine values from JSBSim.
|
||||
for ( i=0; i < Propulsion->GetNumEngines(); i++ ) {
|
||||
SGPropertyNode * node = fgGetNode("engines/engine", i, true);
|
||||
FGEngine * eng = Propulsion->GetEngine(i);
|
||||
FGThruster * thrust = Propulsion->GetThruster(i);
|
||||
char buf[30];
|
||||
sprintf(buf, "engines/engine[%d]/thruster", i);
|
||||
SGPropertyNode * tnode = fgGetNode(buf, true);
|
||||
FGThruster * thruster = Propulsion->GetThruster(i);
|
||||
|
||||
node->setDoubleValue("mp-osi", eng->getManifoldPressure_inHg());
|
||||
node->setDoubleValue("rpm", thrust->GetRPM());
|
||||
node->setDoubleValue("egt-degf", eng->getExhaustGasTemp_degF());
|
||||
switch (Propulsion->GetEngine(i)->GetType()) {
|
||||
case FGEngine::etPiston:
|
||||
{ // FGPiston code block
|
||||
FGPiston* eng = (FGPiston*)Propulsion->GetEngine(i);
|
||||
node->setDoubleValue("egt-degf", eng->getExhaustGasTemp_degF());
|
||||
node->setDoubleValue("oil-temperature-degf", eng->getOilTemp_degF());
|
||||
node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi());
|
||||
node->setDoubleValue("mp-osi", eng->getManifoldPressure_inHg());
|
||||
node->setDoubleValue("cht-degf", eng->getCylinderHeadTemp_degF());
|
||||
node->setDoubleValue("rpm", eng->getRPM());
|
||||
} // end FGPiston code block
|
||||
break;
|
||||
case FGEngine::etRocket:
|
||||
{ // FGRocket code block
|
||||
FGRocket* eng = (FGRocket*)Propulsion->GetEngine(i);
|
||||
} // end FGRocket code block
|
||||
break;
|
||||
case FGEngine::etSimTurbine:
|
||||
{ // FGSimTurbine code block
|
||||
FGSimTurbine* eng = (FGSimTurbine*)Propulsion->GetEngine(i);
|
||||
node->setDoubleValue("N1", eng->GetN1());
|
||||
node->setDoubleValue("N2", eng->GetN2());
|
||||
node->setDoubleValue("EGT_degC", eng->GetEGT());
|
||||
node->setBoolValue("augmentation", eng->GetAugmentation());
|
||||
node->setBoolValue("water-injection", eng->GetInjection());
|
||||
node->setBoolValue("ignition", eng->GetIgnition());
|
||||
node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle());
|
||||
node->setDoubleValue("inlet-pos-norm", eng->GetInlet());
|
||||
node->setBoolValue("reversed", eng->GetReversed());
|
||||
node->setBoolValue("cutoff", eng->GetCutoff());
|
||||
globals->get_controls()->set_reverser(i, eng->GetReversed() );
|
||||
globals->get_controls()->set_cutoff(i, eng->GetCutoff() );
|
||||
globals->get_controls()->set_water_injection(i, eng->GetInjection() );
|
||||
globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
|
||||
} // end FGSimTurbine code block
|
||||
break;
|
||||
}
|
||||
|
||||
{ // FGEngine code block
|
||||
FGEngine* eng = Propulsion->GetEngine(i);
|
||||
node->setDoubleValue("fuel-flow-gph", eng->getFuelFlow_gph());
|
||||
node->setDoubleValue("cht-degf", eng->getCylinderHeadTemp_degF());
|
||||
node->setDoubleValue("oil-temperature-degf", eng->getOilTemp_degF());
|
||||
node->setDoubleValue("oil-pressure-psi", eng->getOilPressure_psi());
|
||||
node->setDoubleValue("thrust_lb", eng->GetThrust());
|
||||
node->setDoubleValue("N1", eng->GetN1());
|
||||
node->setDoubleValue("N2", eng->GetN2());
|
||||
node->setDoubleValue("EGT_degC", eng->GetEGT());
|
||||
node->setDoubleValue("thrust_lb", thruster->GetThrust());
|
||||
node->setDoubleValue("fuel-flow_pph", eng->getFuelFlow_pph());
|
||||
node->setDoubleValue("nozzle-pos-norm", eng->GetNozzle());
|
||||
node->setDoubleValue("inlet-pos-norm", eng->GetInlet());
|
||||
node->setBoolValue("running", eng->GetRunning());
|
||||
node->setBoolValue("starter", eng->GetStarter());
|
||||
node->setBoolValue("cranking", eng->GetCranking());
|
||||
node->setBoolValue("ignition", eng->GetIgnition());
|
||||
node->setBoolValue("augmentation", eng->GetAugmentation());
|
||||
node->setBoolValue("water-injection", eng->GetInjection());
|
||||
node->setBoolValue("reversed", eng->GetReversed());
|
||||
node->setBoolValue("cutoff", eng->GetCutoff());
|
||||
node->setBoolValue("nitrous", eng->GetNitrous());
|
||||
globals->get_controls()->set_starter(i, eng->GetStarter() );
|
||||
globals->get_controls()->set_cutoff(i, eng->GetCutoff() );
|
||||
globals->get_controls()->set_augmentation(i, eng->GetAugmentation() );
|
||||
globals->get_controls()->set_reverser(i, eng->GetReversed() );
|
||||
globals->get_controls()->set_water_injection(i, eng->GetInjection() );
|
||||
} // end FGEngine code block
|
||||
|
||||
switch (thruster->GetType()) {
|
||||
case FGThruster::ttNozzle:
|
||||
{ // FGNozzle code block
|
||||
FGNozzle* noz = (FGNozzle*)thruster;
|
||||
} // end FGNozzle code block
|
||||
break;
|
||||
case FGThruster::ttPropeller:
|
||||
{ // FGPropeller code block
|
||||
FGPropeller* prop = (FGPropeller*)thruster;
|
||||
tnode->setDoubleValue("rpm", thruster->GetRPM());
|
||||
tnode->setDoubleValue("pitch", prop->GetPitch());
|
||||
tnode->setDoubleValue("torque", prop->GetTorque());
|
||||
} // end FGPropeller code block
|
||||
break;
|
||||
case FGThruster::ttRotor:
|
||||
{ // FGRotor code block
|
||||
FGRotor* rotor = (FGRotor*)thruster;
|
||||
} // end FGRotor code block
|
||||
break;
|
||||
case FGThruster::ttDirect:
|
||||
{ // Direct code block
|
||||
} // end Direct code block
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static const SGPropertyNode *fuel_freeze
|
||||
= fgGetNode("/sim/freeze/fuel");
|
||||
static const SGPropertyNode *fuel_freeze = fgGetNode("/sim/freeze/fuel");
|
||||
|
||||
// Copy the fuel levels from JSBSim if fuel
|
||||
// freeze not enabled.
|
||||
// Copy the fuel levels from JSBSim if fuel
|
||||
// freeze not enabled.
|
||||
if ( ! fuel_freeze->getBoolValue() ) {
|
||||
for (i = 0; i < Propulsion->GetNumTanks(); i++) {
|
||||
SGPropertyNode * node
|
||||
= fgGetNode("/consumables/fuel/tank", i, true);
|
||||
double contents = Propulsion->GetTank(i)->GetContents();
|
||||
node->setDoubleValue("level-gal_us", contents/6.6);
|
||||
node->setDoubleValue("level-lb", contents);
|
||||
// node->setDoubleValue("temperature_degC",
|
||||
}
|
||||
for (i = 0; i < Propulsion->GetNumTanks(); i++) {
|
||||
SGPropertyNode * node = fgGetNode("/consumables/fuel/tank", i, true);
|
||||
double contents = Propulsion->GetTank(i)->GetContents();
|
||||
node->setDoubleValue("level-gal_us", contents/6.6);
|
||||
node->setDoubleValue("level-lb", contents);
|
||||
// node->setDoubleValue("temperature_degC",
|
||||
}
|
||||
}
|
||||
|
||||
update_gear();
|
||||
|
||||
stall_warning->setDoubleValue( Aerodynamics->GetStallWarn() );
|
||||
|
||||
/* elevator_pos_deg->setDoubleValue( FCS->GetDePos()*SG_RADIANS_TO_DEGREES );
|
||||
left_aileron_pos_deg->setDoubleValue( FCS->GetDaLPos()*SG_RADIANS_TO_DEGREES );
|
||||
right_aileron_pos_deg->setDoubleValue( FCS->GetDaRPos()*SG_RADIANS_TO_DEGREES );
|
||||
rudder_pos_deg->setDoubleValue( -1*FCS->GetDrPos()*SG_RADIANS_TO_DEGREES );
|
||||
flap_pos_deg->setDoubleValue( FCS->GetDfPos() ); */
|
||||
|
||||
|
||||
elevator_pos_pct->setDoubleValue( FCS->GetDePos(ofNorm) );
|
||||
left_aileron_pos_pct->setDoubleValue( FCS->GetDaLPos(ofNorm) );
|
||||
right_aileron_pos_pct->setDoubleValue( -1*FCS->GetDaLPos(ofNorm) );
|
||||
|
@ -643,17 +707,19 @@ bool FGJSBsim::copy_from_JSBsim() {
|
|||
flap_pos_pct->setDoubleValue( FCS->GetDfPos(ofNorm) );
|
||||
speedbrake_pos_pct->setDoubleValue( FCS->GetDsbPos(ofNorm) );
|
||||
spoilers_pos_pct->setDoubleValue( FCS->GetDspPos(ofNorm) );
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool FGJSBsim::ToggleDataLogging(void) {
|
||||
|
||||
bool FGJSBsim::ToggleDataLogging(void)
|
||||
{
|
||||
return fdmex->GetOutput()->Toggle();
|
||||
}
|
||||
|
||||
|
||||
bool FGJSBsim::ToggleDataLogging(bool state) {
|
||||
bool FGJSBsim::ToggleDataLogging(bool state)
|
||||
{
|
||||
if (state) {
|
||||
fdmex->GetOutput()->Enable();
|
||||
return true;
|
||||
|
@ -665,12 +731,13 @@ bool FGJSBsim::ToggleDataLogging(bool state) {
|
|||
|
||||
|
||||
//Positions
|
||||
void FGJSBsim::set_Latitude(double lat) {
|
||||
void FGJSBsim::set_Latitude(double lat)
|
||||
{
|
||||
static const SGPropertyNode *altitude = fgGetNode("/position/altitude-ft");
|
||||
double alt;
|
||||
double sea_level_radius_meters, lat_geoc;
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Latitude(lat);
|
||||
|
||||
if ( altitude->getDoubleValue() > -9990 ) {
|
||||
|
@ -693,11 +760,12 @@ void FGJSBsim::set_Latitude(double lat) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Longitude(double lon) {
|
||||
|
||||
void FGJSBsim::set_Longitude(double lon)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO,"FGJSBsim::set_Longitude: " << lon );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Longitude(lon);
|
||||
|
||||
update_ic();
|
||||
|
@ -707,7 +775,8 @@ void FGJSBsim::set_Longitude(double lon) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Altitude(double alt) {
|
||||
void FGJSBsim::set_Altitude(double alt)
|
||||
{
|
||||
static const SGPropertyNode *latitude = fgGetNode("/position/latitude-deg");
|
||||
|
||||
double sea_level_radius_meters,lat_geoc;
|
||||
|
@ -715,7 +784,7 @@ void FGJSBsim::set_Altitude(double alt) {
|
|||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Altitude: " << alt );
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, " lat (deg) = " << latitude->getDoubleValue() );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Altitude(alt);
|
||||
|
||||
update_ic();
|
||||
|
@ -732,10 +801,11 @@ void FGJSBsim::set_Altitude(double alt) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_V_calibrated_kts(double vc) {
|
||||
void FGJSBsim::set_V_calibrated_kts(double vc)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_V_calibrated_kts: " << vc );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_V_calibrated_kts(vc);
|
||||
|
||||
update_ic();
|
||||
|
@ -743,10 +813,11 @@ void FGJSBsim::set_V_calibrated_kts(double vc) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Mach_number(double mach) {
|
||||
void FGJSBsim::set_Mach_number(double mach)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Mach_number: " << mach );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Mach_number(mach);
|
||||
|
||||
update_ic();
|
||||
|
@ -754,11 +825,12 @@ void FGJSBsim::set_Mach_number(double mach) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
|
||||
void FGJSBsim::set_Velocities_Local( double north, double east, double down )
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Local: "
|
||||
<< north << ", " << east << ", " << down );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Velocities_Local(north, east, down);
|
||||
|
||||
update_ic();
|
||||
|
@ -768,11 +840,12 @@ void FGJSBsim::set_Velocities_Local( double north, double east, double down ){
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
|
||||
void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Velocities_Wind_Body: "
|
||||
<< u << ", " << v << ", " << w );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Velocities_Wind_Body(u, v, w);
|
||||
|
||||
update_ic();
|
||||
|
@ -783,11 +856,12 @@ void FGJSBsim::set_Velocities_Wind_Body( double u, double v, double w){
|
|||
}
|
||||
|
||||
//Euler angles
|
||||
void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
|
||||
void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi )
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Euler_Angles: "
|
||||
<< phi << ", " << theta << ", " << psi );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Euler_Angles(phi, theta, psi);
|
||||
|
||||
update_ic();
|
||||
|
@ -798,10 +872,11 @@ void FGJSBsim::set_Euler_Angles( double phi, double theta, double psi ) {
|
|||
}
|
||||
|
||||
//Flight Path
|
||||
void FGJSBsim::set_Climb_Rate( double roc) {
|
||||
void FGJSBsim::set_Climb_Rate( double roc)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Climb_Rate: " << roc );
|
||||
|
||||
// In case we're not trimming
|
||||
// In case we're not trimming
|
||||
FGInterface::set_Climb_Rate(roc);
|
||||
|
||||
update_ic();
|
||||
|
@ -814,7 +889,8 @@ void FGJSBsim::set_Climb_Rate( double roc) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::set_Gamma_vert_rad( double gamma) {
|
||||
void FGJSBsim::set_Gamma_vert_rad( double gamma)
|
||||
{
|
||||
SG_LOG(SG_FLIGHT,SG_INFO, "FGJSBsim::set_Gamma_vert_rad: " << gamma );
|
||||
|
||||
update_ic();
|
||||
|
@ -824,18 +900,18 @@ void FGJSBsim::set_Gamma_vert_rad( double gamma) {
|
|||
needTrim=true;
|
||||
}
|
||||
|
||||
void FGJSBsim::init_gear(void ) {
|
||||
|
||||
void FGJSBsim::init_gear(void )
|
||||
{
|
||||
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
||||
int Ngear=GroundReactions->GetNumGearUnits();
|
||||
for (int i=0;i<Ngear;i++) {
|
||||
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
||||
node->setDoubleValue("xoffset-in",
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(1));
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(1));
|
||||
node->setDoubleValue("yoffset-in",
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(2));
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(2));
|
||||
node->setDoubleValue("zoffset-in",
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(3));
|
||||
gr->GetGearUnit(i)->GetBodyLocation()(3));
|
||||
node->setBoolValue("wow", gr->GetGearUnit(i)->GetWOW());
|
||||
node->setBoolValue("has-brake", gr->GetGearUnit(i)->GetBrakeGroup() > 0);
|
||||
node->setDoubleValue("position-norm", FCS->GetGearPos());
|
||||
|
@ -843,56 +919,60 @@ void FGJSBsim::init_gear(void ) {
|
|||
}
|
||||
}
|
||||
|
||||
void FGJSBsim::update_gear(void) {
|
||||
|
||||
void FGJSBsim::update_gear(void)
|
||||
{
|
||||
FGGroundReactions* gr=fdmex->GetGroundReactions();
|
||||
int Ngear=GroundReactions->GetNumGearUnits();
|
||||
for (int i=0;i<Ngear;i++) {
|
||||
SGPropertyNode * node = fgGetNode("gear/gear", i, true);
|
||||
node->getChild("wow", 0, true)
|
||||
->setBoolValue(gr->GetGearUnit(i)->GetWOW());
|
||||
node->getChild("position-norm", 0, true)
|
||||
->setDoubleValue(FCS->GetGearPos());
|
||||
node->getChild("wow", 0, true)->setBoolValue(gr->GetGearUnit(i)->GetWOW());
|
||||
node->getChild("position-norm", 0, true)->setDoubleValue(FCS->GetGearPos());
|
||||
gr->GetGearUnit(i)->SetTirePressure(node->getDoubleValue("tire-pressure-norm"));
|
||||
}
|
||||
}
|
||||
|
||||
void FGJSBsim::do_trim(void) {
|
||||
void FGJSBsim::do_trim(void)
|
||||
{
|
||||
FGTrim *fgtrim;
|
||||
|
||||
FGTrim *fgtrim;
|
||||
if( fgGetBool("/sim/presets/onground") ) {
|
||||
fgic->SetVcalibratedKtsIC(0.0);
|
||||
fgtrim=new FGTrim(fdmex,tGround);
|
||||
} else {
|
||||
fgtrim=new FGTrim(fdmex,tLongitudinal);
|
||||
}
|
||||
if( !fgtrim->DoTrim() ) {
|
||||
fgtrim->Report();
|
||||
fgtrim->TrimStats();
|
||||
} else {
|
||||
trimmed->setBoolValue(true);
|
||||
}
|
||||
if (FGJSBBase::debug_lvl > 0)
|
||||
State->ReportState();
|
||||
delete fgtrim;
|
||||
pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
|
||||
throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
|
||||
aileron_trim->setDoubleValue( FCS->GetDaCmd() );
|
||||
rudder_trim->setDoubleValue( FCS->GetDrCmd() );
|
||||
if ( fgGetBool("/sim/presets/onground") )
|
||||
{
|
||||
fgic->SetVcalibratedKtsIC(0.0);
|
||||
fgtrim = new FGTrim(fdmex,tGround);
|
||||
} else {
|
||||
fgtrim = new FGTrim(fdmex,tLongitudinal);
|
||||
}
|
||||
|
||||
globals->get_controls()->set_elevator_trim(FCS->GetPitchTrimCmd());
|
||||
globals->get_controls()->set_elevator(FCS->GetDeCmd());
|
||||
globals->get_controls()->set_throttle(FGControls::ALL_ENGINES,
|
||||
FCS->GetThrottleCmd(0));
|
||||
if ( !fgtrim->DoTrim() ) {
|
||||
fgtrim->Report();
|
||||
fgtrim->TrimStats();
|
||||
} else {
|
||||
trimmed->setBoolValue(true);
|
||||
}
|
||||
if (FGJSBBase::debug_lvl > 0)
|
||||
State->ReportState();
|
||||
|
||||
globals->get_controls()->set_aileron(FCS->GetDaCmd());
|
||||
globals->get_controls()->set_rudder( FCS->GetDrCmd());
|
||||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
|
||||
delete fgtrim;
|
||||
|
||||
pitch_trim->setDoubleValue( FCS->GetPitchTrimCmd() );
|
||||
throttle_trim->setDoubleValue( FCS->GetThrottleCmd(0) );
|
||||
aileron_trim->setDoubleValue( FCS->GetDaCmd() );
|
||||
rudder_trim->setDoubleValue( FCS->GetDrCmd() );
|
||||
|
||||
globals->get_controls()->set_elevator_trim(FCS->GetPitchTrimCmd());
|
||||
globals->get_controls()->set_elevator(FCS->GetDeCmd());
|
||||
globals->get_controls()->set_throttle(FGControls::ALL_ENGINES,
|
||||
FCS->GetThrottleCmd(0));
|
||||
|
||||
globals->get_controls()->set_aileron(FCS->GetDaCmd());
|
||||
globals->get_controls()->set_rudder( FCS->GetDrCmd());
|
||||
|
||||
SG_LOG( SG_FLIGHT, SG_INFO, " Trim complete" );
|
||||
}
|
||||
|
||||
void FGJSBsim::update_ic(void) {
|
||||
if( !needTrim ) {
|
||||
void FGJSBsim::update_ic(void)
|
||||
{
|
||||
if ( !needTrim ) {
|
||||
fgic->SetLatitudeRadIC(get_Lat_geocentric() );
|
||||
fgic->SetLongitudeRadIC( get_Longitude() );
|
||||
fgic->SetAltitudeFtIC( get_Altitude() );
|
||||
|
|
|
@ -47,12 +47,12 @@ DEFINITIONS
|
|||
|
||||
#define ID_CONDITION "$Id$"
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -54,10 +54,6 @@ namespace JSBSim {
|
|||
|
||||
class FGFCS;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -46,7 +46,6 @@ INCLUDES
|
|||
#include "../FGJSBBase.h"
|
||||
#include "../FGPropertyManager.h"
|
||||
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -63,10 +62,6 @@ namespace JSBSim {
|
|||
|
||||
class FGFCS;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -75,15 +70,15 @@ CLASS DOCUMENTATION
|
|||
The Flight Control System (FCS) for JSBSim consists of the FCS container
|
||||
class (see \URL[FGFCS]{FGFCS.html}), the FGFCSComponent base class, and the
|
||||
component classes from which can be constructed a string, or channel. See:
|
||||
<ul>
|
||||
<li>\URL[Switch Component]{FGSwitch.html}</li>
|
||||
<li>\URL[Gain Component]{FGGain.html}</li>
|
||||
<li>\URL[Flaps Component]{FGFlaps.html}</li>
|
||||
<li>\URL[Filter Component]{FGFilter.html}</li>
|
||||
<li>\URL[Deadband Component]{FGDeadBand.html}</li>
|
||||
<li>\URL[Summer Component]{FGSummer.html}</li>
|
||||
<li>\URL[Gradient Component]{FGGradient.html}</li>
|
||||
</ul>
|
||||
|
||||
- FGSwitch
|
||||
- FGGain
|
||||
- FGKinemat
|
||||
- FGFilter
|
||||
- FGDeadBand
|
||||
- FGSummer
|
||||
- FGGradient
|
||||
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see Documentation for the FGFCS class, and for the configuration file class
|
||||
|
|
|
@ -59,6 +59,7 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
|||
Name = AC_cfg->GetValue("NAME");
|
||||
AC_cfg->GetNextConfigLine();
|
||||
dt = fcs->GetState()->Getdt();
|
||||
Trigger = 0;
|
||||
|
||||
C1 = C2 = C3 = C4 = C5 = C6 = 0.0;
|
||||
|
||||
|
@ -71,12 +72,18 @@ FGFilter::FGFilter(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
|||
|
||||
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
||||
*AC_cfg >> token;
|
||||
if (token == "C1") *AC_cfg >> C1;
|
||||
else if (token == "C2") *AC_cfg >> C2;
|
||||
else if (token == "C3") *AC_cfg >> C3;
|
||||
else if (token == "C4") *AC_cfg >> C4;
|
||||
else if (token == "C5") *AC_cfg >> C5;
|
||||
else if (token == "C6") *AC_cfg >> C6;
|
||||
if (token == "C1") *AC_cfg >> C1;
|
||||
else if (token == "C2") *AC_cfg >> C2;
|
||||
else if (token == "C3") *AC_cfg >> C3;
|
||||
else if (token == "C4") *AC_cfg >> C4;
|
||||
else if (token == "C5") *AC_cfg >> C5;
|
||||
else if (token == "C6") *AC_cfg >> C6;
|
||||
else if (token == "TRIGGER")
|
||||
{
|
||||
token = AC_cfg->GetValue("TRIGGER");
|
||||
*AC_cfg >> token;
|
||||
Trigger = resolveSymbol(token);
|
||||
}
|
||||
else if (token == "INPUT")
|
||||
{
|
||||
token = AC_cfg->GetValue("INPUT");
|
||||
|
@ -146,6 +153,8 @@ FGFilter::~FGFilter()
|
|||
|
||||
bool FGFilter::Run(void)
|
||||
{
|
||||
int test = 0;
|
||||
|
||||
FGFCSComponent::Run(); // call the base class for initialization of Input
|
||||
|
||||
if (Initialize) {
|
||||
|
@ -153,6 +162,15 @@ bool FGFilter::Run(void)
|
|||
PreviousOutput1 = PreviousInput1 = Output = Input;
|
||||
Initialize = false;
|
||||
|
||||
} else if (Trigger != 0) {
|
||||
test = Trigger->getIntValue();
|
||||
if (test < 0) {
|
||||
Output = PreviousOutput1 = PreviousOutput2 = 0.0;
|
||||
Input = PreviousInput1 = PreviousInput2 = 0.0;
|
||||
} else {
|
||||
Output = PreviousOutput1 = PreviousOutput2 = 0.0;
|
||||
}
|
||||
|
||||
} else {
|
||||
Input = InputNodes[0]->getDoubleValue();
|
||||
switch (FilterType) {
|
||||
|
|
|
@ -52,38 +52,127 @@ FORWARD DECLARATIONS
|
|||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates a filter for the flight control system.
|
||||
Filters are modeled using the Tustin Substitution method. These types of
|
||||
filters can currently be modeled:
|
||||
|
||||
- Lag
|
||||
- Lead-Lag
|
||||
- Washout
|
||||
- Integrator
|
||||
- Second order
|
||||
The filter component can simulate any filter up to second order. The
|
||||
Tustin substitution is used to take filter definitions from LaPlace space to the
|
||||
time domain. The general format for a filter specification is:
|
||||
|
||||
The filter is specified in the config file like this:
|
||||
<pre>
|
||||
\<COMPONENT NAME="{name}" TYPE="{LAG_FILTER}"\><BR>
|
||||
INPUT 15<BR>
|
||||
C1 600<BR>
|
||||
OUTPUT fcs/elevator-pos-rad<BR>
|
||||
\</COMPONENT\>
|
||||
</pre>
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="type">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
[C2 \<value>]
|
||||
[C3 \<value>]
|
||||
[C4 \<value>]
|
||||
[C5 \<value>]
|
||||
[C6 \<value>]
|
||||
[OUTPUT \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
|
||||
For a lag filter of the form,
|
||||
<pre>
|
||||
C1
|
||||
------
|
||||
s + C1
|
||||
</pre>
|
||||
the corresponding filter definition is:
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="LAG_FILTER">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
[OUTPUT \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
As an example, for the specific filter:
|
||||
<pre>
|
||||
600
|
||||
------
|
||||
s + 600
|
||||
</pre>
|
||||
the corresponding filter definition could be:
|
||||
<pre>
|
||||
\<COMPONENT NAME="LAG_1" TYPE="LAG_FILTER">
|
||||
INPUT aileron_cmd
|
||||
C1 600
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
For a lead-lag filter of the form:
|
||||
<pre>
|
||||
C1*s + C2
|
||||
---------
|
||||
C3*s + C4
|
||||
</pre>
|
||||
The corresponding filter definition is:
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="LEAD_LAG_FILTER">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
C2 \<value>
|
||||
C3 \<value>
|
||||
C4 \<value>
|
||||
[OUTPUT \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
For a washout filter of the form:
|
||||
<pre>
|
||||
s
|
||||
------
|
||||
s + C1
|
||||
</pre>
|
||||
The corresponding filter definition is:
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="WASHOUT_FILTER">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
[OUTPUT \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
For a second order filter of the form:
|
||||
<pre>
|
||||
C1*s^2 + C2*s + C3
|
||||
------------------
|
||||
C4*s^2 + C5*s + C6
|
||||
</pre>
|
||||
The corresponding filter definition is:
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="SECOND_ORDER_FILTER">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
C2 \<value>
|
||||
C3 \<value>
|
||||
C4 \<value>
|
||||
C5 \<value>
|
||||
C6 \<value>
|
||||
[OUTPUT \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
For an integrator of the form:
|
||||
<pre>
|
||||
C1
|
||||
---
|
||||
s
|
||||
</pre>
|
||||
The corresponding filter definition is:
|
||||
<pre>
|
||||
\<COMPONENT NAME="name" TYPE="INTEGRATOR">
|
||||
INPUT \<property>
|
||||
C1 \<value>
|
||||
[OUTPUT \<property>]
|
||||
[TRIGGER \<property>]
|
||||
\</COMPONENT>
|
||||
</pre>
|
||||
For the integrator, the TRIGGER features the following behavior, if the TRIGGER property value is:
|
||||
- -1 (or simply less than zero), all previous inputs and outputs are set to 0.0
|
||||
- 0, no action is taken - the output is calculated normally
|
||||
- +1 (or simply greater than zero), all previous outputs (only) will be set to 0.0
|
||||
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFilter.h?rev=HEAD">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGFilter.cpp?rev=HEAD">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
@ -122,6 +211,7 @@ private:
|
|||
double PreviousOutput1;
|
||||
double PreviousOutput2;
|
||||
FGConfigFile* AC_cfg;
|
||||
FGPropertyManager* Trigger;
|
||||
void Debug(int from);
|
||||
};
|
||||
}
|
||||
|
|
|
@ -72,19 +72,19 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
|||
while ((token = AC_cfg->GetValue()) != string("/COMPONENT")) {
|
||||
*AC_cfg >> token;
|
||||
if (token == "INPUT") {
|
||||
token = AC_cfg->GetValue("INPUT");
|
||||
*AC_cfg >> token;
|
||||
|
||||
if (token[0] == '-') {
|
||||
invert = true;
|
||||
token.erase(0,1);
|
||||
}
|
||||
}
|
||||
|
||||
if (InputNodes.size() > 0) {
|
||||
cerr << "Gains can only accept one input" << endl;
|
||||
} else {
|
||||
*AC_cfg >> token;
|
||||
InputNodes.push_back( resolveSymbol(token) );
|
||||
}
|
||||
}
|
||||
|
||||
} else if (token == "GAIN") {
|
||||
*AC_cfg >> Gain;
|
||||
} else if (token == "MIN") {
|
||||
|
@ -113,7 +113,7 @@ FGGain::FGGain(FGFCS* fcs, FGConfigFile* AC_cfg) : FGFCSComponent(fcs),
|
|||
*Table << *AC_cfg;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FGFCSComponent::bind();
|
||||
if (Type == "AEROSURFACE_SCALE")
|
||||
treenode->Tie( "output-norm", this, &FGGain::GetOutputPct );
|
||||
|
@ -198,7 +198,6 @@ void FGGain::Debug(int from)
|
|||
if (IsOutput) cout << " OUTPUT: " << OutputNode->getName() << endl;
|
||||
cout << " MIN: " << Min << endl;
|
||||
cout << " MAX: " << Max << endl;
|
||||
if(invert) cout << " Invert mapping" << endl;
|
||||
if (ScheduledBy != 0) {
|
||||
cout << " Scheduled by parameter: " << ScheduledBy->getName() << endl;
|
||||
Table->Print();
|
||||
|
|
|
@ -26,10 +26,6 @@
|
|||
HISTORY
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -53,17 +49,27 @@ INCLUDES
|
|||
#include "../FGConfigFile.h"
|
||||
#include "../FGTable.h"
|
||||
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINES
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_GAIN "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
class FGFCS;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates a gain component for the flight control system.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -26,10 +26,6 @@
|
|||
HISTORY
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -45,15 +41,26 @@ INCLUDES
|
|||
#include "../FGConfigFile.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINES
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_GRADIENT "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
class FGFCS;
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates a gradient component for the flight control system.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -26,10 +26,6 @@
|
|||
HISTORY
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
SENTRY
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -57,13 +53,24 @@ INCLUDES
|
|||
#include "../FGConfigFile.h"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
DEFINES
|
||||
DEFINITIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
#define ID_FLAPS "$Id$"
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
/** Encapsulates a kinematic component for the flight control system.
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DECLARATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
|
|
@ -65,10 +65,6 @@ FORWARD DECLARATIONS
|
|||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
|
@ -77,10 +73,6 @@ CLASS DOCUMENTATION
|
|||
state variables, or even floating point numbers (e.g. for a bias).
|
||||
@author Jon S. Berndt
|
||||
@version $Id$
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGSummer.h?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Header File </a>
|
||||
@see <a href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jsbsim/JSBSim/FGSummer.cpp?rev=HEAD&content-type=text/vnd.viewcvs-markup">
|
||||
Source File </a>
|
||||
*/
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
|
|
|
@ -47,12 +47,12 @@ DEFINITIONS
|
|||
|
||||
#define ID_SWITCH "$Id$"
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
|
||||
FORWARD DECLARATIONS
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
||||
namespace JSBSim {
|
||||
|
||||
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
CLASS DOCUMENTATION
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
|
||||
|
@ -85,20 +85,20 @@ complex groupings of logical comparisons. Each CONDITION_GROUP contains
|
|||
additional conditions, as well as possibly additional CONDITION_GROUPs.
|
||||
|
||||
<pre>
|
||||
\<COMPONENT NAME="switch1" TYPE="SWITCH"\><BR>
|
||||
\<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\><BR>
|
||||
{property} {conditional} {property|value}<BR>
|
||||
\<CONDITION_GROUP LOGIC="{AND|OR}"\><BR>
|
||||
{property} {conditional} {property|value}<BR>
|
||||
...<BR>
|
||||
\</CONDITION_GROUP\><BR>
|
||||
...<BR>
|
||||
\</TEST><BR>
|
||||
\<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\><BR>
|
||||
{property} {conditional} {property|value}<BR>
|
||||
...<BR>
|
||||
\</TEST\><BR>
|
||||
...<BR>
|
||||
\<COMPONENT NAME="switch1" TYPE="SWITCH"\>
|
||||
\<TEST LOGIC="{AND|OR|DEFAULT}" OUTPUT="{property|value}"\>
|
||||
{property} {conditional} {property|value}
|
||||
\<CONDITION_GROUP LOGIC="{AND|OR}"\>
|
||||
{property} {conditional} {property|value}
|
||||
...
|
||||
\</CONDITION_GROUP\>
|
||||
...
|
||||
\</TEST>
|
||||
\<TEST LOGIC="{AND|OR}" OUTPUT="{property|value}"\>
|
||||
{property} {conditional} {property|value}
|
||||
...
|
||||
\</TEST\>
|
||||
...
|
||||
\</COMPONENT\>
|
||||
</pre>
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue