Diana  0.8.3
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
SensParameterFittingTask Class Reference

#include <DianaParameterFittingTask.hpp>

Inheritance diagram for SensParameterFittingTask:
DianaParameterFittingTask ICapeSensNLPTask DianaDynamicNLPTask IDianaNLPTaskReporting ICapeNLPTask DianaNLPTask ICapeDynamicOptimizationTask ICapeUtilities ICapeIdentification ICapeNLPTask ICapeNLPTask ICapeUtilities ICapeIdentification ICapeUtilities ICapeIdentification

List of all members.

Public Member Functions

 SensParameterFittingTask (Numeric::Solvers::Solver::ICapeNumericSolver *_solver, Diana::IDianaContinuousModel *_model, Common::NLPData::CapeMeasuredData *_expdata)
 SensParameterFittingTask (Diana::IDianaMain *_dianaMain, Common::Types::CapeString _solverName, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model, const Common::NLPData::CapeMeasuredData *_expdata)
 SensParameterFittingTask (Diana::IDianaMain *_dianaMain, Common::Types::CapeString _solverName, Numeric::Solvers::Model::ICapeNumericContinuousModel *_model, const Common::NLPData::CapeMeasuredData *_expdata, const Common::Collection::ICapeCollection *pars)
virtual ~SensParameterFittingTask ()
virtual void AddEstimatedParameterBySpec (const Common::Parameter::ICapeParameterSpec *pSpecValue, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
virtual void AddEstimatedParameterByName (const Common::Types::CapeString strName, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
virtual void AddEstimatedParameterByIndex (const Common::Types::CapeLong nIndex, eEstimatedParameterType eptTypeOfUnknown=DIANA_PARAMETER) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
Common::Types::CapeLong GetFixedSoughtParamsCount ()
Common::Types::CapeLong GetStateSoughtParamsCount ()
virtual eCapeNLPTaskType Type () const
virtual Common::Types::CapeDouble CalcObjFunction () throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError)
virtual
Common::Types::CapeArrayDouble 
GetObjFunctionGradient () throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError)
void ExecuteAllCalculations () throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError)
virtual const
Diana::DianaSparseArray
GetConstraintsJacobian (ConstraintType _type) throw (Common::Error::ECapeUnknown, Common::Error::ECapeSolvingError)
virtual void Initialize () throw (Common::Error::ECapeUnknown, Common::Error::ECapeFailedInitialisation, Common::Error::ECapeOutOfResources, Common::Error::ECapeLicenceError, Common::Error::ECapeBadInvOrder)
const Common::Types::CapeStringGetComponentName () const throw (Common::Error::ECapeUnknown)
const Common::Types::CapeStringGetComponentDescription () const throw (Common::Error::ECapeUnknown)
void SetComponentName (const Common::Types::CapeString &_name) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)
void SetComponentDescription (const Common::Types::CapeString &_description) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument)

Protected Attributes

Common::Parameter::CapeArrayParameter arrEstimatedInitStates
 Array with estimated state variables.
Common::Parameter::CapeArrayParameter arrEstimatedParameters
 Array with estimated parameters.
Diana::DianaSparseArray mtrConstraintsJacobian
 Sparse matrix with Jacobian of constraints.
Common::Types::CapeDouble dblEpsilon
Common::Types::CapeBoolean bInitialized
 Flag, indicates that optimizer is initialised.

Private Member Functions

void ExtractParams (const Numeric::Solvers::NLPTasks::Parameters::ICapeOptimizationPoint &_parVals) throw (Common::Error::ECapeUnknown)

Private Attributes

Common::Types::CapeString strName
 Component name.
Common::Types::CapeString strDescription
 Component description.
Common::Types::CapeArrayDouble arrDefaultDerivatives
 array of default derivatives
Common::Types::CapeArrayDouble arrDefaultSensitivities
 array of default sensitivities
Common::Types::CapeArrayDouble arrDefaultModelDerivatives
 array of default model derivatives
Common::Types::CapeArrayDouble arrDefaultModelVariables
 array of default model sensitivities

Detailed Description

Class for parameter fitting task with sensativities calculation.


Constructor & Destructor Documentation

Constructor of parameter fitting task class based on one experiment with external solver and sens. model (not defined in SWIG)

Parameters:
_solver- solver used for integrating trajectory & calculating sensitivities
_model- considered model (this model must contain DianaSensESO with preseted estimated parameters & fitted)
_expdata- set of experimental state variables values in measured time points

Constructor of parameter fitting task class based on one experiment using solver with name specified and CapeNLPSoughtParameters.

Parameters:
_dianaMain- pointer to DianaMain which is used to create solver
_solverName- name of the solver used for integrating
_model- considered model
_expdata- set of experimental state variables values in measured time points

Constructor of parameter fitting task class based on one experiment using solver with name specified and CapeNLPSoughtParameters.

Parameters:
_dianaMain- pointer to DianaMain which is used to create solver
_solverName- name of the solver used for integrating
_model- considered model
_expdata- set of experimental state variables values in measured time points
pars- estimated parameter set
virtual ~SensParameterFittingTask ( ) [virtual]

Destructor of BasicNLPTask class.


Member Function Documentation

virtual void AddEstimatedParameterByIndex ( const Common::Types::CapeLong  nIndex,
eEstimatedParameterType  eptTypeOfUnknown = DIANA_PARAMETER 
) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual]

Adds unknown to the list of sought parameters.

Parameters:
nIndexindex of added parameter
eptTypeOfUnknowntype of added parameter (default value DIANA_PARAMETER)
virtual void AddEstimatedParameterByName ( const Common::Types::CapeString  strName,
eEstimatedParameterType  eptTypeOfUnknown = DIANA_PARAMETER 
) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual]

Adds unknown to the list of sought parameters.

Parameters:
strNamename of added parameter
eptTypeOfUnknowntype of added parameter (default value DIANA_PARAMETER)
virtual void AddEstimatedParameterBySpec ( const Common::Parameter::ICapeParameterSpec pSpecValue,
eEstimatedParameterType  eptTypeOfUnknown = DIANA_PARAMETER 
) throw (Common::Error::ECapeUnknown, Common::Error::ECapeInvalidArgument) [virtual]

Adds unknown to the list of sought parameters.

Parameters:
pSpecValuename of added parameter
eptTypeOfUnknowntype of added parameter (default value DIANA_PARAMETER)

Calculates and returns objective function value for optimization task:

\[ L(x_0,p) = \sum_{i=1}^n \sum_{j=1}^{obs} \frac{ (x^{(j)}(t_i;x_0,p)-x_i^{(j)})^2}{2\sigma_{ij}^2} \]

Implements ICapeNLPTask.

Calculates objective function and its gradient

Extracts parameters from set of parameters for setting intial values of state variables and estimated parameters.

Parameters:
_parValsset of parameters for task

Reimplemented from DianaDynamicNLPTask.

Gets the description of the component.

Implements ICapeIdentification.

References ParameterFittingTask::strDescription.

const Common::Types::CapeString& GetComponentName ( ) const throw (Common::Error::ECapeUnknown) [inline, virtual]

Gets the name of the component.

Implements ICapeIdentification.

References ParameterFittingTask::strName.

Calculates Jacoian with respect to constraint functions of the same type. Calculation performs by using the forward-difference:

\[\frac{\partial F}{\partial x_i}(x)=\frac{F(x+\epsilon e_i)-F(x)}{\partial x_i}\]

.

Parameters:
_typetype of constraints

Implements ICapeSensNLPTask.

Gets number of fixed variables among sought parameters.

Implements DianaParameterFittingTask.

Calculates and returns objective function's gradient with respect to initial values of state variables

\[ \frac{\partial L(x_0,p)}{\partial x0_k}= \sum_{i=1}^n \sum_{j=1}^{obs} \frac{\partial x^{(j)}(t_i;x_0,p)}{\partial x0_k} \frac{ x^{(j)}(t_i;x_0,p)-x_i^{(j)}}{\sigma_{ij}^2} \]

and estimated parameters

\[ \frac{\partial L(x_0,p)}{\partial p_k}= \sum_{i=1}^n \sum_{j=1}^{obs} \frac{\partial x^{(j)}(t_i;x_0,p)}{\partial p_k} \frac{ x^{(j)}(t_i;x_0,p)-x_i^{(j)}}{\sigma_{ij}^2} \]

Implements ICapeSensNLPTask.

Gets number of state variables among sought parameters.

Implements DianaParameterFittingTask.

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.

Sets the description of the component.

Parameters:
_descriptionthe description of the component

Implements ICapeIdentification.

Sets the name of the component.

Parameters:
_namethe name of the component

Implements ICapeIdentification.

virtual eCapeNLPTaskType Type ( ) const [inline, virtual]

Returns type of solver that can be used for solvin this task

Implements ICapeNLPTask.

References Numeric::Solvers::NLPTasks::CAPE_FIRSTRANGE.


Member Data Documentation

Parameter that represents $ \epsilon=\partial x $ in formulas for approximating derivative. Default value $ 10^{-8}$. Usually $ \epsilon \approx \sqrt u $ for forward-difference where $ u $ is unit roundoff (for double $ u\approx 10^{-16} $).


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