Diana  0.8.3
Public Member Functions | Protected Member Functions | Protected Attributes
DianaSensDAESO Class Reference

#include <DianaSensDAESO.hpp>

Inheritance diagram for DianaSensDAESO:
IDianaSensDAESO DianaDAESO IDianaDAESO IDianaDAESO ICapeNumericDAESO ICapeNumericDAESO ICapeNumericESO ICapeNumericESO ICapeIdentification ICapeUtilities ICapeIdentification ICapeUtilities

List of all members.

Public Member Functions

 DianaSensDAESO (DianaDAESO *_model, const CapeArrayLong &parIndices, const CapeArrayLong &stateIndices)
 DianaSensDAESO (const DianaSensDAESO &org)
virtual ~DianaSensDAESO ()
DianaDAESOGetModel ()
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 DianaSparseArrayGetSensParJacobianValues () 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 DianaSparseArrayGetAllModelJacobianValues () 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 DianaDAESOcreateClone ()
void setupModelJacIndices ()

Protected Attributes

DianaDAESOmodel
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

\[n_{x_0^s}\]


CapeLong nSensitivities
 number of sensitivity parameters

\[n_{p^s}\]


CapeLong nModelStates
CapeLong nModelEqns
CapeArrayDouble arrSensInitStates
CapeArrayDouble arrSensParameters
 Values of the sensitivity-initstates.
CapeDouble * pSensitivities
 Values of the sensitivity-parameters.

Detailed Description

Special ESO to calculate a model with certain sensitivities automatically.


Constructor & Destructor Documentation

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.


Member Function Documentation

virtual void calculateResiduals ( ) [protected, virtual]

Values of the sensitivities (inside pStates)

calculateResiduals updates array pResidualsVector with a values of the

\[F(t,x,\dot{x}) = B\dot{x}-f(t,x)\]

. In the sensitivity model it caculates the sensitivity equations too

Implements DianaDAESO.

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.

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.

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.

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.

Get only the states of the model

Implements IDianaSensDAESO.

Gets the value of all the residuals.

Reimplemented from DianaDAESO.

Get the vector of all sensitivities. These are 2 Sensitivity-matrices inlined: first

\[\frac{\partial x_j}{\partial p_k} j=1\dots n_{\mbox{var}} k=1\dots n_{\mbox{spar}}\]

and then

\[\frac{\partial x_j}{\partial 0_l} j=1\dots n_{\mbox{var}} l=1\dots n_{\mbox{sx}_0}\]

Implements IDianaSensDAESO.

Gets the value of all variables.

Reimplemented from DianaDAESO.

Gets the value of a subset of the derivatives.

Parameters:
varIndicesthe indices of the variables whose derivatives we wish to get.

Reimplemented from DianaDAESO.

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:

  • -1.0 indicates an entry which cannot be computed by the ESO.
  • 0.0 indicates an entry which will always be zero.
  • Any other value indicates a nonzero, computable entry.

Reimplemented from DianaDAESO.

Gets the current value of the independent variable in the DAESO.

Reimplemented from DianaDAESO.

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 :

  • -1.0 indicates an entry which cannot be computed by the ESO.
  • 0.0 indicates an entry which will always be zero.
  • Any other value indicates a nonzero, computable entry.

Reimplemented from DianaDAESO.

Returns array of lower bounds for the state vector.

Reimplemented from DianaDAESO.

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.

Get the Jacobian for the sensitivity-parameters

Implements IDianaSensDAESO.

Returns array of upper bounds for the state vector.

Reimplemented from DianaDAESO.

Gets the value of a subset of the variables.

Parameters:
varIndicesthe indices of the variables we wish to get.

Reimplemented from DianaDAESO.

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.

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.

Parameters:
varValuesthe values of the derivatives.

Reimplemented from DianaDAESO.

virtual void SetAllModelDerivatives ( const Common::Types::CapeArrayDouble vars) [virtual]

Set the only the model variables

See also:
GetAllModelDerivatives()

Implements IDianaSensDAESO.

virtual void SetAllModelVariables ( const Common::Types::CapeArrayDouble vars) [virtual]

Set the only the model variables

See also:
GetAllModelVariables()

Implements IDianaSensDAESO.

virtual void SetAllSensitivities ( const Common::Types::CapeArrayDouble vars) [virtual]

Set the vector of all sensitivities.

See also:
GetAllSensitivities()

Implements IDianaSensDAESO.

Sets the value of all variables of this ESO.

Parameters:
varValuesthe 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.

Sets the value of a subset of the derivatives.

Parameters:
varIndicesthe indices of the variables whose derivatives we wish to get.
varValuesthe values of all the derivatives we wish to set

Reimplemented from DianaDAESO.

Sets the value of some variables and marks these variables as fixed.

Parameters:
varIndicesthe indices of the variables we wish to set
varValuesthe values of the variables we wish to set

Reimplemented from DianaDAESO.

Sets the value of the independent variable in the DAESO.

Parameters:
indVarthe value of the independent variable

Reimplemented from DianaDAESO.

Set the values of the sensitivity-parameters

Implements IDianaSensDAESO.

Set the values of the sensitivity-parameters

Implements IDianaSensDAESO.

Sets the value of some variables.

Parameters:
varIndicesthe indices of the variables we wish to set
varValuesthe values of all the variables we wish to set

Reimplemented from DianaDAESO.

Currently not implemented.

Reimplemented from DianaDAESO.

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.


Member Data Documentation

CapeLong nSensitivities [protected]

number of sensitivity parameters

\[n_{p^s}\]

total number of sensitivities, this is

\[n^s=n_x*(n_{x_0^s}+n_{p^s})\]


The documentation for this class was generated from the following file: