KerMor  0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
error.BaseEstimator Class Referenceabstract

Base class for all error estimators. More...

Detailed Description

Base class for all error estimators.

In KerMor any error estimators have the chance to add additionaly terms to the ODE function by using the evalODEPart and getE0 functions. Finally, the method postProcess gets called when the ODE solver finished to allow for any processing / final computation of error estimates.

Author
Daniel Wirtz
Date
24.11.2010
New in 0.6:
(Daniel Wirtz, 2012-09-21) Removed the setReducedModel and replaced it by a estimator-cloning function error.BaseEstimator.prepareForReducedModel, that performs all necessary steps once the reduced model is completely built with all reduced components.
New in 0.6:
(Daniel Wirtz, 2012-06-08) Split up the former setReducedModel routine into offlineGenerations and setReducedModel. The first stage is run together with the BaseFullModels offlineGenerations, and the latter for every reduced model created from the full one. (Originally the setReducedModel was to be taken away, but some estimators rely on the effectively projected reduced components of the reduced models)
Change in 0.6:
(Daniel Wirtz, 2011-12-14) Changed the interface of the BaseEstimator.postProcess and BaseEstimator.prepareConstants methods so that the effective time needed for computation is returned. This is a consequence of the models.BaseFullModel's simulation cache.
Change in 0.5:
(Daniel Wirtz, 2011-07-07) Added a new property e0Comp that computes the initial error for the given reduced model, depending on its initial value class. In consequence, the getE0 method is now found at this base error estimator class.
Change in 0.4:
(Daniel Wirtz, 2011-05-23) Created a new interface with separate output error computation. Postprocessing is now a template method and a new property error.BaseEstimator.OutputError has been introduced. Renamed the LastError property to error.BaseEstimator.StateError.
Change in 0.3:
(Syed Ammar, 2011-04-23) Implemented Setters for the properties
Todo:
include scaling effects into the error estimator!

Definition at line 18 of file BaseEstimator.m.

Public Member Functions

function  offlineComputations (models.BaseFullModel model)
 Performs a validity check for the given model and sets up the estimator for use with the specified model. More...
 
function double ct = postProcess (unused1,rowvec t, unused2)
 Post-processes the error estimator ODE part after reduced simulation computation. More...
 
function  clear ()
 Clears the last error set by the estimator. More...
 
function copy = clone (copy)
 Creates a copy of this error estimator. Call only allowed from subclasses. More...
 
function e0 = getE0 (colvec< double > mu)
 Calls the inner initial error computation strategy. More...
 
function ct = prepareConstants (colvec< double > mu, unused1)
 
function
prepared = 
prepareForReducedModel (models.ReducedModel rmodel)
 Default implementation which simply clones this (subclass!)instance and returns the copy to use in reduced models. More...
 
virtual function eint = evalODEPart (colvec x,double t,double ut)
 Template method for evaluation of the auxiliary ode part of the error estimator. More...
 
- Public Member Functions inherited from KerMorObject
 KerMorObject ()
 Constructs a new KerMor object. More...
 
function  display ()
 disp(object2str(this)); More...
 
function bool = eq (B)
 Checks equality of two KerMor objects. More...
 
function bool = ne (B)
 Checks if two KerMorObjects are different. More...
 
function cn = getClassName ()
 Returns the simple class name of this object without packages. More...
 
- Public Member Functions inherited from DPCMObject
 DPCMObject ()
 Creates a new DPCM object. More...
 
 DPCMObject ()
 

Static Public Member Functions

static function est = getEstimator (models.BaseFullModel model)
 Factory method that creates a suitable error estimator for the given model. More...
 
static function errmsg = validModelForEstimator (models.ReducedModel rmodel)
 Abstract static method that forces subclasses to specify whether an estimator can be used for a given model or not. More...
 

Public Attributes

 Enabled
 Flag that indicates whether error estimation is used or not. More...
 
 StateError = "[]"
 The reduction state-space error from the last simulation. More...
 
 ExtraODEDims = 0
 The dimensions added to the ODE function by the estimator. More...
 
 OutputError = "[]"
 The output error from the last simulation. More...
 
models.ReducedModel ReducedModel = "[]"
 The reduced model associated with the error estimator. More...
 
 mu
 
- Public Attributes inherited from DPCMObject
 WorkspaceVariableName = ""
 The workspace variable name of this class. Optional. More...
 
 ID = "[]"
 An ID that allows to uniquely identify this DPCMObject (at least within the current MatLab session/context). More...
 
 PropertiesChanged = "[]"
 The Dictionary containing all the property settings as key/value pairs. More...
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs. More...
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects. More...
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends. More...
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function. More...
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function. More...
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects. More...
 
 findprop
 Returns a meta.property objects associated with the specified property name. More...
 
 fields
 Returns a cell array of string containing the names of public properties. More...
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function. More...
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass. More...
 
 eq
 Relational functions example. See details for more information. More...
 
 transpose
 Transposes the elements of the handle object array. More...
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function. More...
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function. More...
 
 sort
 ort the handle objects in any array in ascending or descending order. More...
 

Additional Inherited Members

- Protected Member Functions inherited from KerMorObject
function  checkType (obj, type)
 Object typechecker. More...
 
- Protected Member Functions inherited from DPCMObject
function  registerProps (varargin)
 Call this method at any class that defines DPCM observed properties. More...
 
function  registerProps (varargin)
 
- Static Protected Member Functions inherited from DPCMObject
static function obj = loadobj (obj, from)
 Re-register any registered change listeners! More...
 
static function obj = loadobj (obj, from)
 

Member Function Documentation

function error.BaseEstimator.clear ( )

Clears the last error set by the estimator.

Definition at line 234 of file BaseEstimator.m.

References OutputError, and StateError.

Referenced by models.ReducedModel.computeTrajectory().

Here is the caller graph for this function:

function copy = error.BaseEstimator.clone (   copy)
virtual

Creates a copy of this error estimator. Call only allowed from subclasses.

Parameters
copyThe subclass instance where to copy the local properties to
Generated fields of copy:

Implements ICloneable.

Definition at line 244 of file BaseEstimator.m.

References Enabled, ExtraODEDims, mu, OutputError, ReducedModel, and StateError.

Referenced by testing.DEIM.getDEIMEstimators_ErrOrders(), testing.DEIM.getDEIMEstimators_MDEIM_ST(), and prepareForReducedModel().

Here is the caller graph for this function:

function eint = error.BaseEstimator.evalODEPart ( colvec  x,
double  t,
double  ut 
)
pure virtual

Template method for evaluation of the auxiliary ode part of the error estimator.

Parameters
xThe full extended state variable vector. Extended means that the last ExtraODEDims rows contain the error estimators own data. If not used, implementers must take care to ditch those values if any function evaluations are performed within the integral part.
tThe current time \(t\)
utThe value of the input function \(u(t)\) if given, [] else.
Return values
eintThe auxiliary ode part value.

Implemented in error.TPWLLocalLipEstimator, and error.BaseCompLemmaEstimator.

function e0 = error.BaseEstimator.getE0 ( colvec< double mu)

Calls the inner initial error computation strategy.

Parameters
muThe currently used parameter \(\vmu\). Set to \([]\) if not used.

Definition at line 270 of file BaseEstimator.m.

Referenced by error.IterationCompLemmaEstimator.postProcess().

Here is the caller graph for this function:

function est = error.BaseEstimator.getEstimator ( models.BaseFullModel  model)
static

Factory method that creates a suitable error estimator for the given model.

Tries to always select the best estimator available for the model. Of course the error estimator can be changed manually later on.

Todo:
overhaul this method of assigning an error estimator to a reduced model. at this method local knowledge of all available error estimators has to be present anyways if going through this in a if then fashion. otherwise, see if reflection may be used here!
Parameters
modelA KerMor full model

Definition at line 381 of file BaseEstimator.m.

function error.BaseEstimator.offlineComputations ( models.BaseFullModel  model)

Performs a validity check for the given model and sets up the estimator for use with the specified model.

Override in subclasses and call this method first to perform any additional offline computations

Parameters
modelA KerMor full model
Required fields of model:

Definition at line 159 of file BaseEstimator.m.

References models.BaseModel.System, and models.BaseFirstOrderSystem.x0.

Referenced by error.DefaultEstimator.DefaultEstimator().

Here is the caller graph for this function:

function double ct = error.BaseEstimator.postProcess (   unused1,
rowvec  t,
  unused2 
)

Post-processes the error estimator ODE part after reduced simulation computation.

Here the OutputError fields

Parameters
unused1Marked as "~" in original m-file.
tThe times at which the reduced simulation was computed
unused2Marked as "~" in original m-file.
xThe reduced simulation's system state PLUS the error estimation values in the last this.ExtraODEDims rows.
inputidxThe current input index
Return values
ctThe time needed for postprocessing

Definition at line 181 of file BaseEstimator.m.

References all(), models.BaseFirstOrderSystem.C, models.ReducedModel.FullModel, mu, OutputError, ReducedModel, StateError, models.BaseModel.System, and models.ReducedModel.V.

Referenced by models.ReducedModel.computeTrajectory().

Here is the call graph for this function:

Here is the caller graph for this function:

function ct = error.BaseEstimator.prepareConstants ( colvec< double mu,
  unused1 
)

Definition at line 282 of file BaseEstimator.m.

References mu.

Referenced by models.ReducedModel.computeTrajectory().

Here is the caller graph for this function:

function prepared = error.BaseEstimator.prepareForReducedModel ( models.ReducedModel  rmodel)

Default implementation which simply clones this (subclass!)instance and returns the copy to use in reduced models.

Override in subclasses to do final (e.g. projection-related) steps.

Parameters
rmodelA KerMor reduced model
Generated fields of prepared:

Definition at line 288 of file BaseEstimator.m.

References clone().

Referenced by models.ReducedModel.build(), and error.DefaultEstimator.DefaultEstimator().

Here is the call graph for this function:

Here is the caller graph for this function:

function errmsg = error.BaseEstimator.validModelForEstimator ( models.ReducedModel  rmodel)
staticpure virtual

Abstract static method that forces subclasses to specify whether an estimator can be used for a given model or not.

Parameters
rmodelA KerMor reduced model

Implemented in error.TPWLLocalLipEstimator.

Member Data Documentation

error.BaseEstimator.Enabled

Flag that indicates whether error estimation is used or not.

Default: true

Note
This property has the MATLAB attribute Dependent set to true.
Matlab documentation of property attributes.

Definition at line 67 of file BaseEstimator.m.

Referenced by clone(), models.ReducedModel.computeTrajectory(), error.DefaultEstimator.DefaultEstimator(), and error.DEIMEstimator.prepareConstants().

error.BaseEstimator.ExtraODEDims = 0

The dimensions added to the ODE function by the estimator.

Please set to correct value in subclasses as simulations are not possible if set incorrect.

Default: 0

Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.
This property has custom functionality when its value is changed.

Definition at line 97 of file BaseEstimator.m.

Referenced by error.BaseCompLemmaEstimator.BaseCompLemmaEstimator(), clone(), models.ReducedModel.computeTrajectory(), error.DefaultEstimator.DefaultEstimator(), error.DEIMEstimator.DEIMEstimator(), error.TPWLLocalLipEstimator.evalODEPart(), error.DefaultEstimator.postProcess(), error.TPWLLocalLipEstimator.postProcess(), and error.TPWLLocalLipEstimator.TPWLLocalLipEstimator().

error.BaseEstimator.OutputError = "[]"

The output error from the last simulation.

Default: []

See Also
models.ReducedModel.ErrorEstimator
Note
This property has non-standard access specifiers: SetAccess = Private, GetAccess = Public
Matlab documentation of property attributes.

Definition at line 115 of file BaseEstimator.m.

Referenced by clear(), clone(), testing.DEIM.effectivityAnalysis(), testing.DEIM.getDEIMReducedModelErrors(), EstimatorAnalyzer.getErrorEstimates(), and postProcess().

error.BaseEstimator.StateError = "[]"

The reduction state-space error from the last simulation.

Default: []

See Also
models.ReducedModel.ErrorEstimator
Note
This property has non-standard access specifiers: SetAccess = Protected, GetAccess = Public
Matlab documentation of property attributes.
This property has custom functionality when its value is changed.

Definition at line 82 of file BaseEstimator.m.

Referenced by clear(), clone(), EstimatorAnalyzer.getErrorEstimates(), error.GLEstimator.postProcess(), error.DefaultEstimator.postProcess(), postProcess(), error.TPWLLocalLipEstimator.postProcess(), error.IterationCompLemmaEstimator.postProcess(), and error.DEIMEstimator.postProcess().


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