57 double kSpring = 20000.0;
58 double kTire = 200000.0;
65 f <<
dot(xBody) == vBody;
66 f <<
dot(xWheel) == vWheel;
67 f <<
dot(vBody) == ( -kSpring*xBody + kSpring*xWheel + dampingForce ) / mBody;
68 f <<
dot(vWheel) == ( -kTire*xBody - (kTire+kSpring)*xWheel + kTire*roadExcitation - dampingForce ) / mWheel;
93 const double t_end = 1.0;
95 OCP ocp( t_start, t_end, 20 );
107 ocp.
subjectTo( -500.0 <= dampingForce <= 500.0 );
113 window1.
addSubplot( xBody,
"Body Position [m]" );
114 window1.
addSubplot( xWheel,
"Wheel Position [m]" );
115 window1.
addSubplot( vBody,
"Body Velocity [m/s]" );
116 window1.
addSubplot( vWheel,
"Wheel Velocity [m/s]" );
118 window1.
addSubplot( dampingForce,
"Damping Force [N]" );
119 window1.
addSubplot( roadExcitation,
"Road Excitation [m]" );
126 algorithm << window1;
Allows to setup and evaluate a general function based on SymbolicExpressions.
User-interface to formulate and solve optimal control problems and static NLPs.
#define USING_NAMESPACE_ACADO
returnValue subjectTo(const DifferentialEquation &differentialEquation_)
returnValue addSubplot(PlotWindowSubplot &_subplot)
returnValue set(OptionsName name, int value)
returnValue minimizeLSQ(const DMatrix &S, const Function &h, const DVector &r)
Data class for defining optimal control problems.
Expression dot(const Expression &arg)
void setAll(const T &_value)
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.