Create a piecewise-linear nonlinearity estimator object
idPiecewiseLinear is an object that stores the
piecewise-linear nonlinearity estimator for estimating Hammerstein-Wiener
idPiecewiseLinear to define a nonlinear function , where y and x are scalars, and
θ represents the parameters specifying the number of break points and the
value of nonlinearity at the break points.
The nonlinearity function, F, is a piecewise-linear (affine) function
of x. There are
k = 1,...,n, such that yk =
F(xk). F is linearly interpolated between the
F is also linear to the left and right of the extreme breakpoints.
The slope of these extensions is a function of xi
and yi breakpoints. The breakpoints are ordered by
x-values, which is important when you set a specific breakpoint
to a different value.
There are minor difference between the breakpoint values you set and the values stored in the object because the toolbox has a different internal representation of breakpoints.
For example, in the following plot, the breakpoints are xk = [-2,1,4] and the corresponding nonlinearity values are yk = [4,3,5].
F(x) is computed by
NL is the
idPiecewiseLinear object. When using
evaluate, the break points have to be initialized manually.
idPiecewiseLinear object properties, see Properties.
creates a default
piecewise-linear nonlinearity estimator object with 10 break points for estimating
Hammerstein-Wiener models. The value of the nonlinearity at the break points are set to
NL = idPiecewiseLinear
. The initial value of the nonlinearity is determined from the
estimation data range during estimation using
nlhw. Use dot notation to customize the object properties, if needed.
creates a piecewise-linear nonlinearity estimator object with properties specified by one
NL = idPiecewiseLinear(
Name,Value pair arguments. The properties that you do not
specify retain their default value.
idPiecewiseLinear object properties include:
NumberofUnits — Number of breakpoints
10 (default) | positive integer
Number of breakpoints, specified as an integer.
BreakPoints — Break points and corresponding nonlinearity values at the breakpoints
[ ] (default) | vector | matrix
Break points, xk, and the corresponding nonlinearity values at the breakpoints, yk, specified as one of the following:
2-by-n matrix — The x and y values for each of the n break points are specified as [x1,x2, ...., xn;y1, y2, ..., yn].
1-by-n vector — The specified vector is interpreted as the x values of the break points: x1,x2, ...., xn. All the y values of the break points are set to
When the nonlinearity object is created, the breakpoints are ordered by ascending
x-values. This is important to consider if you set a specific
breakpoint to a different value after creating the object.
Free — Option to fix or free the values in the mapping object
true (default) | logical scalar
Option to fix or free the values in the mapping object, specified as a logical
scalar. When you set an element of
false, the object does not update during estimation.
Create a Default Piecewise-Linear Nonlinearity Estimator
NL = idPiecewiseLinear;
Specify the number of break points.
NL.NumberOfUnits = 5;
Estimate a Hammerstein Model with Piecewise-Linear Nonlinearity
Load estimation data.
load twotankdata; z = iddata(y,u,0.2,'Name','Two tank system'); z1 = z(1:1000);
idPiecewiseLinear object, and specify the breakpoints.
InputNL = idPiecewiseLinear('BreakPoints',[-2,1,4]);
BreakPoints is specified as a vector, the specified vector is interpreted as the x-values of the break points. The y-values of the break points are set to 0, and are determined during model estimation.
Estimate model with no output nonlinearity.
sys = nlhw(z1,[2 3 0],InputNL,);
Version HistoryIntroduced in R2007a
R2021b: Use of previous
idnlhw mapping object names is not recommended.
Starting in R2021b, the mapping objects (also known as nonlinearities) used in the nonlinear components of the
idnlhw objects have been renamed. The following table lists the name changes.
|Pre-R2021b Name||R2021b Name|
Scripts with the old names still run normally, although they will produce a warning. Consider using the new names for continuing compatibility with newly developed features and algorithms. There are no plans to exclude the use of these object names at this time