]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGCoefficient.cpp
- fixed fuel-need calculations
[flightgear.git] / src / FDM / JSBSim / FGCoefficient.cpp
index 565b089492793230c24ee16345e67747b17b70fe..fa6973a65d9206ad762db94d224c67af38607a2c 100644 (file)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  Module:       FGCoefficient.cpp
  Author:       Jon S. Berndt
@@ -30,69 +30,6 @@ FUNCTIONAL DESCRIPTION
 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:
-
-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
-
 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.
@@ -103,319 +40,177 @@ HISTORY
 --------------------------------------------------------------------------------
 12/28/98   JSB   Created
 
-********************************************************************************
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 INCLUDES
-*******************************************************************************/
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGCoefficient.h"
-#include "FGAtmosphere.h"
 #include "FGState.h"
 #include "FGFDMExec.h"
-#include "FGFCS.h"
-#include "FGAircraft.h"
-#include "FGTranslation.h"
-#include "FGRotation.h"
-#include "FGPosition.h"
-#include "FGAuxiliary.h"
-#include "FGOutput.h"
-
-/*******************************************************************************
-************************************ CODE **************************************
-*******************************************************************************/
-
-FGCoefficient::FGCoefficient(FGFDMExec* fdex, ifstream& coeffDefFile)
-{
-  int r, c;
-  float ftrashcan;
-  string strashcan;
-
-  FDMExec     = fdex;
-  State       = FDMExec->GetState();
-  Atmosphere  = FDMExec->GetAtmosphere();
-  FCS         = FDMExec->GetFCS();
-  Aircraft    = FDMExec->GetAircraft();
-  Translation = FDMExec->GetTranslation();
-  Rotation    = FDMExec->GetRotation();
-  Position    = FDMExec->GetPosition();
-  Auxiliary   = FDMExec->GetAuxiliary();
-  Output      = FDMExec->GetOutput();
-
-  if (coeffDefFile) {
-    if (!coeffDefFile.fail()) {
-      coeffDefFile >> name;
-      cout << "   " << name << endl;
-      coeffDefFile >> strashcan;
-      coeffDefFile >> description;
-      cout << "   " << description << endl;
-      coeffDefFile >> method;
-      cout << "   " << method << endl;
 
-      if      (method == "EQUATION") type = EQUATION;
-      else if (method == "TABLE")    type = TABLE;
-      else if (method == "VECTOR")   type = VECTOR;
-      else if (method == "VALUE")    type = VALUE;
-      else                           type = UNKNOWN;
-
-      if (type == VECTOR || type == TABLE) {
-        coeffDefFile >> rows;
-        cout << "   Rows: " << rows << " ";
-        if (type == TABLE) {
-          coeffDefFile >> columns;
-          cout << "Cols: " << columns;
-        }
-        coeffDefFile >> LookupR;
-        cout << endl;
-        cout << "   Row indexing parameter: " << LookupR << endl;
-      }
+#ifndef FGFS
+#  if defined(sgi) && !defined(__GNUC__)
+#    include <iomanip.h>
+#  else
+#    include <iomanip>
+#  endif
+#else
+#  include STL_IOMANIP
+#endif
 
-      if (type == TABLE) {
-        coeffDefFile >> LookupC;
-        cout << "   Column indexing parameter: " << LookupC << endl;
-      }
+static const char *IdSrc = "$Id$";
+static const char *IdHdr = ID_COEFFICIENT;
 
-      coeffDefFile >> multipliers;
-      cout << "   Non-Dimensionalized by: ";
-      
-      mult_count = 0;
-      if (multipliers & FG_QBAR) {
-        mult_idx[mult_count] = FG_QBAR;
-        mult_count++;
-        cout << "qbar ";
-      }
-      if (multipliers & FG_WINGAREA) {
-        mult_idx[mult_count] = FG_WINGAREA;
-        mult_count++;
-        cout << "S ";
-      }
-      if (multipliers & FG_WINGSPAN) {
-        mult_idx[mult_count] = FG_WINGSPAN;
-        mult_count++;
-        cout << "b ";
-      }
-      if (multipliers & FG_CBAR) {
-        mult_idx[mult_count] = FG_CBAR;
-        mult_count++;
-        cout << "c ";
-      }
-      if (multipliers & FG_ALPHA) {
-        mult_idx[mult_count] = FG_ALPHA;
-        mult_count++;
-        cout << "alpha ";
-      }
-      if (multipliers & FG_ALPHADOT) {
-        mult_idx[mult_count] = FG_ALPHADOT;
-        mult_count++;
-        cout << "alphadot ";
-      }
-      if (multipliers & FG_BETA) {
-        mult_idx[mult_count] = FG_BETA;
-        mult_count++;
-        cout << "beta ";
-      }
-      if (multipliers & FG_BETADOT) {
-        mult_idx[mult_count] = FG_BETADOT;
-        mult_count++;
-        cout << "betadot ";
-      }
-      if (multipliers & FG_PITCHRATE) {
-        mult_idx[mult_count] = FG_PITCHRATE;
-        mult_count++;
-        cout << "q ";
-      }
-      if (multipliers & FG_ROLLRATE) {
-        mult_idx[mult_count] = FG_ROLLRATE;
-        mult_count++;
-        cout << "p ";
-      }
-      if (multipliers & FG_YAWRATE) {
-        mult_idx[mult_count] = FG_YAWRATE;
-        mult_count++;
-        cout << "r ";
-      }
-      if (multipliers & FG_ELEVATOR) {
-        mult_idx[mult_count] = FG_ELEVATOR;
-        mult_count++;
-        cout << "De ";
-      }
-      if (multipliers & FG_AILERON) {
-        mult_idx[mult_count] = FG_AILERON;
-        mult_count++;
-        cout << "Da ";
-      }
-      if (multipliers & FG_RUDDER) {
-        mult_idx[mult_count] = FG_RUDDER;
-        mult_count++;
-        cout << "Dr ";
-      }
-      if (multipliers & FG_MACH) {
-        mult_idx[mult_count] = FG_MACH;
-        mult_count++;
-        cout << "Mach ";
-      }
-      if (multipliers & FG_ALTITUDE) {
-        mult_idx[mult_count] = FG_ALTITUDE;
-        mult_count++;
-        cout << "h ";
-      }
-                       cout << endl;
-                       
-      switch(type) {
-      case VALUE:
-        coeffDefFile >> StaticValue;
-        break;
-      case VECTOR:
-        Allocate(rows,2);
-
-        for (r=1;r<=rows;r++) {
-          coeffDefFile >> Table3D[r][0];
-          coeffDefFile >> Table3D[r][1];
-        }
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+CLASS IMPLEMENTATION
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
-        for (r=0;r<=rows;r++) {
-               cout << "       ";
-               for (c=0;c<=columns;c++) {
-                       cout << Table3D[r][c] << "      ";
-               }
-               cout << endl;
-        }
+FGCoefficient::FGCoefficient( FGFDMExec* fdex )
+{
 
-        break;
-      case TABLE:
-        Allocate(rows, columns);
-
-        for (c=1;c<=columns;c++) {
-          coeffDefFile >> Table3D[0][c];
-          for (r=1;r<=rows;r++) {
-            if ( c==1 ) coeffDefFile >> Table3D[r][0];
-            else coeffDefFile >> ftrashcan;
-            coeffDefFile >> Table3D[r][c];
-          }
-        }
+  FDMExec = fdex;
+  State   = FDMExec->GetState();
+  Table   = 0;
+  
+  bias=0;
+  gain=1;
 
-        for (r=0;r<=rows;r++) {
-               cout << "       ";
-               for (c=0;c<=columns;c++) {
-                       cout << Table3D[r][c] << "      ";
-               }
-               cout << endl;
-        }
-        
-        break;
-      }
-    } else {
-      cerr << "Empty file" << endl;
-    }
-  }
+  if (debug_lvl & 2) cout << "Instantiated: FGCoefficient" << endl;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-FGCoefficient::~FGCoefficient(void)
+FGCoefficient::~FGCoefficient()
 {
+  if (Table) delete Table;
+  if (debug_lvl & 2) cout << "Destroyed:    FGCoefficient" << endl;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-bool FGCoefficient::Allocate(int r, int c)
+bool FGCoefficient::Load(FGConfigFile *AC_cfg)
 {
-  rows = r;
-  columns = c;
-  Table3D = new float*[r+1];
-  for (int i=0;i<=r;i++) Table3D[i] = new float[c+1];
-  return true;
-}
+  int start, end, n;
+  string mult;
+
+  if (AC_cfg) {
+    name = AC_cfg->GetValue("NAME");
+    method = AC_cfg->GetValue("TYPE");
+    AC_cfg->GetNextConfigLine();
+    *AC_cfg >> description;
+
+    if      (method == "EQUATION") type = EQUATION;
+    else if (method == "TABLE")    type = TABLE;
+    else if (method == "VECTOR")   type = VECTOR;
+    else if (method == "VALUE")    type = VALUE;
+    else                           type = UNKNOWN;
+
+    if (type == VECTOR || type == TABLE) {
+      *AC_cfg >> rows;
+      if (type == TABLE) {
+        *AC_cfg >> columns;
+        Table = new FGTable(rows, columns);
+      } else {
+        Table = new FGTable(rows);
+      }
 
+      *AC_cfg >> multparmsRow;
+      LookupR = State->GetParameterIndex(multparmsRow);
+    }
 
-bool FGCoefficient::Allocate(int n)
-{
-  rows = n;
-  columns = 0;
-  Table2D = new float[n+1];
-  return true;
-}
+    if (type == TABLE) {
+      *AC_cfg >> multparmsCol;
+      LookupC = State->GetParameterIndex(multparmsCol);
+    }
 
+    // Here, read in the line of the form (e.g.) FG_MACH|FG_QBAR|FG_ALPHA
+    // where each non-dimensionalizing parameter for this coefficient is
+    // separated by a | character
 
-float FGCoefficient::Value(float rVal, float cVal)
-{
-  float rFactor, cFactor, col1temp, col2temp, Value;
-  int r, c, midx;
+    *AC_cfg >> multparms;
 
-  if (rows < 2 || columns < 2) return 0.0;
+    end   = multparms.length();
+    n     = multparms.find("|");
+    start = 0;
 
-  for (r=1;r<=rows;r++) if (Table3D[r][0] >= rVal) break;
-  for (c=1;c<=columns;c++) if (Table3D[0][c] >= cVal) break;
+    if (multparms != string("FG_NONE")) {
+      while (n < end && n >= 0) {
+        n -= start;
+        mult = multparms.substr(start,n);
+        multipliers.push_back( State->GetParameterIndex(mult) );
+        start += n+1;
+        n = multparms.find("|",start);
+      }
+      multipliers.push_back(State->GetParameterIndex(multparms.substr(start,n)));
+      // End of non-dimensionalizing parameter read-in
+    }
 
-  c = c < 2 ? 2 : (c > columns ? columns : c);
-  r = r < 2 ? 2 : (r > rows    ? rows    : r);
+    if (type == VALUE) {
+      *AC_cfg >> StaticValue;
+    } else if (type == VECTOR || type == TABLE) {
+      *Table << *AC_cfg;
+    } else {
+      cerr << "Unimplemented coefficient type: " << type << endl;
+    }
 
-  rFactor = (rVal - Table3D[r-1][0]) / (Table3D[r][0] - Table3D[r-1][0]);
-  cFactor = (cVal - Table3D[0][c-1]) / (Table3D[0][c] - Table3D[0][c-1]);
+    AC_cfg->GetNextConfigLine();
+    FGCoefficient::Debug(2);
 
-  col1temp = rFactor*(Table3D[r][c-1] - Table3D[r-1][c-1]) + Table3D[r-1][c-1];
-  col2temp = rFactor*(Table3D[r][c] - Table3D[r-1][c]) + Table3D[r-1][c];
+    return true;
+  } else {
+    return false;
+  }  
+}
 
-  Value = col1temp + cFactor*(col2temp - col1temp);
-  
-//cout << "Value for " << description << " is " << Value;
-  for (midx=0;midx<mult_count;midx++) {
-    Value *= GetCoeffVal(mult_idx[midx]);
-  }
 
-//cout << " after multipliers it is: " << Value << endl;
-
-  return Value;
-}
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-float FGCoefficient::Value(float Val)
+double FGCoefficient::Value(double rVal, double cVal)
 {
-  float Factor, Value;
-  int r, midx;
+  double Value;
+  unsigned int midx;
 
-  if (rows < 2) return 0.0;
+  SD = Value = gain*Table->GetValue(rVal, cVal) + bias;
   
-  for (r=1;r<=rows;r++) if (Table3D[r][0] >= Val) break;
-  r = r < 2 ? 2 : (r > rows    ? rows    : r);
 
-  // make sure denominator below does not go to zero.
-  if (Table3D[r][0] != Table3D[r-1][0]) {
-    Factor = (Val - Table3D[r-1][0]) / (Table3D[r][0] - Table3D[r-1][0]);
-  } else {
-    Factor = 1.0;
+  for (midx=0; midx < multipliers.size(); midx++) {
+      Value *= State->GetParameter(multipliers[midx]);
   }
+  return Value;
+}
 
-  Value = Factor*(Table3D[r][1] - Table3D[r-1][1]) + Table3D[r-1][1];
-
-// cout << "Value for " << description << " is " << Value;
-  for (midx=0;midx<mult_count;midx++) {
-    Value *= GetCoeffVal(mult_idx[midx]);
-  }
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-//cout << " after multipliers it is: " << Value << endl;
+double FGCoefficient::Value(double Val)
+{
+  double Value;
 
+  SD = Value = gain*Table->GetValue(Val) + bias;
+  
+  for (unsigned int midx=0; midx < multipliers.size(); midx++) 
+      Value *= State->GetParameter(multipliers[midx]);
+  
   return Value;
 }
 
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
-float FGCoefficient::Value(void)
+double FGCoefficient::Value(void)
 {
-       float Value;
-       int midx;
-       
-       Value = StaticValue;
-
-// cout << "Value for " << description << " is " << Value << endl;
-  for (midx=0;midx<mult_count;midx++) {
-    Value *= GetCoeffVal(mult_idx[midx]);
-  }
+       double Value;
 
-// cout << " after multipliers it is: " << Value << endl;
+  SD = Value = gain*StaticValue + bias;
+
+  for (unsigned int midx=0; midx < multipliers.size(); midx++)
+    Value *= State->GetParameter(multipliers[midx]);
 
   return Value;
 }
 
-float FGCoefficient::TotalValue()
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+double FGCoefficient::TotalValue()
 {
   switch(type) {
   case 0:
@@ -423,66 +218,117 @@ float FGCoefficient::TotalValue()
   case 1:
     return (Value());
   case 2:
-    return (Value(GetCoeffVal(LookupR)));
+    return (Value(State->GetParameter(LookupR)));
   case 3:
-    return (Value(GetCoeffVal(LookupR),GetCoeffVal(LookupC)));
+    return (Value(State->GetParameter(LookupR),State->GetParameter(LookupC)));
   case 4:
     return 0.0;
   }
   return 0;
 }
 
-float FGCoefficient::GetCoeffVal(int val_idx)
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGCoefficient::DumpSD(void)
+{
+  cout << "   " << name << ": " << SD << endl;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+void FGCoefficient::DisplayCoeffFactors(void)
 {
-  switch(val_idx) {
-  case FG_QBAR:
-//cout << "Qbar: " << State->Getqbar() << endl;
-    return State->Getqbar();
-  case FG_WINGAREA:
-//cout << "S: " << Aircraft->GetWingArea() << endl;  
-    return Aircraft->GetWingArea();
-  case FG_WINGSPAN:
-//cout << "b: " << Aircraft->GetWingSpan() << endl;
-    return Aircraft->GetWingSpan();
-  case FG_CBAR:
-//cout << "Cbar: " << Aircraft->Getcbar() << endl;
-    return Aircraft->Getcbar();
-  case FG_ALPHA:
-//cout << "Alpha: " << Translation->Getalpha() << endl;
-    return Translation->Getalpha();
-  case FG_ALPHADOT:
-//cout << "Adot: " << State->Getadot() << endl;
-    return State->Getadot();
-  case FG_BETA:
-//cout << "Beta: " << Translation->Getbeta() << endl;
-    return Translation->Getbeta();
-  case FG_BETADOT:
-//cout << "Bdot: " << State->Getbdot() << endl;
-    return State->Getbdot();
-  case FG_PITCHRATE:
-//cout << "Q: " << Rotation->GetQ() << endl;
-    return Rotation->GetQ();
-  case FG_ROLLRATE:
-//cout << "P: " << Rotation->GetP() << endl;
-    return Rotation->GetP();
-  case FG_YAWRATE:
-//cout << "R: " << Rotation->GetR() << endl;
-    return Rotation->GetR();
-  case FG_ELEVATOR:
-//cout << "De: " << FCS->GetDe() << endl;
-    return FCS->GetDe();
-  case FG_AILERON:
-//cout << "Da: " << FCS->GetDa() << endl;
-    return FCS->GetDa();
-  case FG_RUDDER:
-//cout << "Dr: " << FCS->GetDr() << endl;
-    return FCS->GetDr();
-  case FG_MACH:
-//cout << "Mach: " << State->GetMach() << endl;
-    return State->GetMach();
-  case FG_ALTITUDE:
-//cout << "h: " << State->Geth() << endl;
-    return State->Geth();
+  unsigned int i;
+
+  cout << "   Non-Dimensionalized by: ";
+
+  if (multipliers.size() == 0) {
+    cout << "none" << endl;
+  } else {
+    for (i=0; i<multipliers.size(); i++) 
+        cout << FDMExec->GetState()->paramdef[multipliers[i]];
   }
-  return 0;
+  cout << endl;
 }
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+string FGCoefficient::GetCoefficientValues(void)
+{
+  char buffer[10];
+  string value;
+
+  sprintf(buffer,"%9.6f",SD);
+  value = string(buffer);
+  return value;
+}
+
+//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+//    The bitmasked value choices are as follows:
+//    unset: In this case (the default) JSBSim would only print
+//       out the normally expected messages, essentially echoing
+//       the config files as they are read. If the environment
+//       variable is not set, debug_lvl is set to 1 internally
+//    0: This requests JSBSim not to output any messages
+//       whatsoever.
+//    1: This value explicity requests the normal JSBSim
+//       startup messages
+//    2: This value asks for a message to be printed out when
+//       a class is instantiated
+//    4: When this value is set, a message is displayed when a
+//       FGModel object executes its Run() method
+//    8: When this value is set, various runtime state variables
+//       are printed out periodically
+//    16: When set various parameters are sanity checked and
+//       a message is printed out when they go out of bounds
+
+void FGCoefficient::Debug(int from)
+{
+  if (debug_lvl <= 0) return;
+
+  if (debug_lvl & 1) { // Standard console startup message output
+    
+    if (from == 2) { // Loading
+      cout << "\n   " << highint << underon << name << underoff << normint << endl;
+      cout << "   " << description << endl;
+      cout << "   " << method << endl;
+
+      if (type == VECTOR || type == TABLE) {
+        cout << "   Rows: " << rows << " ";
+        if (type == TABLE) {
+          cout << "Cols: " << columns;
+        }
+        cout << endl << "   Row indexing parameter: " << multparmsRow << endl;
+      }
+
+      if (type == TABLE) {
+        cout << "   Column indexing parameter: " << multparmsCol << endl;
+      }
+
+      if (type == VALUE) {
+        cout << "      Value = " << StaticValue << endl;
+      } else if (type == VECTOR || type == TABLE) {
+        Table->Print();
+      }
+
+      DisplayCoeffFactors();
+    }
+  }
+  if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+    if (from == 0) cout << "Instantiated: FGCoefficient" << endl;
+    if (from == 1) cout << "Destroyed:    FGCoefficient" << endl;
+  }
+  if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+  }
+  if (debug_lvl & 8 ) { // Runtime state variables
+  }
+  if (debug_lvl & 16) { // Sanity checking
+  }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
+}
+