60 s = solvers.ExplEuler;
66 this.
System= models.wh10.WH10System(
this);
75 models.wh10.WH10Experiment.Experiment1(100);
91 m = models.wh10.WH10Experiment(dim);
97 f.Ma= repmat(-exp(-f.Centers.xi(1,:)/15),dim,1);
99 s.x0= dscomponents.ConstInitialValue(ones(dim,1));
104 s.Inputs[1] = @(
t).04*sin(
t/3);
105 s.Inputs[2] = @(
t)exp(-abs(10-
t/2));
109 s.B= dscomponents.LinearInputConv(ones(m.dim,1));
113 m.TrainingInputs= [];
115 s.C= dscomponents.LinearOutputConv(ones(1,m.dim)/m.dim);
117 V = ones(dim,1)/sqrt(dim);
118 sr = spacereduction.ManualReduction(V,V);
119 sr = spacereduction.RotationDecorator(sr);
125 d.EstimatorVersions= [1 1 0 0 1 0 0 1 1];
133 pm.UseFileTypeFolders=
false;
134 pm.NoTitlesOnSave=
true;
137 for didx = 1:length(degs)
138 sr.Degree= degs(didx);
141 rmodels[didx] = d.ReducedModel;
144 for idx=1:s.InputCount
145 m.Name= sprintf(
" \\theta=%.4f ",sr.Degree);
146 [errs, relerrs, ctimes] = d.compute([],idx);
147 d.createPlots(errs, relerrs, ctimes, pm);
149 md = d.ModelData(end);
151 absmax = 30*abs(md.ErrT(7)-md.ErrT(1));
152 relmax = 30*abs(md.RelErrT(7)-md.RelErrT(1));
154 axis(gca(1),[0 m.T md.MinErr*.9 min(1e4,absmax)]);
155 axis(gca(2),[0 m.T md.MinRelErr*.9 min(1,relmax)]);
156 set(gca(3),
" XScale ",
" log ");
158 pm.FilePrefix= sprintf(
" WH10_in%d_deg%f ",idx,sr.Degree);
165 ma.SingleFigures=
true;
166 d.ReducedModel.ErrorEstimator= d.Est(7).Estimator;
167 ma.analyzeError([],3,pm);
168 pm.FilePrefix=
" WH10_in3_deg05 ";
173 sort = [range (range)+1 (range)+2 (range)+3];
174 d.createStatsTables(
sort);
199 s = spacereduction.PODReducer;
202 s.UseSVDS= dim > 10000;
203 s = spacereduction.RotationDecorator(s);
210 s.x0= dscomponents.ConstInitialValue(ones(dim,1));
211 f.Ma= repmat(-exp(-f.Centers.xi(1,:)/15),dim,1);
213 m.System.Inputs[1] = @(
t).2*sin(
t);
215 B = linspace(0,1,m.dim)^
t;
216 m.System.B= dscomponents.LinearInputConv(B);
220 m.Name=
" Sinus input, mean output mapping, larger error ";
221 m.System.C= dscomponents.LinearOutputConv(ones(1,m.dim)/m.dim);
225 d.EstimatorVersions= [1 0 0 1 0 0 1 1];
226 d.SingleFigures=
true;
232 axis(a,[0 m.T 0 10]);
233 set(legend(a),
" Location ",
" NorthEast ");
239 f = d.Figures[2]; a = gca(f);
240 axis(a,[0 m.T 5e-5 1]);
241 set(legend(a),
" Location ",
" NorthEast ");
247 f = d.Figures[3]; a = gca(f);
265 f.x0= @(mu)ones(dim,1);
266 f.Ma= repmat(-exp(-f.Centers.xi(1,:)/15),dim,1);
269 m.System.Inputs[1] = @(
t).04*sin(
t/3);
270 m.System.Inputs[2] = @(
t)exp(-abs(10-
t/2));
272 m.System.Inputs[3] = @(
t)exp(-(10-
t).^2);
274 m.System.Inputs[4] = @(
t)(
t>10)*.1;
276 m.System.B= dscomponents.LinearInputConv(ones(m.dim,1));
278 m.TrainingInputs= 1:4;
280 m.System.C= dscomponents.LinearOutputConv(ones(1,m.dim)/m.dim);
282 s = spacereduction.PODReducer;
285 s.UseSVDS= dim > 10000;
290 d.EstimatorVersions= [1 1 0 0 1 0 0 1 1];
291 d.SingleFigures=
true;
294 for idx=1:m.System.InputCount
298 md = d.ModelData(end);
300 absmax = 30*abs(md.ErrT(7)-md.ErrT(1));
301 relmax = 30*abs(md.RelErrT(7)-md.RelErrT(1));
305 axis(a,[0 m.T md.ErrT(1)*.9 min(1e4,absmax)]);
306 set(legend(a),
" Location ",
" NorthEast ");
311 f = d.Figures[2]; a = gca(f);
312 axis(a,[0 m.T md.RelErrT(1)*.9 min(1,relmax)]);
313 set(legend(a),
" Location ",
" NorthEast ");
318 f = d.Figures[3]; a = gca(f);
323 close([d.Figures[:]]);
339 rnd = RandStream(
" mt19937ar ",
" Seed ",2564);
349 s = spacereduction.PODReducer;
352 s.UseSVDS= dim > 10000;
353 s = spacereduction.RotationDecorator(s);
359 f.x0= @(mu)ones(dim,1);
360 n = size(f.Centers.xi,2);
361 f.Ma= -exp(-rand(dim,n));
363 m.System.Inputs[1] = @(
t).1*sin(
t);
364 m.System.B= dscomponents.LinearInputConv(rnd.rand(m.dim,1));
368 m.Name=
" Sinus input, mean output mapping, larger error ";
369 m.System.C= dscomponents.LinearOutputConv(ones(1,m.dim)/m.dim);
373 d.EstimatorVersions= [1 0 0 1 0 0 1 1];
374 d.SingleFigures=
true;
ModelAnalyzer: Analysis tools for reduced models and approximations.
Collection of generally useful functions.
The base class for any KerMor detailed model.
double dt
The desired time-stepsize for simulations.
integer TrainingInputs
The indices of inputs to use for training data generation. Uses the DefaultInput if not set (and Defa...
sampling.BaseSampler Sampler
The sampling strategy the Model uses.
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
static function d = Experiment2(dim)
Experiment with POD reduction and training with all 4 inputs!
static function d = Experiment4(dim)
sort
ort the handle objects in any array in ascending or descending order.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
rowvec EstimatorIterations
How many estimator iterations should be performed?
static function d = Experiment3(dim)
Experiment with truly random component-wise functions.
solvers.BaseSolver ODESolver
The solver to use for the ODE. Must be an instance of any solvers.BaseSolver subclass.
static function [ d , rmodels ] = Experiment1(dim, dir)
Experiment with manual reduction and rotation as error source.
static function saveFigure(fig, filename, ext)
Opens a matlab save dialog and saves the given figure to the file selected.
approx.BaseApprox Approx
The approximation method for the CoreFunction.
Analysis class for the error estimators.
rowvec< integer > AutoTickMarks
An integer number to enforce a minimum number of tickmarks on the respective axes.
Global configuration class for all KerMor run-time settings.
static function KerMor theinstance = App()
The singleton KerMor instance.
Numerical experiments class for Paper WH10.
dim
The system's dimension.
double MaxTimestep
The maximum timestep allowed for any ODE solvers.
static function res = test_WH10_RunExperiments()