KerMor
0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
|
DEIM: Tests regarding the DEIM method. More...
DEIM: Tests regarding the DEIM method.
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 Public Member Functions | |
DEIM (sys, dim) | |
function fx = | evaluateCoreFun (unused1,double t) |
Public Member Functions inherited from dscomponents.ACompEvalCoreFun | |
ACompEvalCoreFun (sys) | |
function fx = | evaluateComponentSet (integer nr,colvec< double > x,double t) |
Computes the full or reduced component functions of the given point set. More... | |
function fx = | evaluateComponentSetMulti (integer nr,matrix< double > x,rowvec< double > t,matrix< double > mu) |
Computes the full component functions of the given point set. More... | |
function dfx = | evaluateComponentSetGradientsAt (integer nr,colvec< double > x,double t) |
Computes the full/reduced gradients of all component functions of the given point set. More... | |
function J = | evaluateJacobianSet (integer nr,colvec< double > x,double t) |
Returns the jacobian entries of the point set that have been specified using setPointSet's argument jpd. More... | |
function J = | evaluateJacobianSetMulti (integer nr,matrix< double > x,rowvec< double > t,colvec< double > mu) |
Returns the jacobian entries at multiple locations/times/parameters of the point set that have been specified using setPointSet's argument jpd. More... | |
function | setPointSet (nr, pts, jpd) |
Parameters: pts: A row vector with the desired points jpd: ("Jacobian Partial Derivatives") A cell array of size equal to the number of points. Each cell contains the indices for which the partial derivatives of the corresponding component function will be computed when calling evaluateJacobianSet. More... | |
function target = | project (V, W, target) |
function copy = | clone (copy) |
The interface method with returns a copy of the current class instance. More... | |
function res = | test_ComponentEvalMatch (xsize) |
Tests if the local implementation of evaluateComponents matches the full evaluation. More... | |
Public Member Functions inherited from dscomponents.ACoreFun | |
ACoreFun (sys) | |
function | setSystem (sys) |
function target = | project (V, W, target) |
Sets the protected \(\vV,\vW\) matrices that can be utilized on core function evaluations after projection. More... | |
function fx = | evaluate (x, t) |
Evaluates the f-approximation. Depending on a possible projection and the CustomProjection-property the function either calls the inner evaluation directly which assumes \(f = f^r(z)\) or projects the reduced state variable z into the original space and evaluates the function there, so via \(f = V'f(Vz)\). More... | |
function fx = | evaluateMulti (colvec< double > x,double t,colvec< double > mu) |
Evaluates this function on multiple locations and maybe multiple times and parameters. More... | |
function | prepareSimulation (colvec< double > mu) |
A method that allows parameter-dependent computations to be performed before a simulation using this parameter starts. More... | |
function J = | getStateJacobian (x, t) |
Default implementation of jacobian matrix evaluation via finite differences. More... | |
function J = | getStateJacobianImpl (colvec< double > x,double t) |
Default implementation of state jacobians. uses finite differences. More... | |
function copy = | clone (copy) |
The interface method with returns a copy of the current class instance. More... | |
function [
matrix< double > J , dx ] = | getStateJacobianFD (x, t,rowvec< integer > partidx) |
Implementation of jacobian matrix evaluation via finite differences. More... | |
virtual function fx = | evaluateCoreFun (colvec< double > x,double t) |
Actual method used to evaluate the dynamical sytems' core function. More... | |
function res = | test_MultiArgEval (mudim) |
Convenience function that tests if a custom MultiArgumentEvaluation works as if called with single arguments. More... | |
function logical res = | test_Jacobian (matrix< double > xa,rowvec< double > ta,matrix< double > mua) |
Tests the custom provided jacobian matrix against the default finite difference computed one. 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 () | |
Public Member Functions inherited from general.AProjectable | |
function handle target = | project (matrix< double > V,matrix< double > W,handle target) |
Returns a NEW INSTANCE of the projected object that does not rely on data of the old one via references (everything must be copied to ensure separability of reduced(=projected) versions and full versions, unless. More... | |
function copy = | clone (copy) |
The interface method with returns a copy of the current class instance. More... | |
Static Public Member Functions | |
static function res = | test_DEIMNoSpatialDependence () |
static function | analysis_DEIM_approx (m) |
static function res = | computeDEIMErrors (general.DEIM deim,data.ApproxTrainData atd,rowvec< integer > orders,rowvec< integer > errorders) |
% DEIM approximation analysis over training data Computes the DEIM approximation error over the given training data for specified DEIM orders (M) and DEIM error orders (M'). More... | |
static function pm = | plotDEIMErrs (res, pm) |
static function [ double t , nof , nor , o , pm ] = | jacobian_tests (m, pm) |
Tis function computes the jacobians of both the full and DEIM approximated system functions. More... | |
static function [ efull , ered , fxno ] = | getApproxErrorFullRed (r, xr,double t,colvec< double > mu, V) |
static function [ etrue , EE , ED , pm ] = | getTrajApproxErrorDEIMEstimates (models.ReducedModel r,colvec< double > mu,integer inputidx) |
[etrue, EE, ED, pm] = getTrajApproxErrorDEIMEstimates(this, mu, inputidx) Computes the DEIM approximation errors for given mu and input. More... | |
static function pm = | getTrajApproxErrorDEIMEstimates_plots (r, etrue, EE, ED, pm) |
Visualizes the results of the ModelAnalyzer.getTrajApproxErrorDEIMEstimates method. More... | |
static function [ double t , values ] = | getMinReqErrorOrdersTable (errordata, relerrs, tsize, maxorder) |
Return values: t: A PrintTable containing the results. If not specified as a nargout argument, the table will be printed instead. More... | |
static function [ matrix < double > mui , fxi , afxi ] = | getDEIMErrorsAtXForParams (models.BaseFullModel m,colvec< double > x,integer numExtraSamples) |
% DEIM approximation analysis over parameters for specific state space location More... | |
static function pm = | getDEIMErrorsAtXForParams_plots (m,matrix< double > mui, fxi, afxi, pm) |
static function [ errs , relerrs , times , rowvec < integer > deim_orders ] = | getDEIMReducedModelErrors (models.ReducedModel r,colvec< double > mu,integer inidx,rowvec< integer > deim_orders) |
% Model DEIM reduction quality assessment pics More... | |
static function pm = | getDEIMReducedModelErrors_plots (r, errs, relerrs, times, deim_orders, pm, tag) |
static function [ e , aln , rowvec < integer > orders ] = | compareDEIM_Full_Jacobian (models.BaseFullModel m,data.ApproxTrainData atd,rowvec< integer > orders) |
% Matrix DEIM approximation analysis Compares the MDEIM approximation with the full jacobian More... | |
static function pm = | compareDEIM_Full_Jacobian_plots (m, e, aln, orders, pm, atdsubset) |
static function pm = | effectivityAnalysis (models.ReducedModel r,colvec< double > mu,integer inputidx) |
% Effectivity analysis of error estimators Plots an effectivity graph for the current error estimator. More... | |
static function struct est = | getDEIMEstimators_MDEIM_ST (models.ReducedModel rmodel,struct est,rowvec< integer > jdorders,rowvec< integer > stsizes) |
% Error estimator struct compilation Computes a set of DEIMEstimators for given MDEIM orders and simtrans-sizes. More... | |
static function est = | getDEIMEstimators_ErrOrders (models.ReducedModel rmodel, est, errororders) |
Protected Member Functions | |
function fx = | evaluateComponents (pts, ends, idx, self,colvec< double > x,double t) |
function fx = | evaluateComponentsMulti (pts, ends, idx, self,colvec< double > x,double t,colvec< double > mu) |
Protected Member Functions inherited from dscomponents.ACompEvalCoreFun | |
function matrix < double > dfx = | evaluateComponentGradientsAt (rowvec< integer > pts,rowvec< integer > ends,rowvec< integer > idx,rowvec< integer > self,colvec< double > x,double t) |
Default implementation of gradient computation via finite differences. More... | |
function dfx = | evaluateComponentPartialDerivatives (rowvec< integer > pts,rowvec< integer > ends,rowvec< integer > idx,rowvec< integer > deriv,rowvec< integer > self,colvec< double > x,double t, dfxsel) |
Computes specified partial derivatives of \(f\) of the components given by pts and the selected partial derivatives by dfxsel. More... | |
function dfx = | evaluateComponentPartialDerivativesMulti (pts, ends, idx, deriv, self,colvec< double > x,double t,colvec< double > mu, dfxsel) |
Multi-argument evaluation method for partial derivatives. Not used so far in KerMor, this is "legacy code" to keep around if needed at any stage as default finite difference-implementation. More... | |
function fx = | evaluateComponentsMulti (pts, ends, idx, self,colvec< double > x,double t,colvec< double > mu) |
virtual function fx = | evaluateComponents (rowvec< integer > pts,rowvec< integer > ends,rowvec< integer > idx,rowvec< integer > self,matrix< double > x,rowvec< double > t,colvec< double > mu) |
This is the template method that actually evaluates the components at given points and values. More... | |
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) |
Additional Inherited Members | |
Public Attributes inherited from dscomponents.ACompEvalCoreFun | |
PointSets | |
Public Attributes inherited from dscomponents.ACoreFun | |
logical | TimeDependent = true |
Flag that indicates if the ACoreFun is (truly) time-dependent. More... | |
CustomProjection = false | |
Set this property if the projection process is customized by overriding the default project method. More... | |
sparse< logical > | JSparsityPattern = "[]" |
Sparsity pattern for the jacobian matrix. More... | |
integer | xDim = "[]" |
The current state space dimension of the function's argument \(x\). More... | |
integer | fDim = "[]" |
The current output dimension of the function. More... | |
models.BaseFirstOrderSystem | System |
The system associated with the current ACoreFun. More... | |
colvec< double > | mu = "[]" |
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime during simulations. More... | |
Vcache | |
Wcache | |
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... | |
Public Attributes inherited from general.AProjectable | |
V | |
The \(V\) matrix of the biorthogonal pair \(V,W\). More... | |
W | |
The \(W\) matrix of the biorthogonal pair \(V,W\). More... | |
Static Protected Member Functions inherited from dscomponents.ACompEvalCoreFun | |
static function obj = | loadobj (obj, from) |
Static Protected Member Functions inherited from dscomponents.ACoreFun | |
static function obj = | loadobj (obj, from) |
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) |
Static Protected Member Functions inherited from general.AProjectable | |
static function obj = | loadobj (obj, from) |
Protected Attributes inherited from dscomponents.ACompEvalCoreFun | |
matrix< double > | S = {""} |
The x-component selection matrices (precomputed on setting PointSet/AltPointSet). �S� is passed to the function evaluating the components of �� or its derivatives. More... | |
testing.DEIM.DEIM | ( | sys, | |
dim | |||
) |
Definition at line 47 of file DEIM.m.
References dscomponents.ACoreFun.fDim, dscomponents.ACoreFun.JSparsityPattern, and dscomponents.ACoreFun.xDim.
|
static |
Definition at line 112 of file DEIM.m.
References dscomponents.ACoreFun.mu, and t.
|
static |
% Matrix DEIM approximation analysis Compares the MDEIM approximation with the full jacobian
m | The full model |
atd | The approximation training data |
orders | The different orders \(m_J\) to try |
Definition at line 780 of file DEIM.m.
References models.BaseFullModel.Data, models.BaseFullModel.ErrorEstimator, models.BaseFirstOrderSystem.f, dscomponents.ACoreFun.getStateJacobian(), data.ModelData.JacobianTrainData, dscomponents.ACoreFun.JSparsityPattern, Norm.L2(), Utils.logNorm(), handle.reshape, models.BaseModel.System, and t.
|
static |
Definition at line 836 of file DEIM.m.
References LogPlot.logsurf(), handle.sort, X, and Y.
|
static |
% DEIM approximation analysis over training data Computes the DEIM approximation error over the given training data for specified DEIM orders (M) and DEIM error orders (M').
The error over any training data point is measured L2 in state and Linf over all training points.
1: order 2: errororder 3: max abs true error (indep. of errororder) 4: max rel true error w.r.t true fxi norm (indep. of errororder) 5: mean abs true error (indep. of errororder) 6: mean rel true error w.r.t true fxi norm (indep. of errororder) 7: max abs estimated error 8: max rel estimated error w.r.t true fxi norm 9: mean abs estimated error 10: mean rel estimated error w.r.t true fxi norm 11: max rel error of (estimated-true error) w.r.t true error 12: mean rel error of (estimated-true error) w.r.t true error 13: max rel error of (estimated-maxorder error) w.r.t maxorder error 14: mean rel error of (estimated-maxorder error) w.r.t maxorder error
deim | The DEIM instance |
atd | The approximation training data |
orders | The different orders \(1 \leq m\leq M\) to try |
errorders | The different error orders \(1 \leq m'\leq M-m\) to try |
res | A 12 x totalcombinations matrix containing the values in rows |
Definition at line 146 of file DEIM.m.
References general.DEIM.evaluate(), data.ApproxTrainData.fxi, data.FileMatrix.getBlockPos(), general.DEIM.getEstimatedError(), k, Norm.L2(), data.FileMatrix.m, general.DEIM.MaxOrder, data.ApproxTrainData.mui, data.FileMatrix.nBlocks, general.DEIM.Order, t, data.ApproxTrainData.ti, general.AProjectable.V, and data.ApproxTrainData.xi.
|
static |
% Effectivity analysis of error estimators Plots an effectivity graph for the current error estimator.
r | The reduced model |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
inputidx | The index \(i\) of the currently used input function \(u_i(t)\). Set to \([]\) if not used. |
Definition at line 889 of file DEIM.m.
References models.ReducedModel.ErrorEstimator, models.ReducedModel.FullModel, Norm.L2(), error.BaseEstimator.OutputError, models.BaseModel.simulate(), and t.
|
protected |
Definition at line 67 of file DEIM.m.
References evaluateComponentsMulti(), and dscomponents.ACoreFun.mu.
|
protected |
Definition at line 72 of file DEIM.m.
References dscomponents.ACoreFun.mu.
Referenced by evaluateComponents().
function fx = testing.DEIM.evaluateCoreFun | ( | unused1, | |
double | t | ||
) |
Definition at line 60 of file DEIM.m.
References dscomponents.ACoreFun.fDim, and dscomponents.ACoreFun.mu.
|
static |
% DEIM approximation analysis over parameters for specific state space location
Only t=0 is used
m | The full model |
x | The state space location \(\vx\) |
numExtraSamples | The number of extra samples to use. Default: 0 |
Definition at line 647 of file DEIM.m.
References models.BaseFullModel.Approx, models.BaseFullModel.Data, dscomponents.ACoreFun.evaluate(), models.BaseFirstOrderSystem.f, data.ModelData.ParamSamples, and models.BaseModel.System.
|
static |
Definition at line 676 of file DEIM.m.
References Norm.L2(), PlotManager.LeaveOpen, and LogPlot.logtrisurf().
|
static |
Definition at line 965 of file DEIM.m.
References error.BaseEstimator.clone(), and models.ReducedModel.ErrorEstimator.
|
static |
% Error estimator struct compilation Computes a set of DEIMEstimators for given MDEIM orders and simtrans-sizes.
rmodel | The reduced model |
est | The estimator settings struct |
jdorders | The MDEIM orders \(1\leq m_J \leq M_J\) to use |
stsizes | The similarity transformation sizes \(1\leq k \leq d\) to use |
est | An estimator struct usable by the EstimatorAnalyzer |
Definition at line 917 of file DEIM.m.
References error.BaseEstimator.clone(), models.ReducedModel.ErrorEstimator, and k.
|
static |
% Model DEIM reduction quality assessment pics
r | The reduced model |
mu | The current parameter \(\vmu\) |
inidx | The input index \(i\) for the input function \(\vu_i(t)\) |
deim_orders | The DEIM orders \(1 \leq m \leq M\) to use |
Definition at line 706 of file DEIM.m.
References models.ReducedModel.ErrorEstimator, models.BaseFirstOrderSystem.f, models.ReducedModel.FullModel, Norm.L2(), error.BaseEstimator.OutputError, models.BaseModel.simulate(), models.BaseModel.System, and models.BaseModel.Times.
|
static |
Definition at line 744 of file DEIM.m.
References LogPlot.logsurf(), X, and Y.
|
static |
Return values: t: A PrintTable containing the results. If not specified as a nargout argument, the table will be printed instead.
values: a value matrix with rows for orders and columns for relerrs
Definition at line 587 of file DEIM.m.
References t.
|
static |
[etrue, EE, ED, pm] = getTrajApproxErrorDEIMEstimates(this, mu, inputidx) Computes the DEIM approximation errors for given mu and input.
Depending on the current Order \(o\) of the DEIM approximation, all possible ErrorOrders \(eo = o+1 ... N\) to the approx.DEIM.MaxOrder \(N\) are used estimations for the given trajectory computed.
r | The reduced model |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
inputidx | The index \(i\) of the currently used input function \(u_i(t)\). Set to \([]\) if not used. |
etrue | The true approximation error using the full trajectory. |
EE | The matrix of estimated errors, containing the estimated state-space L2 error (columns) for each possible ErrorOrder (rows). time step. |
ED | The absolute difference between true and estimated error for each ErrorOrder (rows) and timestep (columns) |
pm | The PlotManager used to create the result plots. If not requested as output, no plotting will be done. |
Definition at line 456 of file DEIM.m.
References models.ReducedModel.FullModel, Norm.L2(), dscomponents.ACoreFun.mu, and t.
|
static |
Visualizes the results of the ModelAnalyzer.getTrajApproxErrorDEIMEstimates method.
Definition at line 543 of file DEIM.m.
References LogPlot.logsurf(), and t.
|
static |
Definition at line 283 of file DEIM.m.
References LogPlot.logtrisurf().
|
static |