118 #if 0 //mtoc++: 'set.MinWeightValue'
121 error(
" MinWeightValue must be a positive real scalar ");
130 #if 0 //mtoc++: 'set.Beta'
131 function
Beta(value) {
133 error("
Beta must be a positive real scalar. ");
143 #if 0 //mtoc++: 'get.Beta'
144 function value =
Beta() {
152 this =
this@approx.BaseApprox(sys);
166 copy = approx.TPWLApprox(this.
System);
167 copy =
clone@approx.BaseApprox(
this, copy);
171 copy.Beta= this.
Beta;
177 projected =
project@approx.BaseApprox(
this, V, W, this.
clone);
178 for i=1:length(this.
Ai)
179 projected.Ai[i] = W^
t*this.
Ai[i]*
V;
181 projected.bi= W^
t*this.
bi;
182 projected.xi= W^
t*this.
xi;
195 as = length(this.
Ai);
200 di = sqrt(sum((this.
xi - repmat(x,1,as)).^2));
202 w = this.
GaussWeight.evaluateScalar(sqrt(di/min(di)));
208 y = y + w(i)*(this.
Ai[i]*x + this.
bi(:,i));
213 xisel =
reshape(meshgrid(1:n,1:as),[],1)^
t;
215 di = sqrt(sum((repmat(this.
xi,1,n)-x(:,xisel)).^2));
218 dimin = min(di,[],2);
219 w = this.
GaussWeight.evaluateScalar(sqrt(di./repmat(dimin,1,as)));
220 w = w ./ repmat(sum(w,2),1,as);
228 hlp = this.
Ai[i]*x(:,rel) + this.
bi(:,i*ones(1,sum(rel)));
229 y(:,rel) = y(:,rel) + hlp*diag(w(rel,i));
254 as = size(this.
xi,2);
264 this.
bi(:,i) = fxi(:,i) - this.
Ai[i]*this.
xi(:,i);
281 m = models.synth.KernelTest(100,
false);
282 m.ErrorEstimator= [];
283 m.Approx= approx.TPWLApprox(m.System);
286 m.Sampler= sampling.ManualSampler(m.getRandomParam);
288 m.offlineGenerations;
289 mu = m.getRandomParam;
290 [~,y] = m.simulate(
mu);
291 r = m.buildReducedModel;
292 [~,yr] = r.simulate(
mu);
293 fprintf(
" Max absolute error: %g\n ",max(
Norm.
L2(y-yr)));
The base class for any KerMor detailed model.
CustomProjection
Set this property if the projection process is customized by overriding the default project method...
function J = getStateJacobian(x, t)
Default implementation of jacobian matrix evaluation via finite differences.
models.BaseFirstOrderSystem System
The actual dynamical system used in the model.
function matrix< double > y = evaluateCoreFun()
Noting to do here, evaluate is implemented directly. This method will never be called.
Trajectory-piecewise function approximation.
function setConfig(mu, inputidx)
Sets the dynamical system's configuration.
A MatLab cell array or matrix.
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
reshape
hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape ...
static function res = test_TWPLApprox()
function approximateSystemFunction(models.BaseFullModel model)
models.BaseFirstOrderSystem System
The system associated with the current ACoreFun.
integer DefaultInput
The default input to use if none is given.
V
The matrix of the biorthogonal pair .
colvec< double > mu
The current model parameter mu for evaluations. Will not be persisted as only valid for runtime durin...
data.ModelData Data
The full model's data container. Defaults to an empty container.
MinWeightValue
The minimum value a weight needs to have after normalization in order to affect the evaluation...
Abstract base class for all core function approximations inside dynamical systems.
function matrix< double > y = evaluate(colvec< double > x,double t,colvec< double > mu)
Directly overrides the evaluate method of the ACoreFun as custom projection and multi-argument evalua...
dscomponents.ACoreFun f
The core f function from the dynamical system.
static function rowvec< double > n = L2(matrix< double > x)
Returns the discrete norm for each column vector in x.
Norm: Static class for commonly used norms on sets of vectors.
W
The matrix of the biorthogonal pair .
data.ApproxTrainData ApproxTrainData
Training data for the core function approximation.
data.selection.ASelector TrainDataSelector
The algorithm that selects the approximation training data.
function res = isposrealscalar(value)
isposintscalar: Backwards-compatibility function for matlab versions greater than 2012a ...
function projected = project(V, W)
Implements AProjectable.project()