ACADO Toolkit
1.2.0beta
Toolkit for Automatic Control and Dynamic Optimization
|
Allows to setup and evaluate discretized differential equations based on SymbolicExpressions. More...
#include <discretized_differential_equation.hpp>
Public Member Functions | |
DiscretizedDifferentialEquation () | |
Default constructor. | |
DiscretizedDifferentialEquation (const double &stepLength_) | |
Constructor, which is equivalent to the defaul constructor, but the step length can be defined. | |
DiscretizedDifferentialEquation (const DiscretizedDifferentialEquation &arg) | |
Copy constructor (deep copy). | |
virtual | ~DiscretizedDifferentialEquation () |
Destructor. | |
DiscretizedDifferentialEquation & | operator= (const DiscretizedDifferentialEquation &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). | |
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). | |
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). | |
DifferentialEquation & | operator== (const Lyapunov &arg) |
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 & | addDifferential (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
DifferentialEquation & | addDifferential (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
DifferentialEquation & | addAlgebraic (const Expression &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addAlgebraic (const double &arg) |
Loading Expressions (deep copy). | |
DifferentialEquation & | addAlgebraic (const Vector &arg) |
Loading Symbolic Vector (deep copy). | |
DifferentialEquation & | addAlgebraic (const Matrix &arg) |
Loading Symbolic Matrix (deep copy). | |
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() (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 DiscretizedDifferentialEquation allows to setup and evaluate discretized differential equations (ODEs and DAEs) based on SymbolicExpressions.
If this constructor is used a nonlinear
autonomous discrete time system will be set up, i.e. the class
represtents a system of the form
x_{k+1} = f( x_k, u_k, p, ... )
Here, the function f can be defined as usual with the
<< operator which is inherited form the class DifferentialEquation.
Note that this function will in general assume that the function
f is not explictly time dependent.
If this constructor is used, the step length will be 1 by default.
References BT_TRUE, DifferentialEquation::is_discretized, and DifferentialEquation::stepLength.
Referenced by clone().
DiscretizedDifferentialEquation::DiscretizedDifferentialEquation | ( | const double & | stepLength_ | ) |
References BT_TRUE, DifferentialEquation::is_discretized, and DifferentialEquation::stepLength.
DiscretizedDifferentialEquation::DiscretizedDifferentialEquation | ( | const DiscretizedDifferentialEquation & | arg | ) |
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 | ) | [inherited] |
References DifferentialEquation::det, DET_DAE, and DifferentialEquation::operator<<().
Referenced by DifferentialEquation::addAlgebraic(), NewtonEulerFormalism(), and DifferentialEquation::operator==().
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const double & | arg | ) | [inherited] |
References ACADOWARNING, DifferentialEquation::det, DET_DAE, EPS, fabs(), and RET_INFEASIBLE_ALGEBRAIC_CONSTRAINT.
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const Vector & | arg | ) | [inherited] |
References DifferentialEquation::addAlgebraic(), VectorspaceElement::getDim(), and uint.
DifferentialEquation & DifferentialEquation::addAlgebraic | ( | const Matrix & | arg | ) | [inherited] |
References DifferentialEquation::addAlgebraic(), Matrix::getNumCols(), Matrix::getNumRows(), and uint.
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Expression & | arg | ) | [inherited] |
References BT_TRUE, DifferentialEquation::det, DET_DAE, DET_ODE, Expression::isDependingOn(), DifferentialEquation::operator<<(), DifferentialEquation::T1, DifferentialEquation::t1, DifferentialEquation::T2, DifferentialEquation::t2, and VT_DDIFFERENTIAL_STATE.
Referenced by DifferentialEquation::addDifferential(), DifferentialEquation::operator<<(), and DifferentialEquation::operator==().
DifferentialEquation & DifferentialEquation::addDifferential | ( | const double & | arg | ) | [inherited] |
References DifferentialEquation::addDifferential().
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Vector & | arg | ) | [inherited] |
References DifferentialEquation::addDifferential(), VectorspaceElement::getDim(), and uint.
DifferentialEquation & DifferentialEquation::addDifferential | ( | const Matrix & | arg | ) | [inherited] |
References DifferentialEquation::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 * DiscretizedDifferentialEquation::clone | ( | ) | const [virtual] |
Reimplemented from DifferentialEquation.
References DiscretizedDifferentialEquation().
void DifferentialEquation::copy | ( | const DifferentialEquation & | arg | ) | [protected, inherited] |
References DifferentialEquation::component, DifferentialEquation::counter, DifferentialEquation::det, DifferentialEquation::is_discretized, DifferentialEquation::is_implicit, DifferentialEquation::lyap, DifferentialEquation::stepLength, DifferentialEquation::T1, DifferentialEquation::t1, DifferentialEquation::T2, and DifferentialEquation::t2.
Referenced by DifferentialEquation::DifferentialEquation(), and DifferentialEquation::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, inherited] |
References DifferentialEquation::component.
Referenced by EllipsoidalIntegrator::init().
Vector DifferentialEquation::getDifferentialStateComponents | ( | ) | const [inline, inherited] |
References ASSERT, DifferentialEquation::component, DifferentialEquation::counter, and DifferentialEquation::getNumDynamicEquations().
Referenced by Integrator::getBackwardSensitivities(), Integrator::getX(), Integrator::integrate(), Integrator::integrateSensitivities(), Integrator::setBackwardSeed(), Integrator::setForwardSeed(), and Process::simulate().
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(), PointConstraint::getNC(), BoundaryConstraint::getNC(), CoupledPathConstraint::getNC(), DifferentialEquation::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(), DifferentialEquation::makeImplicit(), OCP::minimizeLSQ(), OCP::minimizeLSQEndTerm(), Function::operator()(), Function::operator<<(), Function::operator=(), ConstraintElement::operator=(), LSQTerm::operator=(), LSQEndTerm::operator=(), Function::print(), ExportNLPSolver::setConstraints(), LSQTerm::setGrid(), IntegratorExport::setModelData(), and ExportNLPSolver::setObjective().
double DifferentialEquation::getEndTime | ( | ) | const [inline, inherited] |
References INFTY, DifferentialEquation::T2, and DifferentialEquation::t2.
Referenced by ShootingMethod::addStage().
int DifferentialEquation::getEndTimeIdx | ( | ) | const [inline, inherited] |
References Expression::getComponent(), and DifferentialEquation::T2.
Referenced by ShootingMethod::addStage().
returnValue Function::getExpression | ( | Expression & | expression | ) | const [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::getExpression().
Referenced by ModelData::addOutput(), DifferentialEquation::getODEexpansion(), OutputFcn::operator()(), ExportNLPSolver::setConstraints(), ModelData::setModel(), IntegratorExport::setModelData(), and ExportNLPSolver::setObjective().
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().
Lyapunov DifferentialEquation::getLyapunovObject | ( | ) | const [inherited] |
References DifferentialEquation::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(), DifferentialEquation::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, inherited] |
References Function::getNXA().
Referenced by AlgebraicConsistencyConstraint::add(), DynamicSystem::getNumAlgebraicEquations(), DifferentialEquation::getNumDynamicEquations(), DynamicSystem::isConsistentDiffEqn(), DifferentialEquation::isDAE(), DifferentialEquation::isODE(), and DifferentialEquation::makeImplicit().
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(), LSQTerm::evaluateSensitivities(), PointConstraint::evaluateSensitivities(), BoundaryConstraint::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(), IntegratorRK::setBackwardSeed2(), IntegratorLYAPUNOV::setBackwardSeed2(), IntegratorRK::setForwardSeed2(), IntegratorLYAPUNOV::setForwardSeed2(), IntegratorRK::setProtectedBackwardSeed(), IntegratorLYAPUNOV::setProtectedBackwardSeed(), IntegratorLYAPUNOV::setProtectedForwardSeed(), and IntegratorRK::setProtectedForwardSeed().
BEGIN_NAMESPACE_ACADO int DifferentialEquation::getNumDynamicEquations | ( | ) | const [inline, inherited] |
References Function::getDim(), and DifferentialEquation::getNumAlgebraicEquations().
Referenced by AlgebraicConsistencyConstraint::add(), ModelData::addOutput(), OptimizationAlgorithmBase::determineDimensions(), DifferentialEquation::getDifferentialStateComponents(), DynamicSystem::getNumDynamicEquations(), DynamicSystem::getNumOutputs(), DifferentialEquation::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(), IntegratorLYAPUNOV::init(), IntegratorRK::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(), IntegratorRK::allocateMemory(), IntegratorLYAPUNOV::allocateMemory(), Function::getN(), DifferentialEquation::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 [inherited] |
order | the order of Taylor expansion. |
References ACADOERROR, DifferentialEquation::component, Function::getExpression(), Expression::getODEexpansion(), and RET_INDEX_OUT_OF_BOUNDS.
Referenced by EllipsoidalIntegrator::init().
double DifferentialEquation::getStartTime | ( | ) | const [inline, inherited] |
References INFTY, DifferentialEquation::T1, and DifferentialEquation::t1.
Referenced by ShootingMethod::addStage().
int DifferentialEquation::getStartTimeIdx | ( | ) | const [inline, inherited] |
References Expression::getComponent(), and DifferentialEquation::T1.
Referenced by ShootingMethod::addStage().
int DifferentialEquation::getStateEnumerationIndex | ( | int | index_ | ) | [inline, inherited] |
double DifferentialEquation::getStepLength | ( | ) | const [virtual, inherited] |
BooleanType DifferentialEquation::hasLyapunovEquation | ( | ) | const [inherited] |
References BT_FALSE, BT_TRUE, Lyapunov::isEmpty(), and DifferentialEquation::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(), DifferentialEquation::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(), LSQEndTerm::isQuadratic(), and LSQTerm::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 [inherited] |
References BT_FALSE, BT_TRUE, and DifferentialEquation::getNumAlgebraicEquations().
Referenced by DynamicSystem::isDAE().
BooleanType Function::isDependingOn | ( | const Expression & | variable | ) | [inherited] |
References Function::evaluationTree, and FunctionEvaluationTree::isDependingOn().
BooleanType DifferentialEquation::isDiscretized | ( | ) | const [virtual, inherited] |
BooleanType DifferentialEquation::isImplicit | ( | ) | const [inline, inherited] |
References DifferentialEquation::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 [inherited] |
References BT_FALSE, BT_TRUE, and DifferentialEquation::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, inherited] |
References BT_FALSE, BT_TRUE, Function::evaluationTree, Function::getDim(), DifferentialEquation::getNumAlgebraicEquations(), DifferentialEquation::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 | ) | [inherited] |
Reimplemented from Function.
References ACADOERROR, DifferentialEquation::addDifferential(), ASSERT, BT_TRUE, DifferentialEquation::component, DifferentialEquation::counter, DifferentialEquation::det, DET_DAE, Expression::getComponent(), Expression::getDim(), Function::getNDX(), Expression::getVariableType(), DifferentialEquation::is_implicit, RET_INVALID_USE_OF_FUNCTION, uint, and VT_DDIFFERENTIAL_STATE.
Referenced by DifferentialEquation::addAlgebraic(), and DifferentialEquation::addDifferential().
DifferentialEquation & DifferentialEquation::operator<< | ( | const int & | arg | ) | [inherited] |
References ACADOWARNING, DifferentialEquation::det, DET_DAE, and RET_INVALID_USE_OF_FUNCTION.
DiscretizedDifferentialEquation & DiscretizedDifferentialEquation::operator= | ( | const DiscretizedDifferentialEquation & | arg | ) |
DifferentialEquation & DifferentialEquation::operator== | ( | const Expression & | arg | ) | [inherited] |
References DifferentialEquation::addAlgebraic(), DifferentialEquation::addDifferential(), DifferentialEquation::det, and DET_DAE.
Referenced by DifferentialEquation::operator==().
DifferentialEquation & DifferentialEquation::operator== | ( | const double & | arg | ) | [inherited] |
DifferentialEquation & DifferentialEquation::operator== | ( | const Vector & | arg | ) | [inherited] |
DifferentialEquation & DifferentialEquation::operator== | ( | const Matrix & | arg | ) | [inherited] |
DifferentialEquation & DifferentialEquation::operator== | ( | const Lyapunov & | arg | ) | [inherited] |
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, inherited] |
References BT_FALSE, DifferentialEquation::component, DifferentialEquation::counter, DifferentialEquation::det, DET_UNKNOWN, INFTY, DifferentialEquation::is_discretized, DifferentialEquation::is_implicit, and DifferentialEquation::stepLength.
Referenced by DifferentialEquation::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, inherited] |
Referenced by DifferentialEquation::copy(), DifferentialEquation::getComponents(), DifferentialEquation::getDifferentialStateComponents(), DifferentialEquation::getODEexpansion(), DifferentialEquation::getStateEnumerationIndex(), DifferentialEquation::operator<<(), DifferentialEquation::operator=(), DifferentialEquation::setup(), and DifferentialEquation::~DifferentialEquation().
int DifferentialEquation::counter [protected, inherited] |
DifferentialEquationType DifferentialEquation::det [protected, inherited] |
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(), DifferentialEquation::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, inherited] |
BooleanType DifferentialEquation::is_implicit [protected, inherited] |
Lyapunov DifferentialEquation::lyap [protected, inherited] |
int Function::memoryOffset [protected, inherited] |
double* Function::result [protected, inherited] |
double DifferentialEquation::stepLength [protected, inherited] |
Parameter* DifferentialEquation::T1 [protected, inherited] |
double DifferentialEquation::t1 [protected, inherited] |
Parameter * DifferentialEquation::T2 [protected, inherited] |
double DifferentialEquation::t2 [protected, inherited] |