Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

rdFSQP Class Reference

This class provides methods for finding the optimal controls of a redundant system by applying sequential quadratic programming techniques. More...

#include <rdFSQP.h>

List of all members.

Public Member Functions

virtual ~rdFSQP ()
 Destructor.

 rdFSQP (rdOptimizationTarget *aTarget)
 Construct an rdFSQP instance based on an optimization target.

rdOptimizationTargetsetTarget (rdOptimizationTarget *aTarget)
 Set the optimization target.

rdOptimizationTargetgetTarget ()
 Get the current optimization target.

void setMode (int aMode)
 Set the mode of fsqp.

int getMode ()
 Get the mode of fsqp.

void setPrintLevel (int aLevel)
 Set the print level.

int getPrintLevel ()
 Get the print level.

void setMaxIterations (int aMaxIter)
 Set the maximum number of iterations.

int getMaxIterations ()
 Get the maximum number of iterations.

void setInfinity (double aInfinity)
 Set the value considered to be infinity.

double getInfinity ()
 Set the value considered to be infinity.

void setConvergenceCriterion (double aEPS)
 Set the convergence criterion.

double getConvergenceCriterion ()
 Get the convergence criterion.

void setNonlinearEqualityConstraintTolerance (double aEPSEQN)
 Set the tolerance allowed in meeting nonlinear equality constraints.

double getNonlinearEqualityConstraintTolerance ()
 Get the tolerance allowed in meeting nonlinear equality constraints.

void setLowerBound (double aLower)
 Set a lower bound on the controls.

void setLowerBound (int aIndex, double aLower)
 Set the lower bound for a specified control.

void setLowerBound (double aLower[])
 Set lower bounds on the controls.

double * getLowerBound ()
 Get lower bounds on the controls.

void setUpperBound (double aUpper)
 Set a upper bound on the controls.

void setUpperBound (int aIndex, double aUpper)
 Set the upper bound for a specified control.

void setUpperBound (double aUpper[])
 Set upper bounds on the controls.

double * getUpperBound ()
 Get upper bounds on the controls.

int computeOptimalControls (const double *xstart, double *x)
 Compute a set of optimal controls, given the input controls (xin) and the current state of the optimization target.


Static Public Member Functions

int CentralDifferences (rdOptimizationTarget *aTarget, double *dx, double *x, double *dpdx, double *dcdx)
 Compute derivatives of performance and constraints with respect to the controls by central differences.

int CentralDifferences (rdOptimizationTarget *aTarget, double *dx, double *x, double *dpdx)
 Compute derivatives of performance with respect to the controls by central differences.

int CentralDifferencesConstraint (rdOptimizationTarget *aTarget, double *dx, double *x, int ic, double *dcdx)
 Compute derivatives of a constraint with respect to the controls by central differences.

void pFunc (int nparam, int j, double *x, double *pj, void *cd)
 Compute the performance criterion.

void cFunc (int nparam, int j, double *x, double *cj, void *cd)
 Compute the constraints.

void dpdxFunc (int nparam, int j, double *x, double *dpdx, void(*dummy)(int, int, double *, double *, void *), void *cd)
 Compute the derivatives of the performance criterion.

void dcdxFunc (int nparam, int j, double *x, double *dcdx, void(*dummy)(int, int, double *, double *, void *), void *cd)
 Compute the gradient of the constraints.


Private Member Functions

void setNull ()
 Set NULL values for the member variables.


Private Attributes

rdOptimizationTarget_target
int _mode
 Mode.

int _printLevel
 Print level.

int _maxIter
 Maximum number of iterations.

int _inform
 Variable that contains information about the status of an optimization.

double _infinity
 Value used for infinity or a very large number.

double _eps
 Convergence criterion.

double _epseqn
 Convergence criterion for nonlinear equality constraints.

double _udelta
 I don't know.

int _ncsrl
int _ncsrn
int _nfsr
int * _mesh
double * _bl
 Lower bounds on controls.

double * _bu
 Upper bounds on controls.

double * _x
 Controls.

double * _p
 Array of performance criteria.

double * _c
 Array of constraints.

double * _lambda
 Lagrange multipliers for constraints.


Detailed Description

This class provides methods for finding the optimal controls of a redundant system by applying sequential quadratic programming techniques.

The core algorithm is called fsqp, "Fast Sequential Quadratic Programming".


Member Function Documentation

int rdFSQP::CentralDifferences rdOptimizationTarget aTarget,
double *  dx,
double *  x,
double *  dpdx
[static]
 

Compute derivatives of performance with respect to the controls by central differences.

Note that the gradient array should be allocated as dpdx[nx].

Parameters:
dx An array of control perturbation values.
x Values of the controls at time t.
dpdx The derivatives of the performance criterion.
Returns:
-1 if an error is encountered, 0 otherwize.

int rdFSQP::CentralDifferences rdOptimizationTarget aTarget,
double *  dx,
double *  x,
double *  dpdx,
double *  dcdx
[static]
 

Compute derivatives of performance and constraints with respect to the controls by central differences.

Note that the gradient arrays should be allocated as dpdx[nx] and dcdx[nc][nx].

Parameters:
dx An array of control perturbation values.
x Values of the controls at time t.
dpdx The derivatives of the performance criterion.
dcdx The derivatives of the constraints.
Returns:
-1 if an error is encountered, 0 otherwize.

int rdFSQP::CentralDifferencesConstraint rdOptimizationTarget aTarget,
double *  dx,
double *  x,
int  ic,
double *  dcdx
[static]
 

Compute derivatives of a constraint with respect to the controls by central differences.

Parameters:
dx An array of control perturbation values.
x Values of the controls at time t.
ic Index of the constraint.
dcdx The derivatives of the constraints.
Returns:
-1 if an error is encountered, 0 otherwize.

int rdFSQP::computeOptimalControls const double *  xstart,
double *  x
 

Compute a set of optimal controls, given the input controls (xin) and the current state of the optimization target.

Whether or not the optimization terminates normally, the latest value of the controls are copied to xout. It is safe to use the same pointer for xin and xout. However, in all cases the calling routine must allocate enough space for xin and xout.

Parameters:
xin Values of the controls.
xout Optimal values of the controls.
Returns:
Parameter inform of cfsqp. -1 means a fatal error.

double * rdFSQP::getLowerBound  ) 
 

Get lower bounds on the controls.

Note that the address is returned and not a copy;

Returns:
Pointer the the array of lower bounds.

rdOptimizationTarget * rdFSQP::getTarget  ) 
 

Get the current optimization target.

Returns:
Optimization target

double * rdFSQP::getUpperBound  ) 
 

Get upper bounds on the controls.

Note that the address is returned and not a copy;

Returns:
Pointer to the array of upper bounds.

void rdFSQP::setLowerBound double  aLower[]  ) 
 

Set lower bounds on the controls.

Parameters:
aLower Array of lower bounds. The size of aLower should be at least the number of controls.

void rdFSQP::setLowerBound int  aIndex,
double  aLower
 

Set the lower bound for a specified control.

Parameters:
aIndex Index of the control.
aLower Lower bound.

void rdFSQP::setLowerBound double  aLower  ) 
 

Set a lower bound on the controls.

Parameters:
aLower Lower bound for all controls.

rdOptimizationTarget * rdFSQP::setTarget rdOptimizationTarget aTarget  ) 
 

Set the optimization target.

It is permissible to change the target at any time. Calling this method, however, will destroy any information about the lower and upper bounds for the controls. The upper and lower bounds therefore need to be set again.

Parameters:
aTarget New optimization target.
Returns:
Previous optimiztion target.

void rdFSQP::setUpperBound double  aUpper[]  ) 
 

Set upper bounds on the controls.

Parameters:
aUpper Array of upper bounds. The size of aUpper should be at least the the number of controls

void rdFSQP::setUpperBound int  aIndex,
double  aUpper
 

Set the upper bound for a specified control.

Parameters:
aIndex Index of the control.
aLower Upper bound.

void rdFSQP::setUpperBound double  aUpper  ) 
 

Set a upper bound on the controls.

Parameters:
aUpper Upper bound for all controls.


The documentation for this class was generated from the following files:
Generated on Wed Aug 20 02:17:10 2003 for Simulation Software by doxygen1.3