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
approx.KernelApprox Class Reference

KernelApprox: Base class for component-wise kernel approximations. More...

Detailed Description

KernelApprox: Base class for component-wise kernel approximations.

For each dimension \(k\) there is a representation

\[f_k(x) = \sum\limits_{i=1}^N \alpha_{k,i}\K(x,x_i)\]

for the approximation. The property Ma contains in row \(k\) all indices \(\alpha_k\) used in the \(k\)-th dimension.

The property Centers (inherited from kernels.ParamTimeKernelExpansion) contains all state variable Centers that are relevant for the evaluation of the approximated function. (No matter how many originally have been used for the approximation computation)

Change in 0.5:
(Daniel Wirtz, 2011-11-02)
  • Adopted to the new interface for approximation computation (passing data.ApproxTrainData instance instead of xi,ti,mui parameters)
  • Also cloning the approximation algorithm instance at KernelApprox.clone
Change in 0.5:
(Daniel Wirtz, 2011-10-16) Included setting the projection-induced norm \(V^tGV\) to any kernels.ARBFKernel implementing classes as required by the theory. (So far made no difference as we had \(V^tGV=I_r\) all the time)
Change in 0.5:
(Daniel Wirtz, 2011-07-07) Now inherits from kernels.ParamTimeKernelExpansion and has a strategy pattern class reference for the approximation generation algorithm "Algorithm". This has been changed so that standalone use of approximation algorithms can also be applied; now this class simply wraps this functionality in the context of the original model reduction scheme.
Change in 0.4:
(Daniel Wirtz, 2011-05-19) Disconnected the Approx classes from taking a BaseModel instance at approx computation. This way external tools can use the approximation algorithms, too.
Change in 0.4:
(Daniel Wirtz, 2011-05-03) Removed off-property dependencies in computeCoeffs routines as expansion offsets are no longer used.
Change in 0.3:
(Daniel Wirtz, 2011-04-26) Implementing the approximateData in this class so that rescaling of the function f values \(f_{x_i}\) can be used. Subclasses now implement the template method approx.KernelApprox.computeCompwiseApprox.
New in 0.3:
(Daniel Wirtz, 2011-04-21) Integrated this class to the property default value changed supervision system Property classes and levels. This class now inherits from KerMorObject and has an extended constructor registering any user-relevant properties using KerMorObject.registerProps.
Change in 0.3:
(Daniel Wirtz, 2011-03-31)
  • Added a new property approx.KernelApprox.CoeffComp which allows to use the strategy pattern for computing kernel expansion coefficients.
  • Moved some old methods into the new class approx.algorithms.Componentwise to retain the old functionality which selects a subset of the projection training data by linspace selection as approximation data.
  • Changed method names for computeSerial/Parallel to computeCoeffsSerial/computeCoeffsParallel and visibility to protected as they can be used by any subclass.
See Also
KernelApprox

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 18 of file KernelApprox.m.

Public Member Functions

 KernelApprox (sys)
 
function  approximateSystemFunction (models.BaseFullModel model)
 If V=W, we have W^tV = I_r by assumption, so if G=1 we have V^tGV = I_r and we dont need to set a custom norm for the kernels (would mean additional rounding error) if isa(this.Kernel,kernels.ARBFKernel) && ... ~isequal(model.Data.V,model.Data.W) || model.G ~= 1 % Set norm matrix to V^tGV as required by theory. this.Kernel.G = model.Data.V'*(model.G*model.Data.V); end. More...
 
function copy = clone ()
 Clones the instance. More...
 
- 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 [ 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...
 
- Public Member Functions inherited from dscomponents.ParamTimeKernelCoreFun
 ParamTimeKernelCoreFun (sys)
 
function
projected = 
project (V, W)
 Call superclass method. More...
 
function matrix
< double > fx = 
evaluate (colvec< double > x,double t)
 Evaluates this CoreFun. More...
 
function matrix
< double > fx = 
evaluateMulti (matrix< double > x, varargin)
 Evaluates this CoreFun for multiple values. More...
 
function L = getGlobalLipschitz (double t,colvec< double > mu)
 For some error estimators, a global Lipschitz constant estimation is performed. This function has to yield the global lipschitz constant for the spatial/state part of a CoreFunction \(f(x,t,mu)\). More...
 
function copy = clone (copy)
 The interface method with returns a copy of the current class instance. More...
 
function matrix
< double > J = 
getStateJacobian (colvec< double > x,double t)
 Implement explicitly as both ACoreFun and KernelExpansion provide getStateJacobian methods. More...
 
function matrix
< double > y = 
evaluateCoreFun ()
 

Public Attributes

approx.algorithms.Algorithm Algorithm
 The algorithm used to create the kernel expansion. More...
 
- 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< logicalJSparsityPattern = "[]"
 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< doublemu = "[]"
 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...
 
- Public Attributes inherited from dscomponents.ParamTimeKernelCoreFun
kernels.KernelExpansion Expansion
 The inner kernel expansion which is evaluated as core function. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from approx.BaseApprox
static function res = test_ApproxProjections ()
 
- 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)
 
- Static Protected Member Functions inherited from dscomponents.ParamTimeKernelCoreFun
static function this = loadobj ()
 

Constructor & Destructor Documentation

approx.KernelApprox.KernelApprox (   sys)

Definition at line 108 of file KernelApprox.m.

References Algorithm, and DPCMObject.registerProps().

Here is the call graph for this function:

Member Function Documentation

function approx.KernelApprox.approximateSystemFunction ( models.BaseFullModel  model)

If V=W, we have W^tV = I_r by assumption, so if G=1 we have V^tGV = I_r and we dont need to set a custom norm for the kernels (would mean additional rounding error) if isa(this.Kernel,kernels.ARBFKernel) && ... ~isequal(model.Data.V,model.Data.W) || model.G ~= 1 % Set norm matrix to V^tGV as required by theory. this.Kernel.G = model.Data.V'*(model.G*model.Data.V); end.

Parameters
modelA KerMor full model
Required fields of model:

Definition at line 118 of file KernelApprox.m.

References Algorithm, data.ModelData.ApproxTrainData, models.BaseFullModel.Data, dscomponents.ParamTimeKernelCoreFun.Expansion, and models.BaseModel.G.

function copy = approx.KernelApprox.clone ( )

Clones the instance.

Note
Since we use multiple inheritance we have to call the clone method from both above superclasses. In this case this leads to a double execution of the clone method from dscomponents.ACoreFcn, but this is rather done than ommitted and causing trouble later on.
Generated fields of copy:

Definition at line 145 of file KernelApprox.m.

References Algorithm, and dscomponents.ACoreFun.System.

Member Data Documentation

approx.KernelApprox.Algorithm

The algorithm used to create the kernel expansion.

Property class critical:
The approximation strategy for kernel expansions is essential.
Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.
This property has custom functionality when its value is changed.

Definition at line 90 of file KernelApprox.m.

Referenced by approximateSystemFunction(), clone(), and KernelApprox().


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