]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGCoefficient.h
Added recent ground effect modeling changes.
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3  Header:       FGCoefficient.h
4  Author:       Jon Berndt
5  Date started: 12/28/98
6
7  ------------- Copyright (C) 1999  Jon S. Berndt (jsb@hal-pc.org) -------------
8
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
17  details.
18
19  You should have received a copy of the GNU General Public License along with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA  02111-1307, USA.
22
23  Further information about the GNU General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25
26 HISTORY
27 --------------------------------------------------------------------------------
28 12/28/98   JSB   Created
29
30 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 SENTRY
32 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34 #ifndef FGCOEFFICIENT_H
35 #define FGCOEFFICIENT_H
36
37 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 INCLUDES
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41 #ifdef FGFS
42 #  include <simgear/compiler.h>
43 #endif
44
45 #include <vector>
46 #include <string>
47 #include "FGConfigFile.h"
48 #include "FGDefs.h"
49 #include "FGTable.h"
50
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
52 DEFINITIONS
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
54
55 #define ID_COEFFICIENT "$Id$"
56
57 using std::vector;
58
59 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
60 FORWARD DECLARATIONS
61 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
62
63 class FGFDMExec;
64 class FGState;
65 class FGAtmosphere;
66 class FGFCS;
67 class FGAircraft;
68 class FGTranslation;
69 class FGRotation;
70 class FGPosition;
71 class FGAuxiliary;
72 class FGOutput;
73
74 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 COMMENTS, REFERENCES, and NOTES [use "class documentation" below for API docs]
76 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
77
78 Note that the coefficients need not be calculated each delta-t. This is
79 something that may be fixed someday.
80
81 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
82 CLASS DOCUMENTATION
83 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
84
85 /** This class models the stability derivative coefficient lookup tables.
86     Each coefficient for an axis is stored in that axes' vector of coefficients.
87     Each FDM execution frame the Run() method of the [currently] FGAircraft model
88     is called and the coefficient value is calculated.
89     @author Jon S. Berndt
90     @version $Id$
91     @see -
92 */
93
94 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
95 CLASS DECLARATION
96 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
97
98 class FGCoefficient
99 {
100 public:
101   FGCoefficient(FGFDMExec*);
102   ~FGCoefficient();
103   
104   virtual bool Load(FGConfigFile* AC_cfg);
105   
106   typedef vector <eParam> MultVec;
107   virtual float TotalValue(void);
108   virtual inline string Getname(void) {return name;}
109   virtual inline float GetSD(void) { return SD;}
110   inline MultVec Getmultipliers(void) {return multipliers;}
111   void DumpSD(void);  
112   
113   /** Outputs coefficient information.
114       Non-dimensionalizing parameter descriptions are output
115       for each aero coefficient defined.
116       @param multipliers the list of multipliers for this coefficient.*/
117   virtual void DisplayCoeffFactors(void);
118   virtual inline string GetCoefficientStrings(void) { return name; }
119   virtual string GetCoefficientValues(void);
120 private:
121   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
122
123   int numInstances;
124   string filename;
125   string description;
126   string name;
127   string method;
128   float Value(float, float);
129   float Value(float);
130   float Value(void);
131   float StaticValue;
132   eParam LookupR, LookupC;
133   MultVec multipliers;
134   int rows, columns;
135   Type type;
136   float SD; // Actual stability derivative (or other coefficient) value
137   FGTable *Table;
138
139   FGFDMExec*      FDMExec;
140   FGState*        State;
141   FGAtmosphere*   Atmosphere;
142   FGFCS*          FCS;
143   FGAircraft*     Aircraft;
144   FGTranslation*  Translation;
145   FGRotation*     Rotation;
146   FGPosition*     Position;
147   FGAuxiliary*    Auxiliary;
148   FGOutput*       Output;
149
150   void Debug(void);
151 };
152
153 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
154 #endif
155