KerMor
0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
|
KernelEI: DEIM approximation using kernel expansions for function/operator evaluations. More...
KernelEI: DEIM approximation using kernel expansions for function/operator evaluations.
Implements the ideas described in [14] .
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 KernelEI.m.
Public Member Functions | |
KernelEI (sys) | |
function | approximateSystemFunction (models.BaseFullModel model) |
function fx = | evaluateCoreFun (colvec< double > x,double t) |
Actual method used to evaluate the dynamical sytems' core function. More... | |
function ESP = | computeEmpiricalSparsityPattern () |
function
projected = | project (V, W) |
function copy = | clone () |
Public Member Functions inherited from approx.BaseApprox | |
BaseApprox (sys) | |
function copy = | clone (copy) |
The interface method with returns a copy of the current class instance. More... | |
virtual function | approximateSystemFunction (model) |
Computes the approximation according to the concrete approximation strategy. 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... | |
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_KernelEI () |
Static Public Member Functions inherited from approx.BaseApprox | |
static function res = | test_ApproxProjections () |
Public Attributes | |
integer | MaxOrder = 40 |
The maximum order up to which the DEIM approximation should be computed. More... | |
Variant = 2 | |
The variant to use. More... | |
approx.ABase | Algorithm |
An approx.ABase approximation algorithm that is used to learn the component functions (either simultaneously or component-wise depending on Variant) More... | |
natural | nJacobians = 5 |
nJacobians: number of Jacobian samples to use for empirical sparsity detection i.e. we choose nJacobians many Jacobian samples from trajectories number More... | |
kernels.KernelExpansion | V1Expansion = "[]" |
The Kernel expansion computed if using Variant 1. More... | |
rowvec < kernels.KernelExpansion > | V2Expansions = {""} |
The array of kernel expansions of using Variant 2. More... | |
integer | Order |
The actual order for the current DEIM approximation. More... | |
fOrder = 10 | |
u | |
The full approximation base. More... | |
pts | |
Interpolation points. More... | |
U | |
The U matrix for the current Order. More... | |
S | |
f | |
jrow | |
jend | |
Public Attributes inherited from approx.BaseApprox | |
data.selection.ASelector | TrainDataSelector |
The algorithm that selects the approximation training data. More... | |
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... | |
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 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) |
approx.KernelEI.KernelEI | ( | sys | ) |
Definition at line 199 of file KernelEI.m.
References dscomponents.ACoreFun.CustomProjection, and dscomponents.ACoreFun.TimeDependent.
function approx.KernelEI.approximateSystemFunction | ( | models.BaseFullModel | model | ) |
Definition at line 206 of file KernelEI.m.
References Algorithm, data.ModelData.ApproxTrainData, computeEmpiricalSparsityPattern(), models.BaseFullModel.Data, dscomponents.ACoreFun.evaluateMulti(), models.BaseFirstOrderSystem.f, f, fOrder, jend, jrow, MaxOrder, Order, pts, models.BaseModel.System, t, u, general.AProjectable.V, V1Expansion, V2Expansions, Variant, and general.AProjectable.W.
function copy = approx.KernelEI.clone | ( | ) |
Definition at line 423 of file KernelEI.m.
References kernels.KernelExpansion.clone(), f, fOrder, jend, jrow, MaxOrder, pts, S, dscomponents.ACoreFun.System, u, U, V1Expansion, V2Expansions, and Variant.
Referenced by project().
function ESP = approx.KernelEI.computeEmpiricalSparsityPattern | ( | ) |
Definition at line 322 of file KernelEI.m.
References models.BaseFirstOrderSystem.f, dscomponents.ACoreFun.getStateJacobianFD(), k, models.BaseFirstOrderSystem.Model, dscomponents.ACoreFun.mu, nJacobians, dscomponents.ACoreFun.prepareSimulation(), and dscomponents.ACoreFun.System.
Referenced by approximateSystemFunction().
Actual method used to evaluate the dynamical sytems' core function.
Subclasses might implement this method and set the flag CustomProjection appropriately. However, for speed reasons, if both are true one might as well override the evaluate
member directly as it basically cares for the cases when one of the flags is not true. In that case it is still important to set both flags to true as some components rely on them.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
Implements dscomponents.ACoreFun.
Definition at line 301 of file KernelEI.m.
References kernels.KernelExpansion.evaluate(), fOrder, jend, dscomponents.ACoreFun.mu, S, U, V1Expansion, V2Expansions, and Variant.
function projected = approx.KernelEI.project | ( | V, | |
W | |||
) |
Definition at line 408 of file KernelEI.m.
References clone(), kernels.KernelExpansion.Ma, kernels.KernelExpansion.project(), and V1Expansion.
|
static |
Definition at line 546 of file KernelEI.m.
References dscomponents.ACoreFun.mu.
approx.KernelEI.Algorithm |
An approx.ABase approximation algorithm that is used to learn the component functions (either simultaneously or component-wise depending on Variant)
Default: []
SetObservable
set to true. Definition at line 71 of file KernelEI.m.
Referenced by approximateSystemFunction().
approx.KernelEI.f |
Definition at line 190 of file KernelEI.m.
Referenced by approximateSystemFunction(), and clone().
approx.KernelEI.fOrder = 10 |
Definition at line 153 of file KernelEI.m.
Referenced by approximateSystemFunction(), clone(), and evaluateCoreFun().
approx.KernelEI.jend |
Definition at line 194 of file KernelEI.m.
Referenced by approximateSystemFunction(), clone(), and evaluateCoreFun().
approx.KernelEI.jrow |
Definition at line 192 of file KernelEI.m.
Referenced by approximateSystemFunction(), and clone().
approx.KernelEI.MaxOrder = 40 |
The maximum order up to which the DEIM approximation should be computed.
This corresponds to the maximum number \(m\) that can be choosen as approximation order.
Default: 40
SetObservable
set to true. Definition at line 41 of file KernelEI.m.
Referenced by approximateSystemFunction(), and clone().
approx.KernelEI.nJacobians = 5 |
nJacobians: number of Jacobian samples to use for empirical sparsity detection i.e. we choose nJacobians many Jacobian samples from trajectories number
SetObservable
set to true. Definition at line 88 of file KernelEI.m.
Referenced by computeEmpiricalSparsityPattern().
approx.KernelEI.Order |
The actual order for the current DEIM approximation.
Default: 10
Dependent
set to true. SetObservable
set to true. Definition at line 135 of file KernelEI.m.
Referenced by approximateSystemFunction().
approx.KernelEI.pts |
Interpolation points.
SetAccess = Private, GetAccess = Public
Definition at line 167 of file KernelEI.m.
Referenced by approximateSystemFunction(), and clone().
approx.KernelEI.S |
Definition at line 188 of file KernelEI.m.
Referenced by clone(), and evaluateCoreFun().
approx.KernelEI.u |
The full approximation base.
SetAccess = Private, GetAccess = Public
Definition at line 156 of file KernelEI.m.
Referenced by approximateSystemFunction(), and clone().
approx.KernelEI.U |
The U matrix for the current Order.
SetAccess = Private, GetAccess = Public
Definition at line 178 of file KernelEI.m.
Referenced by clone(), and evaluateCoreFun().
approx.KernelEI.V1Expansion = "[]" |
The Kernel expansion computed if using Variant 1.
SetAccess = Private, GetAccess = Public
Definition at line 105 of file KernelEI.m.
Referenced by approximateSystemFunction(), clone(), evaluateCoreFun(), and project().
approx.KernelEI.V2Expansions = {""} |
The array of kernel expansions of using Variant 2.
SetAccess = Private, GetAccess = Public
Definition at line 119 of file KernelEI.m.
Referenced by approximateSystemFunction(), clone(), and evaluateCoreFun().
approx.KernelEI.Variant = 2 |
The variant to use.
Possible values are 1 and 2. 1 means that all components are interpolated simultaneously and only the current KernelEI.Order
SetObservable
set to true. Definition at line 56 of file KernelEI.m.
Referenced by approximateSystemFunction(), clone(), and evaluateCoreFun().