KerMor
0.9
Model order reduction for nonlinear dynamical systems and nonlinear approximation
|
The core nonlinear function of the PCD model. More...
The core nonlinear function of the PCD model.
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 19 of file CoreFun2D.m.
Public Member Functions | |
CoreFun2D (dynsys) | |
function copy = | clone () |
System already copied in constructor (see below) More... | |
function | newSysDimension () |
Create diffusion matrix. More... | |
function fx = | evaluate (colvec< double > x,double t) |
If this has been projected, restore full size and compute values. More... | |
function fx = | evaluateMulti (colvec< double > x, unused1,colvec< double > mu) |
Allocate result vector. More... | |
function J = | getStateJacobian (colvec< double > x,double t) |
Public Member Functions inherited from models.pcdi.BaseCoreFun | |
BaseCoreFun (dynsys) | |
function copy = | clone (copy) |
Call superclass method. More... | |
function fx = | evaluateCoreFun (colvec< double > x,double t) |
Actual method used to evaluate the dynamical sytems' core function. More... | |
function | plotActivationFun (colvec< double > mu, pm) |
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... | |
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... | |
Protected Member Functions | |
function fxj = | evaluateComponents (pts, ends, unused1, unused2, X,double t) |
function fxj = | evaluateComponentsMulti (rowvec< integer > pts,rowvec< integer > ends, unused1, unused2,matrix< double > X,double t,matrix< double > mu) |
The vector embedding results from the fixed ordering of the full 4*m-vector into the components x_a, y_a, x_i, y_i. More... | |
function dfx = | evaluateComponentPartialDerivatives (rowvec< integer > pts,rowvec< integer > ends, unused1,rowvec< integer > deriv, unused2,colvec< double > X, unused3,colvec< double > mu, unused4) |
See dscomponents.ACompEvalCoreFun for more details. More... | |
Protected Member Functions inherited from models.pcdi.BaseCoreFun | |
function idx = | nodepos (nr) |
function f = | activationFun (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 models.pcdi.BaseCoreFun | |
integer | ActivationFunType |
Type of the activation function. More... | |
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 Public Attributes inherited from models.pcdi.BaseCoreFun | |
static const ::double | ActivationTransitionTime = 10 |
The time in seconds needed before the activation function reaches its maximum value and decays back to zero. [s]. More... | |
static const ::double | MaxActivationTime = 400 |
The maximum time in seconds that spans the support of the piecewise activation function. It is composed of gaussian-shaped increase/decrease ends and a constant one in between. For the default settings, we would have a maximum duration of 500s-2*30s=440s for the activation rate of level one. [s]. 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 models.pcdi.BaseCoreFun | |
nodes | |
hlp | |
idxmat | |
Ji | |
Jj | |
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... | |
models.pcdi.CoreFun2D.CoreFun2D | ( | dynsys | ) |
Definition at line 40 of file CoreFun2D.m.
function copy = models.pcdi.CoreFun2D.clone | ( | ) |
System already copied in constructor (see below)
Definition at line 45 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.hlp, models.pcdi.BaseCoreFun.idxmat, models.pcdi.BaseCoreFun.Ji, models.pcdi.BaseCoreFun.Jj, models.pcdi.BaseCoreFun.nodes, and dscomponents.ACoreFun.System.
If this has been projected, restore full size and compute values.
x | The state variable vector \(\vx(t)\) |
t | The current time(s) \(t \in [0, T]\) |
Definition at line 118 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.activationFun(), models.pcdi.BaseCoreFun.hlp, models.pcdi.BaseCoreFun.idxmat, dscomponents.ACoreFun.mu, models.pcdi.BaseCoreFun.nodes, dscomponents.ACoreFun.System, general.AProjectable.V, and general.AProjectable.W.
|
protected |
See dscomponents.ACompEvalCoreFun for more details.
pts | The components of \(f\) for which derivatives are required |
ends | At the \(i\)-th entry it contains the last position in the \(\vx\) vector that indicates an input value relevant for the \(i\)-th point evaluation, i.e. \(f_i(\vx) = f_i(\vx(ends(i-1){:}ends(i)));\) |
unused1 | Marked as "~" in original m-file. |
deriv | The indices within \(\vx\) that derivatives are required for. |
unused2 | Marked as "~" in original m-file. |
X | The state space location \(\vx\) |
unused3 | Marked as "~" in original m-file. |
mu | The corresponding parameter \(\mu\) for the state \(\vx\) |
unused4 | Marked as "~" in original m-file. |
dfx | A column vector with numel(deriv) rows containing the derivatives at all specified pts i with respect to the coordinates given by idx(ends(i-1):ends(i)) |
Definition at line 450 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.hlp, dscomponents.ACoreFun.mu, models.pcdi.BaseCoreFun.nodes, dscomponents.ACoreFun.System, and X.
|
protected |
Definition at line 324 of file CoreFun2D.m.
References evaluateComponentsMulti(), and dscomponents.ACoreFun.mu.
|
protected |
The vector embedding results from the fixed ordering of the full 4*m-vector into the components x_a, y_a, x_i, y_i.
pts | The components of \(\vf\) for which derivatives are required |
ends | At the \(i\)-th entry it contains the last position in the \(\vx\) vector that indicates an input value relevant for the \(i\)-th point evaluation, i.e. \(f_i(\vx) = f_i(\vx(ends(i-1){:}ends(i)));\) |
unused1 | Marked as "~" in original m-file. |
unused2 | Marked as "~" in original m-file. |
X | A matrix \(\vX\) with the state space locations \(\vx_i\) in its columns |
t | The current time(s) \(t \in [0, T]\) |
mu | The corresponding parameters \(\mu_i\) for each state \(\vx_i\), as column matrix |
fxj | A matrix with pts-many component function evaluations \(f_i(\vx)\) as rows and as many columns as \(\vX\) had. |
Definition at line 329 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.hlp, dscomponents.ACoreFun.mu, models.pcdi.BaseCoreFun.nodes, dscomponents.ACoreFun.System, and X.
Referenced by evaluateComponents().
function fx = models.pcdi.CoreFun2D.evaluateMulti | ( | colvec< double > | x, |
unused1, | |||
colvec< double > | mu | ||
) |
Allocate result vector.
x | The state variable vector \(\vx(t)\) |
unused1 | Marked as "~" in original m-file. |
mu | The currently used parameter \(\vmu\). Set to \([]\) if not used. |
Definition at line 189 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.activationFun(), models.pcdi.BaseCoreFun.hlp, models.pcdi.BaseCoreFun.idxmat, dscomponents.ACoreFun.mu, models.pcdi.BaseCoreFun.nodes, dscomponents.ACoreFun.System, and t.
Definition at line 252 of file CoreFun2D.m.
References models.pcdi.BaseCoreFun.activationFun(), dscomponents.ACoreFun.fDim, models.pcdi.BaseCoreFun.hlp, models.pcdi.BaseCoreFun.idxmat, models.pcdi.BaseCoreFun.Ji, models.pcdi.BaseCoreFun.Jj, dscomponents.ACoreFun.mu, models.pcdi.BaseCoreFun.nodes, handle.reshape, dscomponents.ACoreFun.System, general.AProjectable.V, general.AProjectable.W, and dscomponents.ACoreFun.xDim.
function models.pcdi.CoreFun2D.newSysDimension | ( | ) |
Create diffusion matrix.
Definition at line 66 of file CoreFun2D.m.
References dscomponents.ACoreFun.fDim, models.pcdi.BaseCoreFun.hlp, models.pcdi.BaseCoreFun.idxmat, models.pcdi.BaseCoreFun.Ji, models.pcdi.BaseCoreFun.Jj, dscomponents.ACoreFun.JSparsityPattern, models.pcdi.BaseCoreFun.nodepos(), models.pcdi.BaseCoreFun.nodes, dscomponents.ACoreFun.System, t, and dscomponents.ACoreFun.xDim.