66 f <<
dot(phi ) == dphi;
67 f <<
dot(dphi) == -(g/l)*
sin(phi) - alpha*dphi + F/m;
86 S(0,0) = 1.0/
pow(0.1,2);
95 measurements.
read(
"parameter_estimation_data2.txt" );
98 printf(
"The file \"parameter_estimation_data2.txt\" can't be opened.");
106 F_reference.
read(
"parameter_estimation_controls.txt" );
109 printf(
"The file \"parameter_estimation_controls.txt\" can't be opened.");
120 ocp.subjectTo( 0.0 <= alpha <= 4.0 );
121 ocp.subjectTo( 0.0 <= l <= 2.0 );
123 ocp.subjectTo( F == F_reference(0) );
124 ocp.subjectTo( g == 9.81 );
132 window.
addSubplot( dphi,
"The angular velocity dphi " );
133 window.
addSubplot( l,
"The length of the pendulum l" );
134 window.
addSubplot( alpha,
"Frictional constant alpha " );
135 window.
addSubplot( F,
"Control input (force) F" );
155 printf(
"\n\nResults for the parameters: \n");
156 printf(
"-----------------------------------------------\n");
157 printf(
" l = %.3e \n", parameters(0,0) );
158 printf(
" alpha = %.3e \n", parameters(0,1) );
159 printf(
" g = %.3e \n", parameters(0,2) );
160 printf(
"-----------------------------------------------\n\n\n");
167 window.addData( 0, measurements(0) );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
Allows to setup and evaluate a general function based on SymbolicExpressions.
returnValue getPlotWindow(uint idx, PlotWindow &_window) const
#define USING_NAMESPACE_ACADO
Provides a time grid consisting of vector-valued optimization variables at each grid point...
IntermediateState pow(const Expression &arg1, const Expression &arg2)
BooleanType isEmpty() const
returnValue getParameters(VariablesGrid &u_) const
returnValue addSubplot(PlotWindowSubplot &_subplot)
returnValue set(OptionsName name, int value)
User-interface to formulate and solve parameter estimation problems.
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
Grid getTimePoints() const
returnValue initializeDifferentialStates(const char *fileName, BooleanType autoinit=BT_FALSE)
Data class for defining optimal control problems.
Expression dot(const Expression &arg)
returnValue read(std::istream &stream)
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.