#include <FGTrim.h>
Inherits FGJSBBase.
The remaining modes include tCustom, which is completely user defined and tNone.
Note that trims can (and do) fail for reasons that are completely outside the control of the trimming routine itself. The most common problem is the initial conditions: is the model capable of steady state flight at those conditions? Check the speed, altitude, configuration (flaps, gear, etc.), weight, cg, and anything else that may be relevant.
Example usage:
FGFDMExec* FDMExec = new FGFDMExec(); FGInitialCondition* fgic = new FGInitialCondition(FDMExec); FGTrim fgt(FDMExec, fgic, tFull); fgic->SetVcaibratedKtsIC(100); fgic->SetAltitudeFtIC(1000); fgic->SetClimbRate(500); if( !fgt.DoTrim() ) { cout << "Trim Failed" << endl; } fgt.Report();
Definition at line 130 of file FGTrim.h.
Public Member Functions | |
| bool | AddState (State state, Control control) |
| Add a state-control pair to the current configuration. | |
| void | ClearDebug (void) |
| void | ClearStates (void) |
| Clear all state-control pairs from the current configuration. | |
| void | DebugState (State state) |
| Output debug data for one of the axes The State enum is defined in FGTrimAxis.h. | |
| bool | DoTrim (void) |
| Execute the trim. | |
| bool | EditState (State state, Control new_control) |
| Change the control used to zero a state previously configured. | |
| FGTrim (FGFDMExec *FDMExec, TrimMode tm=tGround) | |
| Initializes the trimming class. | |
| bool | GetGammaFallback (void) |
| query the fallback state | |
| double | GetTargetNlf (void) |
| bool | RemoveState (State state) |
| Remove a specific state-control pair from the current configuration. | |
| void | Report (void) |
| Print the results of the trim. | |
| void | SetDebug (int level) |
| Debug level 1 shows results of each top-level iteration Debug level 2 shows level 1 & results of each per-axis iteration. | |
| void | SetGammaFallback (bool bb) |
| automatically switch to trimming longitudinal acceleration with flight path angle (gamma) once it becomes apparent that there is not enough/too much thrust. | |
| void | SetMaxCycles (int ii) |
| Set the iteration limit. | |
| 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. | |
| void | SetTargetNlf (double nlf) |
| void | SetTolerance (double tt) |
| Set the tolerance for declaring a state trimmed. | |
| void | TrimStats () |
| Iteration statistics. | |
| FDMExec | pointer to a JSBSim executive object. | |
| tm | trim mode |
Definition at line 67 of file FGTrim.cpp.
| bool AddState | ( | State | state, | |
| Control | control | |||
| ) |
See the enums State and Control in FGTrimAxis.h for the available options. Will fail if the given state is already configured.
| state | the accel or other condition to zero | |
| control | the control used to zero the state |
Definition at line 151 of file FGTrim.cpp.
| void ClearStates | ( | void | ) |
The trimming routine must have at least one state-control pair configured to be useful
Definition at line 134 of file FGTrim.cpp.
| bool EditState | ( | State | state, | |
| Control | new_control | |||
| ) |
| state | the accel or other condition to zero | |
| new_control | the control used to zero the state |
Definition at line 206 of file FGTrim.cpp.
| bool GetGammaFallback | ( | void | ) | [inline] |
| bool RemoveState | ( | State | state | ) |
| state | the state to remove |
Definition at line 177 of file FGTrim.cpp.
| void Report | ( | void | ) |
For each axis trimmed, this includes the final state value, control value, and tolerance used.
Definition at line 125 of file FGTrim.cpp.
| void SetGammaFallback | ( | bool | bb | ) | [inline] |
| void SetMaxCycles | ( | int | ii | ) | [inline] |
| void SetMaxCyclesPerAxis | ( | int | ii | ) | [inline] |
| void SetMode | ( | TrimMode | tm | ) |
| tm | the set of axes to trim. Can be: tLongitudinal, tFull, tGround, tCustom, or tNone |
Definition at line 621 of file FGTrim.cpp.
| void SetTolerance | ( | double | tt | ) | [inline] |
1.5.5