30 int main(
int argc,
char *
const argv[ ])
43 const double mc = 1.0;
45 const double g = 9.81;
48 c = 0.5 * ((x - w) * (x - w) + y * y - L *
L);
49 dc = dy * y + (dw - dx) * (w - x);
57 f << 0 ==
dot( x ) - dx;
58 f << 0 ==
dot( y ) - dy;
59 f << 0 ==
dot( w ) - dw;
61 f << 0 == m *
dot( dx ) + (x - w) * mu;
62 f << 0 == m *
dot( dy ) + y * mu + m *
g;
63 f << 0 == mc *
dot( dw ) + (w - x) * mu - F;
65 f << 0 == (x - w) *
dot( dx ) + y *
dot( dy ) + (w - x) *
dot( dw )
66 - (-p * p * c - 2 * p * dc - dy * dy - (dw - dx) * (dw - dx));
75 rf << x << y << w << dx << dy << dw << F;
76 rfN << x << y << w << dx << dy << dw;
78 DMatrix W = eye<double>( rf.getDim() );
87 const double Ts = 0.1;
89 OCP ocp(0, N * Ts, N);
129 exit( EXIT_FAILURE );
Allows to setup and evaluate a general function based on SymbolicExpressions.
#define USING_NAMESPACE_ACADO
virtual returnValue exportCode(const std::string &dirName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16)
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue set(OptionsName name, int value)
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
returnValue minimizeLSQEndTerm(const DMatrix &S, const Function &m, const DVector &r)
Data class for defining optimal control problems.
Expression dot(const Expression &arg)
A user class for auto-generation of OCP solvers.
returnValue printDimensionsQP()
USING_NAMESPACE_ACADO int main(int argc, char *const argv[])
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.