45 OCP::OCP(
const double &tStart_,
const double &tEnd_,
const int &N_)
65 double totalSteps = 0;
67 for( i = 0; i < _numSteps.
getDim(); i++ ) {
68 totalSteps += _numSteps(i);
70 double h = (tEnd_ - tStart_)/totalSteps;
71 for( i = 0; i < _numSteps.
getDim(); i++ ) {
72 times(i+1) = times(i) + h*_numSteps(i);
112 const char* rFilename )
127 const char* rFilename ){
140 const char* rFilename ){
176 for (
unsigned el = 0; el < component.
getDim(); ++el)
179 else if (index_ ==
AT_END)
181 for (
unsigned el = 0; el < component.
getDim(); ++el)
186 for (
unsigned el = 0; el < component.
getDim(); ++el)
197 return constraint->add( lb_, arg1, arg2, ub_ );
203 return constraint->add( lb_, arguments, ub_ );
223 for (
unsigned el = 0; el < _lb.
getDim(); ++el)
226 else if (_index ==
AT_END)
228 for (
unsigned el = 0; el < _lb.
getDim(); ++el)
232 for (
unsigned el = 0; el < _lb.
getDim(); ++el)
233 constraint->add(_index, _lb( el ), _expr( el ), _ub( el ));
249 return objective->addLSQ( &tmpS, h, &tmpR );
287 return objective->addLSQ( &tmpS, h, &r );
304 return objective->addLSQEndTerm( S, m, r );
413 return objective->addLSQLinearTerms(Slx, Slu);
418 return objective->addLSQLinearTerms(Slx, Slu);
425 grid->init( tStart, tEnd, N );
OCP(const double &tStart_=0.0, const double &tEnd_=1.0, const int &N_=20)
Allows to setup and evaluate a general function based on SymbolicExpressions.
void setupGrid(double tStart, double tEnd, int N)
returnValue setIntegrationGrid(const Grid &_ocpGrid, const uint _numSteps)
returnValue getObjective(Objective &objective_) const
std::shared_ptr< Objective > objective
returnValue minimizeLagrangeTerm(const Expression &arg)
bool isPositiveSemiDefinite() const
returnValue minimizeMayerTerm(const int &multiObjectiveIdx, const Expression &arg)
returnValue getObjective(const int &multiObjectiveIdx, Expression **arg) const
returnValue setNumberIntegrationSteps(const uint numSteps)
returnValue maximizeLagrangeTerm(const Expression &arg)
Stores and evaluates the constraints of optimal control problems.
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Allows to conveniently handle (one-dimensional) grids consisting of time points.
BooleanType isEmpty() const
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
#define CLOSE_NAMESPACE_ACADO
returnValue minimizeMayerTerm(const Expression &arg)
returnValue getConstraint(Constraint &constraint_) const
Data class for symbolically formulating constraints within optimal control problems.
returnValue setConstraint(const Constraint &constraint_)
Base class for all variables within the symbolic expressions family.
std::shared_ptr< Grid > grid
double getEndTime() const
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
returnValue setN(const uint N_)
returnValue minimizeLSQEndTerm(const DMatrix &S, const Function &m, const DVector &r)
Encapsulates functionality for defining OCPs having multiple objectives.
returnValue setModel(const DifferentialEquation &_f)
Provides a time grid consisting of matrix-valued optimization variables at each grid point...
BooleanType hasEquidistantControlGrid() const
BooleanType hasConstraint() const
std::shared_ptr< Constraint > constraint
returnValue setIntegrationGrid(const Grid &_ocpGrid, const uint _numSteps)
double getStartTime() const
returnValue minimizeLSQLinearTerms(const DVector &Slx, const DVector &Slu)
Derived & setZero(Index size)
returnValue read(std::istream &stream)
virtual BooleanType hasEquidistantGrid() const
returnValue getNumSteps(DVector &_numSteps) const
returnValue getGrid(Grid &grid_) const
#define BEGIN_NAMESPACE_ACADO
BooleanType hasObjective() const
returnValue setObjective(const Objective &objective_)
returnValue maximizeMayerTerm(const Expression &arg)
Stores and evaluates the objective function of optimal control problems.
#define ACADOERROR(retval)
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.