90 double rhoc = 1450.00;
120 double PI = 3.1415926535897932;
176 dm = (rhoc*AQ/ 3.0)*dr;
183 w =
log(h/hr) /
log(h0/hr) *w0 ;
189 we[0] = w*
sin(theta)*
cos(phi) - dr ;
190 we[1] = -w*
sin(phi) - r*
sin(theta)*dphi ;
191 we[2] = -w*
cos(theta)*
cos(phi) + r *dtheta;
197 nwep =
pow( we[1]*we[1] + we[2]*we[2], 0.5 );
198 nwe =
pow( we[0]*we[0] + we[1]*we[1] + we[2]*we[2], 0.5 );
199 eta =
asin( we[0]*
tan(Psi)/ nwep ) ;
204 ewep[1] = we[1] / nwep ;
205 ewep[2] = we[2] / nwep ;
210 et [1] = (-
cos(Psi)*
sin(eta))*ewep[1] - (
cos(Psi)*
cos(eta))*ewep[2];
211 et [2] = (-
cos(Psi)*
sin(eta))*ewep[2] + (
cos(Psi)*
cos(eta))*ewep[1];
220 Caer = (rho*A/2.0 )*nwe ;
221 Cf = (rho*dc/8.0)*r*nwe ;
234 Fg [0] = Cg *
cos(theta) ;
236 Fg [2] = Cg *
sin(theta) ;
242 Faer[0] = Caer*( CL*(we[1]*et[2]-we[2]*et[1]) + CD*we[0] ) ;
243 Faer[1] = Caer*( CL*(we[2]*et[0]-we[0]*et[2]) + CD*we[1] ) ;
244 Faer[2] = Caer*( CL*(we[0]*et[1]-we[1]*et[0]) + CD*we[2] ) ;
251 Ff [1] = Cf * cc* we[1] ;
252 Ff [2] = Cf * cc* we[2] ;
259 F [0] = Fg[0] + Faer[0] ;
260 F [1] = Faer[1] + Ff[1] ;
261 F [2] = Fg[2] + Faer[2] + Ff[2] ;
268 a_pseudo [0] = - ddr0
270 +
sin(theta)*
sin(theta)*dphi *dphi )
273 a_pseudo [1] = - 2.0*
cos(theta)/
sin(theta)*dphi*dtheta
277 a_pseudo [2] =
cos(theta)*
sin(theta)*dphi*dphi
287 ddr = F[0]/m + a_pseudo[0] ;
288 ddphi = F[1]/(m*r*
sin(theta)) + a_pseudo[1] ;
289 ddtheta = -F[2]/(m*r ) + a_pseudo[2] ;
298 dn = ( dphi*ddtheta - dtheta*ddphi ) /
299 (2.0*PI*(dphi*dphi + dtheta*dtheta) ) ;
314 regularisation = 5.0e2 * ddr0 * ddr0
315 + 1.0e8 * dPsi * dPsi
318 + 2.5e7 * ddphi * ddphi;
319 + 2.5e7 * ddtheta * ddtheta;
320 + 2.5e6 * dtheta * dtheta;
330 f <<
dot(phi) == dphi ;
331 f <<
dot(theta) == dtheta ;
332 f <<
dot(dr) == ddr0 ;
333 f <<
dot(dphi) == ddphi ;
334 f <<
dot(dtheta) == ddtheta ;
336 f <<
dot(Psi) == dPsi ;
337 f <<
dot(CL) == dCL ;
338 f <<
dot(W) == (-power + regularisation)*1.0e-6;
343 OCP ocp( 0.0, 18.0, 18 );
358 ocp.
subjectTo( 0.0, theta , -theta , 0.0 );
360 ocp.
subjectTo( 0.0, dphi , -dphi , 0.0 );
361 ocp.
subjectTo( 0.0, dtheta, -dtheta, 0.0 );
372 ocp.
subjectTo( -0.065 <= dPsi <= 0.065 );
381 window.
addSubplot( phi,
"POSITION ANGLE phi [rad]" );
382 window.
addSubplot( theta,
"POSITION ANGLE theta [rad]" );
383 window.
addSubplot( Psi,
"ROLL ANGLE psi [rad]" );
384 window.
addSubplot( CL,
"LIFT COEFFICIENT CL" );
386 window.
addSubplot( F[0],
"FORCE IN CABLE [N]" );
387 window.
addSubplot( phi,theta,
"Kite Orbit",
"theta [rad]",
"phi [rad]" );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
returnValue initializeControls(const char *fileName)
User-interface to formulate and solve optimal control problems and static NLPs.
#define USING_NAMESPACE_ACADO
IntermediateState asin(const Expression &arg)
IntermediateState pow(const Expression &arg1, const Expression &arg2)
IntermediateState tan(const Expression &arg)
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue minimizeMayerTerm(const Expression &arg)
returnValue addSubplot(PlotWindowSubplot &_subplot)
IntermediateState cos(const Expression &arg)
returnValue set(OptionsName name, int value)
returnValue initializeDifferentialStates(const char *fileName, BooleanType autoinit=BT_FALSE)
Data class for defining optimal control problems.
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.
IntermediateState log(const Expression &arg)