Main Content

idPiecewiseLinear

Create a piecewise-linear nonlinearity estimator object

Syntax

NL = idPiecewiseLinear
NL = idPiecewiseLinear(Name,Value)

Description

NL= idPiecewiseLinearcreates 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[]. The initial value of the nonlinearity is determined from the estimation data range during estimation usingnlhw. Use dot notation to customize the object properties, if needed.

NL= idPiecewiseLinear(Name,Value)creates a piecewise-linear nonlinearity estimator object with properties specified by one or moreName,Valuepair arguments. The properties that you do not specify retain their default value.

Object Description

idPiecewiseLinearis an object that stores the piecewise-linear nonlinearity estimator for estimating Hammerstein-Wiener models.

UseidPiecewiseLinearto define a nonlinear function y = F ( x , θ ) , whereyandxare 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 ofx. There arenbreakpoints (xk,yk),k= 1,...,n, such thatyk= F(xk).Fis linearly interpolated between the breakpoints.

Fis also linear to the left and right of the extreme breakpoints. The slope of these extensions is a function ofxiandyibreakpoints. The breakpoints are ordered by ascendingx-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 arexk= [-2,1,4]and the corresponding nonlinearity values areyk= [4,3,5].

The valueF(x)is computed byevaluate(NL,x), whereNLis theidPiecewiseLinearobject. When usingevaluate, the break points have to be initialized manually.

ForidPiecewiseLinearobject properties, seeProperties.

Examples

全部折叠

NL = idPiecewiseLinear;

Specify the number of break points.

NL.NumberOfUnits = 5;

Load estimation data.

loadtwotankdata;z= iddata(y,u,0.2,'Name','Two tank system'); z1 = z(1:1000);

Create anidPiecewiseLinearobject, and specify the breakpoints.

InputNL = idPiecewiseLinear ('BreakPoints',[-2,1,4]);

SinceBreakPointsis specified as a vector, the specified vector is interpreted as thex-values of the break points. They-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,[]);

Input Arguments

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

UseName,Valuearguments to specify additional properties of theidPiecewiseLinearnonlinearity. For example,NL= idPiecewiseLinear('NumberofUnits',5)creates a piecewise-linear nonlinearity estimator object with 5 breakpoints.

Properties

idPiecewiseLinearobject properties include:

NumberofUnits

Number of breakpoints, specified as an integer.

Default:10

BreakPoints

Break points,xk, and the corresponding nonlinearity values at the breakpoints,yk, specified as one of the following:

  • 2-by-nmatrix — Thexandyvalues for each of thenbreak points are specified as[x1,x2, ....,xn;y1,y2, ...,yn].

  • 1-by-nvector — The specified vector is interpreted as thexvalues of the break points:x1,x2, ....,xn. All theyvalues of the break points are set to0.

When the nonlinearity object is created, the breakpoints are ordered by ascendingx-values. This is important to consider if you set a specific breakpoint to a different value after creating the object.

Default:[]

Free

Option to fix or free the values in the mapping object, specified as a logical scalar. When you set an element ofFreetofalse, the object does not update during estimation.

Default:true

Output Arguments

全部折叠

Piecewise-linear nonlinearity estimator object, returned as anidPiecewiseLinearobject.

Version History

Introduced in R2007a

expand all