49#define DEFAULT_TOLERANCE 0.001
57const std::string StateNames[] = {
"all",
"udot",
"vdot",
"wdot",
"qdot",
"pdot",
60const std::string ControlNames[] = {
"Throttle",
"Sideslip",
"Angle of Attack",
61 "Elevator",
"Ailerons",
"Rudder",
62 "Altitude AGL",
"Pitch Angle",
63 "Roll Angle",
"Flight Path Angle",
64 "Pitch Trim",
"Roll Trim",
"Yaw Trim",
68class FGInitialCondition;
82enum State { tAll,tUdot,tVdot,tWdot,tQdot,tPdot,tRdot,tHmgt,tNlf };
83enum Control { tThrottle, tBeta, tAlpha, tElevator, tAileron, tRudder, tAltAGL,
84 tTheta, tPhi, tGamma, tPitchTrim, tRollTrim, tYawTrim, tHeading };
105 double GetState(
void) { getState();
return state_value; }
107 inline void SetControl(
double value ) { control_value=value; }
108 inline double GetControl(
void) {
return control_value; }
110 inline State GetStateType(
void) {
return state; }
111 inline Control GetControlType(
void) {
return control; }
113 inline std::string GetStateName(
void) {
return StateNames[state]; }
114 inline std::string GetControlName(
void) {
return ControlNames[control]; }
116 inline double GetControlMin(
void) {
return control_min; }
117 inline double GetControlMax(
void) {
return control_max; }
119 inline void SetControlToMin(
void) { control_value=control_min; }
120 inline void SetControlToMax(
void) { control_value=control_max; }
122 inline void SetControlLimits(
double min,
double max) {
127 inline void SetTolerance(
double ff) { tolerance=ff;}
128 inline double GetTolerance(
void) {
return tolerance; }
130 inline double GetSolverEps(
void) {
return solver_eps; }
131 inline void SetSolverEps(
double ff) { solver_eps=ff; }
133 inline int GetIterationLimit(
void) {
return max_iterations; }
134 inline void SetIterationLimit(
int ii) { max_iterations=ii; }
136 inline int GetStability(
void) {
return its_to_stable_value; }
137 inline int GetRunCount(
void) {
return total_stability_iterations; }
138 double GetAvgStability(
void );
140 inline void SetStateTarget(
double target) { state_target=target; }
141 inline double GetStateTarget(
void) {
return state_target; }
143 void AxisReport(
void);
145 bool InTolerance(
void) { getState();
return (fabs(state_value) <= tolerance); }
157 double control_value;
166 double state_convert;
167 double control_convert;
171 int its_to_stable_value;
172 int total_stability_iterations;
173 int total_iterations;
175 void setThrottlesPct(
void);
178 void getControl(
void);
179 void setControl(
void);
181 double computeHmgt(
void);
183 void Debug(
int from);
Encapsulates the JSBSim simulation executive.
Initializes the simulation run.
void Run(void)
This function iterates through a call to the FGFDMExec::RunIC() function until the desired trimming c...