46 const double g = 9.81 ;
56 ocp.minimizeLSQ( h, measurements ) ;
58 f <<
dot(phi ) == omega ;
59 f <<
dot(omega) == -(g/l) *
sin(phi )
63 ocp.subjectTo( 0.0 <= alpha <= 4.0 );
64 ocp.subjectTo( 0.0 <= l <= 2.0 );
68 window.
addSubplot( phi ,
"The angle phi",
"time [s]",
"angle [rad]" );
69 window.
addSubplot( omega,
"The angular velocity dphi" );
70 window.
addData( 0, measurements(0) );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
Allows to setup and evaluate a general function based on SymbolicExpressions.
#define USING_NAMESPACE_ACADO
Provides a time grid consisting of vector-valued optimization variables at each grid point...
returnValue addSubplot(PlotWindowSubplot &_subplot)
returnValue readFromFile(real_t *data, int nrow, int ncol, const char *datafilename)
User-interface to formulate and solve parameter estimation problems.
Grid getTimePoints() const
Data class for defining optimal control problems.
virtual returnValue addData(uint idx, const VariablesGrid &_newData)
Expression dot(const Expression &arg)
Provides an interface to Gnuplot for plotting algorithmic outputs.
virtual returnValue solve()
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.