41 void ffcn_model(
double *x,
double *f,
void *user_data ){
49 const double m = 1.0 ;
50 const double g = 9.81 ;
51 const double alpha = 2.0 ;
54 f[1] = -(m*g/l)*
sin(phi) - alpha*dphi + F/(m*l);
81 f << pendulumModel(x);
95 double x_start[2] = { 0.0, 0.0 };
96 double u_ [1] = { 1.0 };
97 double p_ [1] = { 1.0 };
107 integrator.
integrate( t_start, t_end, x_start, 0, p_, u_ );
136 integrator.
getX( differentialStates );
142 differentialStates.
print(
"x" );
USING_NAMESPACE_ACADO IntermediateState sin(const Expression &arg)
returnValue print(std::ostream &stream=std::cout, const char *const name=DEFAULT_LABEL, const char *const startString=DEFAULT_START_STRING, const char *const endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const char *const colSeparator=DEFAULT_COL_SEPARATOR, const char *const rowSeparator=DEFAULT_ROW_SEPARATOR) const
returnValue getX(DVector &xEnd) const
returnValue set(OptionsName name, int value)
USING_NAMESPACE_ACADO void ffcn_model(double *x, double *f, void *user_data)
#define USING_NAMESPACE_ACADO
Provides a time grid consisting of vector-valued optimization variables at each grid point...
returnValue setForwardSeed(const int &order, const DVector &xSeed, const DVector &pSeed=emptyVector, const DVector &uSeed=emptyVector, const DVector &wSeed=emptyVector)
virtual returnValue print(std::ostream &stream=std::cout, const std::string &name=DEFAULT_LABEL, const std::string &startString=DEFAULT_START_STRING, const std::string &endString=DEFAULT_END_STRING, uint width=DEFAULT_WIDTH, uint precision=DEFAULT_PRECISION, const std::string &colSeparator=DEFAULT_COL_SEPARATOR, const std::string &rowSeparator=DEFAULT_ROW_SEPARATOR) const
virtual returnValue freezeAll()
Implements the Runge-Kutta-45 scheme for integrating ODEs.
returnValue integrateSensitivities()
returnValue getForwardSensitivities(DVector &Dx, int order) const
returnValue integrate(double t0, double tend, double *x0, double *xa=0, double *p=0, double *u=0, double *w=0)
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.