JSBSim Flight Dynamics Model 1.0 (23 February 2013)
An Open Source Flight Dynamics and Control Software Library in C++

Objective Class Reference

Collaboration diagram for Objective:

List of all members.

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.
void CostFunctionFullCoordinatedTurn (long vars, Vector< double > &v, double &f)
 Steady Turn Trim cost function, NON-coordinated.
void CostFunctionFullTurn (long vars, Vector< double > &v, double &f)
 Steady Turn Trim cost function.
void CostFunctionFullWingsLevel (long vars, Vector< double > &v, double &f)
 Wings Level Trim cost function.
void CostFunctionLongitudinal (long vars, Vector< double > &v, double &f)
 Longitudinal Trim cost function.
void CostFunctionPullUp (long vars, Vector< double > &v, double &f)
 Pullup Trim cost function.
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.
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.
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.
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.
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.
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.

Detailed Description

Definition at line 129 of file FGTrimAnalysis.h.


Member Function Documentation

void CostFunctionFull ( long  vars,
Vector< double > &  v,
double &  f 
)
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 221 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 7) {
      cerr << "\nError: (Cost function for taFull mode) Dimension must be 7 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taFull){
      cerr << "\nError: must be taFull mode !!\n";
      exit(1);
  }

  f = myCostFunctionFull(v);
  return;
}

Here is the call graph for this function:

void CostFunctionFullCoordinatedTurn ( long  vars,
Vector< double > &  v,
double &  f 
)
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 266 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 5) {
      cerr << "\nError: (Cost function for taTurn mode) Dimension must be 5 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taTurn){
      cerr << "\nError: trim mode must be taTurn mode !!\n";
      exit(1);
  }

  f = myCostFunctionFullCoordinatedTurn(v);
  return;
}

Here is the call graph for this function:

void CostFunctionFullTurn ( long  vars,
Vector< double > &  v,
double &  f 
)
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 281 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 6) {
      cerr << "\nError: (Cost function for taTurn mode) Dimension must be 6 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taTurnFull){
      cerr << "\nError: trim mode must be taTurnFull ("<< (int)taTurnFull << ") mode !!\n";
      exit(1);
  }

  f = myCostFunctionFullTurn(v);
  return;
}

Here is the call graph for this function:

void CostFunctionFullWingsLevel ( long  vars,
Vector< double > &  v,
double &  f 
)
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 236 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 6) {
      cerr << "\nError: (Cost function for taFullWingsLevel mode) Dimension must be 6 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taFullWingsLevel){
      cerr << "\nError: must be taFull mode !!\n";
      exit(1);
  }

  f = myCostFunctionFullWingsLevel(v);
  return;
}

Here is the call graph for this function:

void CostFunctionLongitudinal ( long  vars,
Vector< double > &  v,
double &  f 
)
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 251 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 3) {
      cerr << "\nError: (Cost function for taLongitudinal mode) Dimension must be 3 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taLongitudinal){
      cerr << "\nError: trim mode must be taLongitudinal mode !!\n";
      exit(1);
  }

  f = myCostFunctionLongitudinal(v);
  return;
}

Here is the call graph for this function:

void CostFunctionPullUp ( long  vars,
Vector< double > &  v,
double &  f 
)
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 296 of file FGTrimAnalysis.cpp.

References FGTrimAnalysis::GetMode().

{
  if (vars != 5) {
      cerr << "\nError: (Cost function for taPullup mode) Dimension must be 5 !!\n";
      exit(1);
  }
  if (TrimAnalysis->GetMode()!=taPullup){
      cerr << "\nError: trim mode must be taPullup mode !!\n";
      exit(1);
  }

  f = myCostFunctionPullUp(v);
  return;
}

Here is the call graph for this function:


Friends And Related Function Documentation

void find_CostFunctionFull ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 107 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionFull(vars, v, f);
        success = true;
    }
void find_CostFunctionFullCoordinatedTurn ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 164 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionFullCoordinatedTurn(vars, v, f);
        success = true;
    }
void find_CostFunctionFullTurn ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 183 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionFullTurn(vars, v, f);
        success = true;
    }
void find_CostFunctionFullWingsLevel ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 126 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionFullWingsLevel(vars, v, f);
        success = true;
    }
void find_CostFunctionLongitudinal ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 145 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionLongitudinal(vars, v, f);
        success = true;
    }
void find_CostFunctionPullUp ( long  vars,
Vector< double > &  v,
double &  f,
bool &  success,
void *  t_ptr 
) [friend]
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 202 of file FGTrimAnalysis.cpp.

    {
        (*(Objective*)t_ptr).CostFunctionPullUp(vars, v, f);
        success = true;
    }
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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