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
DEIM.m
Go to the documentation of this file.
1 namespace approx{
2 
3 
4 /* (Autoinserted by mtoc++)
5  * This source code has been filtered by the mtoc++ executable,
6  * which generates code that can be processed by the doxygen documentation tool.
7  *
8  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
9  * Except for the comments, the function bodies of your M-file functions are untouched.
10  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
11  * attached source files that are highly readable by humans.
12  *
13  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
14  * the correct locations in the source code browser.
15  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
16  */
17 
18 class DEIM
19  :public approx.BaseApprox,
20  public general.DEIM {
47  public:
48 
49  DEIM(sys) {
50  this = this@general.DEIM;
51  this = this@approx.BaseApprox(sys);
52 
53  this.CustomProjection= true;
54  this.TimeDependent= true;
55  }
56 
57 
59  this.computeDEIM(model.System.f, model.Data.ApproxTrainData.fxi);
60  }
61 
62 
63  function fx = evaluate(colvec<double> x,double t) {
64  fx = evaluate@general.DEIM(this, x, t);
65  }
66 
67 
68  function fx = evaluateMulti(colvec<double> x,double t,colvec<double> mu) {
69  fx = evaluateMulti@general.DEIM(this, x, t, mu);
70  }
71 
72 
74  prepareSimulation@approx.BaseApprox(this, mu);
75  /* Forward the parameter setting to the inner ACompEvalCoreFun
76  * (if already set) */
77  if ~isempty(this.f)
78  this.f.prepareSimulation(mu);
79  end
80  }
81 
82 
83  function J = getStateJacobian(colvec<double> x,double t) {
84  J = getStateJacobian@general.DEIM(this, x, t);
85  /* Finite difference one:
86  *J2 = getStateJacobian@dscomponents.ACoreFun(this, x, t, mu); */
87  }
88 
89 
90  function fx = evaluateCoreFun() {
91  error(" Do not call me! ");
92  }
100  function projected = project(V,W) {
101  projected = this.clone;
102  projected = project@approx.BaseApprox(this, V, W, projected);
103  projected = project@general.DEIM(this, V, W, projected);
104  }
105 
106 
107  function copy = clone() {
108  copy = approx.DEIM(this.System);
109  copy = clone@approx.BaseApprox(this, copy);
110  copy = clone@general.DEIM(this, copy);
111  }
112 
113 
114  protected: /* ( Static ) */
115 
116  static function obj = loadobj(obj,varargin) {
117  obj = loadobj@general.DEIM(obj, varargin[:]);
118  obj = loadobj@approx.BaseApprox(obj, varargin[:]);
119  }
120 
121 
122  public: /* ( Static ) */
123 
124  static function res = test_DEIM() {
125  m = models.pcd.PCDModel(1);
126  m.EnableTrajectoryCaching= false;
127  m.Approx= approx.DEIM(m.System);
128  m.Approx.MaxOrder= 40;
129  m.System.Params(1).Desired = 10;
130  m.SpaceReducer= spacereduction.PODGreedy;
131  m.offlineGenerations;
132  m.Approx.Order= [20 4];
133  r = m.buildReducedModel;
134  mu = m.getRandomParam;
135  r.simulate(mu);
136  r.System.f.Order= [15 2];
137  r.simulate(mu);
138  r.System.f.Order= 40;
139  r.simulate(mu);
140  res = true;
141  }
142 
143 
144 };
145 }
146 
function prepareSimulation(colvec< double > mu)
Definition: DEIM.m:73
DEIM: Implements the DEIM-Algorithm from .
Definition: DEIM.m:18
static function res = test_DEIM()
Definition: DEIM.m:124
data.FileMatrix fxi
The evaluations of , stored row-wise in a data.FileMatrix.
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
CustomProjection
Set this property if the projection process is customized by overriding the default project method...
Definition: ACoreFun.m:108
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
Definition: BaseModel.m:102
function fx = evaluateMulti(colvec< double > x,double t,colvec< double > mu)
Definition: DEIM.m:68
function prepareSimulation(colvec< double > mu)
A method that allows parameter-dependent computations to be performed before a simulation using this ...
Definition: ACoreFun.m:380
logical TimeDependent
Flag that indicates if the ACoreFun is (truly) time-dependent.
Definition: ACoreFun.m:84
function J = getStateJacobian(colvec< double > x,double t)
Definition: DEIM.m:83
function projected = project(V, W)
Definition: DEIM.m:100
dscomponents.ACompEvalCoreFun f
The function which DEIM is applied to.
Definition: DEIM.m:214
function fx = evaluate(colvec< double > x,double t)
Definition: DEIM.m:63
function copy = clone()
Definition: DEIM.m:107
A variable number of input arguments.
function approximateSystemFunction(models.BaseFullModel model)
Definition: DEIM.m:58
models.BaseFirstOrderSystem System
The system associated with the current ACoreFun.
Definition: ACoreFun.m:193
V
The matrix of the biorthogonal pair .
Definition: AProjectable.m:61
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
Definition: ACoreFun.m:208
data.ModelData Data
The full model's data container. Defaults to an empty container.
function fx = evaluateCoreFun()
do nothing as evaluate is overridden directly
Definition: DEIM.m:90
function computeDEIM(dscomponents.ACompEvalCoreFun f,matrix< double > fxi)
Implementation of the DEIM algorithm.
Definition: DEIM.m:244
Abstract base class for all core function approximations inside dynamical systems.
Definition: BaseApprox.m:18
dscomponents.ACoreFun f
The core f function from the dynamical system.
DEIM(sys)
Definition: DEIM.m:49
DEIM: Wrapper for KerMor dynamical systems of the general.DEIM class.
Definition: DEIM.m:18
W
The matrix of the biorthogonal pair .
Definition: AProjectable.m:72
data.ApproxTrainData ApproxTrainData
Training data for the core function approximation.
Definition: ModelData.m:110
static function obj = loadobj(obj, varargin)
Definition: DEIM.m:116