]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGCoefficient.h
Updates to help work the kinks out of JSBsim.
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.h
index 4bfc91acfd59c5a74312b38f86804ebab22c0f62..c937c54a657d472f48c914eebb94e970e0632ccf 100644 (file)
@@ -51,6 +51,8 @@ INCLUDES
 #  include <fstream>
 #endif
 
+#include <map>
+
 /*******************************************************************************
 DEFINES
 *******************************************************************************/
@@ -73,6 +75,8 @@ using namespace std;
 #define FG_RUDDER    8192
 #define FG_MACH     16384
 #define FG_ALTITUDE 32768L
+#define FG_BI2VEL   65536L
+#define FG_CI2VEL  131072L
 
 /*******************************************************************************
 FORWARD DECLARATIONS
@@ -90,81 +94,11 @@ class FGOutput;
 
 /*******************************************************************************
 COMMENTS, REFERENCES,  and NOTES
-*******************************************************************************/
-/**
+********************************************************************************
+
 This class models the stability derivative coefficient lookup tables or 
 equations. Note that the coefficients need not be calculated each delta-t.
 
-The coefficient files are located in the axis subdirectory for each aircraft.
-For instance, for the X-15, you would find subdirectories under the
-aircraft/X-15/ directory named CLIFT, CDRAG, CSIDE, CROLL, CPITCH, CYAW. Under
-each of these directories would be files named a, a0, q, and so on. The file
-named "a" under the CLIFT directory would contain data for the stability
-derivative modeling lift due to a change in alpha. See the FGAircraft.cpp file
-for additional information. The coefficient files have the following format:
-
-<name of coefficient>
-<short description of coefficient with no embedded spaces>
-<method used in calculating the coefficient: TABLE | EQUATION | VECTOR | VALUE>
-  <parameter identifier for table row (if required)>
-  <parameter identifier for table column (if required)>
-<OR'ed list of parameter identifiers needed to turn this coefficient into a force>
-<number of rows in table (if required)>
-<number of columns in table (if required)>
-
-<value of parameter indexing into the column of a table or vector - or value
-  itself for a VALUE coefficient>
-<values of parameter indexing into row of a table if TABLE type> <Value of
-  coefficient at this row and column>
-
-<... repeat above for each column of data in table ...>
-
-As an example for the X-15, for the lift due to mach:
-<PRE>
-
-CLa0
-Lift_at_zero_alpha
-Table 8 3
-16384
-32768
-16387
-
-0.00
-0.0 0.0
-0.5 0.4
-0.9 0.9
-1.0 1.6
-1.1 1.3
-1.4 1.0
-2.0 0.5
-3.0 0.5
-
-30000.00
-0.0 0.0
-0.5 0.5
-0.9 1.0
-1.0 1.7
-1.1 1.4
-1.4 1.1
-2.0 0.6
-3.0 0.6
-
-70000.00
-0.0 0.0
-0.5 0.6
-0.9 1.1
-1.0 1.7
-1.1 1.5
-1.4 1.2
-2.0 0.7
-3.0 0.7
-</PRE>
-
-Note that the values in a row which index into the table must be the same value
-for each column of data, so the first column of numbers for each altitude are
-seen to be equal, and there are the same number of values for each altitude.
-
-<PRE>
 FG_QBAR         1
 FG_WINGAREA     2
 FG_WINGSPAN     4
@@ -181,83 +115,31 @@ FG_AILERON   4096
 FG_RUDDER    8192
 FG_MACH     16384
 FG_ALTITUDE 32768L
-</PRE>
-@author Jon S. Berndt
-@memo This class models the stability derivative coefficient lookup tables or equations.
-*/
-/*******************************************************************************
+FG_BI2VEL   65536L
+FG_CI2VEL  131072L
+
+********************************************************************************
 CLASS DECLARATION
 *******************************************************************************/
 
 class FGCoefficient
 {
 public:
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   FGCoefficient(FGFDMExec*, ifstream&);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   ~FGCoefficient(void);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   bool Allocate(int);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   bool Allocate(int, int);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   float Value(float, float);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   float Value(float);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   float Value(void);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   float TotalValue(void);
-
-  // ***************************************************************************
-  /** @memo
-      @param
-      @return
-  */
   enum Type {UNKNOWN, VALUE, VECTOR, TABLE, EQUATION};
 
 protected:
 
 private:
+  typedef map<string, long> CoeffMap;
+  CoeffMap coeffdef;
   string filename;
   string description;
   string name;