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 60 double h = ((
double*) user_data)[0];
69 f[1] = v + h*(u-0.02*v*
v)/(1.0+m);
70 f[2] = m - h*0.01*u*u;
119 const double h = 0.01;
139 x(0) =
v; x(1) = m; x(2) = u; x(3) =
L; x(4) = s;
144 OCP ocp( 0.0, 10.0, 20 );
158 window1.
addSubplot( s,
"DifferentialState s" );
159 window1.
addSubplot( v,
"DifferentialState v" );
160 window1.
addSubplot( m,
"DifferentialState m" );
169 algorithm << window1;
User-interface to formulate and solve optimal control problems and static NLPs.
void myEndPointConstraint(double *x, double *f, void *user_data)
#define USING_NAMESPACE_ACADO
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue minimizeMayerTerm(const Expression &arg)
returnValue addSubplot(PlotWindowSubplot &_subplot)
Allows to setup and evaluate discretized differential equations based on SymbolicExpressions.
returnValue set(OptionsName name, int value)
void myObjectiveFunction(double *x, double *f, void *user_data)
void myInequalityPathConstraint(double *x, double *f, void *user_data)
USING_NAMESPACE_ACADO int main()
void myInitialValueConstraint(double *x, double *f, void *user_data)
virtual returnValue setUserData(void *user_data_)
Data class for defining optimal control problems.
void myDifferentialEquation(double *x, double *f, void *user_data)
Provides an interface to Gnuplot for plotting algorithmic outputs.
virtual returnValue solve()