53 #include "FGFDMExec.h" 54 #include "FGJSBBase.h" 55 #include "FGTrimAxis.h" 63 #define ID_TRIM "$Id: FGTrim.h,v 1.11 2014/05/01 18:32:54 bcoconni Exp $" 71 typedef enum { tLongitudinal=0, tFull, tGround, tPullup,
72 tCustom, tTurn, tNone } TrimMode;
134 std::vector<FGTrimAxis> TrimAxes;
137 int DebugLevel, Debug;
138 double Tolerance, A_Tolerance;
139 std::vector<double> sub_iterations, successful;
140 std::vector<bool> solution;
141 unsigned int max_sub_iterations;
142 unsigned int max_iterations;
143 unsigned int total_its;
146 double xlo,xhi,alo,ahi;
168 void setupPullup(
void);
169 void setupTurn(
void);
171 void updateRates(
void);
174 struct ContactPoints {
179 struct RotationParameters {
181 std::vector<ContactPoints>::iterator contactRef;
184 void trimOnGround(
void);
185 RotationParameters calcRotation(std::vector<ContactPoints>& contacts,
232 bool AddState( State state, Control control );
244 bool EditState( State state, Control new_control );
279 A_Tolerance = tt / 10;
286 inline void SetDebug(
int level) { DebugLevel = level; }
287 inline void ClearDebug(
void) { DebugLevel = 0; }
295 inline void SetTargetNlf(
double nlf) { targetNlf=nlf; }
296 inline double GetTargetNlf(
void) {
return targetNlf; }
bool AddState(State state, Control control)
Add a state-control pair to the current configuration.
void SetTolerance(double tt)
Set the tolerance for declaring a state trimmed.
void Report(void)
Print the results of the trim.
bool GetGammaFallback(void)
query the fallback state
void SetMaxCyclesPerAxis(int ii)
Set the per-axis iteration limit.
void SetMode(TrimMode tm)
Clear all state-control pairs and set a predefined trim mode.
This class implements a 3 element column vector.
bool EditState(State state, Control new_control)
Change the control used to zero a state previously configured.
The trimming routine for JSBSim.
void SetDebug(int level)
Debug level 1 shows results of each top-level iteration Debug level 2 shows level 1 & results of each...
void SetGammaFallback(bool bb)
automatically switch to trimming longitudinal acceleration with flight path angle (gamma) once it bec...
Initializes the simulation run.
bool RemoveState(State state)
Remove a specific state-control pair from the current configuration.
FGTrim(FGFDMExec *FDMExec, TrimMode tm=tGround)
Initializes the trimming class.
void DebugState(State state)
Output debug data for one of the axes The State enum is defined in FGTrimAxis.h.
void ClearStates(void)
Clear all state-control pairs from the current configuration.
Encapsulates the JSBSim simulation executive.
void SetMaxCycles(int ii)
Set the iteration limit.
bool DoTrim(void)
Execute the trim.
void TrimStats()
Iteration statistics.