66 f <<
dot(phi ) == dphi;
67 f <<
dot(dphi) == -g/L*
sin(phi) -ax/L*
cos(phi) - b/(m*L*
L)*dphi;
72 fSim <<
dot(v) == ax + W;
73 fSim <<
dot(phi ) == dphi;
74 fSim <<
dot(dphi) == -g/L*
sin(phi) -ax/L*
cos(phi) - b/(m*L*
L)*dphi;
95 const double t_end = 5.0;
97 OCP ocp( t_start, t_end, 25 );
113 exit( EXIT_FAILURE );
117 double samplingTime = 0.1;
130 double startTime = 0.0;
131 double endTime = 20.0;
138 exit( EXIT_FAILURE );
139 controller.
getU( uCon );
142 exit( EXIT_FAILURE );
143 process.
getY( ySim );
150 double currentTime = startTime;
152 while ( currentTime <= endTime )
154 printf(
"\n*** Simulation Loop No. %d (starting at time %.3f) ***\n",nSteps,currentTime );
157 exit( EXIT_FAILURE );
158 controller.
getU( uCon );
161 exit( EXIT_FAILURE );
162 process.
getY( ySim );
165 currentTime = (double)nSteps * samplingTime;
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
Calculates the control inputs of the Process based on the Process outputs.
Allows to setup and evaluate a general function based on SymbolicExpressions.
Allows to setup and evaluate output functions based on SymbolicExpressions.
returnValue getY(VariablesGrid &_y) const
Stores a DifferentialEquation together with an OutputFcn.
#define USING_NAMESPACE_ACADO
Provides a time grid consisting of vector-valued optimization variables at each grid point...
User-interface to formulate and solve model predictive control problems.
virtual returnValue step(const VariablesGrid &_u, const VariablesGrid &_p=emptyVariablesGrid)
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
IntermediateState cos(const Expression &arg)
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
virtual returnValue step(double currentTime, const DVector &_y, const VariablesGrid &_yRef=emptyConstVariablesGrid)
virtual returnValue init(double startTime=0.0, const DVector &_x0=emptyConstVector, const DVector &_p=emptyConstVector, const VariablesGrid &_yRef=emptyConstVariablesGrid)
DVector getLastVector() const
Derived & setZero(Index size)
Data class for defining optimal control problems.
Allows to define a static reference trajectory that the ControlLaw aims to track. ...
Expression dot(const Expression &arg)
returnValue read(std::istream &stream)
returnValue setProcessDisturbance(const Curve &_processDisturbance)
Simulates the process to be controlled based on a dynamic model.
returnValue getU(DVector &_u) const
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.
virtual returnValue init(double _startTime=0.0, const DVector &_xStart=emptyConstVector, const DVector &_uStart=emptyConstVector, const DVector &_pStart=emptyConstVector)