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
kernels.ParamTimeKernelExpansion Class Reference

ParamTimeKernelExpansion: Kernel expansion class for time and/or parameter dependent kernels. More...

Detailed Description

ParamTimeKernelExpansion: Kernel expansion class for time and/or parameter dependent kernels.

This class represents a function \(f\) in the space induced by given kernels \(\K_{s,t,\mu}\) for state, time and parameter space as

\[f(x,t,\mu) = \sum\limits_{i=1}^N c_i\K_s(x,x_i)\K_t(t,t_i)\K_\mu(\mu,\mu_i)\]

This class is the composition of three different kernels, which are one for time, parameters and state variables. Those kernels are combined using the function handle set by the property SubKernelCombinationFun.

Author
Daniel Wirtz
Date
2011-07-07
New in 0.5:
(Daniel Wirtz, 2011-07-07) Added this class.
Former changes from old class AKernelCoreFun
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:
(Syed Ammar, 2011-04-16) Implemented Setter for the property Centers
New in 0.3:
(Daniel Wirtz, 2011-04-15) Added the dscomponents.AKernelCoreFun.evaluateStateNabla method to allow efficient computation of kernel expansion jacobians.
Change in 0.3:
(Daniel Wirtz, 2011-04-6) Set the kernel properties to dependent and introduced private storage members for them. Also improved the setter for the SubKernelCombinationFun (checks for 3 args now)
New in 0.3:
(Daniel Wirtz, 2011-04-04) Added the dscomponents.AKernelCoreFun.getKernelMatrix method
Change in 0.2:
(Daniel Wirtz, 2011-03-21)
  • Moved the dscomponents.AKernelCoreFun.RotationInvariant property into a local private variable that gets updated only when the kernels are changed. This way a repetitive in-simulation evaluation of the property gets avoided.
  • Changed & documented the default kernels.
  • Added set method for dscomponents.AKernelCoreFun.SubKernelCombinationFun property.

This class is part of the framework

KerMor - Model Order Reduction using Kernels

Definition at line 18 of file ParamTimeKernelExpansion.m.

Public Member Functions

 ParamTimeKernelExpansion ()
 Default constructor. More...
 
function fx = evaluate (colvec< double > x,double t,colvec< double > mu)
 
function phi = getKernelVector (colvec< double > x,double t,colvec< double > mu)
 Returns the kernel vector \(\varphi(x,t,\mu) = (\K(x,x_i)\K(t,t_i)\K(\mu,\mu_i))_i\). (for the case of a product SubKernelCombinationFun More...
 
function J = getStateJacobian (colvec< double > x,double t,colvec< double > mu)
 Evaluates the jacobian matrix of this function at the given point. More...
 
function c = getGlobalLipschitz (double t,colvec< double > mu)
 Overrides the implementation in KernelExpansion. More...
 
function K = getKernelMatrix ()
 Computes the kernel matrix for the currently set center data. More...
 
function K = getKernelMatrixColumn (idx,colvec< double > x,double t,colvec< double > mu)
 Computes the kernel matrix for the currently set center data. More...
 
function  setCentersFromATD (data.ApproxTrainData atd,rowvec< integer > idx)
 Sets the centers according to the indices idx of the training data. More...
 
function copy = clone (copy)
 The interface method with returns a copy of the current class instance. More...
 
function  clear ()
 Removes all centers and coefficients from the expansion and leaves the associated kernels untouched. More...
 
- Public Member Functions inherited from kernels.KernelExpansion
 KernelExpansion ()
 Default constructor. More...
 
function fx = evaluate (matrix x, varargin)
 Evaluates the kernel expansion. More...
 
function phi = getKernelVector (matrix x, varargin)
 Evaluates the kernel expansion. More...
 
function row = getKernelMatrixColumn (integer idx,matrix x, varargin)
 Evaluates the kernel expansion. More...
 
function J = getStateJacobian (x, varargin)
 Evaluates the jacobian matrix of this function at the given point. More...
 
function K = getKernelMatrix ()
 Computes the kernel matrix for the currently set center data. More...
 
function v = scalarProductWith (f)
 
function  normalize ()
 
function  setCentersFromATD (data.ApproxTrainData atd,rowvec< integer > idx)
 Sets the centers according to the indices idx of the data.ApproxTrainData. More...
 
function kernels.KernelExpansion
kexp = 
toTranslateBase ()
 Returns the same kernel expansion with the canonical translate base used. More...
 
function subexp = getSubExpansion (arg)
 
function target = project (V, W)
 
function  clear ()
 Removes all centers and coefficients from the expansion and leaves the associated kernels untouched. More...
 
function sum = plus (B)
 Adds two kernel expansions and will clone the frist argument's class as result type. More...
 
function diff = minus (B)
 Adds two kernel expansions and will clone the frist argument's class as result type. More...
 
function neg = uminus ()
 
function  exportToDirectory (dir)
 
function json = toJSON (filename)
 
function res = test_getStateJacobianInstance ()
 
- 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...
 

Public Attributes

kernels.BaseKernel TimeKernel
 The Kernel to use for time variables. More...
 
kernels.BaseKernel ParamKernel
 The Kernel to use for parameter variables. More...
 
 SubKernelCombinationFun = @("t,s,p")t .* s .* p
 The function that combines the sub (time/system/param) kernels. Must be a function handle that takes three arguments. More...
 
 StateNablaCombinationFun = @("t,s,p)bsxfun(\@times, s, t.*p")
 The combination function for the nabla of the system/state kernel with the other kernels. More...
 
- Public Attributes inherited from kernels.KernelExpansion
kernels.BaseKernel Kernel
 The Kernel to use for system variables. More...
 
rowvec Ma_norms
 The norms of the coefficient matrix of the kernel expansion. More...
 
double NativeNorm
 Returns the norm \(||f||^2_{\H^q}\) of \(f\) in the RKHS \(\H^q,\quad q\in\N\). More...
 
colvec< doubleComponentNorms
 Returns the native space norms \(||f_j||^2_\H\) for each component function \(j \equiv\)size(Ma,1) More...
 
 MBnd
 Returns the M upper bound for this KernelExpansion, which is \(M := \max\limits_{j=1}^d\sum\limits_{i=1}^m |c^d_i|\). More...
 
logical HasCustomBase
 Flag that indicates if a base other than the direct translate base is used for this kernel expansion. More...
 
 Size
 The size of the kernel expansion. More...
 
struct Centers = struct("'xi',[]")
 The kernel centers used in the approximation. More...
 
matrix< doubleMa = "[]"
 The coefficient data for each dimension. More...
 
matrix< doubleBase = 1
 This property lets the user store a custom base, for which the coefficients are set. The custom base tells which linear combinations of center elements belong to which base. More...
 
- 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

- Static Public Member Functions inherited from kernels.KernelExpansion
static function res = test_getStateJacobian ()
 
- 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 kernels.KernelExpansion
static function this = loadobj (this, from)
 As the constant properties are transient, they have to be re-computed upon loading. More...
 
- 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 kernels.KernelExpansion
kernels.BaseKernel fSK
 The inner (state) kernel object. More...
 

Constructor & Destructor Documentation

kernels.ParamTimeKernelExpansion.ParamTimeKernelExpansion ( )

Default constructor.

Initializes default kernels.

Definition at line 160 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, and DPCMObject.registerProps().

Here is the call graph for this function:

Member Function Documentation

function kernels.ParamTimeKernelExpansion.clear ( )

Removes all centers and coefficients from the expansion and leaves the associated kernels untouched.

Definition at line 347 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers.

function copy = kernels.ParamTimeKernelExpansion.clone (   target)
virtual

The interface method with returns a copy of the current class instance.

Parameters
targetIf clone was called for a subclass of this class, target must contain the new instance of the subclass that is to be the cloned result.

Reimplemented from kernels.KernelExpansion.

Definition at line 334 of file ParamTimeKernelExpansion.m.

References StateNablaCombinationFun, and SubKernelCombinationFun.

function fx = kernels.ParamTimeKernelExpansion.evaluate ( colvec< double x,
double  t,
colvec< double mu 
)

Definition at line 190 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Ma, and t.

function c = kernels.ParamTimeKernelExpansion.getGlobalLipschitz ( double  t,
colvec< double mu 
)
virtual

Overrides the implementation in KernelExpansion.

Todo:
validate computation
Parameters
tThe current time(s) \(t \in [0, T]\)
muThe currently used parameter \(\vmu\). Set to \([]\) if not used.

Reimplemented from kernels.KernelExpansion.

Definition at line 239 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, kernels.BaseKernel.evaluate(), kernels.BaseKernel.getGlobalLipschitz(), k, kernels.KernelExpansion.Kernel, kernels.KernelExpansion.Ma_norms, ParamKernel, and TimeKernel.

Here is the call graph for this function:

function K = kernels.ParamTimeKernelExpansion.getKernelMatrix ( )

Computes the kernel matrix for the currently set center data.

Convenience method, equal to call evaluateAtCenters with passing the center data as arguments. However, this method is (possibly, depends on kernel implementation) faster as it calls the kernels kernels.BaseKernel.evaluate -method with one argument.

See Also
evaluateAtCenters

Definition at line 255 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, and SubKernelCombinationFun.

function K = kernels.ParamTimeKernelExpansion.getKernelMatrixColumn (   idx,
colvec< double x,
double  t,
colvec< double mu 
)

Computes the kernel matrix for the currently set center data.

Convenience method, equal to call evaluateAtCenters with passing the center data as arguments. However, this method is (possibly, depends on kernel implementation) faster as it calls the kernels kernels.BaseKernel.evaluate -method with one argument.

See Also
evaluateAtCenters
Parameters
xThe state variable vector \(\vx(t)\)
tThe current time(s) \(t \in [0, T]\)
muThe currently used parameter \(\vmu\). Set to \([]\) if not used.

Definition at line 279 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, and SubKernelCombinationFun.

function phi = kernels.ParamTimeKernelExpansion.getKernelVector ( colvec< double x,
double  t,
colvec< double mu 
)

Returns the kernel vector \(\varphi(x,t,\mu) = (\K(x,x_i)\K(t,t_i)\K(\mu,\mu_i))_i\). (for the case of a product SubKernelCombinationFun

Parameters
xThe state variable vector \(\vx(t)\)
tThe current time(s) \(t \in [0, T]\)
muThe currently used parameter \(\vmu\). Set to \([]\) if not used.

Definition at line 195 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, kernels.BaseKernel.evaluate(), kernels.KernelExpansion.fSK, and SubKernelCombinationFun.

Here is the call graph for this function:

function J = kernels.ParamTimeKernelExpansion.getStateJacobian ( colvec< double x,
double  t,
colvec< double mu 
)

Evaluates the jacobian matrix of this function at the given point.

As this is a component-wise kernel expansion, the jacobian is easily computed using the coefficient vectors and the state variable nablas.

See Also
dscomponents.IJacobian kernels.BaseKernel
Parameters
xThe state variable vector \(\vx(t)\)
tThe current time(s) \(t \in [0, T]\)
muThe currently used parameter \(\vmu\). Set to \([]\) if not used.

Definition at line 213 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, kernels.KernelExpansion.fSK, kernels.BaseKernel.getNabla(), kernels.KernelExpansion.Ma, StateNablaCombinationFun, and t.

Here is the call graph for this function:

function kernels.ParamTimeKernelExpansion.setCentersFromATD ( data.ApproxTrainData  atd,
rowvec< integer idx 
)

Sets the centers according to the indices idx of the training data.

Parameters
atdThe training data
idxThe indices in the training data for centers
Required fields of atd:

Definition at line 312 of file ParamTimeKernelExpansion.m.

References kernels.KernelExpansion.Centers, data.ApproxTrainData.hasParams, data.ApproxTrainData.hasTime, data.ApproxTrainData.mui, and data.ApproxTrainData.ti.

Member Data Documentation

kernels.ParamTimeKernelExpansion.ParamKernel

The Kernel to use for parameter variables.

Property class critical:
Correct choice of the system kernel greatly influences the function behaviour.

Default: kernels.NoKernel

See Also
TimeKernel Kernel
Note
This property has the MATLAB attribute Dependent set to true.
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.

Definition at line 93 of file ParamTimeKernelExpansion.m.

Referenced by getGlobalLipschitz().

kernels.ParamTimeKernelExpansion.StateNablaCombinationFun = @("t,s,p)bsxfun(\@times, s, t.*p")

The combination function for the nabla of the system/state kernel with the other kernels.

Depends directly on the SubKernelCombinationFun

Property class optional:
Adjust this whenever the SubKernelCombinationFun is changed.
See Also
SubKernelCombinationFun
Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.
Default: @("t,s,p)bsxfun(\@times, s, t.*p")

Definition at line 133 of file ParamTimeKernelExpansion.m.

Referenced by clone(), and getStateJacobian().

kernels.ParamTimeKernelExpansion.SubKernelCombinationFun = @("t,s,p")t .* s .* p

The function that combines the sub (time/system/param) kernels. Must be a function handle that takes three arguments.

Property class optional:
Standard kernel combination is pointwise multiplication.

Default: @(t,s,p)t .* s .* p @(t,s,p)t .* s .* p

See Also
StateNablaCombinationFun
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 114 of file ParamTimeKernelExpansion.m.

Referenced by clone(), getKernelMatrix(), getKernelMatrixColumn(), and getKernelVector().

kernels.ParamTimeKernelExpansion.TimeKernel

The Kernel to use for time variables.

Property class critical:
Correct choice of the time kernel greatly influences the function behaviour.

Default: kernels.NoKernel

See Also
Kernel ParamKernel
Note
This property has the MATLAB attribute Dependent set to true.
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.

Definition at line 74 of file ParamTimeKernelExpansion.m.

Referenced by getGlobalLipschitz().


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