JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
Objective Class Reference
+ Collaboration diagram for Objective:

Public Types

typedef void(* PF) (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Pointer to cost function implementation.
 

Public Member Functions

 Objective (FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
 Constructor.
 
 ~Objective ()
 Destructor.
 
void CostFunctionFull (long vars, Vector< double > &v, double &f)
 Full Trim cost function. More...
 
void CostFunctionFullCoordinatedTurn (long vars, Vector< double > &v, double &f)
 Steady Turn Trim cost function, NON-coordinated. More...
 
void CostFunctionFullTurn (long vars, Vector< double > &v, double &f)
 Steady Turn Trim cost function. More...
 
void CostFunctionFullWingsLevel (long vars, Vector< double > &v, double &f)
 Wings Level Trim cost function. More...
 
void CostFunctionLongitudinal (long vars, Vector< double > &v, double &f)
 Longitudinal Trim cost function. More...
 
void CostFunctionPullUp (long vars, Vector< double > &v, double &f)
 Pullup Trim cost function. More...
 
double Get_x_val () const
 
void Set_x_val (double new_x)
 

Public Attributes

map< TrimAnalysisMode, PFmpCostFunctions
 

Friends

void find_CostFunctionFull (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Full Trim cost function, to be called by optimization method. More...
 
void find_CostFunctionFullCoordinatedTurn (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Steady Turn Trim cost function, to be called by optimization method. More...
 
void find_CostFunctionFullTurn (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Steady Turn Trim cost function, to be called by optimization method. More...
 
void find_CostFunctionFullWingsLevel (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Wings Level Trim cost function, to be called by optimization method. More...
 
void find_CostFunctionLongitudinal (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Longitudinal Trim cost function, to be called by optimization method. More...
 
void find_CostFunctionPullUp (long vars, Vector< double > &v, double &f, bool &success, void *t_ptr)
 Wrapping function for the effective Pullup Trim cost function, to be called by optimization method. More...
 

Detailed Description

Definition at line 129 of file FGTrimAnalysis.h.

Member Function Documentation

◆ CostFunctionFull()

void CostFunctionFull ( long  vars,
Vector< double > &  v,
double &  f 
)

Full Trim cost function.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 220 of file FGTrimAnalysis.cpp.

221 {
222  if (vars != 7) {
223  cerr << "\nError: (Cost function for taFull mode) Dimension must be 7 !!\n";
224  exit(1);
225  }
226  if (TrimAnalysis->GetMode()!=taFull){
227  cerr << "\nError: must be taFull mode !!\n";
228  exit(1);
229  }
230 
231  f = myCostFunctionFull(v);
232  return;
233 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CostFunctionFullCoordinatedTurn()

void CostFunctionFullCoordinatedTurn ( long  vars,
Vector< double > &  v,
double &  f 
)

Steady Turn Trim cost function, NON-coordinated.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 265 of file FGTrimAnalysis.cpp.

266 {
267  if (vars != 5) {
268  cerr << "\nError: (Cost function for taTurn mode) Dimension must be 5 !!\n";
269  exit(1);
270  }
271  if (TrimAnalysis->GetMode()!=taTurn){
272  cerr << "\nError: trim mode must be taTurn mode !!\n";
273  exit(1);
274  }
275 
276  f = myCostFunctionFullCoordinatedTurn(v);
277  return;
278 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CostFunctionFullTurn()

void CostFunctionFullTurn ( long  vars,
Vector< double > &  v,
double &  f 
)

Steady Turn Trim cost function.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 280 of file FGTrimAnalysis.cpp.

281 {
282  if (vars != 6) {
283  cerr << "\nError: (Cost function for taTurn mode) Dimension must be 6 !!\n";
284  exit(1);
285  }
286  if (TrimAnalysis->GetMode()!=taTurnFull){
287  cerr << "\nError: trim mode must be taTurnFull ("<< (int)taTurnFull << ") mode !!\n";
288  exit(1);
289  }
290 
291  f = myCostFunctionFullTurn(v);
292  return;
293 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CostFunctionFullWingsLevel()

void CostFunctionFullWingsLevel ( long  vars,
Vector< double > &  v,
double &  f 
)

Wings Level Trim cost function.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 235 of file FGTrimAnalysis.cpp.

236 {
237  if (vars != 6) {
238  cerr << "\nError: (Cost function for taFullWingsLevel mode) Dimension must be 6 !!\n";
239  exit(1);
240  }
241  if (TrimAnalysis->GetMode()!=taFullWingsLevel){
242  cerr << "\nError: must be taFull mode !!\n";
243  exit(1);
244  }
245 
246  f = myCostFunctionFullWingsLevel(v);
247  return;
248 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CostFunctionLongitudinal()

void CostFunctionLongitudinal ( long  vars,
Vector< double > &  v,
double &  f 
)

Longitudinal Trim cost function.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 250 of file FGTrimAnalysis.cpp.

251 {
252  if (vars != 3) {
253  cerr << "\nError: (Cost function for taLongitudinal mode) Dimension must be 3 !!\n";
254  exit(1);
255  }
256  if (TrimAnalysis->GetMode()!=taLongitudinal){
257  cerr << "\nError: trim mode must be taLongitudinal mode !!\n";
258  exit(1);
259  }
260 
261  f = myCostFunctionLongitudinal(v);
262  return;
263 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CostFunctionPullUp()

void CostFunctionPullUp ( long  vars,
Vector< double > &  v,
double &  f 
)

Pullup Trim cost function.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value

Note: the effective cost function evaluation is performed in a private function

Definition at line 295 of file FGTrimAnalysis.cpp.

296 {
297  if (vars != 5) {
298  cerr << "\nError: (Cost function for taPullup mode) Dimension must be 5 !!\n";
299  exit(1);
300  }
301  if (TrimAnalysis->GetMode()!=taPullup){
302  cerr << "\nError: trim mode must be taPullup mode !!\n";
303  exit(1);
304  }
305 
306  f = myCostFunctionPullUp(v);
307  return;
308 }
TrimAnalysisMode GetMode() const
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ find_CostFunctionFull

void find_CostFunctionFull ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Full Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 106 of file FGTrimAnalysis.cpp.

108  {
109  (*(Objective*)t_ptr).CostFunctionFull(vars, v, f);
110  success = true;
111  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

◆ find_CostFunctionFullCoordinatedTurn

void find_CostFunctionFullCoordinatedTurn ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Steady Turn Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 163 of file FGTrimAnalysis.cpp.

165  {
166  (*(Objective*)t_ptr).CostFunctionFullCoordinatedTurn(vars, v, f);
167  success = true;
168  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

◆ find_CostFunctionFullTurn

void find_CostFunctionFullTurn ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Steady Turn Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 182 of file FGTrimAnalysis.cpp.

184  {
185  (*(Objective*)t_ptr).CostFunctionFullTurn(vars, v, f);
186  success = true;
187  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

◆ find_CostFunctionFullWingsLevel

void find_CostFunctionFullWingsLevel ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Wings Level Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 125 of file FGTrimAnalysis.cpp.

127  {
128  (*(Objective*)t_ptr).CostFunctionFullWingsLevel(vars, v, f);
129  success = true;
130  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

◆ find_CostFunctionLongitudinal

void find_CostFunctionLongitudinal ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Longitudinal Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 144 of file FGTrimAnalysis.cpp.

146  {
147  (*(Objective*)t_ptr).CostFunctionLongitudinal(vars, v, f);
148  success = true;
149  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

◆ find_CostFunctionPullUp

void find_CostFunctionPullUp ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
)
friend

Wrapping function for the effective Pullup Trim cost function, to be called by optimization method.

Parameters
varsnumber ofcontrol varables
vreference to a vector containing controls variables
ffunction value
success
t_ptrthe following method is friend rather then member of FGTrimAnalysis because we want our FGTrimAnalysis::DoTrim() to be able to pass pointers to it.

Note that in the call masked by this methods, the void pointer should be cast to a pointer of the class type.

Definition at line 201 of file FGTrimAnalysis.cpp.

203  {
204  (*(Objective*)t_ptr).CostFunctionPullUp(vars, v, f);
205  success = true;
206  }
Objective(FGFDMExec *fdmex, FGTrimAnalysis *ta, double x)
Constructor.

The documentation for this class was generated from the following files: