ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions. More...
#include <differential_equation.hpp>
Public Member Functions | |
DifferentialEquation () | |
Default constructor. | |
DifferentialEquation (const double &tStart, const double &tEnd) | |
Default constructor. | |
DifferentialEquation (const double &tStart, const Parameter &tEnd) | |
Default constructor. | |
DifferentialEquation (const Parameter &tStart, const double &tEnd) | |
Default constructor. | |
DifferentialEquation (const Parameter &tStart, const Parameter &tEnd) | |
Default constructor. | |
DifferentialEquation (const DifferentialEquation &arg) | |
Copy constructor (deep copy). | |
virtual | ~DifferentialEquation () |
Destructor. | |
DifferentialEquation & | operator= (const DifferentialEquation &arg) |
Assignment operator (deep copy). | |
virtual DifferentialEquation * | clone () const |
Clone constructor (deep copy). | |
DifferentialEquation & | operator<< (const Expression &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | operator<< (const int &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | operator== (const Expression &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | operator== (const double &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | operator== (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
DifferentialEquation & | operator== (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
BooleanType | isDAE () const |
Ask whether the differential equation is a DAE. | |
BooleanType | isODE () const |
Ask whether the differential equation is a ODE. | |
BooleanType | isImplicit () const |
Ask whether the differential equation is given in implicit form. | |
virtual BooleanType | makeImplicit () |
Adds DifferentialStateDerivative if the differential equation is an ODE. | |
int | getNumDynamicEquations () const |
Returns the number of dynamic equations . | |
int | getNumAlgebraicEquations () const |
Returns the number of algebraic equations . | |
virtual BooleanType | isDiscretized () const |
Ask whether the differential equation is discretized (in time). | |
double | getStartTime () const |
Returns the start time of the horizon of the differential equation or -INFTY for the case that the start time is not defined. | |
double | getEndTime () const |
Returns the end time of the horizon of the differential equation or +INFTY for the case that the start time is not defined. | |
int | getStartTimeIdx () const |
Returns the index of the parameter associated with the start time of the time horizon of the differential equation or -1 for the that the start time is constant . | |
int | getEndTimeIdx () const |
Returns the index of the parameter associated with the start time of the time horizon of the differential equation or -1 for the that the start time is constant . | |
virtual double | getStepLength () const |
Always returns -INFTY in the time-continuous case. | |
int | getStateEnumerationIndex (int index_) |
Vector | getDifferentialStateComponents () const |
DifferentialEquation & | addDifferential (const Expression &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addDifferential (const double &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addAlgebraic (const Expression &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addAlgebraic (const double &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addDifferential (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
DifferentialEquation & | addAlgebraic (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
DifferentialEquation & | addDifferential (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
DifferentialEquation & | addAlgebraic (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
DifferentialEquation & | operator== (const Lyapunov &arg) |
Lyapunov | getLyapunovObject () const |
BooleanType | hasLyapunovEquation () const |
Expression | getODEexpansion (const int &order) const |
Returning an Expression that contains a Taylor expansion of the ODE-solution trajectory. | |
int * | getComponents () const |
Function & | operator<< (const double &arg) |
Loading Expressions (deep copy). | |
Function & | operator<< (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
Function & | operator<< (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
Function | operator() (uint idx) const |
Vector | operator() (const EvaluationPoint &x, const int &number=0) |
Redundant evaluation routine which is equivalent to to the evaluate routine above. | |
returnValue | getExpression (Expression &expression) const |
Operator * | getExpression (uint componentIdx) const |
Returns the symbolic expression of the given component of the function. | |
returnValue | reset () |
int | getDim () const |
Returns the dimension of the function . | |
int | getN () const |
Returns the number of intermediate expressions that have been detected in the function. | |
int | getN (VariableType &variableType_) const |
Returns the number of differential states . | |
int | getNX () const |
Returns the number of differential states . | |
int | getNXA () const |
Returns the number of algebraic states . | |
int | getNDX () const |
Returns the number of differential states derivatives . | |
int | getNU () const |
Returns the number of controls . | |
int | getNUI () const |
Returns the number of integer controls . | |
int | getNP () const |
Returns the number of parameters . | |
int | getNPI () const |
Returns the number of integer parameters . | |
int | getNW () const |
Returns the number of disturbances . | |
int | getNT () const |
Returns the number of time variables . | |
int | index (VariableType variableType_, int index_) const |
Returns the index of the variable with specified type and component. | |
double | scale (VariableType variableType_, int index_) const |
Returns the scale of a given variable. | |
int | getNumberOfVariables () const |
Returns the variable counter. | |
Vector | evaluate (const EvaluationPoint &x, const int &number=0) |
Evaluates the function. | |
template<typename T > | |
Tmatrix< T > | evaluate (const TevaluationPoint< T > &x) |
Evaluates the function at a templated evaluation point. | |
returnValue | evaluate (int number, double *x, double *_result) |
Evaluates the function and stores the intermediate results in a buffer (needed for automatic differentiation in backward mode) . | |
returnValue | substitute (VariableType variableType_, int index_, double sub_) |
Substitutes var(index) with the double sub. | |
NeutralElement | isOneOrZero () |
Checks whether the function is zero or one . | |
BooleanType | isDependingOn (const Expression &variable) |
Checks whether the function is depending on var(index) . | |
BooleanType | isLinearIn (const Expression &variable) |
Checks whether the function is linear in (or not depending on) var(index) . | |
BooleanType | isPolynomialIn (const Expression &variable) |
Checks whether the function is polynomial in the variable var(index) . | |
BooleanType | isRationalIn (const Expression &variable) |
Checks whether the function is rational in the variable var(index) . | |
BooleanType | isNondecreasing () |
Checks whether the function is nondecreasing. | |
BooleanType | isNonincreasing () |
Checks whether the function is nonincreasing. | |
BooleanType | isAffine () |
Checks whether the function is affine. | |
BooleanType | isConvex () |
Checks whether the function is convex. | |
BooleanType | isConcave () |
Checks whether the function is concave. | |
Vector | AD_forward (const EvaluationPoint &x, const int &number=0) |
Automatic Differentiation in forward mode. | |
returnValue | AD_forward (int number, double *seed, double *df) |
Automatic Differentiation in forward mode. | |
returnValue | AD_backward (const Vector &seed, EvaluationPoint &df, const int &number=0) |
Automatic Differentiation in backward mode. | |
returnValue | AD_backward (int number, double *seed, double *df) |
Automatic Differentiation in backward mode based on buffered values . | |
returnValue | AD_forward2 (int number, double *seed1, double *seed2, double *df, double *ddf) |
Automatic Differentiation in forward mode for 2nd derivatives. | |
returnValue | AD_backward2 (int number, double *seed1, double *seed2, double *df, double *ddf) |
Automatic Differentiation in backward mode for 2nd order derivatives based on buffered values. | |
returnValue | jacobian (Matrix &x) |
calculate the jacobian of an evaluated function | |
returnValue | print (FILE *file, const char *fcnName="ACADOfcn", const char *realString="double", int precision=16) const |
Prints the function in form of plain C-code into a file. | |
returnValue | exportHeader (FILE *file, const char *fcnName="ACADOfcn", const char *realString="double") const |
returnValue | exportForwardDeclarations (FILE *file, const char *fcnName="ACADOfcn", const char *realString="double") const |
returnValue | exportCode (FILE *file, const char *fcnName="ACADOfcn", const char *realString="double", int precision=16, uint _numX=0, uint _numXA=0, uint _numU=0, uint _numP=0, uint _numDX=0) const |
returnValue | clearBuffer () |
Clears the buffer and resets the buffer size to 1. | |
returnValue | setScale (double *scale_) |
Defines a scale for the case that a C-function is used . | |
BooleanType | isSymbolic () const |
Returns whether the function is symbolic or not. | |
BooleanType | ADisSupported () const |
returnValue | setMemoryOffset (int memoryOffset_) |
returnValue | setGlobalExportVariableName (const String &var) |
Set name of the variable that holds intermediate values. | |
String | getGlobalExportVariableName () const |
Get name of the variable that holds intermediate values. | |
unsigned | getGlobalExportVariableSize () const |
Get size of the variable that holds intermediate values. | |
Protected Member Functions | |
void | setup () |
Setup routine (for internal use only) | |
void | copy (const DifferentialEquation &arg) |
Protected version of the copy constructor. | |
Protected Attributes | |
DifferentialEquationType | det |
BooleanType | is_implicit |
BooleanType | is_discretized |
int | counter |
int * | component |
Parameter * | T1 |
Parameter * | T2 |
double | t1 |
double | t2 |
double | stepLength |
Lyapunov | lyap |
FunctionEvaluationTree | evaluationTree |
int | memoryOffset |
double * | result |
Friends | |
returnValue | operator<< (FILE *file, Function &arg) |
Prints the function into a file. |
The class DifferentialEquation allows to setup and evaluate differential equations (ODEs and DAEs) based on SymbolicExpressions.
DifferentialEquation::DifferentialEquation | ( | const double & | tStart, |
const double & | tEnd | ||
) |
DifferentialEquation::DifferentialEquation | ( | const double & | tStart, |
const Parameter & | tEnd | ||
) |
DifferentialEquation::DifferentialEquation | ( | const Parameter & | tStart, |
const double & | tEnd | ||
) |
DifferentialEquation::DifferentialEquation | ( | const Parameter & | tStart, |
const Parameter & | tEnd | ||
) |
DifferentialEquation::DifferentialEquation | ( | const DifferentialEquation & | arg | ) |
References copy().
DifferentialEquation::~DifferentialEquation | ( | ) | [virtual] |
returnValue Function::AD_backward | ( | const Vector & | seed, |
EvaluationPoint & | df, | ||
const int & | number = 0 |
||
) | [inherited] |
seed | the backward seed |
df | the directional derivative (output) |
number | the storage position |
References Function::AD_forward(), Function::ADisSupported(), BT_TRUE, Function::getDim(), VectorspaceElement::getDim(), EvaluationPoint::getEvaluationPointer(), Function::getNumberOfVariables(), SUCCESSFUL_RETURN, uint, and EvaluationPoint::z.
Referenced by Integrator::diffTransitionBackward(), MayerTerm::evaluateSensitivities(), LSQTerm::evaluateSensitivities(), LSQTerm::evaluateSensitivitiesGN(), LSQEndTerm::evaluateSensitivitiesGN(), and Function::jacobian().
returnValue Function::AD_backward | ( | int | number, |
double * | seed, | ||
double * | df | ||
) | [inherited] |
number | the buffer position |
seed | the seed |
df | the derivative of the expression |
References FunctionEvaluationTree::AD_backward(), Function::evaluationTree, and Function::memoryOffset.
returnValue Function::AD_backward2 | ( | int | number, |
double * | seed1, | ||
double * | seed2, | ||
double * | df, | ||
double * | ddf | ||
) | [inherited] |
IMPORTANT REMARK: run AD_forward first to define
the point x and to compute f and df.
number | the buffer position |
seed1 | the seed1 |
seed2 | the seed2 |
df | the 1st derivative of the expression |
ddf | the 2nd derivative of the expression |
References FunctionEvaluationTree::AD_backward2(), Function::evaluationTree, and Function::memoryOffset.
Referenced by MayerTerm::evaluateSensitivities().
Vector Function::AD_forward | ( | const EvaluationPoint & | x, |
const int & | number = 0 |
||
) | [inherited] |
x | the evaluation point |
number | the storage position |
References Function::getDim(), EvaluationPoint::getEvaluationPointer(), and Function::result.
Referenced by Function::AD_backward(), Integrator::diffTransitionForward(), MayerTerm::evaluateSensitivities(), and LSQTerm::evaluateSensitivitiesGN().
returnValue Function::AD_forward | ( | int | number, |
double * | seed, | ||
double * | df | ||
) | [inherited] |
This function uses the intermediate
results from a buffer
number | storage position |
seed | the seed |
df | the derivative of the expression |
References FunctionEvaluationTree::AD_forward(), Function::evaluationTree, and Function::memoryOffset.
returnValue Function::AD_forward2 | ( | int | number, |
double * | seed1, | ||
double * | seed2, | ||
double * | df, | ||
double * | ddf | ||
) | [inherited] |
This function uses intermediate
results from a buffer.
number | the buffer position |
seed1 | the seed |
seed2 | the seed for the first derivative |
df | the derivative of the expression |
ddf | the 2nd derivative of the expression |
References FunctionEvaluationTree::AD_forward2(), Function::evaluationTree, and Function::memoryOffset.
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const Expression & | arg | ) |
References det, DET_DAE, and operator<<().
Referenced by addAlgebraic(), NewtonEulerFormalism(), and operator==().
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const double & | arg | ) |
References ACADOWARNING, det, DET_DAE, EPS, fabs(), and RET_INFEASIBLE_ALGEBRAIC_CONSTRAINT.
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const Vector & | arg | ) |
References addAlgebraic(), VectorspaceElement::getDim(), and uint.
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const Matrix & | arg | ) |
References addAlgebraic(), Matrix::getNumCols(), Matrix::getNumRows(), and uint.
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Expression & | arg | ) |
References BT_TRUE, det, DET_DAE, DET_ODE, Expression::isDependingOn(), operator<<(), T1, t1, T2, t2, and VT_DDIFFERENTIAL_STATE.
Referenced by addDifferential(), operator<<(), and operator==().
DifferentialEquation & DifferentialEquation::addDifferential | ( | const double & | arg | ) |
References addDifferential().
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Vector & | arg | ) |
References addDifferential(), VectorspaceElement::getDim(), and uint.
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Matrix & | arg | ) |
References addDifferential(), Matrix::getNumCols(), Matrix::getNumRows(), and uint.
BooleanType Function::ADisSupported | ( | ) | const [inline, inherited] |
References Function::isSymbolic().
Referenced by Function::AD_backward(), and LSQTerm::evaluateSensitivitiesGN().
returnValue Function::clearBuffer | ( | ) | [inherited] |
References FunctionEvaluationTree::clearBuffer(), and Function::evaluationTree.
DifferentialEquation * DifferentialEquation::clone | ( | ) | const [virtual] |
Reimplemented in DiscretizedDifferentialEquation.
References DifferentialEquation().
Referenced by DynamicSystem::addSubsystem(), DynamicSystem::DynamicSystem(), and DynamicSystem::operator=().
void DifferentialEquation::copy | ( | const DifferentialEquation & | arg | ) | [protected] |
References component, counter, det, is_discretized, is_implicit, lyap, stepLength, T1, t1, T2, and t2.
Referenced by DifferentialEquation(), and operator=().
Vector Function::evaluate | ( | const EvaluationPoint & | x, |
const int & | number = 0 |
||
) | [inherited] |
x | the evaluation point |
number | the storage position |
Reimplemented in OutputFcn.
References Function::getDim(), EvaluationPoint::getEvaluationPointer(), and Function::result.
Referenced by OutputFcn::evaluate(), PointConstraint::evaluate(), BoundaryConstraint::evaluate(), CoupledPathConstraint::evaluate(), PathConstraint::evaluate(), MayerTerm::evaluate(), LSQTerm::evaluate(), LSQEndTerm::evaluate(), AlgebraicConsistencyConstraint::evaluate(), Curve::evaluate(), IntegratorBDF::evaluate(), Integrator::evaluateTransition(), Expression::getDependencyPattern(), Function::operator()(), ExportNLPSolver::setConstraints(), and ExportNLPSolver::setObjective().
Tmatrix< T > Function::evaluate | ( | const TevaluationPoint< T > & | x | ) | [inherited] |
x | the evaluation point |
References FunctionEvaluationTree::evaluate(), Function::evaluationTree, Function::getDim(), and TevaluationPoint< T >::getEvaluationPointer().
returnValue Function::evaluate | ( | int | number, |
double * | x, | ||
double * | _result | ||
) | [inherited] |
number | storage position |
x | the input variable x |
_result | the result |
References FunctionEvaluationTree::evaluate(), Function::evaluationTree, Function::memoryOffset, and SUCCESSFUL_RETURN.
returnValue Function::exportCode | ( | FILE * | file, |
const char * | fcnName = "ACADOfcn" , |
||
const char * | realString = "double" , |
||
int | precision = 16 , |
||
uint | _numX = 0 , |
||
uint | _numXA = 0 , |
||
uint | _numU = 0 , |
||
uint | _numP = 0 , |
||
uint | _numDX = 0 |
||
) | const [inherited] |
returnValue Function::exportForwardDeclarations | ( | FILE * | file, |
const char * | fcnName = "ACADOfcn" , |
||
const char * | realString = "double" |
||
) | const [inherited] |
returnValue Function::exportHeader | ( | FILE * | file, |
const char * | fcnName = "ACADOfcn" , |
||
const char * | realString = "double" |
||
) | const [inherited] |
int * DifferentialEquation::getComponents | ( | ) | const [inline] |
References component.
Referenced by EllipsoidalIntegrator::init().
Vector DifferentialEquation::getDifferentialStateComponents | ( | ) | const [inline] |
BEGIN_NAMESPACE_ACADO int Function::getDim | ( | ) | const [inline, inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getDim().
Referenced by Function::AD_backward(), Function::AD_forward(), PointConstraint::add(), CoupledPathConstraint::add(), BoundaryConstraint::add(), PathConstraint::add(), Curve::add(), PointConstraint::computeForwardSensitivityBlock(), AlgebraicConsistencyConstraint::computeForwardSensitivityBlock(), ConstraintElement::ConstraintElement(), OutputFcn::evaluate(), PointConstraint::evaluate(), PathConstraint::evaluate(), LSQTerm::evaluate(), LSQEndTerm::evaluate(), Function::evaluate(), PointConstraint::evaluateSensitivities(), LSQTerm::evaluateSensitivities(), PathConstraint::evaluateSensitivities(), AlgebraicConsistencyConstraint::evaluateSensitivities(), LSQTerm::evaluateSensitivitiesGN(), LSQEndTerm::evaluateSensitivitiesGN(), Function::exportCode(), Function::exportForwardDeclarations(), Function::exportHeader(), Function::Function(), ConstraintElement::get(), Integrator::getBackwardSensitivities(), Expression::getDependencyPattern(), PathConstraint::getDim(), BoundaryConstraint::getNC(), PointConstraint::getNC(), CoupledPathConstraint::getNC(), getNumDynamicEquations(), DynamicSystem::getNumOutputs(), Integrator::getX(), Integrator::getXA(), ModelData::hasDifferentialEquation(), ModelContainer::hasDifferentialEquation(), IntegratorBDF::init(), IntegratorRK::init(), IntegratorLYAPUNOV::init(), EllipsoidalIntegrator::init(), Integrator::integrate(), Integrator::integrateSensitivities(), DynamicSystem::isConsistentOutputFcn(), Function::jacobian(), LSQEndTerm::LSQEndTerm(), LSQTerm::LSQTerm(), makeImplicit(), OCP::minimizeLSQ(), OCP::minimizeLSQEndTerm(), Function::operator()(), Function::operator<<(), ConstraintElement::operator=(), Function::operator=(), LSQTerm::operator=(), LSQEndTerm::operator=(), Function::print(), ExportNLPSolver::setConstraints(), LSQTerm::setGrid(), IntegratorExport::setModelData(), and ExportNLPSolver::setObjective().
double DifferentialEquation::getEndTime | ( | ) | const [inline] |
int DifferentialEquation::getEndTimeIdx | ( | ) | const [inline] |
References Expression::getComponent(), and T2.
Referenced by ShootingMethod::addStage().
returnValue Function::getExpression | ( | Expression & | expression | ) | const [inherited] |
Operator * Function::getExpression | ( | uint | componentIdx | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getExpression().
String Function::getGlobalExportVariableName | ( | ) | const [inherited] |
unsigned Function::getGlobalExportVariableSize | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getGlobalExportVariableSize().
Referenced by ExportNLPSolver::setConstraints(), and ExportNLPSolver::setObjective().
References lyap.
Referenced by IntegratorLYAPUNOV::init().
int Function::getN | ( | ) | const [inline, inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getN().
Referenced by Function::getN(), IntegratorBDF::init(), IntegratorLYAPUNOV::init(), and IntegratorRK::init().
int Function::getN | ( | VariableType & | variableType_ | ) | const [inherited] |
References Function::evaluationTree, Function::getN(), Function::getNDX(), Function::getNP(), Function::getNPI(), Function::getNU(), Function::getNUI(), Function::getNW(), FunctionEvaluationTree::getNX(), Function::getNX(), Function::getNXA(), VT_ALGEBRAIC_STATE, VT_CONTROL, VT_DDIFFERENTIAL_STATE, VT_DIFFERENTIAL_STATE, VT_DISTURBANCE, VT_INTEGER_CONTROL, VT_INTEGER_PARAMETER, VT_INTERMEDIATE_STATE, VT_OUTPUT, VT_PARAMETER, VT_TIME, and VT_UNKNOWN.
int Function::getNDX | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNDX().
Referenced by IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), Function::getN(), IntegratorBDF::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), operator<<(), ExplicitRungeKuttaExport::setDifferentialEquation(), ImplicitRungeKuttaExport::setDifferentialEquation(), IntegratorExport::setLinearOutput(), NARXExport::setLinearOutput(), ModelData::setModel(), and ImplicitRungeKuttaExport::setupOutput().
int Function::getNP | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNP().
Referenced by Curve::add(), Function::getN(), ObjectiveElement::getNP(), IntegratorBDF::init(), IntegratorLYAPUNOV::init(), IntegratorRK::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Integrator::integrate(), ExportNLPSolver::setConstraints(), ModelData::setModel(), and EllipsoidalIntegrator::step().
int Function::getNPI | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNPI().
Referenced by Curve::add(), SIMexport::checkConsistency(), Function::getN(), IntegratorBDF::init(), IntegratorLYAPUNOV::init(), and IntegratorRK::init().
int Function::getNT | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNT().
Referenced by ExplicitRungeKuttaExport::setDifferentialEquation(), and ImplicitRungeKuttaExport::setDifferentialEquation().
int Function::getNU | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNU().
Referenced by Curve::add(), Function::getN(), ObjectiveElement::getNU(), IntegratorBDF::init(), IntegratorLYAPUNOV::init(), IntegratorRK::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Integrator::integrate(), ExportNLPSolver::setConstraints(), ModelData::setLinearOutput(), ModelData::setModel(), and ExportNLPSolver::setObjective().
int Function::getNUI | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNUI().
Referenced by Curve::add(), OCPexport::checkConsistency(), SIMexport::checkConsistency(), Function::getN(), IntegratorBDF::init(), IntegratorLYAPUNOV::init(), and IntegratorRK::init().
int DifferentialEquation::getNumAlgebraicEquations | ( | ) | const [inline] |
int Function::getNumberOfVariables | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNumberOfVariables().
Referenced by Function::AD_backward(), IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), IntegratorBDF::allocateMemory(), PointConstraint::computeForwardSensitivityBlock(), IntegratorRK::constructAll(), IntegratorLYAPUNOV::constructAll(), IntegratorBDF::constructAll(), IntegratorLYAPUNOV::determineEtaHBackward(), IntegratorRK::determineEtaHBackward(), IntegratorLYAPUNOV::determineEtaHBackward2(), IntegratorRK::determineEtaHBackward2(), MayerTerm::evaluateSensitivities(), PointConstraint::evaluateSensitivities(), BoundaryConstraint::evaluateSensitivities(), LSQTerm::evaluateSensitivities(), PathConstraint::evaluateSensitivities(), CoupledPathConstraint::evaluateSensitivities(), IntegratorLYAPUNOV::evaluateSensitivities(), IntegratorRK::evaluateSensitivities(), LSQTerm::evaluateSensitivitiesGN(), LSQEndTerm::evaluateSensitivitiesGN(), Expression::getDependencyPattern(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Function::jacobian(), IntegratorDiscretizedODE::performADbackwardStep(), IntegratorDiscretizedODE::performADbackwardStep2(), IntegratorLYAPUNOV::setBackwardSeed2(), IntegratorRK::setBackwardSeed2(), IntegratorLYAPUNOV::setForwardSeed2(), IntegratorRK::setForwardSeed2(), IntegratorLYAPUNOV::setProtectedBackwardSeed(), IntegratorRK::setProtectedBackwardSeed(), IntegratorLYAPUNOV::setProtectedForwardSeed(), and IntegratorRK::setProtectedForwardSeed().
BEGIN_NAMESPACE_ACADO int DifferentialEquation::getNumDynamicEquations | ( | ) | const [inline] |
References Function::getDim(), and getNumAlgebraicEquations().
Referenced by AlgebraicConsistencyConstraint::add(), ModelData::addOutput(), OptimizationAlgorithmBase::determineDimensions(), getDifferentialStateComponents(), DynamicSystem::getNumDynamicEquations(), DynamicSystem::getNumOutputs(), getStateEnumerationIndex(), IntegratorBDF::init(), DynamicSystem::isConsistentDiffEqn(), and ModelData::setModel().
int Function::getNW | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNW().
Referenced by Curve::add(), SIMexport::checkConsistency(), Function::getN(), ObjectiveElement::getNW(), IntegratorBDF::init(), IntegratorRK::init(), IntegratorLYAPUNOV::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Integrator::integrate(), and EllipsoidalIntegrator::step().
int Function::getNX | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNX().
Referenced by Curve::add(), Function::getN(), ObjectiveElement::getNX(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Function::jacobian(), ExportNLPSolver::setConstraints(), and ExportNLPSolver::setObjective().
int Function::getNXA | ( | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getNXA().
Referenced by Curve::add(), ShootingMethod::addTransition(), IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), Function::getN(), getNumAlgebraicEquations(), ObjectiveElement::getNXA(), IntegratorBDF::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Integrator::integrate(), DynamicSystem::isConsistentOutputFcn(), IntegratorExport::setLinearOutput(), NARXExport::setLinearOutput(), ModelData::setModel(), and ImplicitRungeKuttaExport::setupOutput().
Expression DifferentialEquation::getODEexpansion | ( | const int & | order | ) | const |
order | the order of Taylor expansion. |
References ACADOERROR, component, Function::getExpression(), Expression::getODEexpansion(), and RET_INDEX_OUT_OF_BOUNDS.
Referenced by EllipsoidalIntegrator::init().
double DifferentialEquation::getStartTime | ( | ) | const [inline] |
int DifferentialEquation::getStartTimeIdx | ( | ) | const [inline] |
References Expression::getComponent(), and T1.
Referenced by ShootingMethod::addStage().
int DifferentialEquation::getStateEnumerationIndex | ( | int | index_ | ) | [inline] |
References ASSERT, component, counter, getNumDynamicEquations(), Function::index(), and VT_DIFFERENTIAL_STATE.
Referenced by IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), and IntegratorBDF::allocateMemory().
double DifferentialEquation::getStepLength | ( | ) | const [virtual] |
References BT_FALSE, BT_TRUE, Lyapunov::isEmpty(), and lyap.
int Function::index | ( | VariableType | variableType_, |
int | index_ | ||
) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::index().
Referenced by IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), IntegratorBDF::allocateMemory(), IntegratorBDF::constructAll(), getStateEnumerationIndex(), ConstraintElement::init(), ObjectiveElement::init(), TevaluationPoint< T >::init(), EvaluationPoint::init(), Function::jacobian(), IntegratorBDF::rk_start(), IntegratorDiscretizedODE::step(), IntegratorBDF::step(), IntegratorLYAPUNOV::step(), and IntegratorRK::step().
BooleanType Function::isAffine | ( | ) | [inherited] |
References BT_FALSE, BT_TRUE, Function::isConcave(), and Function::isConvex().
Referenced by Integrator::isDifferentialEquationAffine(), LSQTerm::isQuadratic(), and LSQEndTerm::isQuadratic().
BooleanType Function::isConcave | ( | ) | [inherited] |
References BT_FALSE, BT_TRUE, CT_AFFINE, CT_CONCAVE, CT_CONSTANT, Function::evaluationTree, and FunctionEvaluationTree::getCurvature().
Referenced by Function::isAffine().
BooleanType Function::isConvex | ( | ) | [inherited] |
References BT_FALSE, BT_TRUE, CT_AFFINE, CT_CONSTANT, CT_CONVEX, Function::evaluationTree, and FunctionEvaluationTree::getCurvature().
Referenced by Function::isAffine().
BooleanType DifferentialEquation::isDAE | ( | ) | const |
References BT_FALSE, BT_TRUE, and getNumAlgebraicEquations().
Referenced by DynamicSystem::isDAE().
BooleanType Function::isDependingOn | ( | const Expression & | variable | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isDependingOn().
BooleanType DifferentialEquation::isDiscretized | ( | ) | const [virtual] |
BooleanType DifferentialEquation::isImplicit | ( | ) | const [inline] |
References is_implicit.
BooleanType Function::isLinearIn | ( | const Expression & | variable | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isLinearIn().
BooleanType Function::isNondecreasing | ( | ) | [inherited] |
References BT_FALSE, BT_TRUE, Function::evaluationTree, FunctionEvaluationTree::getMonotonicity(), MT_CONSTANT, and MT_NONDECREASING.
BooleanType Function::isNonincreasing | ( | ) | [inherited] |
References BT_FALSE, BT_TRUE, Function::evaluationTree, FunctionEvaluationTree::getMonotonicity(), MT_CONSTANT, and MT_NONINCREASING.
BooleanType DifferentialEquation::isODE | ( | ) | const |
References BT_FALSE, BT_TRUE, and getNumAlgebraicEquations().
Referenced by EllipsoidalIntegrator::EllipsoidalIntegrator(), EllipsoidalIntegrator::init(), and DynamicSystem::isODE().
NeutralElement Function::isOneOrZero | ( | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isOneOrZero().
Referenced by ExportNLPSolver::setObjective().
BooleanType Function::isPolynomialIn | ( | const Expression & | variable | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isPolynomialIn().
BooleanType Function::isRationalIn | ( | const Expression & | variable | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isRationalIn().
BooleanType Function::isSymbolic | ( | ) | const [inline, inherited] |
If BT_TRUE
is returned, automatic differentiation will be used by
default.
References Function::evaluationTree, and FunctionEvaluationTree::isSymbolic().
Referenced by Function::ADisSupported(), LSQTerm::isQuadratic(), and Function::substitute().
returnValue Function::jacobian | ( | Matrix & | x | ) | [inherited] |
Calculates the matrix diff(fun(x,u,v,p,q,w),x)
x | will be assigned jacobian(fun,differential states) |
References Function::AD_backward(), Function::getDim(), Function::getNumberOfVariables(), Function::getNX(), Function::index(), VectorspaceElement::setAll(), SUCCESSFUL_RETURN, and VT_DIFFERENTIAL_STATE.
BooleanType DifferentialEquation::makeImplicit | ( | ) | [virtual] |
References BT_FALSE, BT_TRUE, Function::evaluationTree, Function::getDim(), getNumAlgebraicEquations(), is_implicit, and FunctionEvaluationTree::makeImplicit().
Referenced by IntegratorBDF::init().
Vector Function::operator() | ( | const EvaluationPoint & | x, |
const int & | number = 0 |
||
) | [inline, inherited] |
x | the evaluation point |
number | the storage position |
References Function::evaluate().
Function & Function::operator<< | ( | const double & | arg | ) | [inherited] |
References Function::operator<<().
References Function::operator<<().
References Function::operator<<().
DifferentialEquation & DifferentialEquation::operator<< | ( | const Expression & | arg | ) |
Reimplemented from Function.
References ACADOERROR, addDifferential(), ASSERT, BT_TRUE, component, counter, det, DET_DAE, Expression::getComponent(), Expression::getDim(), Function::getNDX(), Expression::getVariableType(), is_implicit, RET_INVALID_USE_OF_FUNCTION, uint, and VT_DDIFFERENTIAL_STATE.
Referenced by addAlgebraic(), and addDifferential().
DifferentialEquation & DifferentialEquation::operator<< | ( | const int & | arg | ) |
References ACADOWARNING, det, DET_DAE, and RET_INVALID_USE_OF_FUNCTION.
DifferentialEquation & DifferentialEquation::operator= | ( | const DifferentialEquation & | arg | ) |
DifferentialEquation & DifferentialEquation::operator== | ( | const Expression & | arg | ) |
References addAlgebraic(), addDifferential(), det, and DET_DAE.
Referenced by operator==().
DifferentialEquation & DifferentialEquation::operator== | ( | const double & | arg | ) |
References addAlgebraic(), addDifferential(), det, and DET_DAE.
DifferentialEquation & DifferentialEquation::operator== | ( | const Vector & | arg | ) |
References addAlgebraic(), addDifferential(), det, and DET_DAE.
DifferentialEquation & DifferentialEquation::operator== | ( | const Matrix & | arg | ) |
References addAlgebraic(), addDifferential(), det, and DET_DAE.
DifferentialEquation & DifferentialEquation::operator== | ( | const Lyapunov & | arg | ) |
References Lyapunov::A, Lyapunov::B, lyap, operator==(), Lyapunov::P, and Expression::transpose().
returnValue Function::print | ( | FILE * | file, |
const char * | fcnName = "ACADOfcn" , |
||
const char * | realString = "double" , |
||
int | precision = 16 |
||
) | const [inherited] |
The integer
"precision" must be in [1,16] and defines the number of internal decimal places
which occur in "double" - valued parts of the expression tree.
file | The file to which the expression should be printed. |
fcnName | The name of the generated function (default: "ACADOfcn"). |
precision | The number of internal dec. places to be printed (default: 16). |
References FunctionEvaluationTree::C_print(), Function::evaluationTree, Function::getDim(), and SUCCESSFUL_RETURN.
Referenced by operator<<().
returnValue Function::reset | ( | ) | [inherited] |
References Function::evaluationTree, Function::memoryOffset, Function::result, and SUCCESSFUL_RETURN.
double Function::scale | ( | VariableType | variableType_, |
int | index_ | ||
) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::scale().
Referenced by IntegratorLYAPUNOV::allocateMemory(), IntegratorRK::allocateMemory(), IntegratorBDF::allocateMemory(), and IntegratorBDF::constructAll().
returnValue Function::setGlobalExportVariableName | ( | const String & | var | ) | [inherited] |
returnValue Function::setMemoryOffset | ( | int | memoryOffset_ | ) | [inline, inherited] |
References Function::memoryOffset, and SUCCESSFUL_RETURN.
returnValue Function::setScale | ( | double * | scale_ | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::setScale().
void DifferentialEquation::setup | ( | ) | [protected] |
References BT_FALSE, component, counter, det, DET_UNKNOWN, INFTY, is_discretized, is_implicit, and stepLength.
Referenced by DifferentialEquation().
returnValue Function::substitute | ( | VariableType | variableType_, |
int | index_, | ||
double | sub_ | ||
) | [inherited] |
index_ | subst. index |
sub_ | the substitution |
References ACADOERROR, BT_TRUE, Function::evaluationTree, Function::isSymbolic(), RET_ONLY_SUPPORTED_FOR_SYMBOLIC_FUNCTIONS, FunctionEvaluationTree::substitute(), and SUCCESSFUL_RETURN.
returnValue operator<< | ( | FILE * | file, |
Function & | arg | ||
) | [friend, inherited] |
int* DifferentialEquation::component [protected] |
int DifferentialEquation::counter [protected] |
Referenced by copy(), getDifferentialStateComponents(), getStateEnumerationIndex(), operator<<(), and setup().
DifferentialEquationType DifferentialEquation::det [protected] |
Referenced by addAlgebraic(), addDifferential(), copy(), operator<<(), operator==(), and setup().
FunctionEvaluationTree Function::evaluationTree [protected, inherited] |
Referenced by Function::AD_backward(), Function::AD_backward2(), Function::AD_forward(), Function::AD_forward2(), Function::clearBuffer(), Function::evaluate(), Function::exportCode(), Function::exportForwardDeclarations(), Function::exportHeader(), Function::Function(), Function::getDim(), Function::getExpression(), Function::getGlobalExportVariableName(), Function::getGlobalExportVariableSize(), Function::getN(), Function::getNDX(), Function::getNP(), Function::getNPI(), Function::getNT(), Function::getNU(), Function::getNUI(), Function::getNumberOfVariables(), Function::getNW(), Function::getNX(), Function::getNXA(), Function::index(), Function::isConcave(), Function::isConvex(), OutputFcn::isDefined(), Function::isDependingOn(), Function::isLinearIn(), Function::isNondecreasing(), Function::isNonincreasing(), Function::isOneOrZero(), Function::isPolynomialIn(), Function::isRationalIn(), Function::isSymbolic(), makeImplicit(), Function::operator()(), Function::operator<<(), Function::operator=(), Function::print(), Function::reset(), Function::scale(), Function::setGlobalExportVariableName(), Function::setScale(), and Function::substitute().
BooleanType DifferentialEquation::is_discretized [protected] |
Referenced by copy(), DiscretizedDifferentialEquation::DiscretizedDifferentialEquation(), isDiscretized(), and setup().
BooleanType DifferentialEquation::is_implicit [protected] |
Referenced by copy(), isImplicit(), makeImplicit(), operator<<(), and setup().
Lyapunov DifferentialEquation::lyap [protected] |
Referenced by copy(), getLyapunovObject(), hasLyapunovEquation(), and operator==().
int Function::memoryOffset [protected, inherited] |
double* Function::result [protected, inherited] |
double DifferentialEquation::stepLength [protected] |
Referenced by copy(), DiscretizedDifferentialEquation::DiscretizedDifferentialEquation(), getStepLength(), and setup().
Parameter* DifferentialEquation::T1 [protected] |
Referenced by addDifferential(), copy(), DifferentialEquation(), getStartTime(), getStartTimeIdx(), operator=(), and ~DifferentialEquation().
double DifferentialEquation::t1 [protected] |
Referenced by addDifferential(), copy(), DifferentialEquation(), and getStartTime().
Parameter * DifferentialEquation::T2 [protected] |
Referenced by addDifferential(), copy(), DifferentialEquation(), getEndTime(), getEndTimeIdx(), operator=(), and ~DifferentialEquation().
double DifferentialEquation::t2 [protected] |
Referenced by addDifferential(), copy(), DifferentialEquation(), and getEndTime().