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 );
136 exit( EXIT_FAILURE );
138 exit( EXIT_FAILURE );
144 exit( EXIT_FAILURE );
148 exit( EXIT_FAILURE );
151 window.
addSubplot( diffStates(0),
"POSITION OF THE TROLLEY" );
152 window.
addSubplot( diffStates(1),
"VELOCITY OF THE TROLLEY" );
155 window.
addSubplot( feedbackControl,
"Accelaration [m/s^2]" );
159 diffStates.
print(
"diffStates.txt" );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
Calculates the control inputs of the Process based on the Process outputs.
returnValue print(std::ostream &stream=std::cout, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
Allows to setup and evaluate a general function based on SymbolicExpressions.
Allows to setup and evaluate output functions based on SymbolicExpressions.
virtual returnValue plot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
returnValue getProcessDifferentialStates(VariablesGrid &_diffStates)
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...
returnValue getFeedbackControl(Curve &_feedbackControl) const
User-interface to formulate and solve model predictive control problems.
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue addSubplot(PlotWindowSubplot &_subplot)
IntermediateState cos(const Expression &arg)
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
returnValue init(const DVector &x0_, const DVector &p_=emptyConstVector)
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)
Allows to run closed-loop simulations of dynamic systems.
Simulates the process to be controlled based on a dynamic model.
Provides an interface to Gnuplot for plotting algorithmic outputs.
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.