KerMor
0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
|
DEIMEstimator: A-posteriori error estimation for DEIM reduced models. More...
DEIMEstimator: A-posteriori error estimation for DEIM reduced models.
This class is part of the framework
Homepage
http://www.morepas.org/software/index.htmlDocumentation
http://www.morepas.org/software/kermor/index.htmlLicense
KerMor license conditions Definition at line 18 of file DEIMEstimator.m.
Public Member Functions | |
DEIMEstimator () | |
function | offlineComputations (models.BaseFullModel fm) |
Overrides the method from BaseEstimator and performs additional computations. More... | |
function
prepared = | prepareForReducedModel (models.ReducedModel rm) |
Prepares this estimator for use with a given reduced model. Basically uses the projection matrices and some other reduced quantities for local storage. More... | |
function ct = | prepareConstants (colvec< double > mu,integer inputidx) |
function a = | getAlpha (colvec< double > x,double t,colvec< double > ut) |
More expensive variant, using the true DEIM approximation error instead of the estimated ones using M,M' technique. More... | |
function b = | getBeta (colvec< double > x,double t) |
Old log lip const kernel learning code x = x .* (this.scale(:,2) - this.scale(:,1)) + this.scale(:,1); x = (x - this.scale(:,1)) ./ (this.scale(:,2) - this.scale(:,1)); b = this.kexp.evaluate(x, t, mu)*olderr + sqrt(abs(a));. More... | |
function eint = | evalODEPart (colvec< double > x,double t,colvec< double > ut) |
Compose the ode function. More... | |
function time = | postProcess (matrix< double > x,double t,integer inputidx) |
Postprocessing for the error estimate. More... | |
function copy = | clone () |
function | plotSummary (pm, context) |
Public Member Functions inherited from error.BaseEstimator | |
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 errmsg = | validModelForEstimator (models.BaseFullModel model) |
Abstract static method that forces subclasses to specify whether an estimator can be used for a given model or not. More... | |
Static Public Member Functions inherited from error.BaseEstimator | |
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 | |
integer | JacSimTransMaxSize = 50 |
The maximum size of the similarity transformation. More... | |
integer | JacMatDEIMMaxOrder = 50 |
Maximum order for the DEIM approximation of the state space jacobian. More... | |
data.selection.ASelector | TrainDataSelector |
The selector that chooses the full model's trajectory points that are used for the MatrixDEIM approximation of the jacobian and the partial similarity transformation. More... | |
UseFullJacobian = false | |
"Expensive version": Using the full system's jacobian for logarithmic norm computation. Included for easy error estimator comparison. More... | |
UseTrueLogLipConst = false | |
"Even More Expensive version": Precompute the full solution and use the true logarithmic lipschitz constant of \(f\) in computations. Included for easy error estimator comparison. More... | |
UseJacobianLogLipConst = false | |
"Even More Expensive version 2": Precompute the full solution and use the true logarithmic lipschitz constant of the jacobian of \(f\) in computations. Included for easy error estimator comparison. More... | |
UseJacobianNorm = false | |
Expensive conservative guess. More... | |
UseTrueDEIMErr = false | |
"Expensive" version that uses the true approximation error between the DEIM approximation and the full system function instead of the \(M'\) variant. More... | |
matrix< double > | QFull = "[]" |
The complete similarity transformation \(\vQ\) matrix of size \(d \times JacSimTransMaxSize\). More... | |
rowvec< double > | QSingVals = "[]" |
The singular values computed by the SimTransPOD in the offline stage. More... | |
general.MatrixDEIM | JacMDEIM |
The MatrixDEIM instance used to approximate the state space jacobian matrices. More... | |
M3 = "[]" | |
M4 = "[]" | |
M5 = "[]" | |
M6 = "[]" | |
M7 = "[]" | |
M8 = "[]" | |
M9 = "[]" | |
M10 = "[]" | |
M11 = "[]" | |
M12 = "[]" | |
Ah | |
the \(\hat{A}\) component More... | |
Bh | |
the \(\hat{B}\) component More... | |
Aln | |
The precomputed logarithmic norms of the system's A components. More... | |
scale | |
Stores zi min- and max scaling. More... | |
LastAlpha | |
LastBeta | |
kexp | |
The local logarithmic norm estimation. More... | |
integer | JacSimTransSize |
The size of the partial similarity transform to apply to the matrix DEIM approximated jacobians. More... | |
integer | JacMatDEIMOrder |
The actual order of the DEIM approximation for the system's jacobian. More... | |
Public Attributes inherited from error.BaseEstimator | |
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... | |
Static Protected Member Functions | |
static function obj = | loadobj (obj) |
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) |
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) |
error.DEIMEstimator.DEIMEstimator | ( | ) |
Definition at line 349 of file DEIMEstimator.m.
References error.BaseEstimator.ExtraODEDims, and TrainDataSelector.
function copy = error.DEIMEstimator.clone | ( | ) |
Definition at line 702 of file DEIMEstimator.m.
References handle.addlistener, Ah, Aln, Bh, ICloneable.clone(), general.MatrixDEIM.clone(), JacMatDEIMMaxOrder, JacMDEIM, JacSimTransMaxSize, kexp, M10, M11, M12, M3, M4, M5, M6, M7, M8, M9, QFull, QSingVals, scale, TrainDataSelector, UseFullJacobian, UseTrueDEIMErr, and UseTrueLogLipConst.
function eint = error.DEIMEstimator.evalODEPart | ( | colvec< double > | x, |
double | t, | ||
colvec< double > | ut | ||
) |
Compose the ode function.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
ut | The value \(\vu(t)\) of the current input function \(\vu\) at time \(t\), [] else. |
Definition at line 656 of file DEIMEstimator.m.
References getAlpha(), and getBeta().
More expensive variant, using the true DEIM approximation error instead of the estimated ones using M,M' technique.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
ut | The value \(\vu(t)\) of the current input function \(\vu\) at time \(t\), [] else. |
Definition at line 507 of file DEIMEstimator.m.
References models.BaseFirstOrderSystem.A, dscomponents.LinearCoreFun.evaluate(), models.BaseFirstOrderSystem.f, models.ReducedModel.FullModel, LastAlpha, Norm.LG(), M11, M12, M4, M5, M6, M7, M8, M9, error.BaseEstimator.mu, error.BaseEstimator.ReducedModel, models.BaseModel.System, and UseTrueDEIMErr.
Referenced by evalODEPart(), and postProcess().
Old log lip const kernel learning code x = x .* (this.scale(:,2) - this.scale(:,1)) + this.scale(:,1); x = (x - this.scale(:,1)) ./ (this.scale(:,2) - this.scale(:,1)); b = this.kexp.evaluate(x, t, mu)*olderr + sqrt(abs(a));.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
Definition at line 580 of file DEIMEstimator.m.
References Aln, general.MatrixDEIM.evaluate(), models.BaseFirstOrderSystem.f, models.ReducedModel.FullModel, dscomponents.ACoreFun.getStateJacobian(), JacMDEIM, LastBeta, Utils.logNorm(), error.BaseEstimator.mu, error.BaseEstimator.ReducedModel, models.BaseModel.System, UseFullJacobian, UseJacobianLogLipConst, UseJacobianNorm, and UseTrueLogLipConst.
Referenced by evalODEPart(), and postProcess().
|
staticprotected |
Definition at line 1044 of file DEIMEstimator.m.
References handle.addlistener.
function error.DEIMEstimator.offlineComputations | ( | models.BaseFullModel | fm | ) |
Overrides the method from BaseEstimator and performs additional computations.
fm | The full model. |
Definition at line 356 of file DEIMEstimator.m.
References models.BaseFirstOrderSystem.A, Aln, KerMor.App(), Utils.logNorm(), and models.BaseModel.System.
|
virtual |
Implements IReductionSummaryPlotProvider.
Definition at line 770 of file DEIMEstimator.m.
References QSingVals.
Postprocessing for the error estimate.
t, mu, inputidx do nothing
x | The whole just computed trajectory |
t | The current time(s) \(t \in [0, T]\) |
inputidx | The index \(i\) of the currently used input function \(u_i(t)\). Set to \([]\) if not used. |
varargin | Any further arguments that are passed, but ignored here as not necessary. |
Definition at line 670 of file DEIMEstimator.m.
References getAlpha(), getBeta(), LastAlpha, LastBeta, error.BaseEstimator.mu, error.BaseEstimator.ReducedModel, models.BaseModel.scaledTimes, and error.BaseEstimator.StateError.
Definition at line 469 of file DEIMEstimator.m.
References error.BaseEstimator.Enabled, general.DEIM.f, JacMDEIM, kexp, LastAlpha, LastBeta, M6, M7, M8, M9, dscomponents.ACoreFun.prepareSimulation(), error.BaseEstimator.ReducedModel, UseJacobianLogLipConst, and UseTrueLogLipConst.
function prepared = error.DEIMEstimator.prepareForReducedModel | ( | models.ReducedModel | rm | ) |
Prepares this estimator for use with a given reduced model. Basically uses the projection matrices and some other reduced quantities for local storage.
rm | The reduced model |
Definition at line 402 of file DEIMEstimator.m.
References handle.addlistener, models.BaseFirstOrderSystem.f, models.ReducedModel.FullModel, G, JacMDEIM, general.MatrixDEIM.project(), models.BaseModel.System, t, models.ReducedModel.V, and models.ReducedModel.W.
|
static |
Abstract static method that forces subclasses to specify whether an estimator can be used for a given model or not.
model | A KerMor full model |
Definition at line 1054 of file DEIMEstimator.m.
References models.BaseFirstOrderSystem.A, models.BaseFullModel.Approx, models.BaseFirstOrderSystem.B, and models.BaseModel.System.
error.DEIMEstimator.Ah |
the \(\hat{A}\) component
SetAccess = Private, GetAccess = Public
Definition at line 231 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.Aln |
The precomputed logarithmic norms of the system's A components.
SetAccess = Private, GetAccess = Public
Definition at line 250 of file DEIMEstimator.m.
Referenced by clone(), getBeta(), and offlineComputations().
error.DEIMEstimator.Bh |
the \(\hat{B}\) component
SetAccess = Private, GetAccess = Public
Definition at line 240 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.JacMatDEIMMaxOrder = 50 |
Maximum order for the DEIM approximation of the state space jacobian.
Default: 50
Definition at line 80 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.JacMatDEIMOrder |
The actual order of the DEIM approximation for the system's jacobian.
Upper bounded by JacMatDEIMMaxOrder and defaults to the ceiled half of the maximum size (set during offlineComputations)
Default: ceil(JacMatDEIMMaxOrder/2)
Dependent
set to true. Definition at line 310 of file DEIMEstimator.m.
error.DEIMEstimator.JacMDEIM |
The MatrixDEIM instance used to approximate the state space jacobian matrices.
The default MaxOrder setting is 50.
SetAccess = Private, GetAccess = Public
Definition at line 193 of file DEIMEstimator.m.
Referenced by clone(), getBeta(), prepareConstants(), and prepareForReducedModel().
error.DEIMEstimator.JacSimTransMaxSize = 50 |
The maximum size of the similarity transformation.
Set to empty if not wanted. The BaseFullModel sets this value at offline generations phase
Default: 50
Definition at line 65 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.JacSimTransSize |
The size of the partial similarity transform to apply to the matrix DEIM approximated jacobians.
Upper bounded by JacSimTransMaxSize and defaults to the ceiled half of the maximum size (set during offlineComputations)
Default: ceil(JacSimTransMaxSize/2)
Dependent
set to true. Definition at line 291 of file DEIMEstimator.m.
error.DEIMEstimator.kexp |
The local logarithmic norm estimation.
SetAccess = Private, GetAccess = Public
Definition at line 278 of file DEIMEstimator.m.
Referenced by clone(), and prepareConstants().
error.DEIMEstimator.LastAlpha |
Definition at line 272 of file DEIMEstimator.m.
Referenced by getAlpha(), postProcess(), and prepareConstants().
error.DEIMEstimator.LastBeta |
Definition at line 275 of file DEIMEstimator.m.
Referenced by getBeta(), postProcess(), and prepareConstants().
error.DEIMEstimator.M10 = "[]" |
Definition at line 225 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.M11 = "[]" |
Definition at line 227 of file DEIMEstimator.m.
Referenced by clone(), and getAlpha().
error.DEIMEstimator.M12 = "[]" |
Definition at line 229 of file DEIMEstimator.m.
Referenced by clone(), and getAlpha().
error.DEIMEstimator.M3 = "[]" |
Definition at line 211 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.M4 = "[]" |
Definition at line 213 of file DEIMEstimator.m.
Referenced by clone(), and getAlpha().
error.DEIMEstimator.M5 = "[]" |
Definition at line 215 of file DEIMEstimator.m.
Referenced by clone(), and getAlpha().
error.DEIMEstimator.M6 = "[]" |
Definition at line 217 of file DEIMEstimator.m.
Referenced by clone(), getAlpha(), and prepareConstants().
error.DEIMEstimator.M7 = "[]" |
Definition at line 219 of file DEIMEstimator.m.
Referenced by clone(), getAlpha(), and prepareConstants().
error.DEIMEstimator.M8 = "[]" |
Definition at line 221 of file DEIMEstimator.m.
Referenced by clone(), getAlpha(), and prepareConstants().
error.DEIMEstimator.M9 = "[]" |
Definition at line 223 of file DEIMEstimator.m.
Referenced by clone(), getAlpha(), and prepareConstants().
error.DEIMEstimator.QFull = "[]" |
The complete similarity transformation \(\vQ\) matrix of size \(d \times JacSimTransMaxSize\).
(Debug/testing use)
Default: []
SetAccess = Private, GetAccess = Public
Definition at line 161 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.QSingVals = "[]" |
The singular values computed by the SimTransPOD in the offline stage.
(Debug/testing use)
Default: []
SetAccess = Private, GetAccess = Public
Definition at line 177 of file DEIMEstimator.m.
Referenced by clone(), and plotSummary().
error.DEIMEstimator.scale |
Stores zi min- and max scaling.
SetAccess = Private, GetAccess = Public
Definition at line 261 of file DEIMEstimator.m.
Referenced by clone().
error.DEIMEstimator.TrainDataSelector |
The selector that chooses the full model's trajectory points that are used for the MatrixDEIM approximation of the jacobian and the partial similarity transformation.
Definition at line 91 of file DEIMEstimator.m.
Referenced by clone(), and DEIMEstimator().
error.DEIMEstimator.UseFullJacobian = false |
"Expensive version": Using the full system's jacobian for logarithmic norm computation. Included for easy error estimator comparison.
Default: false
Definition at line 104 of file DEIMEstimator.m.
error.DEIMEstimator.UseJacobianLogLipConst = false |
"Even More Expensive version 2": Precompute the full solution and use the true logarithmic lipschitz constant of the jacobian of \(f\) in computations. Included for easy error estimator comparison.
Default: false
Definition at line 127 of file DEIMEstimator.m.
Referenced by getBeta(), and prepareConstants().
error.DEIMEstimator.UseJacobianNorm = false |
Expensive conservative guess.
Default: false
Definition at line 139 of file DEIMEstimator.m.
Referenced by getBeta().
error.DEIMEstimator.UseTrueDEIMErr = false |
"Expensive" version that uses the true approximation error between the DEIM approximation and the full system function instead of the \(M'\) variant.
Default: false
Definition at line 148 of file DEIMEstimator.m.
Referenced by clone(), and getAlpha().
error.DEIMEstimator.UseTrueLogLipConst = false |
"Even More Expensive version": Precompute the full solution and use the true logarithmic lipschitz constant of \(f\) in computations. Included for easy error estimator comparison.
Default: false
Definition at line 115 of file DEIMEstimator.m.
Referenced by clone(), getBeta(), and prepareConstants().