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
Rotation.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 
19 class Rotation
20  :public models.BaseFullModel {
27  public:
28 
30  this.T= 10;
31  this.dt= .025;
32 
33  /* s = sampling.RandomSampler;
34  *s.Samples = 10;
35  *this.Sampler = s; */
36  this.Sampler= sampling.GridSampler;
37 
38  this.System= models.synth.RotationDynSys(this);
39  this.Name= " Synthetic rotation model ";
40 
41  this.SpaceReducer= [];
42 /*
43  * Core Approximation
44  * a = approx.algorithms.Componentwise;
45  * a.CoeffComp = general.regression.KernelLS;
46  * a.TimeKernel = kernels.GaussKernel;
47  * a.Kernel = kernels.GaussKernel(2);
48  * a.ParamKernel = kernels.LinearKernel;
49  * a.lambda = 2; */
50 
51 /* a = approx.algorithms.Componentwise;
52  * a.CoeffComp = general.regression.ScalarEpsSVR;
53  * a.TimeKernel = kernels.GaussKernel;
54  * a.Kernel = kernels.GaussKernel(2);
55  * a.ParamKernel = kernels.LinearKernel;
56  * a.eps = .05;
57  * a.C = 100;
58  * this.Approx = a; */
59 
60  a = approx.KernelApprox(this.System);
61  a.Expansion.TimeKernel= kernels.GaussKernel;
62  a.Expansion.Kernel= kernels.GaussKernel(2);
63  /* a.ParamKernel = kernels.LinearKernel; */
64  a.Expansion.ParamKernel= kernels.GaussKernel(2);
65  this.Approx= a;
66 
67  this.ODESolver= solvers.MLWrapper(@ode45);
68  }
69 
70 
71  function plot(double t,matrix<double> y) {
72  pm = PlotManager(false,1,2);
73  ax = pm.nextPlot(" 3d "," 3D plot over time (z-axis) "," x_1 "," x_2 ");
74  plot3(ax,y(2,:),y(1,:),t," r ");
75  ax = pm.nextPlot(" 1d "," Plot over time "," t "," x_1,x_2 ");
76  plot(ax,t,y(2,:)," r ",t,y(1,:)," b ");
77  pm.LeaveOpen= true;
78  pm.done;
79  }
80 
81 
82 
83  public: /* ( Static ) */
84 
85  static function test_Rotation_Simulation() {
86  m = models.synth.Rotation;
87  for k = 1:4
88  mu = m.getRandomParam;
89  [t,y] = m.simulate(mu);
90  m.plot(t,y);
91  end
92  }
93 
94 
95 
96 };
97 }
98 }
99 
100 
101 
char Name
The name of the Model.
Definition: BaseModel.m:117
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
double dt
The desired time-stepsize for simulations.
Definition: BaseModel.m:291
sampling.BaseSampler Sampler
The sampling strategy the Model uses.
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
Definition: BaseModel.m:102
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
Definition: PlotManager.m:17
solvers.BaseSolver ODESolver
The solver to use for the ODE. Must be an instance of any solvers.BaseSolver subclass.
Definition: BaseModel.m:315
function plot(double t,matrix< double > y)
Definition: Rotation.m:71
approx.BaseApprox Approx
The approximation method for the CoreFunction.
double T
The final timestep up to which to simulate.
Definition: BaseModel.m:271
spacereduction.BaseSpaceReducer SpaceReducer
The reduction algorithm for subspaces.
static function test_Rotation_Simulation()
Definition: Rotation.m:85