Diana
0.8.3
|
#include <DianaSensDAESO.hpp>
Public Member Functions | |
DianaSensDAESO (DianaDAESO *_model, const CapeArrayLong &parIndices, const CapeArrayLong &stateIndices) | |
DianaSensDAESO (const DianaSensDAESO &org) | |
virtual | ~DianaSensDAESO () |
DianaDAESO & | GetModel () |
virtual CapeLong | GetNumSensParameters () throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual CapeLong | GetNumSensInitStates () throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual const CapeArrayLong & | GetSensParametersIndices () const throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual const CapeArrayLong & | GetSensInitStatesIndices () const throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual const CapeArrayDouble & | GetSensParameters () const throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual void | SetSensParameters (const Common::Types::CapeArrayDouble &pars) throw (ECapeUnknown, ECapeFailedInitialisation) |
virtual const DianaSparseArray & | GetSensParJacobianValues () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual const CapeArrayDouble & | GetSensInitStates () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) |
virtual void | SetSensInitStates (const Common::Types::CapeArrayDouble &states) throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) |
virtual Common::Types::CapeArrayDouble | GetAllModelVariables () |
virtual void | SetAllModelVariables (const Common::Types::CapeArrayDouble &vars) |
virtual Common::Types::CapeArrayDouble | GetAllModelDerivatives () |
virtual void | SetAllModelDerivatives (const Common::Types::CapeArrayDouble &vars) |
virtual const CapeArrayDouble & | GetAllModelResiduals () throw (ECapeUnknown, ECapeBadInvOrder, ECapeFailedInitialisation) |
virtual const DianaSparseArray & | GetAllModelJacobianValues () const throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual const Diana::DianaSparseArray & | GetAllModelDiffJacobianValues () const throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual Common::Types::CapeArrayDouble | GetAllSensitivities () |
virtual void | SetAllSensitivities (const Common::Types::CapeArrayDouble &vars) |
virtual void | Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) |
virtual void | Terminate () throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder) |
virtual void | SetFixedVariables (const Common::Types::CapeArrayLong &varIndices, const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) |
virtual void | SetAllVariables (const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual void | SetVariables (const Common::Types::CapeArrayLong &varIndices, const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual const Common::Types::CapeArrayDouble & | GetAllVariables () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
virtual Common::Types::CapeArrayDouble | GetVariables (const Common::Types::CapeArrayLong &varIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual const Common::Types::CapeArrayDouble & | GetAllResiduals () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, Common::Error::ECapeFailedInitialisation) |
virtual const Diana::DianaSparseArray & | GetJacobianStruct () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual const Diana::DianaSparseArray & | GetAllJacobianValues () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual void | SetVariablesIndex (const Common::Types::CapeArrayLong &varIndexes) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) |
virtual const Common::Types::CapeArrayDouble & | GetLowerBounds () throw (Common::Error::ECapeUnknown) |
virtual const Common::Types::CapeArrayDouble & | GetUpperBounds () throw (Common::Error::ECapeUnknown) |
virtual void | SetAllDerivatives (const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual const Common::Types::CapeArrayDouble & | GetAllDerivatives () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
virtual Common::Types::CapeArrayDouble | GetDerivatives (const Common::Types::CapeArrayLong &varIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual void | SetDerivatives (const Common::Types::CapeArrayLong &varIndices, const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
virtual const Diana::DianaSparseArray & | GetDiffJacobianStruct () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual const Diana::DianaSparseArray & | GetAllDiffJacobianValues () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual void | SetIndependentVar (Common::Types::CapeDouble indVar) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
virtual Common::Types::CapeDouble | GetIndependentVar () throw (Common::Error::ECapeUnknown) |
virtual void | setChangedFlags (DianaVariableType bChanged) |
Protected Member Functions | |
virtual void | calculateResiduals () |
Values of the sensitivities (inside pStates) | |
virtual void | calculateModelResiduals () |
virtual void | calculateSensResiduals () |
virtual void | initializeJacobis () |
virtual void | initializeCollections () |
virtual DianaDAESO * | createClone () |
void | setupModelJacIndices () |
Protected Attributes | |
DianaDAESO * | model |
DianaSparseArray::crc_type | modelParJacobianCRC |
CapeArrayLong | modelJacIndices |
const CapeArrayLong | sensParameterIndices |
CapeArrayLong | sensParameterMap |
indices of sensitivity-pars in | |
DianaSparseArray | mtrValuesSensParJacobi |
mapping of indices | |
CapeBoolean | bValuesSensParJacobiChanged |
dfdp | |
const CapeArrayLong | sensInitStateIndices |
CapeLong | nSensInitStates |
indices of sensitivity-pars in | |
CapeLong | nSensParameters |
number of sensitivity initstates
| |
CapeLong | nSensitivities |
number of sensitivity parameters
| |
CapeLong | nModelStates |
CapeLong | nModelEqns |
CapeArrayDouble | arrSensInitStates |
CapeArrayDouble | arrSensParameters |
Values of the sensitivity-initstates. | |
CapeDouble * | pSensitivities |
Values of the sensitivity-parameters. |
Special ESO to calculate a model with certain sensitivities automatically.
DianaSensDAESO | ( | DianaDAESO * | _model, |
const CapeArrayLong & | parIndices, | ||
const CapeArrayLong & | stateIndices | ||
) |
Constructor. Allocates memory for internal arrays. Considers parameters given in parIndices as sensitivity-parameters and states given by stateIndices as sensitivity-initstates.
virtual ~DianaSensDAESO | ( | ) | [virtual] |
Destructor. Frees memory.
virtual void calculateResiduals | ( | ) | [protected, virtual] |
Values of the sensitivities (inside pStates)
calculateResiduals updates array pResidualsVector with a values of the
. In the sensitivity model it caculates the sensitivity equations too
Implements DianaDAESO.
virtual const Common::Types::CapeArrayDouble& GetAllDerivatives | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) [virtual] |
Gets the values of the derivatives for all the variables. The length of the array returned will be equal to the number of variables, but the values of derivatives which do not appear in the equation system may be meaningless.
Reimplemented from DianaDAESO.
virtual const Diana::DianaSparseArray& GetAllDiffJacobianValues | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
Returns a matrix object whose GetValues method will provide the differential Jacobian values at the ESO s current variable values each time it is called (the values of entries indicated as uncomputable in the matrix returned by GetDiffJacobianStruct will be meaningless, but the call to GetValues will not cause an error simply because such entries exist).
Reimplemented from DianaDAESO.
virtual const Diana::DianaSparseArray& GetAllJacobianValues | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
Returns a matrix object whose GetValues method will provide the Jacobian values at the ESO's current variable values each time it is called (the values of entries indicated as uncomputable in the matrix returned by GetJacobianStruct will be meaningless, but the call to GetValues will not cause an error simply because such entries exist).
Reimplemented from DianaDAESO.
virtual Common::Types::CapeArrayDouble GetAllModelDerivatives | ( | ) | [virtual] |
Get only the derivatives of the model
Implements IDianaSensDAESO.
virtual const CapeArrayDouble& GetAllModelResiduals | ( | ) | throw (ECapeUnknown, ECapeBadInvOrder, ECapeFailedInitialisation) [virtual] |
Get only the residuals of the model
Implements IDianaSensDAESO.
virtual Common::Types::CapeArrayDouble GetAllModelVariables | ( | ) | [virtual] |
Get only the states of the model
Implements IDianaSensDAESO.
virtual const Common::Types::CapeArrayDouble& GetAllResiduals | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, Common::Error::ECapeFailedInitialisation) [virtual] |
Gets the value of all the residuals.
Reimplemented from DianaDAESO.
virtual Common::Types::CapeArrayDouble GetAllSensitivities | ( | ) | [virtual] |
Get the vector of all sensitivities. These are 2 Sensitivity-matrices inlined: first
and then
Implements IDianaSensDAESO.
virtual const Common::Types::CapeArrayDouble& GetAllVariables | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) [virtual] |
Gets the value of all variables.
Reimplemented from DianaDAESO.
virtual Common::Types::CapeArrayDouble GetDerivatives | ( | const Common::Types::CapeArrayLong & | varIndices | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Gets the value of a subset of the derivatives.
varIndices | the indices of the variables whose derivatives we wish to get. |
Reimplemented from DianaDAESO.
virtual const Diana::DianaSparseArray& GetDiffJacobianStruct | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
Returns a matrix object which contains information on the structure of the differential Jacobian matrix. The GetValues method of this object will provide values encoded as follows:
Reimplemented from DianaDAESO.
virtual Common::Types::CapeDouble GetIndependentVar | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Gets the current value of the independent variable in the DAESO.
Reimplemented from DianaDAESO.
virtual const Diana::DianaSparseArray& GetJacobianStruct | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
Returns a matrix object which contains information on the structure of the Jacobian matrix. The GetValues method of this object will provide values encoded as follows :
Reimplemented from DianaDAESO.
virtual const Common::Types::CapeArrayDouble& GetLowerBounds | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns array of lower bounds for the state vector.
Reimplemented from DianaDAESO.
DianaDAESO& GetModel | ( | ) |
Get the model. The user is allowed to read the data from the model, but he should not change the values through the direct methods of the model. The SensDAESO relies on the fact, that it controls the model state allone.
virtual CapeLong GetNumSensInitStates | ( | ) | throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Get the number of initial states sensitivities
Implements IDianaSensDAESO.
virtual CapeLong GetNumSensParameters | ( | ) | throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Get the number of sensitivity parameters
Implements IDianaSensDAESO.
virtual const CapeArrayDouble& GetSensInitStates | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) [virtual] |
Get the values of the sensitivity-initstates
Implements IDianaSensDAESO.
virtual const CapeArrayLong& GetSensInitStatesIndices | ( | ) | const throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Get the indices of initial states sensitivities
Implements IDianaSensDAESO.
virtual const CapeArrayDouble& GetSensParameters | ( | ) | const throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Get the values of the sensitivity-parameters.
Implements IDianaSensDAESO.
virtual const CapeArrayLong& GetSensParametersIndices | ( | ) | const throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Get the indices of sensitivity parameters
Implements IDianaSensDAESO.
virtual const DianaSparseArray& GetSensParJacobianValues | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
Get the Jacobian for the sensitivity-parameters
Implements IDianaSensDAESO.
virtual const Common::Types::CapeArrayDouble& GetUpperBounds | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns array of upper bounds for the state vector.
Reimplemented from DianaDAESO.
virtual Common::Types::CapeArrayDouble GetVariables | ( | const Common::Types::CapeArrayLong & | varIndices | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Gets the value of a subset of the variables.
varIndices | the indices of the variables we wish to get. |
Reimplemented from DianaDAESO.
virtual void Initialize | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) [virtual] |
The environment will order the component to get initialized through this method. Any initialisation that could fail must be placed here. Initialize is guaranteed to be the first method called by the client (except low level methods such as class constructors or initialization persistence methods). Initialize has to be called once when the component is instantiated in a particular flowsheet. When the initialization fails, before signalling an error, the component must free all the resources that were allocated before the failure occurred. When the environment receives this error, it may not use the component anymore. The method terminate of the current interface must not either be called. Hence, the environment may only release the component through the middleware native mechanisms.
Reimplemented from DianaDAESO.
virtual void SetAllDerivatives | ( | const Common::Types::CapeArrayDouble & | varValues | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the numerical value of all the derivatives. The length of the array supplied must equal the number of variables: values for derivatives which do not appear in any of the equations can be ignored.
varValues | the values of the derivatives. |
Reimplemented from DianaDAESO.
virtual void SetAllModelDerivatives | ( | const Common::Types::CapeArrayDouble & | vars | ) | [virtual] |
virtual void SetAllModelVariables | ( | const Common::Types::CapeArrayDouble & | vars | ) | [virtual] |
virtual void SetAllSensitivities | ( | const Common::Types::CapeArrayDouble & | vars | ) | [virtual] |
virtual void SetAllVariables | ( | const Common::Types::CapeArrayDouble & | varValues | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the value of all variables of this ESO.
varValues | the values of all the variables we wish to set |
Reimplemented from DianaDAESO.
virtual void setChangedFlags | ( | DianaVariableType | bChanged | ) | [virtual] |
Returns old value (from previous step) of the independent variable. Returns old value of phi-function by it's index.
Reimplemented from DianaDAESO.
virtual void SetDerivatives | ( | const Common::Types::CapeArrayLong & | varIndices, |
const Common::Types::CapeArrayDouble & | varValues | ||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the value of a subset of the derivatives.
varIndices | the indices of the variables whose derivatives we wish to get. |
varValues | the values of all the derivatives we wish to set |
Reimplemented from DianaDAESO.
virtual void SetFixedVariables | ( | const Common::Types::CapeArrayLong & | varIndices, |
const Common::Types::CapeArrayDouble & | varValues | ||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) [virtual] |
Sets the value of some variables and marks these variables as fixed.
varIndices | the indices of the variables we wish to set |
varValues | the values of the variables we wish to set |
Reimplemented from DianaDAESO.
virtual void SetIndependentVar | ( | Common::Types::CapeDouble | indVar | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
Sets the value of the independent variable in the DAESO.
indVar | the value of the independent variable |
Reimplemented from DianaDAESO.
virtual void SetSensInitStates | ( | const Common::Types::CapeArrayDouble & | states | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) [virtual] |
Set the values of the sensitivity-parameters
Implements IDianaSensDAESO.
virtual void SetSensParameters | ( | const Common::Types::CapeArrayDouble & | pars | ) | throw (ECapeUnknown, ECapeFailedInitialisation) [virtual] |
Set the values of the sensitivity-parameters
Implements IDianaSensDAESO.
virtual void SetVariables | ( | const Common::Types::CapeArrayLong & | varIndices, |
const Common::Types::CapeArrayDouble & | varValues | ||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the value of some variables.
varIndices | the indices of the variables we wish to set |
varValues | the values of all the variables we wish to set |
Reimplemented from DianaDAESO.
virtual void SetVariablesIndex | ( | const Common::Types::CapeArrayLong & | varIndexes | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) [virtual] |
Currently not implemented.
Reimplemented from DianaDAESO.
virtual void Terminate | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder) [virtual] |
The environment will order the component to get destroyed through this method. Any uninitialization that could fail must be placed here. Terminate is guaranteed to be the last method called by the client (except low level methods such as class destructors). Terminate may be called at any time, but may be only called once. When this method returns an error, the environment should report the user. However, after that the environment is not allowed to use the component anymore.
Reimplemented from DianaDAESO.
CapeLong nSensitivities [protected] |
number of sensitivity parameters
total number of sensitivities, this is