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
EstimatorAnalyzer.m
Go to the documentation of this file.
1 
2 
3 /* (Autoinserted by mtoc++)
4  * This source code has been filtered by the mtoc++ executable,
5  * which generates code that can be processed by the doxygen documentation tool.
6  *
7  * On the other hand, it can neither be interpreted by MATLAB, nor can it be compiled with a C++ compiler.
8  * Except for the comments, the function bodies of your M-file functions are untouched.
9  * Consequently, the FILTER_SOURCE_FILES doxygen switch (default in our Doxyfile.template) will produce
10  * attached source files that are highly readable by humans.
11  *
12  * Additionally, links in the doxygen generated documentation to the source code of functions and class members refer to
13  * the correct locations in the source code browser.
14  * However, the line numbers most likely do not correspond to the line numbers in the original MATLAB source files.
15  */
16 
18  :public handle {
45  public:
46 
80  rowvec EstimatorVersions = "[1 1 0 0 1 0 0 1]";
114  char SaveTexTables = "tables.tex";
179  ErrorOrders = "[1 2 3 5 10]";
209  public:
210 
224  public:
225 
226 
228  this.ModelData= struct(" Name ",[]," ErrT ",[]," RelErrT ",[]);
229  if nargin == 1
230  this.setModel(model);
231  end
232  }
233 
234 
235  function setModel(models.BaseFullModel model) {
236  if isa(model," models.ReducedModel ")
237  this.Model= model.FullModel;
238  this.ReducedModel= model;
239  else
240  this.Model= model;
241 
242  model.offlineGenerations;
243  this.ReducedModel= model.buildReducedModel;
244  end
245  /* Only call struct building for old, non-deim estimators */
246  if ~isa(this.ReducedModel.ErrorEstimator," error.DEIMEstimator ")
247  this.buildEstimatorStruct(this.ReducedModel);
248  end
249  }
260  function est = getDefaultEstStruct() {
261  est = struct.empty;
262  est(end+1).Name = " True error ";
263  e = error.DefaultEstimator;
264  e.offlineComputations(this.ReducedModel.FullModel);
265  est(end).Estimator = e.prepareForReducedModel(this.ReducedModel);
266  est(end).Estimator.Enabled= true;
267  est(end).MarkerStyle = " o ";
268  est(end).LineStyle = " - ";
269  est(end).Color = [0 0 1];
270  }
279  function [errs , relerrs , ctimes , doublet , PlotManagerpm ] = compute(colvec mu,integer inidx,PlotManager pm) {
280 
281  if nargin < 3
282  inidx = [];
283  if nargin < 2
284  mu = [];
285  end
286  end
287 
288  [errs, ctimes, relerrs] = this.getErrorEstimates(mu, inidx, true);
289 
290 
291  /* MaxErr data */
292  this.ModelData(end+1).Name = this.Model.Name;
293  this.ModelData(end).ErrT = errs(:,end)^t;
294  this.ModelData(end).MinErr = min(errs(:));
295  this.ModelData(end).OverestT = (errs(:,end)/errs(1,end))^t;
296  this.ModelData(end).RelErrT = relerrs(:,end)^t;
297  this.ModelData(end).MinRelErr = min(relerrs(:));
298  this.ModelData(end).CTimes = ctimes;
299  this.ModelData(end).mu = mu;
300  this.ModelData(end).inputidx = inidx;
301 
302  /* Table overview */
303  t = this.getResultTable(errs, ctimes);
304  t.display;
305 
306  if ~isempty(this.SaveTexTables)
307  t.Format= " tex ";
308  t.saveToFile(this.SaveTexTables);
309  end
310 
311  if nargin == 4
312  this.createPlots(errs, relerrs, ctimes, pm);
313  end
314  }
330  function [errs , ctimes , varargout ] = getErrorEstimates(colvec<double> mu,inidx,withrel) {
331  if nargin == 3
332  withrel = false;
333  end
334  num = length(this.Est);
335  ctimes = zeros(1,num);
336  errs = zeros(num,length(this.Model.Times));
337 
338  /* % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Simulations
339  *fprintf('Starting estimator demo for model %s!\n',this.Model.Name);
340  * Save old estimator */
341  oldest = this.ReducedModel.ErrorEstimator;
342  str = ; compplot = [];
343  try
344  for idx = 1:num
345  el = this.Est(idx);
346  /* Set estimator and run */
347  this.ReducedModel.ErrorEstimator= el.Estimator;
348 
349  /* Optionally run some commands before starting stuff */
350  if isfield(el," Callback ") && ~isempty(el.Callback)
351  el.Callback(el.Estimator);
352  end
353 
354  fprintf(" Performing estimation %d of %d: %s...\n ",idx,num,el.Name);
355  [~, ~, ctimes(idx)] = this.ReducedModel.simulate(mu,inidx);
356  if this.UseOutputError
357  errs(idx,:) = this.ReducedModel.ErrorEstimator.OutputError;
358  else
359  errs(idx,:) = this.ReducedModel.ErrorEstimator.StateError;
360  end
361  /* Plotting preparations */
362  if ~isa(el.Estimator," error.ExpensiveBetaEstimator ")
363  str = [str sprintf(" errs(%d,end),ctimes(%d), "" %s "" , ",idx,idx,el.MarkerStyle)]; /* #ok<*AGROW> */
364 
365  compplot(end+1) = idx;
366  end
367  end
368  catch ME
369  /* Restore old estimator */
370  this.ReducedModel.ErrorEstimator= oldest;
371  rethrow(ME);
372  end
373  /* Restore old estimator */
374  this.ReducedModel.ErrorEstimator= oldest;
375 
376  /* Sanity checks */
377  if any(abs(errs(1,1) - errs(2:end,1))/errs(1,1) > 1e-4)
378  warning(" KerMor:EstimatorAnalyzer ",...
379  " Relative difference in initial errors over 1e-4 detected. ");
380  figure; semilogy(errs(:,1));
381  end
382 
383  if withrel
384  varargout[1] = this.getRelativeErrorEstimates(errs, mu, inidx);
385  end
386  }
387 
388 
389  function relerrs = getRelativeErrorEstimates(errs,colvec<double> mu,inidx) {
390  if this.UseOutputError
391  [~,yf] = this.Model.simulate(mu, inidx);
392  else
393  [~,yf] = this.Model.computeTrajectory(mu, inidx);
394  yf = bsxfun(@times, yf, this.ReducedModel.System.StateScaling);
395  end
396  yfullnorm = sqrt(sum(yf.*(this.Model.G*yf),1));
397  relerrs = errs ./ repmat(yfullnorm,size(errs,1),1);
398  }
399 
400 
401  function pm = createPlots(errs,relerrs,ctimes,pm) {
402  if nargin < 5
403  pm = PlotManager(false, 2, 2);
404  end
405 
406  /* Absolute error plots */
407  this.plotErrors(errs, pm)
408 
409  /* Relative error plots */
410  this.plotRelativeErrors(relerrs, pm);
411 
412  /* Computation ctimes plot */
413  this.plotCTimes(errs, ctimes, pm);
414 
415  if nargout < 1
416  pm.done;
417  end
418  }
419 
420 
421  function plotErrors(errs,pm) {
422  ax = pm.nextPlot(" abserr ",[" Error estimations for model: " this.Model.Name],...
423  " Time ", " Error estimates ");
424 
425  this.doPlots(errs, ax);
426 
427  axis(ax,[this.Model.Times(this.PlotStartIndex) this.Model.T this.getYMin(errs) 3*max(errs(:))]);
428  }
429 
430 
431  function plotRelativeErrors(relerrs,pm) {
432  ax = pm.nextPlot(" relerr ",[" Relative error estimations e(t)/||y||, \Delta x(t)/||y|| for model: " ...
433  this.Model.Name], " Time ", " Relative error estimates ");
434 
435  this.doPlots(relerrs, ax);
436 
437  re = relerrs(:);
438  re(isinf(re)) = -Inf;
439  axis(ax,[this.Model.Times(this.PlotStartIndex) this.Model.T this.getYMin(relerrs) 3*max(re)]);
440  }
441 
442 
443  function plotCTimes(errs,ctimes,pm) {
444  ax = pm.nextPlot(" ctimes ",[" Error estimator computation times: " this.Model.Name], " \Delta(T) ", " Comp. time [s] ");
445  hold(ax, " on ");
446  ph = zeros(length(this.Est),1);
447  plotfun = @plot;
448  if this.LogarithmicPlot
449  plotfun = @semilogx;
450  end
451  ci = LineSpecIterator;
452  for idx = 1:length(this.Est)
453  e = this.Est(idx);
454  if isfield(e," Color ")
455  if isempty(e.Color)
456  error(" If a field 'Color' exists, all estimators must have assigned a color. ");
457  end
458  c = e.Color;
459  else
460  c = ci.nextColor;
461  end
462  ph(idx) = plotfun(ax,errs(idx,end),ctimes(idx),...
463  " Marker ",e.MarkerStyle," Color ",c,...
464  " MarkerSize ",this.MarkerSize*1.5);
465  end
466  /* Fill symbols (later, so char-color specs can be used in estimator structs) */
467  for i=1:length(ph)
468  c = get(ph(i)," Color ");
469  set(ph(i)," MarkerFaceColor ",c);
470  set(ph(i)," MarkerEdgeColor ",c*.7);
471  end
472  /* Add line for minimum error! */
473  plot(ax,[errs(1,end) errs(1,end)],[min(ctimes) max(ctimes)]," black ");
474  hold(ax, " off ");
475  /* Add legend */
476  a = cell(1,length(this.Est));
477  [a[:]] = this.Est(:).Name;
478  legend(a," Location "," NorthEast "," Interpreter "," latex ");
479  axis([.9*min(errs(:,end)) 1.1*max(errs(:,end)) .9*min(ctimes(:)) 1.1*max(ctimes(:))]);
480  }
481 
482 
483  function pt = getResultTable(errs,ctimes) {
484  if this.SortResultTable
485  str = " Estimator hierarchy (error*time product) ";
486  [~,idx] = sort(errs(:,end).*ctimes^t);
487  else
488  str = " Estimator list ";
489  idx = 1:size(errs,2);
490  end
491  pt = PrintTable(" %s for model '%s' ",str,this.Model.Name);
492  pt.HasRowHeader= true;
493  pt.addRow(" Name ",sprintf(" $\\Delta(%g)$ ",this.Model.T)," Time "," Efficiency ");
494  sfun = @(v)Utils.getLatexStr(v,3);
495  for id = 1:length(this.Est)
496  pt.addRow(this.Est(idx(id)).Name,errs(idx(id),end),ctimes(idx(id)),...
497  errs(idx(id),end)/errs(1,end),[sfun," %2.2fs ",sfun]);
498 /* pt.addRow(this.Est(idx(id)).Name,errs(idx(id),end),ctimes(idx(id)),...
499  * errs(idx(id),end)/errs(1,end),{'$%1.3$','%2.2fs','$%1.3e$'}); */
500  end
501  pt.HasHeader= true;
502  }
503 
504 
505  function ts = createStatsTables(sort) {
506  m = length(this.ModelData);
507  if nargin < 2
508  sort = 1:m;
509  end
510  fields = [" ErrT "," RelErrT "," OverestT "," CTimes "];
511  fieldnames = [" Errors "," Relative errors "," Overestimations "," Computation times "];
512 
513  for fi = 1:length(fields)
514  t = PrintTable;
515  t.Format= " tex ";
516  t.HasHeader= true;
517  t.Caption= sprintf(" %s of estimation runs ",fieldnames[fi]);
518  t.addRow(" Model / Est ", this.Est(:).Name);
519 
520  fmt = " $%1.1e$ ";
521  if strcmp(fields[fi]," CTimes ")
522  fmt = " $%2.2fs$ ";
523  end
524  fmt = [[" $%s$ "] repmat([fmt],1,length(this.Est))];
525  for it=1:m
526  md = this.ModelData(sort(it));
527 
528  /* % Compile name and add */
529  nstr = ;
530  if ~isempty(md.mu)
531  nstr = [" , \\mu=[ " sprintf(" %2.2e ",md.mu) " ] "];
532  end
533  if ~isempty(md.inputidx)
534  nstr = [nstr sprintf(" , u_%d ",md.inputidx)];
535  end
536  hlp = num2cell(md.(fields[fi]));
537  t.addRow(nstr,hlp[:],fmt);
538  end
539  /* str = strrep(strrep(strrep(strrep(t.print,'e+','e^{'),'e-','e^{-'),'{0','{'),'{-0','{-');
540  *fprintf(fid,'%s',str);
541  *t.print(fid); */
542  ts(fi) = t;
543  end
544  /* fclose(fid); */
545  }
560  /* % Getter & Setter */
561  public:
562 
563 
564 #if 0 //mtoc++: 'set.EstimatorIterations'
565 function EstimatorIterations(value) {
566  this.EstimatorIterations= value;
567  if ~isempty(this.ReducedModel)/* #ok */
568 
569  this.buildEstimatorStruct(this.ReducedModel);/* #ok */
570 
571  end
572  }
573 
574 #endif
575 
576 
577 
578 #if 0 //mtoc++: 'set.EstimatorVersions'
579 function EstimatorVersions(value) {
580  this.EstimatorVersions= value;
581  if ~isempty(this.ReducedModel)/* #ok */
582 
583  this.buildEstimatorStruct(this.ReducedModel);/* #ok */
584 
585  end
586  }
587 
588 #endif
589 
590 
591  private:
592 
593 
594  function matrix<double>y = getYMin(err) {
595  err = err(:,this.PlotStartIndex:end);
596  e1 = min(err(:,1));
597  er = min(reshape(err(:,2:end),1,[]));
598  if log10(abs(e1 - er)) < 5
599  y = .5*er;
600  else
601  y = .5*min(err(:));
602  end
603  }
604 
605 
606  function doPlots(data,ax) {
607  times = this.Model.Times(this.PlotStartIndex:end);
608  data = data(:,this.PlotStartIndex:end);
609  if this.LogarithmicPlot
610  ph = semilogy(ax,times,data);
611  else
612  ph = plot(ax,times,data);
613  end
614  set(ph," LineWidth ",this.LineWidth);
615  set(ph(1)," LineWidth ",this.LineWidth+.5);
616  hold on;
617  /* Select extra marker places */
618  nt = length(times);
619  sel = round(1:nt/this.NumMarkers:nt);
620  ci = LineSpecIterator;
621  for idx=1:length(this.Est)
622  e = this.Est(idx);
623  if isfield(e," Color ")
624  if isempty(e.Color)
625  error(" If a field 'Color' exists, all estimators must have assigned a color. ");
626  end
627  c = e.Color;
628  else
629  c = ci.nextColor;
630  end
631  set(ph(idx)," LineStyle ",e.LineStyle," Color ",c);
632  /* Shift marker positions for better visual */
633  pos = mod(sel+round(nt/(this.NumMarkers*length(this.Est)))*(idx-1),nt)+1;
634  h = plot(ax,times(pos), data(idx,pos), e.MarkerStyle,...
635  " MarkerSize ",this.MarkerSize);
636  /* Get resulting color, so char-color specs can be used as e.Color above) */
637  c = get(ph(idx)," Color ");
638  set(h," MarkerFaceColor ",c," MarkerEdgeColor ",c*.7);
639  end
640  a = cell(1,length(this.Est));
641  [a[:]] = this.Est(:).Name;
642  [~,oh] = legend(a," Location "," NorthEast "," Interpreter "," latex "," FontSize ",14);
643  /* Assign markers to legend */
644  oh = findobj(oh," Type "," line ");
645  for idx=1:length(this.Est)
646  c = get(ph(idx)," Color ");
647  set(oh(2*idx)," Marker ",this.Est(idx).MarkerStyle," MarkerFaceColor ",c,...
648  " MarkerEdgeColor ",c*.7," MarkerSize ",this.MarkerSize);
649  end
650  }
658  function buildEstimatorStruct(r) {
659  this.Est= this.buildKernelEstimatorStruct(r);
660  }
661 
662 
663  function est = buildKernelEstimatorStruct(r) {
664  est = struct.empty;
665 
666  /* Default Estimator (true error) */
667  if this.EstimatorVersions(1)
668  est(end+1).Name = " True error ";
669  est(end).Estimator = error.DefaultEstimator(r);
670  est(end).Estimator.Enabled= true;
671  est(end).MarkerStyle = " o ";
672  est(end).LineStyle = " - ";
673  end
674 
675  /* GLE estimator */
676  if this.EstimatorVersions(2)
677  msg = error.GLEstimator.validModelForEstimator(r.FullModel);
678  e = error.GLEstimator;
679  e.offlineComputations(r.FullModel);
680  e = e.prepareForReducedModel(r);
681  if isempty(msg)
682  fprintf(" Initializing Global Lipschitz estimator...\n ");
683  est(end+1).Name = " GLE ";
684  est(end).Estimator = e;
685  est(end).MarkerStyle = " s ";
686  est(end).LineStyle = " - ";
687  else
688  fprintf(" Cannot use the GLEstimator for model %s:\n%s\n ",r.Name,msg);
689  end
690  end
691 
692  msg = error.IterationCompLemmaEstimator.validModelForEstimator(r.FullModel);
693  if isempty(msg)
694 
695  if ~isempty(this.Model.Approx)
696  k = this.Model.Approx.Expansion.Kernel;
697  else
698  k = this.Model.System.f.Expansion.Kernel;
699  end
700 
701  reps = this.EstimatorIterations;
702  fprintf(" Using iteration counts: %s\n ",num2str(this.EstimatorIterations));
703  e = error.IterationCompLemmaEstimator;
704  e.offlineComputations(r.FullModel);
705  e = e.prepareForReducedModel(r);
706  if this.EstimatorVersions(3)
707  fprintf(" Initializing LGL estimator...\n ");
708  est(end+1).Name = " LGL ";
709  est(end).Estimator = e;
710  est(end).Estimator.LocalLipschitzFcn= error.lipfun.LocalGradientLipschitz(k);
711  est(end).Estimator.UseTimeDiscreteC= false;
712  est(end).MarkerStyle = " s ";
713  est(end).LineStyle = " - ";
714  for it = reps
715  orig = est(end).Estimator;/* #ok */
716 
717  eval(sprintf([" est(end+1).Name = "" LGL, %d It "" ; "...
718  " est(end).Estimator = orig.clone; "...
719  " est(end).Estimator.Iterations = %d; "...
720  " est(end).MarkerStyle = "" s "" ; "...
721  " est(end).LineStyle = "" -. "" ; "],it,it));
722  end
723  end
724 
725  if this.EstimatorVersions(4)
726  fprintf(" Initializing LGLMod (mod secant) estimator...\n ");
727  est(end+1).Name = " LGLMod ";
728  est(end).Estimator = e.clone;
729  est(end).Estimator.LocalLipschitzFcn= error.lipfun.LocalSecantLipschitz(k);
730  est(end).Estimator.UseTimeDiscreteC= false;
731  est(end).MarkerStyle = " h ";
732  est(end).LineStyle = " - ";
733  for it = reps
734  orig = est(end).Estimator;/* #ok */
735 
736  eval(sprintf([" est(end+1).Name = "" LGLMod, %d It "" ; "...
737  " est(end).Estimator = orig.clone; "...
738  " est(end).Estimator.Iterations = %d; "...
739  " est(end).MarkerStyle = "" h "" ; "...
740  " est(end).LineStyle = "" : "" ; "],it,it));
741  end
742  end
743 
744  if any(this.EstimatorVersions([5 8]))
745  ilfcn = error.lipfun.ImprovedLocalSecantLipschitz(k);
746  end
747 
748  if this.EstimatorVersions(5)
749  fprintf(" Initializing LSL estimator...\n ");
750  est(end+1).Name = " LSLE ";
751  est(end).Estimator = e.clone;
752  est(end).Estimator.LocalLipschitzFcn= ilfcn.clone;
753  est(end).Estimator.UseTimeDiscreteC= false;
754  est(end).MarkerStyle = " p ";
755  est(end).LineStyle = " - ";
756  for it = reps
757  orig = est(end).Estimator;/* #ok */
758 
759  eval(sprintf([" est(end+1).Name = "" LSLE, %d It "" ; "...
760  " est(end).Estimator = orig.clone; "...
761  " est(end).Estimator.Iterations = %d; "...
762  " est(end).MarkerStyle = "" p "" ; "...
763  " est(end).LineStyle = "" -- "" ; "],it,it));
764  end
765  end
766 
767  /* % TD-Versions */
768  if any(this.EstimatorVersions(6:8))
769  td = error.IterationCompLemmaEstimator;
770  td.offlineComputations(r.FullModel);
771  td = td.prepareForReducedModel(r);
772  td.Iterations= 0;
773  td.UseTimeDiscreteC= true;
774  end
775 
776  if this.EstimatorVersions(6)
777  fprintf(" Initializing LSL TD estimators...\n ");
778  est(end+1).Name = " LGL TD ";
779  est(end).Estimator = td;
780  est(end).Estimator.LocalLipschitzFcn= error.lipfun.LocalGradientLipschitz(k);
781  est(end).MarkerStyle = " < ";
782  est(end).LineStyle = " - ";
783  end
784 
785  if this.EstimatorVersions(7)
786  fprintf(" Initializing LSL TD estimators...\n ");
787  est(end+1).Name = " LGL TD ";
788  est(end).Estimator = td.clone;
789  est(end).Estimator.LocalLipschitzFcn= error.lipfun.LocalSecantLipschitz(k);
790  est(end).MarkerStyle = " < ";
791  est(end).LineStyle = " - ";
792  end
793 
794  if this.EstimatorVersions(8)
795  est(end+1).Estimator = est(end).Estimator.clone;
796  est(end).Name = " LSLE TD ";
797  est(end).Estimator = td.clone;
798  est(end).Estimator.LocalLipschitzFcn= ilfcn.clone;
799  est(end).MarkerStyle = " < ";
800  est(end).LineStyle = " - ";
801  end
802  else
803  fprintf(" Cannot use the IterationCompLemmaEstimator for model %s:\n%s\n ",r.Name,msg);
804  end
805  }
824 };
825 
826 
827 
char Name
The name of the Model.
Definition: BaseModel.m:117
function setModel(models.BaseFullModel model)
Sets the model to use for the estimator demo.
Collection of generally useful functions.
Definition: Utils.m:17
function [ errs , relerrs , ctimes , double t , PlotManager pm ] = compute(colvec mu,integer inidx,PlotManager pm)
Runs the demo with the current settings.
fields
Returns a cell array of string containing the names of public properties.
function [ models.ReducedModel reduced , double time ] = buildReducedModel(varargin)
Builds a reduced model from a full model.
The base class for any KerMor detailed model.
Definition: BaseFullModel.m:18
models.BaseFullModel FullModel
The full model this reduced model was created from.
Definition: ReducedModel.m:53
logical SortResultTable
Set flag to sort the resulting computation time and estimates table by the product of comp-time and e...
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
Definition: BaseModel.m:102
models.ReducedModel ReducedModel
The reduced model.
Times
Evaluation points of the model.
Definition: BaseModel.m:206
logical UseOutputError
Flag wether to use the output errors or state variable errors.
A MatLab cell array or matrix.
function pt = getResultTable(errs, ctimes)
function pm = createPlots(errs, relerrs, ctimes, pm)
OutputError
The output error from the last simulation.
function plotCTimes(errs, ctimes, pm)
StateError
The reduction state-space error from the last simulation.
Definition: BaseEstimator.m:82
sort
ort the handle objects in any array in ascending or descending order.
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
An integer value.
The KerMor reduced model class.
Definition: ReducedModel.m:18
PlotManager: Small class that allows the same plots generated by some script to be either organized a...
Definition: PlotManager.m:17
rowvec EstimatorIterations
How many estimator iterations should be performed?
rowvec EstimatorVersions
Chooses the estimator versions. Set to 1 for use, 0 for not use. 1: True Error 2: GLE...
models.BaseFullModel Model
The used model.
Matlab's base handle class (documentation generation substitute)
struct Est
A struct containing information about different error estimators.
A boolean value.
error.BaseEstimator ErrorEstimator
The error estimator for the reduced model.
Definition: ReducedModel.m:118
function est = getDefaultEstStruct()
Returns the default structure for the Est property of this class. Contains only the error...
fieldnames
Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames f...
function relerrs = getRelativeErrorEstimates(errs,colvec< double > mu, inidx)
A matlab column vector.
colvec StateScaling
The scaling for the state vectors.
MarkerSize
The marker size for error and relative errors plots.
double T
The final timestep up to which to simulate.
Definition: BaseModel.m:271
Analysis class for the error estimators.
Speed test * all(1:3)
ModelData
A struct with fields Name, ErrsT, RelErrsT that contains information about the estimations of the dif...
function [ errs , ctimes , varargout ] = getErrorEstimates(colvec< double > mu, inidx, withrel)
PrintTable: Class that allows table-like output spaced by tabs for multiple rows. ...
Definition: PrintTable.m:17
function ts = createStatsTables(sort)
Creates LaTeX tables with each the Errors,Relative errors,Overestimations and Computation times for t...
function [ t , x , time , cache ] = computeTrajectory(colvec< double > mu, inputidx)
Computes a solution/trajectory for the given mu and inputidx in the SCALED state space.
logical LogarithmicPlot
Determines whether to plot the errors on a logarithmic scale or not.
function offlineGenerations()
Performs all large offline computations for model reduction.
findobj
Finds objects matching the specified conditions from the input array of handle objects.
LineWidth
The line width to use.
PlotStartIndex
The position where to start plotting error estimates.
EstimatorAnalyzer(models.BaseFullModel model)
A matlab row vector.
char SaveTexTables
Flag whether to save the time results as a LaTeX-Table into a text file.
ErrorOrders
% DEIM estimator related stuff The error orders to use. Unset if the JacDEIM/SimTranssizes version sh...
function plotRelativeErrors(relerrs, pm)
A MatLab struct.
LinSpecIterator: Small helper class to automatically iterate through different line styles/markers/co...
A MatLab character array.
function plotErrors(errs, pm)
NumMarkers
The number of markers for error and relative errors plots.
static function str = getLatexStr(value, digits)
Definition: Utils.m:194
function [ rowvec< double > t , matrix< double > y , double sec , x ] = simulate(colvec< double > mu,integer inputidx)
Simulates the system and produces the system's output.
Definition: BaseModel.m:477
A variable number of output arguments.