46 #define NJ 1 // number of objective functions 47 #define NX 4 // number of differential states 48 #define NI 4 // number of initial value constraints 49 #define NE 2 // number of end-point / terminal constraints 50 #define NH 1 // number of inequality path constraints 61 f[1] = (x[2]-0.02*x[0]*x[0])/(1.0+x[1]);
62 f[2] = -0.01*x[2]*x[2];
126 x(0) =
v; x(1) = m; x(2) = u; x(3) =
L; x(4) = s;
131 OCP ocp( 0.0, 10.0 );
145 window1.
addSubplot( s,
"DifferentialState s" );
146 window1.
addSubplot( v,
"DifferentialState v" );
147 window1.
addSubplot( m,
"DifferentialState m" );
156 algorithm << window1;
User-interface to formulate and solve optimal control problems and static NLPs.
#define USING_NAMESPACE_ACADO
void myInitialValueConstraint(double *x, double *f, void *user_data)
void myObjectiveFunction(double *x, double *f, void *user_data)
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue minimizeMayerTerm(const Expression &arg)
returnValue addSubplot(PlotWindowSubplot &_subplot)
returnValue set(OptionsName name, int value)
Data class for defining optimal control problems.
void myInequalityPathConstraint(double *x, double *f, void *user_data)
USING_NAMESPACE_ACADO int main()
void myEndPointConstraint(double *x, double *f, void *user_data)
void myDifferentialEquation(double *x, double *f, void *user_data)
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.