66 f <<
dot(vB) == ( -kS*xB + kS*xW + F ) / mB;
67 f <<
dot(vW) == ( kS*xB - (kT+kS)*xW + kT*R - F ) / mW;
94 const double t_end = 1.0;
96 OCP ocp( t_start, t_end, 20 );
121 double samplingTime = 0.025;
132 double startTime = 0.0;
133 double endTime = 2.5;
145 exit( EXIT_FAILURE );
146 controller.
getU( uCon );
149 exit( EXIT_FAILURE );
150 process.
getY( ySim );
156 double currentTime = startTime;
159 while ( currentTime <= endTime )
161 printf(
"\n*** Simulation Loop No. %d (starting at time %.3f) ***\n",nSteps,currentTime );
165 exit( EXIT_FAILURE );
167 controller.
getU( uCon );
169 exit( EXIT_FAILURE );
172 exit( EXIT_FAILURE );
173 process.
getY( ySim );
175 currentTime += samplingTime;
virtual returnValue preparationStep(double nextTime=0.0, const VariablesGrid &_yRef=emptyConstVariablesGrid)
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_)
returnValue set(OptionsName name, int value)
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
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)
void setAll(const T &_value)
Simulates the process to be controlled based on a dynamic model.
virtual returnValue feedbackStep(double currentTime, const DVector &_y, const VariablesGrid &_yRef=emptyConstVariablesGrid)
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)