1
0
Fork 0
flightgear/src/FDM/JSBSim/FGCoefficient.h

180 lines
5.8 KiB
C
Raw Normal View History

2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-02-05 21:26:01 +00:00
Header: FGCoefficient.h
Author: Jon Berndt
Date started: 12/28/98
------------- Copyright (C) 1999 Jon S. Berndt (jsb@hal-pc.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place - Suite 330, Boston, MA 02111-1307, USA.
Further information about the GNU General Public License can also be found on
the world wide web at http://www.gnu.org.
HISTORY
--------------------------------------------------------------------------------
12/28/98 JSB Created
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-02-05 21:26:01 +00:00
SENTRY
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-02-05 21:26:01 +00:00
#ifndef FGCOEFFICIENT_H
#define FGCOEFFICIENT_H
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-02-05 21:26:01 +00:00
INCLUDES
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifdef FGFS
2000-02-15 03:30:01 +00:00
# include <simgear/compiler.h>
#endif
1999-02-05 21:26:01 +00:00
2000-10-02 23:07:30 +00:00
#include <vector>
#include <string>
2000-04-24 23:49:06 +00:00
#include "FGConfigFile.h"
2001-03-30 01:04:50 +00:00
#include "FGTable.h"
#include "FGJSBBase.h"
#include "FGPropertyManager.h"
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
1999-05-08 03:19:08 +00:00
2001-03-30 01:04:50 +00:00
#define ID_COEFFICIENT "$Id$"
2000-11-03 23:02:47 +00:00
using std::vector;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2000-10-02 23:07:30 +00:00
class FGFDMExec;
class FGState;
class FGAtmosphere;
class FGFCS;
class FGAircraft;
class FGTranslation;
class FGRotation;
class FGPosition;
class FGAuxiliary;
class FGOutput;
2000-11-03 23:02:47 +00:00
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2000-11-03 23:02:47 +00:00
Note that the coefficients need not be calculated each delta-t. This is
something that may be fixed someday.
2000-11-03 23:02:47 +00:00
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DOCUMENTATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2000-11-03 23:02:47 +00:00
/** This class models the stability derivative coefficient lookup tables.
Each coefficient for an axis is stored in that axes' vector of coefficients.
Each FDM execution frame the Run() method of the [currently] FGAircraft model
is called and the coefficient value is 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>
2000-11-03 23:02:47 +00:00
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
2000-10-02 23:07:30 +00:00
class FGCoefficient : public FGJSBBase
1999-02-05 21:26:01 +00:00
{
2001-07-10 15:56:38 +00:00
public:
FGCoefficient(FGFDMExec*);
virtual ~FGCoefficient();
virtual bool Load(FGConfigFile* AC_cfg);
typedef vector <FGPropertyManager*> MultVec;
2001-11-20 22:34:24 +00:00
virtual double TotalValue(void);
virtual inline double GetValue(void) const { return totalValue; }
virtual inline string Getname(void) const {return name;}
virtual inline double GetSD(void) const { return SD;}
2001-07-10 15:56:38 +00:00
inline MultVec Getmultipliers(void) {return multipliers;}
void DumpSD(void);
/** Outputs coefficient information.
Non-dimensionalizing parameter descriptions are output
for each aero coefficient defined.
@param multipliers the list of multipliers for this coefficient.*/
virtual void DisplayCoeffFactors(void);
virtual inline string GetCoefficientStrings(void) { return name; }
virtual string GetCoefficientValues(void);
inline void setBias(double b) { bias=b; }
inline void setGain(double g) { gain=g; };
inline double getBias(void) const { return bias; }
inline double getGain(void) const { return gain; }
virtual void bind(FGPropertyManager *parent);
virtual void unbind(void);
2001-07-26 17:17:11 +00:00
2002-04-16 13:15:29 +00:00
protected:
FGFDMExec* FDMExec;
string description;
string name;
FGPropertyManager *node;
2001-07-10 15:56:38 +00:00
private:
enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
2000-04-24 23:49:06 +00:00
int numInstances;
string filename;
string method;
2001-12-13 04:48:34 +00:00
string multparms;
string multparmsRow;
string multparmsCol;
2001-11-20 22:34:24 +00:00
double Value(double, double);
double Value(double);
double Value(void);
double StaticValue;
double totalValue;
double bias,gain;
FGPropertyManager *LookupR, *LookupC;
2000-10-02 23:07:30 +00:00
MultVec multipliers;
1999-02-05 21:26:01 +00:00
int rows, columns;
Type type;
2001-11-20 22:34:24 +00:00
double SD; // Actual stability derivative (or other coefficient) value
2001-03-30 01:04:50 +00:00
FGTable *Table;
1999-02-05 21:26:01 +00:00
FGState* State;
FGAtmosphere* Atmosphere;
FGFCS* FCS;
FGAircraft* Aircraft;
FGTranslation* Translation;
FGRotation* Rotation;
FGPosition* Position;
FGAuxiliary* Auxiliary;
FGOutput* Output;
FGPropertyManager* PropertyManager;
2000-10-02 23:07:30 +00:00
2001-12-13 04:48:34 +00:00
virtual void Debug(int from);
1999-02-05 21:26:01 +00:00
};
2000-11-03 23:02:47 +00:00
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1999-02-05 21:26:01 +00:00
#endif
2001-03-30 01:04:50 +00:00