95 error(
" not yet implemented ");
105 p.KernelLipschitzFcn= rmodel.
System.
f.GaussWeight.getLipschitzFunction;
109 if ~isempty(fm.System.B)
115 warning(
" Some:Id ",
" Error estimator for current system will not work correctly! (B is not linear and mu-independent! ");
127 if ~isempty(rmodel.
V) && ~isempty(rmodel.
W)
130 Ai[i] = (Ai[i] - rmodel.
V*(rmodel.
W^
t*Ai[i]))*rmodel.
V;
132 bi = bi - rmodel.
V*(rmodel.
W^
t*bi);
137 [x,y] = meshgrid(1:n);
142 p.A[i,j] = Ai[i]^
t*(
G*Ai[j]);
143 p.Ab[i,j] = Ai[i]^
t*(
G*bi(:,j));
151 p.AB[i] = Ai[i]^
t*(
G*fB);
159 p.Ainorms= zeros(1,n);
161 p.AV[i] = Ai[i]^
t*(
G*Ai[i]);
162 p.Ainorms(i) = norm(Ai[i]);
200 di = this.xi - repmat(this.
ReducedModel.
V*z,1,size(this.xi,2));
201 di = sqrt(sum(di.^2,1));
203 w = wf.evaluateScalar(di/min(di));
209 [x,y] = meshgrid(idx);
216 e(1) = e(1) + w(i)*w(j)*(z
" *this.A{i,j}*z + 2*z "*this.Ab[i,j] + this.b(i,j));
222 e(1) = e(1) + w(i)*(z^t*this.AB[i]*ut + this.bB(i,:)*ut);
224 e(1) = e(1) + ut^t*this.B*ut;
227 if ~this.neg_e1 && e(1) < 0
231 e(1) = sqrt(max(e(1),0));
238 Ct = eold(1) + eold(2);
242 beta = wf.evaluateScalar(max(0,di-Ct)) * this.Ainorms^
t;
244 av = cellfun(@(A)sqrt(z^t*A*z),this.AV);
245 beta = beta + av * this.KernelLipschitzFcn(di,Ct,t,this.
mu)^
t;
247 e(2) = beta*(eold(1) + eold(2));
279 ct =
postProcess@error.BaseEstimator(
this, t, x,
mu, inputidx);
283 warning(
" CompWiseErrorEstimator:process ",
" Integral part is all zero. Attention! ");
288 disp(
" TPWLLocalLipEstimator: Negative alpha(t) norms occurred. Used zero instead. ");
324 clear@error.BaseEstimator(
this);
336 errmsg =
" Local Lipschitz estimators work only for constant linear output conversion. ";
338 if isempty(errmsg) && ~isa(rmodel.
FullModel.
Approx,
" approx.TPWLApprox ")
339 errmsg =
" The Approx class of the full model must be a subclass of approx.TPWLApprox for this error estimator. ";
function p = prepareForReducedModel(models.ReducedModel rmodel)
Overrides the setReducedModel method from error.BaseEstimator and performs additional offline computa...
models.BaseFullModel FullModel
The full model this reduced model was created from.
static function errmsg = validModelForEstimator(models.ReducedModel rmodel)
Validations.
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
dscomponents.AInputConv B
The input conversion.
A MatLab cell array or matrix.
UseTimeDiscreteC
Determines how many postprocessing iterations for the estimator are performed. For the local Lipschit...
StateError
The reduction state-space error from the last simulation.
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
The KerMor reduced model class.
matrix< double > V
The matrix that has been used for projection.
function ct = postProcess(double t,colvec< double > x,integer inputidx)
matrix< double > W
The biorthogonal matrix for V, i.e. .
Base class for all error estimators.
TPWLLocalLipEstimator: Local-Lipschitz estimation based error estimator for reduced models obtained u...
approx.BaseApprox Approx
The approximation method for the CoreFunction.
disp
Handle object disp method which is called by the display method. See the MATLAB disp function...
dscomponents.LinearOutputConv C
The output conversion Defaults to an LinearOutputConv instance using a 1-matrix, which just forwards ...
function e = evalODEPart(colvec x,double t,double ut)
Evaluates the auxiliary ode part for the TPWL estimator.
dscomponents.ACoreFun f
The core f function from the dynamical system.
function C = evaluate(double t,colvec< double > mu)
Evaluates the output conversion matrix. In this simple case this is just the projection matrix...
models.ReducedModel ReducedModel
The reduced model associated with the error estimator.
ExtraODEDims
The dimensions added to the ODE function by the estimator.
function e0 = init(colvec< double > mu)
Returns the initial error at of the integral part.
function matrix< double > mu = getRandomParam(integer num,integer seed)
Gets a random parameter sample from the system's parameter domain P.