]> git.mxchange.org Git - flightgear.git/blob - src/FDM/JSBSim/FGCoefficient.h
ce236f131fe3043ba4fceb3821987e659e55c10a
[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*, FGConfigFile*);
102   ~FGCoefficient();
103
104   typedef vector <eParam> MultVec;
105   float TotalValue(void);
106   inline string Getname(void) {return name;}
107   inline float GetSD(void) {return SD;}
108   inline MultVec Getmultipliers(void) {return multipliers;}
109   void DumpSD(void);
110
111 private:
112   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
113
114   int numInstances;
115   string filename;
116   string description;
117   string name;
118   string method;
119   float Value(float, float);
120   float Value(float);
121   float Value(void);
122   float StaticValue;
123   eParam LookupR, LookupC;
124   MultVec multipliers;
125   int rows, columns;
126   Type type;
127   float SD; // Actual stability derivative (or other coefficient) value
128   FGTable *Table;
129
130   FGFDMExec*      FDMExec;
131   FGState*        State;
132   FGAtmosphere*   Atmosphere;
133   FGFCS*          FCS;
134   FGAircraft*     Aircraft;
135   FGTranslation*  Translation;
136   FGRotation*     Rotation;
137   FGPosition*     Position;
138   FGAuxiliary*    Auxiliary;
139   FGOutput*       Output;
140
141   void Debug(void);
142 };
143
144 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
145 #endif
146