46 orders = [1 5 20 97 102 107 145;...
47 149 145 130 53 48 43 5];
48 errors = zeros(8,m.Data.SampleCount,length(orders));
50 rand_errors = zeros(8,ns,length(orders));
51 details =
cell(1,length(orders));
52 rand_details = details;
53 for j=1:size(orders,2)
54 fprintf(
" Setting DEIM order = %d\n ",orders(1,j));
55 r.System.f.Order= orders(:,j)^
t;
56 [e, details[j]] = ma.getRedErrForParamSamples;
58 [params, re, rand_details[j]] = ma.getRedErrForRandomParamSamples(ns,1);
60 rand_errors(:,:,j) = re;
62 save(fullfile(d,
" reduction_errors.mat "),
" errors ",
" orders ",
" details ");
63 save(fullfile(d,
" reduction_errors_randparams.mat "),
" rand_errors ",
" orders ",
" params ",
" rand_details ");
131 m = models.pcd.PCDModel(2);
140 m.System.h= (m.System.Omega(1,2)-m.System.Omega(1,1))/(dim-1);
142 if all([m.System.f.fDim m.System.f.xDim] < 1000)
143 m.Data.TrajectoryData= data.MemoryTrajectoryData;
147 m.System.Params(1).Desired = 10;
149 m.System.Params(2).Desired = 20;
150 s = sampling.GridSampler;
154 s = spacereduction.PODGreedy;
158 m.Approx= approx.DEIM;
159 m.Approx.MaxOrder= 120;
161 s = data.selection.LinspaceSelector;
163 m.Approx.TrainDataSelector= s;
165 m.System.MaxTimestep= m.dt;
166 m.ODESolver= solvers.SemiImplicitEuler(m);
168 e = error.DEIMEstimator;
169 e.JacMatDEIMMaxOrder= 80;
170 ts = data.selection.LinspaceSelector;
171 ts.Size= round(.2 * m.T * m.System.Params(1).Desired / m.dt);
172 e.TrainDataSelector= ts;
176 d = fullfile(
KerMor.
App.DataDirectory,sprintf(
" tests_PCD_DEIM_2D_%d_%d ",m.System.Dims));
191 offline_times = m.offlineGenerations;
215 m = models.pcd.PCDModel(2);
224 m.System.h= (m.System.Omega(1,2)-m.System.Omega(1,1))/(dim-1);
230 s = sampling.RandomSampler;
235 m.ComputeTrajectoryFxiData=
true;
236 s = spacereduction.PODGreedy;
238 s.MaxSubspaceSize= 200;
239 s.MinRelImprovement= 1e-8;
240 s.IncludeTrajectoryFxiData=
true;
244 m.Approx= approx.DEIM;
245 m.Approx.MaxOrder= 250;
247 s = data.selection.LinspaceSelector;
249 m.Approx.TrainDataSelector= s;
251 m.System.MaxTimestep= m.dt;
252 m.ODESolver= solvers.SemiImplicitEuler(m);
254 e = error.DEIMEstimator;
255 e.JacMatDEIMMaxOrder= 200;
256 e.JacSimTransMaxSize= 200;
257 ts = data.selection.LinspaceSelector;
259 e.TrainDataSelector= ts;
263 d = fullfile(
KerMor.
App.DataDirectory,sprintf(
" tests_PCD_DEIM_2D_%d_%d_500s ",m.System.Dims));
278 offline_times = m.offlineGenerations;
298 m = models.pcd.PCDModel(1);
307 m.System.h= (m.System.Omega(2)-m.System.Omega(1))/(dim-1);
309 m.Data.TrajectoryData= data.MemoryTrajectoryData;
311 m.System.Params(1).Desired = 20;
312 s = sampling.GridSampler;
316 m.Approx= approx.DEIM;
317 m.Approx.MaxOrder= 60;
319 s = data.selection.DefaultSelector;
321 m.Approx.TrainDataSelector= s;
323 m.System.MaxTimestep= m.dt;
324 m.ODESolver= solvers.SemiImplicitEuler(m);
326 e = error.DEIMEstimator;
327 e.JacMatDEIMMaxOrder= 60;
328 ts = data.selection.LinspaceSelector;
329 ts.Size= round(.2 * m.T * m.System.Params(1).Desired / m.dt);
330 e.TrainDataSelector= ts;
333 offline_times = m.offlineGenerations;
337 d = fullfile(
KerMor.
App.DataDirectory,
" tests_PCD_DEIM_1D ");
349 m = models.pcd.PCDModel(1);
350 mu = m.getRandomParam;
351 [
t,y] = m.simulate(mu);
353 m = models.pcd.PCDModel(2);
354 mu = m.getRandomParam;
355 [
t,y] = m.simulate(mu);
ModelAnalyzer: Analysis tools for reduced models and approximations.
static function m = tests_PCD_DEIM_1D(dim)
A MatLab cell array or matrix.
static function reductionErrorAnalysis_2D(d, r, pm)
% -------------— 2D tests -----------------— Reduction error analysis - computes the reduction erro...
static function m = tests_PCD_DEIM_2D_500s(dim)
New configuration with shorter runtime Samples are randomly distributed!
static function b = getGitBranch(dir)
Returns the current git commit in a descriptive string.
Global configuration class for all KerMor run-time settings.
static function res = test_PCDModels()
static function KerMor theinstance = App()
The singleton KerMor instance.
static function m = tests_PCD_DEIM_2D(dim)
% Model creation functions Original setting for the large-scale reduction up to T=3000 with 200 lin-s...
Tests: Some test settings regarding the PCD model simulations.