180 copy = error.IterationCompLemmaEstimator;
182 copy =
clone@error.BaseCompLemmaEstimator(
this, copy);
187 copy.Ma_norms= this.Ma_norms;
190 copy.errEst= this.errEst;
191 copy.tstep= this.tstep;
192 if ~isempty(copy.ReducedModel)
193 copy.lstPreSolve=
addlistener(copy.ReducedModel.ODESolver,
" PreSolve ",@copy.cbPreSolve);
194 copy.lstPreSolve.Enabled= this.lstPreSolve.Enabled;
195 copy.lstPostSolve=
addlistener(copy.ReducedModel.ODESolver,
" PostSolve ",@copy.cbPostSolve);
196 copy.lstPostSolve.Enabled= this.lstPostSolve.Enabled;
199 copy.smallz_flag= this.smallz_flag;
227 this.Ma_norms= f.Ma_norms;
230 lfcn = error.lipfun.ImprovedLocalSecantLipschitz(f.Kernel);
234 lfcn.precompMaxSecants(d*2,200);
259 if f.Expansion.Kernel.IsRBF && ~isempty(rm.
V)
263 prepared.c= hlp.Expansion.Centers;
266 prepared.G= rm.
V^
t*(prepared.G*rm.
V);
268 prepared.smallz_flag=
true;
295 di = this.c.xi - repmat(x,1,size(this.c.xi,2));
296 di = sqrt(sum(di.*(
this.G*di),1));
310 if (~isempty(this.
mu))
312 hlp = this.Ma_norms ...
313 .* f.Expansion.TimeKernel.evaluate(t, this.c.ti) ...
314 .* f.Expansion.ParamKernel.evaluate(this.
mu, this.c.mui);
333 clear@error.BaseCompLemmaEstimator(
this);
341 warning(
" Ambiguous configuration. Having Iterations and UseTimeDiscreteC set; preferring UseTimeDiscreteC ");
348 if isempty(this.lstPreSolve)
351 this.lstPreSolve.Enabled=
true;
352 if isempty(this.lstPostSolve)
355 this.lstPostSolve.Enabled=
true;
377 this.lstPreSolve.Enabled=
false;
380 if ~this.UseTimeDiscreteC && this.
Iterations > 0
389 [~, e] = solver.solve(@this.iterationODEPart, t, e0);
395 this.lstPostSolve.Enabled=
false;
397 ct =
postProcess@error.BaseCompLemmaEstimator(
this, x, t, inputidx);
418 #if 0 //mtoc++: 'set.LocalLipschitzFcn'
420 if ~isa(value,
" error.lipfun.Base ")
430 #if 0 //mtoc++: 'set.Iterations'
434 elseif ~isscalar(value) || value < 0
444 #if 0 //mtoc++: 'set.UseTimeDiscreteC'
448 elseif ~islogical(value)
449 error(" The value must be a
logical ");
460 function e = iterationODEPart(
double t,eold) {
464 error(
" The ODE solver does not work as required by the iterative scheme. ");
467 if (~isempty(this.
mu))
469 hlp = this.Ma_norms ...
470 .* f.Expansion.TimeKernel.evaluate(t, this.c.ti) ...
471 .* f.Expansion.ParamKernel.evaluate(this.
mu, this.c.mui);
482 this.tstep= this.tstep+1;
497 function cbPreSolve(sender,data) {
498 this.
d_iValues= zeros(length(data.Times),size(this.c.xi,2));
509 function cbPostSolve(sender,data) {
510 this.errEst= data.States(end,:);
528 if isempty(errmsg) && ~isempty(model.
Approx) && ~isa(model.
Approx,
" dscomponents.ParamTimeKernelCoreFun ")
529 errmsg =
" The model "" s approximation function must be a subclass of dscomponents.ParamTimeKernelCoreFun for this error estimator. ";
531 if isempty(errmsg) && isa(model.
System.
f,
" dscomponents.ParamTimeKernelCoreFun ") ...
532 && ~isa(model.
System.
f.Expansion.Kernel,
" kernels.BellFunction ")
533 errmsg =
" The system "" s kernel must be a kernels.BellFunction for this error estimator. ";
548 m = models.synth.KernelTest(10);
549 e = error.IterationCompLemmaEstimator;
550 e.UseTimeDiscreteC=
false;
554 m.offlineGenerations;
555 r = m.buildReducedModel;
557 r.simulate(r.getRandomParam,[]);
558 e.UseTimeDiscreteC=
true;
559 r.simulate(r.getRandomParam,[]);
Collection of generally useful functions.
IterationCompLemmaEstimator: A-posteriori error estimator for kernel-based systems using local lipsch...
function offlineComputations(models.BaseFullModel fm)
Overrides the method from BaseEstimator and performs additional computations.
static function errmsg = validModelForEstimator(models.BaseFullModel model)
Validations.
function prepared = prepareForReducedModel(models.ReducedModel rm)
Prepares this estimator for use with a given reduced model. Basically uses the projection matrices an...
BaseCompLemmaEstimator: Base class for error estimators using the comparison lemma formulation...
The base class for any KerMor detailed model.
models.BaseFullModel FullModel
The full model this reduced model was created from.
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
Iterations
Determines how many postprocessing iterations for the estimator are performed.
logical UseTimeDiscreteC
For the local Lipschitz constant estimation the parameter C can be chosen to equal the error from the...
StateError
The reduction state-space error from the last simulation.
d_iValues
The values for each integration time-step .
matrix< double > G
The custom scalar product matrix .
The KerMor reduced model class.
virtual function ci = evaluate(di, Ct)
Evaluates the local lipschitz estimation function.
function copy = clone()
Creates a deep copy of this estimator instance.
error.lipfun.Base LocalLipschitzFcn
The internal kernel Lipschitz function to use.
static function res = test_IterationCompLemmaEstimator()
matrix< double > V
The matrix that has been used for projection.
function e0 = getE0(colvec< double > mu)
Calls the inner initial error computation strategy.
matrix< double > W
The biorthogonal matrix for V, i.e. .
solvers.BaseSolver ODESolver
The solver to use for the ODE. Must be an instance of any solvers.BaseSolver subclass.
function ct = prepareConstants(colvec< double > mu,integer inputidx)
Return values: ct: The time needed for preprocessing.
function ct = postProcess(colvec< double > x,double t,integer inputidx)
Return values: ct: The time needed for postprocessing.
function b = getBeta(colvec xfull, t)
Compute the local lipschitz constant estimations.
approx.BaseApprox Approx
The approximation method for the CoreFunction.
virtual function copy = clone(target)
The interface method with returns a copy of the current class instance.
EstimationData
matrix containing the values at each time step.
dscomponents.ACoreFun f
The core f function from the dynamical system.
models.ReducedModel ReducedModel
The reduced model associated with the error estimator.
addlistener
Creates a listener for the specified event and assigns a callback function to execute when the event ...
function target = project(V, W, target)
Sets the protected matrices that can be utilized on core function evaluations after projection...
static function [ double bmin , double bmax ] = getBoundingBox(double vectors)
Gets the bounding box for a matrix containing column vectors.