Diana
0.8.3
|
#include <DianaDAESO.hpp>
Public Member Functions | |
DianaDAESO (const Common::Types::CapeString &_name, const Common::Types::CapeString &_description, Common::Types::CapeLong _nVars, Common::Types::CapeLong _nEqns, Common::Types::CapeLong _nRealParams, Common::Types::CapeLong _nStructureParams, Common::Types::CapeLong _nIntegerParams, Common::Types::CapeLong _nHelpVariables, Common::Types::CapeLong _nPhi=0, Common::Types::CapeLong _nPlaces=0) | |
DianaDAESO (const DianaDAESO &org) | |
virtual | ~DianaDAESO () |
virtual DIANA_DAESO_CLONERET * | clone () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
const Common::Types::CapeString & | GetComponentName () const throw (Common::Error::ECapeUnknown) |
void | SetComponentName (const Common::Types::CapeString &_name) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
const Common::Types::CapeString & | GetComponentDescription () const throw (Common::Error::ECapeUnknown) |
void | SetComponentDescription (const Common::Types::CapeString &_description) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
Common::Collection::ICapeCollection * | GetParameters () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) |
Common::Collection::ICapeCollection * | GetStateVariables () throw (Common::Error::ECapeUnknown) |
void | SetSimulationContext (Common::Identification::ICapeIdentification *simContextManager) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) |
void | Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder) |
void | Reset () throw (Common::Error::ECapeUnknown) |
void | Terminate () throw (Common::Error::ECapeUnknown, Common::Error::ECapeOutOfResources, Common::Error::ECapeBadInvOrder) |
Common::Types::CapeLong | GetNumVars () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
Common::Types::CapeLong | GetNumEqns () throw (Common::Error::ECapeUnknown) |
Common::Types::CapeLong | GetNumRealParams () throw (Common::Error::ECapeUnknown) |
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) |
void | SetAllVariables (const Common::Types::CapeArrayDouble &varValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
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) |
const Common::Types::CapeArrayDouble & | GetAllVariables () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
Common::Types::CapeArrayDouble | GetVariables (const Common::Types::CapeArrayLong &varIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
Common::Collection::ICapeCollection * | GetRealParameters () throw (Common::Error::ECapeUnknown) |
void | SetAllRealParameters (const Common::Types::CapeArrayDouble &parValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
void | SetRealParameters (const Common::Types::CapeArrayLong &parIndices, const Common::Types::CapeArrayDouble &parValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
const Common::Types::CapeArrayDouble & | GetAllRealParameters () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
virtual Common::Types::CapeArrayDouble | GetRealParameters (const Common::Types::CapeArrayLong &parIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
const Common::Types::CapeArrayDouble & | GetAllResiduals () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder, Common::Error::ECapeFailedInitialisation) |
Common::Types::CapeArrayDouble | GetResiduals (const Common::Types::CapeArrayLong &eqnIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeBadInvOrder, Common::Error::ECapeFailedInitialisation) |
const Diana::DianaSparseArray & | GetJacobianStruct () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
const Diana::DianaSparseArray & | GetAllJacobianValues () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
Common::Types::CapeArrayDouble | GetJacobianValues (const Common::Types::CapeArrayLong &indices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeNoImpl, Common::Error::ECapeOutOfBounds) |
void | SetVariablesIndex (const Common::Types::CapeArrayLong &varIndexes) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) |
const Common::Types::CapeArrayDouble & | GetLowerBounds () throw (Common::Error::ECapeUnknown) |
const Common::Types::CapeArrayDouble & | GetUpperBounds () throw (Common::Error::ECapeUnknown) |
void | SetAllDerivatives (const Common::Types::CapeArrayDouble &derValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
const Common::Types::CapeArrayDouble & | GetAllDerivatives () throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) |
Common::Types::CapeArrayDouble | GetDerivatives (const Common::Types::CapeArrayLong &derIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
void | SetDerivatives (const Common::Types::CapeArrayLong &derIndices, const Common::Types::CapeArrayDouble &derValues) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) |
const Diana::DianaSparseArray & | GetDiffJacobianStruct () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
const Diana::DianaSparseArray & | GetAllDiffJacobianValues () throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
Common::Types::CapeArrayDouble | GetDiffJacobianValues (const Common::Types::CapeArrayLong &indices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeNoImpl, Common::Error::ECapeOutOfBounds) |
void | SetIndependentVar (Common::Types::CapeDouble indVar) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
Common::Types::CapeDouble | GetIndependentVar () throw (Common::Error::ECapeUnknown) |
void | SaveState (const Common::Types::CapeString &filename) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
void | LoadState (const Common::Types::CapeString &filename) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
void | LoadStateDiva (const Common::Types::CapeString &states, const Common::Types::CapeString ¶ms, const Common::Types::CapeString &mapfile=Common::Types::CapeString()) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
const Diana::DianaSparseArray & | GetHighOrderJacobian (Common::Types::CapeLong nXOrder, Common::Types::CapeLong nDOrder, Common::Types::CapeLong nPOrder) throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
DianaParameter * | GetVariable (const Common::Types::CapeString &name) const throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
CapeArrayDouble | GetAbsoluteError () const throw (Common::Error::ECapeUnknown) |
virtual const CapeArrayDouble & | GetExplicitEventTimes () |
virtual void | calculatePhiFunctions () |
void | SaveState () throw (Common::Error::ECapeUnknown) |
void | RestoreState () throw (Common::Error::ECapeUnknown) |
void | BeforeStep (Diana::IDianaNumericDAESolver *solver) throw (Common::Error::ECapeUnknown) |
void | AfterStep (Diana::IDianaNumericDAESolver *solver) throw (Common::Error::ECapeUnknown) |
const Common::Types::CapeArrayDouble & | GetAllPhiValues () throw (Common::Error::ECapeUnknown) |
Common::Types::CapeDouble | GetPhiValue (CapeLong index) throw (Common::Error::ECapeUnknown) |
IDianaPetriNet * | GetPetriNet () throw (Common::Error::ECapeUnknown) |
virtual const DianaSparseArray & | GetAllParJacobianValues (const Common::Types::CapeArrayLong &parIndices) throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
virtual const DianaSparseArray & | GetAllParJacobianValues (const Common::Types::CapeArrayLong *const parIndices=NULL) throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) |
Common::Types::CapeDouble | FindEventTime (int phi_index) |
Common::Types::CapeDouble | FindEventTime (Common::Types::CapeDouble t1, Common::Types::CapeDouble t2, int phi_index) |
virtual void | MoveToTime (Common::Types::CapeDouble t) |
Protected Types | |
enum | enumJacobianType { jtStateVariables, jtDerivatives } |
Protected Member Functions | |
void | setChangedFlags (DianaVariableType bChanged) |
virtual DianaDAESO * | createClone (const DianaDAESO &original) |
Common::Types::CapeString | makeVarName (const Common::Types::CapeString name, const Common::Types::CapeArrayLong &indices) throw (Common::Error::ECapeUnknown) |
Common::Types::CapeString | makeVarName (const Common::Types::CapeString name, const int idxAmount,...) throw (Common::Error::ECapeUnknown) |
int | getVarPosition (void *var, DianaVariableType type) const throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) |
Common::Types::CapeBoolean | isAscendantIndices (const Common::Types::CapeArrayLong &idx, const std::vector< DianaVariableType > &type) |
virtual void | calculateHelpVariables () |
virtual void | calculateConstantHelpVariables () |
virtual void | calculateResiduals ()=0 |
Common::Types::CapeBoolean | makeMatrixPartitioning (const Diana::DianaSparseArray &dsarray, std::vector< Common::Types::CapeArrayLong > &grouping) |
void | calculateFDJacobiMatrix (enumJacobianType type) |
Common::Types::CapeBoolean | calculateFDJacobiMatrixPartition (enumJacobianType type, CapeDouble dblFDDir=1.0) |
Common::Types::CapeBoolean | calculateFDJacobiMatrixSimple (enumJacobianType type, CapeDouble dblFDDir=1.0) |
Common::Types::CapeBoolean | calculateFDParJacobiMatrix (const Common::Types::CapeArrayLong &parIndices) |
void | checkResidualFiniteness () throw (Common::Error::ECapeUnknown) |
void | checkMatrixFiniteness (const Diana::DianaSparseArray &mat) throw (Common::Error::ECapeUnknown) |
Protected Attributes | |
Common::Types::CapeBoolean | bInitialized |
Common::Types::CapeString | name |
ESO name. | |
Common::Types::CapeString | description |
ESO description. | |
Diana::DianaCollection | collParameters |
collections of the exported parameters | |
Diana::DianaCollection | collStateVariables |
collections of the state variables | |
Diana::DianaCollection | collRealParameters |
collections of the real parameters | |
Common::Types::CapeDouble | dblIndependentVar |
independent variable | |
Common::Types::CapeArrayDouble | arrStates |
state variables array | |
Common::Types::CapeArrayDouble | arrUpperBounds |
upper bounds for the state variables | |
Common::Types::CapeArrayDouble | arrLowerBounds |
lower bounds for the state variables | |
Common::Types::CapeArrayDouble | arrDerivatives |
derivatives of the state variables | |
Common::Types::CapeArrayDouble | arrResiduals |
array with calculated residuals | |
Common::Types::CapeArrayDouble | arrRealParams |
real parameters array | |
Common::Types::CapeArrayLong | arrIntegerParams |
integer parameters array | |
Common::Types::CapeArrayLong | arrStructureParams |
integer parameters array | |
Common::Types::CapeArrayDouble | arrHelpVariables |
help variables array | |
Common::Types::CapeArrayBoolean | arrPlaces |
place array | |
std::vector< std::vector < CapeLong * > > | arrPlaceIndexPointers |
index instances to set for charFunc | |
std::vector< std::vector < CapeLong > > | arrPlaceIndexValues |
values for index instances | |
std::vector< CharFunction > | arrCharFunctions |
array of charFunctions for places, indexed by position | |
std::vector< CharFunction > | arrForkFunctions |
array of charFunctions for places, indexed by position | |
Diana::DianaSparseArray | mtrValuesJacobi |
Diana::DianaSparseArray | mtrStructJacobi |
Diana::DianaSparseArray | mtrValuesDiffJacobi |
Diana::DianaSparseArray | mtrStructDiffJacobi |
Diana::DianaSparseArray | mtrValuesParJacobi |
std::vector< DianaVariableType > | bESOChanged |
Common::Types::CapeBoolean | bFDPartition |
Common::Types::CapeLong | nFDOrder |
Common::Types::CapeDouble | dblFDEpsilon |
Common::Types::CapeArrayDouble | arrFDResidual |
residuals helper array for the finite differences | |
Common::Types::CapeArrayDouble | arrFDVariables |
states helper array for the finite differences | |
Common::Types::CapeArrayDouble | arrFDEpsilons |
epsilons helper array for the finite differences | |
std::vector < Common::Types::CapeArrayLong > | arrJacobianGrouping |
std::vector < Common::Types::CapeArrayLong > | arrDiffJacobianGrouping |
PetriNet * | petriNet |
Petri net of model. | |
Common::Types::CapeArrayDouble | arrPhi |
phi values array | |
Common::Types::CapeArrayDouble | arrExplicitEventTimes |
time points of explicit events | |
Friends | |
class | DianaParameter |
Diana realization of the ICapeNumericDAESO interface
DianaDAESO | ( | const Common::Types::CapeString & | _name, |
const Common::Types::CapeString & | _description, | ||
Common::Types::CapeLong | _nVars, | ||
Common::Types::CapeLong | _nEqns, | ||
Common::Types::CapeLong | _nRealParams, | ||
Common::Types::CapeLong | _nStructureParams, | ||
Common::Types::CapeLong | _nIntegerParams, | ||
Common::Types::CapeLong | _nHelpVariables, | ||
Common::Types::CapeLong | _nPhi = 0 , |
||
Common::Types::CapeLong | _nPlaces = 0 |
||
) |
Constructor. Allocates memory for internal arrays.
DianaDAESO | ( | const DianaDAESO & | org | ) |
Copy constructor for deep copy
virtual ~DianaDAESO | ( | ) | [virtual] |
Destructor. Frees memory.
void AfterStep | ( | Diana::IDianaNumericDAESolver * | solver | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Implementation of method AfterStep()of IDianaDAESO interface
Implements IDianaDAESO.
void BeforeStep | ( | Diana::IDianaNumericDAESolver * | solver | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Implementation of method BeforeStep()of IDianaDAESO interface
Implements IDianaDAESO.
virtual void calculateConstantHelpVariables | ( | ) | [inline, protected, virtual] |
Calculate static entries in arrHelpVars ( h(p) )
Common::Types::CapeBoolean calculateFDParJacobiMatrix | ( | const Common::Types::CapeArrayLong & | parIndices | ) | [protected] |
calculates Entries in mtxParJacobian for the parameters given in parIndices return true if it worked well.
virtual void calculateHelpVariables | ( | ) | [inline, protected, virtual] |
Calculate dynamic entries in arrHelpVars ( h(x,p,t) )
virtual void calculatePhiFunctions | ( | ) | [virtual] |
Updates array arrPhi with a values of the hybrid model's phi-functions.
virtual void calculateResiduals | ( | ) | [protected, pure virtual] |
calculateResiduals updates array pResidualsVector with a values of the
.
Implemented in DiffitModel, DiffitESO, and DianaSensDAESO.
void checkResidualFiniteness | ( | ) | throw (Common::Error::ECapeUnknown) [protected] |
Function checks residual vector for the finite values (not NaN, Inf or -Inf) Throws warning exception if there at lest one non finite value.
virtual DIANA_DAESO_CLONERET* clone | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeNoImpl) [virtual] |
cloning operation, returns a freshly allocated ESO, owned by the caller
Implements IDianaDAESO.
virtual DianaDAESO* createClone | ( | const DianaDAESO & | original | ) | [inline, protected, virtual] |
Common::Types::CapeDouble FindEventTime | ( | int | phi_index | ) |
Called from Switch() method in PetriNet class for correspondent phi-function by it's index. Finds exact time of phi-function switching. Calls FindEventTime(Common::Types::CapeDouble t1, Common::Types::CapeDouble t2, int phi_index) to find exact time of crossing zero in the given time boundaries.
Common::Types::CapeDouble FindEventTime | ( | Common::Types::CapeDouble | t1, |
Common::Types::CapeDouble | t2, | ||
int | phi_index | ||
) |
Calculates exact time of switching in the given time boundaries for given phi-function index. Uses Brent method for this purpose. Brent's method is a root-finding algorithm which combines root bracketing, interval bisection, and inverse quadratic interpolation. It is sometimes known as the van Wijngaarden-Deker-Brent method.
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.
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
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).
Implements ICapeNumericDAESO.
Reimplemented in DiffitESO, and DianaSensDAESO.
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).
Implements ICapeNumericESO.
Reimplemented in DiffitModel, and DianaSensDAESO.
const Common::Types::CapeArrayDouble& GetAllPhiValues | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
All PhiFunctions of the model
Implements IDianaDAESO.
const Common::Types::CapeArrayDouble& GetAllRealParameters | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) [virtual] |
Gets the value of all real parameters.
Implements IDianaDAESO.
const Common::Types::CapeArrayDouble& GetAllVariables | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) [virtual] |
const Common::Types::CapeString& GetComponentDescription | ( | ) | const throw (Common::Error::ECapeUnknown) [virtual] |
gets the description of the component.
Implements ICapeIdentification.
const Common::Types::CapeString& GetComponentName | ( | ) | const throw (Common::Error::ECapeUnknown) [virtual] |
gets the name of the component.
Implements ICapeIdentification.
Common::Types::CapeArrayDouble GetDerivatives | ( | const Common::Types::CapeArrayLong & | derIndices | ) | 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. |
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
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:
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
Gets the values of selected entries of the differential Jacobian, at the current variable values of the ESO.
indices | the indices of selected elements. The semantics are those of the matrix's GetValues method |
Implements ICapeNumericDAESO.
virtual const CapeArrayDouble& GetExplicitEventTimes | ( | ) | [virtual] |
Calculates Timepoints of explicit events
Common::Types::CapeDouble GetIndependentVar | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Gets the current value of the independent variable in the DAESO.
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
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 :
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
Gets the values of selected entries of the Jacobian, at the current variable values of the ESO.
indices | the indices of selected elements. The semantics are those of the matrix's GetValues method. |
Implements ICapeNumericESO.
const Common::Types::CapeArrayDouble& GetLowerBounds | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns array of lower bounds for the state vector.
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
Common::Types::CapeLong GetNumEqns | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Gets the number of equations in this ESO.
Implements ICapeNumericESO.
Gets the number of real parameters in this ESO.
Common::Types::CapeLong GetNumVars | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeBadInvOrder) [virtual] |
Gets the number of variables of this ESO.
Implements ICapeNumericESO.
Common::Collection::ICapeCollection* GetParameters | ( | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation) [virtual] |
Returns an ICapeCollection interface. This interface will contain a collection of ICapeParameter interfaces. This method allows any client to access all the Cape Open Parameters exposed by a model component. If the model component does not support exposing its parameters, it should raise the ECapeNoImpl error, instead of returning a NULL reference or an empty Collection. But if the PMC supports parameters but has for this call no parameters, it should return a valid ICapeCollection reference exposing zero parameters.
Implements ICapeUtilities.
IDianaPetriNet* GetPetriNet | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns Petri net of current ESO.
Implements IDianaDAESO.
Common::Types::CapeDouble GetPhiValue | ( | CapeLong | index | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns value of phi-function by its index.
Implements IDianaDAESO.
Common::Collection::ICapeCollection* GetRealParameters | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns a collection with a real parameters of the model, generated by promot. Order of the real parameters in the collection is the same as result of function GetAllRealParameters, which returns a vector instead of collection.
Implements IDianaDAESO.
virtual Common::Types::CapeArrayDouble GetRealParameters | ( | const Common::Types::CapeArrayLong & | parIndices | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Gets the value of a subset of the real parameters.
varIndices | the indices of the parameters we wish to get. |
Implements IDianaDAESO.
Gets the value of a subset of the residuals.
eqnIndices | the indices of the equations we wish to get the residuals from. |
Implements ICapeNumericESO.
Common::Collection::ICapeCollection* GetStateVariables | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns a collection with a state variables of the model. Order of the state variables in the collection is the same as result of function GetVariables, which returns a vector instead of collection.
Implements IDianaDAESO.
const Common::Types::CapeArrayDouble& GetUpperBounds | ( | ) | throw (Common::Error::ECapeUnknown) [virtual] |
Returns array of upper bounds for the state vector.
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
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. |
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
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.
Implements ICapeUtilities.
Reimplemented in DiffitModel, DiffitESO, DianaSensDAESO, and DianaXmlDAESO.
virtual void MoveToTime | ( | Common::Types::CapeDouble | t | ) | [virtual] |
Integrates till the given time. Called from FindEventTime(CapeDouble t1, CapeDouble t2, int phi_index) method to find exact value of phi-function in any instance of time between t1 and t2.
void Reset | ( | ) | throw (Common::Error::ECapeUnknown) |
Reset all variables and parameters to their default state.
void RestoreState | ( | ) | throw (Common::Error::ECapeUnknown) |
Restores all the data of a hybrid model on a previous step of integration. Restores state variables, derivatives, phi-functions and independent variable
void SaveState | ( | ) | throw (Common::Error::ECapeUnknown) |
Saves current state of a hybrid model on a current stage of integration. Saves state variables, derivatives, phi-functions and independent variable
void SetAllDerivatives | ( | const Common::Types::CapeArrayDouble & | derValues | ) | 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. |
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
void SetAllRealParameters | ( | const Common::Types::CapeArrayDouble & | parValues | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the value of all real parameters of this ESO.
varValues | the values of all the parameters we wish to set |
Implements IDianaDAESO.
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 |
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
void setChangedFlags | ( | DianaVariableType | bChanged | ) | [protected] |
Returns old value (from previous step) of the independent variable. Returns old value of phi-function by it's index.
Reimplemented in DianaSensDAESO.
void SetComponentDescription | ( | const Common::Types::CapeString & | _description | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
sets the description of the component.
_description | the description of the component |
Implements ICapeIdentification.
void SetComponentName | ( | const Common::Types::CapeString & | _name | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual] |
sets the name of the component.
_name | the name of the component |
Implements ICapeIdentification.
void SetDerivatives | ( | const Common::Types::CapeArrayLong & | derIndices, |
const Common::Types::CapeArrayDouble & | derValues | ||
) | 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 |
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
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 |
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
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 |
Implements ICapeNumericDAESO.
Reimplemented in DianaSensDAESO.
void SetRealParameters | ( | const Common::Types::CapeArrayLong & | parIndices, |
const Common::Types::CapeArrayDouble & | parValues | ||
) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeBadInvOrder, Common::Error::ECapeOutOfBounds) [virtual] |
Sets the value of some parameters.
varIndices | the indices of the parameters we wish to set |
varValues | the values of all the parameters we wish to set |
Implements IDianaDAESO.
void SetSimulationContext | ( | Common::Identification::ICapeIdentification * | simContextManager | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeNoImpl) [virtual] |
Allows the environment to convey the component a reference to the former's simulation context. The simulation context will be environment objects which will expose a given set of Cape Open interfaces. Each of these interfaces will allow the component to call back the environment in order to benefit from its exposed services (such as creation of material templates, diagnostics or measurement unit conversion). If the component does not support accessing the simulation context, it is recommended to raise the ECapeNoImpl error.
simContextManager | the reference to the environment's simulation context class. For the component to use this class, this reference will have to be converted to each of the defined Cape Open Simulation Context interfaces. |
Implements ICapeUtilities.
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 |
Implements ICapeNumericESO.
Reimplemented in DianaSensDAESO.
void SetVariablesIndex | ( | const Common::Types::CapeArrayLong & | varIndexes | ) | throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument, Common::Error::ECapeOutOfBounds, Common::Error::ECapeNoImpl) [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.
Implements ICapeUtilities.
Reimplemented in DianaSensDAESO.
friend class DianaParameter [friend] |
This friend declaration is used only for the parameters internal pointers.
Diana::DianaSparseArray mtrStructDiffJacobi [protected] |
Structure of the Jacobi matrix
Diana::DianaSparseArray mtrStructJacobi [protected] |
Structure of the Jacobi matrix
Diana::DianaSparseArray mtrValuesDiffJacobi [protected] |
Jacobi matrix
Diana::DianaSparseArray mtrValuesJacobi [protected] |
Jacobi matrix
Diana::DianaSparseArray mtrValuesParJacobi [protected] |
Jacobi matrix