37 #define round( value ) floor( value + 0.5 ) 217 Grid dummy( 0.0, 1.0 );
219 addStage( _dynamicSystem, dummy, _integratorType );
309 Curve _processDisturbanceCurve;
310 _processDisturbanceCurve.
add( _processDisturbance );
320 _processDisturbanceFromFile.
read( _processDisturbance );
336 if ( _xaStart.
getDim( ) > 0 )
365 if ( _xStart.
getDim( ) > 0 )
382 if ( _uStart.
getDim( ) > 0 )
390 if ( _pStart.
getDim( ) > 0 )
400 uStart.
print(
"uStart(0)");
471 Grid currentGrid( 1 );
472 currentGrid.
setTime( _startTime );
557 Grid commonGrid, tmpGrid;
564 commonGrid & tmpGrid;
609 return step( _u,pTmp );
621 uTmp.setVector( 1,_u );
625 pTmp.setVector( 1,_p );
627 return step( uTmp,pTmp );
643 return step( _u,_p );
655 return run( _u,pTmp );
667 uTmp.setVector( 1,_u );
671 pTmp.setVector( 1,_p );
673 return run( uTmp,pTmp );
681 int controlPlotting, parameterPlotting, outputPlotting;
779 const Grid &stageIntervals,
847 iter.
x->operator()( 0,(int)xComponents(i) ) =
x(i);
946 x(i) = iter.
x->operator()( iter.
x->
getNumPoints( )-1,(int)xComponents(i) );
1011 _outputFcn.
evaluate( _x,_xa,&pTmp,&uTmp,_w, _output );
1018 _output->
init( _xComponents.
getDim( ),outputGrid );
1034 for(
uint i=0; i<_xComponents.
getDim( ); ++i )
1035 _output(j,i) = _x( j,(
int)_xComponents(i) );
returnValue setTime(double _time)
Data class for storing generic optimization variables.
virtual returnValue replot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
virtual returnValue clear()
Curve * processDisturbance
const int defaultFeasibilityCheck
virtual returnValue evaluate(OCPiterate &iter)
returnValue addItem(LogName _name, const char *const _label=DEFAULT_LABEL)
returnValue setActuator(const Actuator &_actuator)
returnValue evaluate(double *x, double *_result)
const double defaultRelaxationParameter
IntegratorType integratorType
Allows to setup and evaluate output functions based on SymbolicExpressions.
virtual returnValue step(VariablesGrid &_y)
const double defaultMaxStepsize
double getSampleTime() const
double getFirstTime() const
BooleanType acadoIsEqual(double x, double y, double TOL)
returnValue addStage(const DynamicSystem &dynamicSystem_, const Grid &stageIntervals, const IntegratorType &integratorType_=INT_UNKNOWN)
Stores a DifferentialEquation together with an OutputFcn.
BooleanType hasActuator() const
DVector getDifferentialStateComponents() const
uint getNumDynamicEquations() const
virtual returnValue setupOptions()
returnValue evaluate(double t, double *result) const
returnValue setStatus(BlockStatus _status)
BooleanType isDefined() const
returnValue add(double tStart, double tEnd, const DVector constant)
void init(unsigned _dim=0)
Discretizes a DifferentialEquation by means of single or multiple shooting.
returnValue projectToComponents(const VariablesGrid &_x, const DVector &_xComponents, VariablesGrid &_output) const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
returnValue disableNominalParameters()
int addLogRecord(LogRecord &record)
BooleanType isDiscretized() const
Allows to pass back messages to the calling function.
returnValue print() const
uint getNU(uint stageIdx=0) const
BooleanType isInTimeDomain(double t) const
uint getNumOutputs() const
const double defaultStepsizeTuning
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
const double defaultMinStepsize
Allows to conveniently handle (one-dimensional) grids consisting of time points.
BooleanType isEmpty() const
const DifferentialEquation & getDifferentialEquation(uint stageIdx=0) const
Allows to simulate the behaviour of sensors within the Process.
const int defaultMaxNumSteps
BooleanType hasProcessDisturbance() const
virtual returnValue step(const VariablesGrid &_u, const VariablesGrid &_p=emptyVariablesGrid)
virtual returnValue setupLogging()
PlotCollection plotCollection
virtual returnValue replot(PlotFrequency _frequency=PLOT_IN_ANY_CASE)
#define CLOSE_NAMESPACE_ACADO
MatrixVariablesGrid getCoarsenedGrid(const Grid &arg) const
const double defaultIntegratorTolerance
returnValue initializeStartValues(const DVector &_xStart, const DVector &_xaStart=emptyConstVector)
MatrixVariablesGrid getRefinedGrid(const Grid &arg, InterpolationMode mode=IM_CONSTANT) const
returnValue setLast(LogName _name, const DMatrix &value, double time=-INFTY)
uint getNW(uint stageIdx=0) const
const int defaultIntegratorPrintlevel
returnValue calculateOutput(OutputFcn &_outputFcn, const VariablesGrid *_x, const DVector &_xComponents, const VariablesGrid *_xa, const VariablesGrid *_p, const VariablesGrid *_u, const VariablesGrid *_w, VariablesGrid *_output) const
BlockStatus getStatus() const
uint getNX(uint stageIdx=0) const
DynamicSystem ** dynamicSystems
returnValue initializeAlgebraicStates(const DVector &_xaStart)
Grid getTimePoints() const
returnValue enableSimulationMode()
Process & operator=(const Process &rhs)
BooleanType hasSensor() const
returnValue setVector(uint pointIdx, const DVector &_values)
Grid getUnionGrid() const
BEGIN_NAMESPACE_ACADO BooleanType acadoIsInteger(double x)
const OutputFcn & getOutputFcn(uint stageIdx=0) const
uint getNXA(uint stageIdx=0) const
DVector getFirstVector() const
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
returnValue getGrid(Grid &_grid) const
returnValue addDynamicSystemStage(const DynamicSystem &_dynamicSystem, IntegratorType _integratorType=INT_UNKNOWN)
const double defaultCorrectorTolerance
DVector getLastVector() const
returnValue refineGrid(const Grid &arg, InterpolationMode mode=IM_CONSTANT)
uint getNP(uint stageIdx=0) const
Derived & setZero(Index size)
Allows to work with piecewise-continous function defined over a scalar time interval.
void rhs(const real_t *x, real_t *f)
virtual returnValue init(double _startTime=0.0, const DVector &_startValueU=emptyConstVector, const DVector &_startValueP=emptyConstVector)
double getSamplingTime() const
const double defaultInitialStepsize
returnValue checkInputConsistency(const VariablesGrid &_u, const VariablesGrid &_p) const
virtual returnValue run(const VariablesGrid &_u, const VariablesGrid &_p=emptyVariablesGrid)
ShootingMethod * integrationMethod
BooleanType hasImplicitSwitches() const
const int defaultprintIntegratorProfile
returnValue read(std::istream &stream)
const int defaultAlgebraicRelaxation
const int defaultParameterPlotting
returnValue setProcessDisturbance(const Curve &_processDisturbance)
returnValue disableNominalOutputs()
uint getNumPoints() const
Base class for building-blocks of the SimulationEnvironment.
returnValue disableNominalControls()
uint getNumStages() const
BooleanType isDefined() const
DVector getVector(uint pointIdx) const
double getLastTime() const
Allows to setup and store user-specified log records of algorithmic information.
Simulates the process to be controlled based on a dynamic model.
#define BEGIN_NAMESPACE_ACADO
returnValue enableNominalParameters()
uint getNY(uint stageIdx=0) const
virtual returnValue init(double _startTime=0.0, const DVector &_startValue=emptyConstVector)
const int defaultControlPlotting
returnValue enableNominalOutputs()
const int defaultPlotResoltion
SimulationBlock & operator=(const SimulationBlock &rhs)
const int defaultLinearAlgebraSolver
Allows to simulate the behaviour of actuators within the Process.
returnValue addOption(OptionsName name, int value)
returnValue simulate(const VariablesGrid &_u, const VariablesGrid &_p, const VariablesGrid &_w)
virtual returnValue step(VariablesGrid &_u, VariablesGrid &_p=emptyVariablesGrid)
const int defaultOutputPlotting
uint getNumValues() const
virtual returnValue addStage(const DynamicSystem &dynamicSystem_, const Grid &stageIntervals, const IntegratorType &integratorType_=INT_UNKNOWN)
returnValue setDynamicSystem(const DynamicSystem &_dynamicSystem, IntegratorType _integratorType=INT_UNKNOWN)
const int defaultSimulationAlgorithm
returnValue enableNominalControls()
returnValue setSensor(const Sensor &_sensor)
#define ACADOERROR(retval)
returnValue getLast(LogName _name, DMatrix &lastValue) const
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.
virtual returnValue init(double _startTime=0.0, const DVector &_xStart=emptyConstVector, const DVector &_uStart=emptyConstVector, const DVector &_pStart=emptyConstVector)