51 const double R = 1.00;
52 const double Omega = 1.00;
53 const double m = 0.80;
54 const double r = 1.00;
55 const double A = 0.15;
57 const double rho = 1.20;
58 const double CL = 1.00;
59 const double CD = 0.15;
60 const double b = 15.00;
61 const double g = 9.81;
65 c = ( (R*R*Omega*Omega)
66 + (r*r)*( (Omega+dphi)*(Omega+dphi) + dtheta*dtheta )
67 + (2.0*r*R*Omega)*( (Omega+dphi)*
sin(theta)*
cos(phi)
68 + dtheta*
cos(theta)*
sin(phi) ) ) * ( A*rho/( 2.0*m ) );
70 f <<
dot( phi ) == dphi;
71 f <<
dot( theta ) == dtheta;
73 f <<
dot( dphi ) == ( 2.0*r*(Omega+dphi)*dtheta*
cos(theta)
74 + (R*Omega*Omega)*
sin(phi)
75 + c*(CD*(1.0+u2)+CL*(1.0+0.5*u2)*phi) ) / (-r*
sin(theta));
77 f <<
dot( dtheta ) == ( (R*Omega*Omega)*
cos(theta)*
cos(phi)
78 + r*(Omega+dphi)*
sin(theta)*
cos(theta)
79 + g*
sin(theta) - c*( CL*u1 + b*dtheta ) ) / r;
83 h << phi << theta << dphi << dtheta << u1 << u2;
84 hN << phi << theta << dphi << dtheta;
96 WN(0,0) = 1.0584373059248833e+01;
97 WN(0,1) = 1.2682415889087276e-01;
98 WN(0,2) = 1.2922232012424681e+00;
99 WN(0,3) = 3.7982078044271374e-02;
100 WN(1,0) = 1.2682415889087265e-01;
101 WN(1,1) = 3.2598407653299275e+00;
102 WN(1,2) = -1.1779732282636639e-01;
103 WN(1,3) = 9.8830655348904548e-02;
104 WN(2,0) = 1.2922232012424684e+00;
105 WN(2,1) = -1.1779732282636640e-01;
106 WN(2,2) = 4.3662024133354898e+00;
107 WN(2,3) = -5.9269992411260908e-02;
108 WN(3,0) = 3.7982078044271367e-02;
109 WN(3,1) = 9.8830655348904534e-02;
110 WN(3,2) = -5.9269992411260901e-02;
111 WN(3,3) = 3.6495564367004318e-01;
118 OCP ocp( 0.0, 2.0 *
M_PI, 10 );
138 exit( EXIT_FAILURE );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
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_)
IntermediateState cos(const Expression &arg)
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()
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.