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
GLEstimator.m
Go to the documentation of this file.
1 namespace error{
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 
48  private:
49 
50  cf;
51 
52  f;
53 
54 
55  public:
56 
57  function copy = clone() {
58  copy = error.GLEstimator;
59  copy = clone@error.BaseCompLemmaEstimator(this, copy);
60  copy.cf= this.cf;
61  copy.f= this.f;
62  }
72  function b = getBeta(colvec<double> x,double t) {
73  if ~isempty(this.cf)
74  b = this.cf;
75  else
76  b = this.f.getGlobalLipschitz(t, this.mu);
77  end
78  }
79 
80 
81  function ct = prepareConstants(colvec<double> mu,integer inputidx) {
82 
83  ct = prepareConstants@error.BaseCompLemmaEstimator(this, mu, inputidx);
84  /* Standard case: the approx function is a kernel expansion. it
85  * can also be that the system's core function is already a
86  * kernel expansion */
87  st = tic;
88  fm = this.ReducedModel.FullModel;
89  if ~isempty(fm.Approx)
90  /* Get full d x N coeff matrix of approx function */
91  this.f= fm.Approx;
92  else
93  /* Get full d x N coeff matrix of core function */
94  this.f= fm.System.f;
95  end
96  /* Only precompute the global lipschitz constant if it is (t,\mu)-independent */
97  if isa(this.f," kernels.KernelExpansion ") || (isa(this.f," kernels.ParamTimeKernelExpansion ") && ...
98  isa(this.f.ParamKernel," kernels.NoKernel ") && isa(this.f.TimeKernel," kernels.NoKernel "))
99  this.cf= this.f.getGlobalLipschitz(0, mu);
100  else
101  this.cf= [];
102  end
103  ct = ct + toc(st);
104  }
116  function ct = postProcess(colvec<double> x,double t,integer inputidx) {
117 
118  st = tic;
119  this.StateError(1,:) = x(end,:);
120  ct = postProcess@error.BaseCompLemmaEstimator(this, x, t, inputidx) + toc(st);
121  }
134  public: /* ( Static ) */
135 
136  static function errmsg = validModelForEstimator(models.BaseFullModel model) {
137  errmsg = validModelForEstimator@error.BaseCompLemmaEstimator(model);
138  if isempty(errmsg) && ~isa(model.System.f.Expansion," dscomponents.IGlobalLipschitz ")
139  errmsg = " The full model "" s core function must implement the dscomponents.IGlobalLipschitz interface for this error estimator. ";
140  end
141  }
154 };
155 }
156 
static function errmsg = validModelForEstimator(models.BaseFullModel model)
Validations.
Definition: GLEstimator.m:136
BaseCompLemmaEstimator: Base class for error estimators using the comparison lemma formulation...
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
function ct = prepareConstants(colvec< double > mu,integer inputidx)
Return values: ct: The time needed for preprocessing.
Definition: GLEstimator.m:81
models.BaseFullModel FullModel
The full model this reduced model was created from.
Definition: ReducedModel.m:53
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
Definition: BaseModel.m:102
StateError
The reduction state-space error from the last simulation.
Definition: BaseEstimator.m:82
An integer value.
GLEstimator: Global lipschitz constant error estimator.
Definition: GLEstimator.m:18
function b = getBeta(colvec< double > x,double t)
Definition: GLEstimator.m:72
function ct = postProcess(colvec< double > x,double t,integer inputidx)
Return values: ct: The time needed for postprocessing.
Definition: GLEstimator.m:116
dscomponents.ACoreFun f
The core f function from the dynamical system.
function copy = clone()
Creates a deep copy of this estimator instance.
Definition: GLEstimator.m:57
models.ReducedModel ReducedModel
The reduced model associated with the error estimator.