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
KernelTestFun.m
Go to the documentation of this file.
1 namespace models{
2 namespace synth{
3 
4 
5 /* (Autoinserted by mtoc++)
6  * This source code has been filtered by the mtoc++ executable,
7  * which generates code that can be processed by the doxygen documentation tool.
8  *
9  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
10  * Except for the comments, the function bodies of your M-file functions are untouched.
11  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
12  * attached source files that are highly readable by humans.
13  *
14  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
15  * the correct locations in the source code browser.
16  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
17  */
18 
39  public: /* ( setObservable ) */
40 
54  public: /* ( setObservable ) */
55 
56  KernelTestFun(sys,pos_flag) {
57 
58  this = this@dscomponents.ParamTimeKernelCoreFun(sys);
59  this.registerProps(" svNum ");
60 
61  if nargin == 1
62  pos_flag = false;
63  end
64 
65  /* Sample bases */
66  this.svNum= 20;
67  kexp = kernels.ParamTimeKernelExpansion;
68  kexp.Centers.xi= repmat(linspace(-24,24,this.svNum),sys.Model.dim,1);
69  kexp.Centers.ti= .5*(1:this.svNum);
70  kexp.Centers.mui= rand(2,this.svNum);
71 
72  /* Function coefficients */
73  offset = .5;
74  /* offset = 0; */
75  if pos_flag
76  offset = 0;
77  end
78  ai = (rand(1,this.svNum)-offset);
79 
80  kexp.Ma= repmat(ai,sys.Model.dim,1);
81 
82  /* % KernelApprox settings
83  *this.Kernel = kernels.GaussKernel(4*sqrt(dims)); */
84  kexp.Kernel= kernels.GaussKernel(sqrt(sys.Model.dim));
85  kexp.Kernel.G= 1;
86  kexp.TimeKernel= kernels.GaussKernel(.4);
87  kexp.TimeKernel.G= 1;
88  kexp.ParamKernel= kernels.GaussKernel(.4);
89  kexp.ParamKernel.G= 1;
90  this.Expansion= kexp;
91  }
92 
93 
94  function showBaseFun() {
95  figure;
96  x = repmat(linspace(-50,50,max(this.svNum*5,100)),this.System.Model.dim,1);
97  fx = this.evaluate(x,0,[]);
98  plot(x(1,:),fx(1,:)," r ");
99  xlabel(" x "); ylabel(" f(x) ");
100  title(" KernelTest base function ");
101  }
110 };
111 }
112 }
113 
ParamTimeKernelCoreFun: Dynamical system core function which evaluates a contained kernel expansion...
Model
The Model this System is attached to.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
Definition: DPCMObject.m:125
function showBaseFun()
Debug method; displays the core function for each parameter sample.
Definition: KernelTestFun.m:94
models.BaseFirstOrderSystem System
The system associated with the current ACoreFun.
Definition: ACoreFun.m:193
kernels.KernelExpansion Expansion
The inner kernel expansion which is evaluated as core function.
KernelTestFun(sys, pos_flag)
Definition: KernelTestFun.m:56
function matrix< double > fx = evaluate(colvec< double > x,double t)
Evaluates this CoreFun.