Compute operating point for Hammerstein-Wiener model
[X,U] = findop(SYS,'steady',InputLevel,OutputLevel)
[X,U] = findop(SYS,SPEC)
[X,U] = findop(SYS,'snapshot',T,UIN,X0)
[X,U,REPORT] = findop(...)
[X,U] = findop(SYS,'steady',InputLevel,OutputLevel) computes operating-point state values, X, and input values, U, from steady-state specifications for an idnlhw model. For more information about the states of an idnlhw model, see idnlhw States.
[X,U] = findop(SYS,SPEC) computes the equilibrium operating point using the specifications in the object SPEC. Whereas the previous command only lets you specify the input and output level, SPEC provides additional specification for computing the steady-state operating point.
[X,U] = findop(SYS,'snapshot',T,UIN,X0) computes the operating point at a simulation snapshot of time T using the specified input and initial state values.
[X,U,REPORT] = findop(...) creates a structure, REPORT, containing information about the algorithm for computing an operating point.
findop(SYS,...,PVPairs) specifies property-value pairs for setting algorithm options.
SYS: idnlhw (Hammerstein-Wiener) model.
'steady': Computes operating point using steady-state input and output levels.
'snapshot': Computes operating point at simulating snapshot of model SYS at time T.
InputLevel: Steady-state input level for computing operating point. Use NaN when the value is unknown. Do not enter OutputLevel when InputLevel does not contain any NaN values.
OutputLevel: Steady-state output level for computing the operating point. Use NaN when the value is unknown.
SPEC: Operating point specifications object. Use SPEC = OPERSPEC(SYS) to construct the SPEC object for model SYS. Then, configure SPEC options, such as signal bounds, known values, and initial guesses. See operspec(idnlhw) for more information.
T: Simulation snapshot time at which to compute the operating point.
UIN: Input for simulating the model. UIN is a double matrix or an iddata object. The number of input channels in UIN must match the number of SYS inputs.
X0: Initial states for model simulation.
PVPairs: Property-value pairs for customizing the model Algorithm property fields, such as SearchMethod, MaxSize, and Tolerance.
X: Operating point state values.
U: Operating point input value.
REPORT: Structure containing the following fields:
SearchMethod: String indicating the value of the SearchMethod property of MODEL.Algorithm.
WhyStop: String describing why the estimation stopped.
Iterations: Number of estimation iterations.
FinalCost: Final value of the sum of squared errors that the algorithm minimizes.
FirstOrderOptimality: Measure of the gradient of the search direction at the final parameter values when the search algorithm terminates. It is equal to the -norm of the gradient vector.
SignalLevels: Structure containing fields Input and Output, which are the input and output signal levels of the operating point.
In this example, you compute the operating point of an idnlhw model for a steady-state input level of 1.
Estimate an idnlhw model from sample data iddata2.
load iddata2; M = nlhw(z2,[4 3 2],'wavenet','pwl');
Compute the steady-state operating point for an input level of 1.
x0 = findop(M,'steady',1,NaN)
findop computes the operating point from steady-state operating point specifications or at a simulation snapshot.
You specify to compute the steady-state operating point by calling findop in either of the following ways:
[X,U] = findop(SYS,'steady',InputLevel,OutputLevel) [X,U] = findop(SYS,SPEC)
When you use the syntax [X,U] = findop(SYS,'steady',InputLevel,OutputLevel), the algorithm assumes the following operating-point specifications:
All finite input values are fixed values. Any NaN values specify an unknown input signal with the initial guess of 0.
All finite output values are initial guess values. Any NaN values specify an unknown output signal with the initial guess of 0.
The minimum and maximum bounds have default values (-/+ Inf) for both Input and Output properties in the specification object.
Using the syntax [X,U] = findop(SYS,SPEC), you can specify additional information, such as the minimum and maximum constraints on the input/output signals and whether certain inputs are known (fixed).
findop uses a different approach to compute the steady-state operating point depending on how much information you provide for this computation:
When you specify values for all input levels (no NaN values). For a given input level, U, the equilibrium state values are X = inv(I-A)*B*f(U), where [A,B,C,D] = ssdata(model.LinearModel), and f() is the input nonlinearity.
When you specify known and unknown input levels. findop uses numerical optimization to minimize the norm of the error and compute the operating point. The total error is the union of contributions from e1 and e2 , e(t) = (e1(t)e2(t)), such that:
e1 applies for known outputs and the algorithm minimizes e1 = y- g(L(x,f(u))), where f is the input nonlinearity, L(x,u) is the linear model with states x, and g is the output nonlinearity.
e2 applies for unknown outputs and the error is a measure of whether these outputs are within the specified minimum and maximum bounds. If a variable is within its specified bounds, the corresponding error is zero. Otherwise, the error is equal to the distance from the nearest bound. For example, if a free output variable has a value z and its minimum and maximum bounds are L and U, respectively, then the error is e2= max[z-U, L-z, 0].
The independent variables for the minimization problem are the unknown inputs. In the error definition e, both the input u and the states x are free variables. To get an error expression that contains only unknown inputs as free variables, the algorithm findop specifies the states as a function of inputs by imposing steady-state conditions: x = inv(I-A)*B*f(U), where [A,B,C,D] are state-space parameters corresponding to the linear model L(x,u). Thus, substituting x = inv(I-A)*B*f(U) into the error function results in an error expression that contains only unknown inputs as free variables computed by the optimization algorithm.
When you use the syntax [X,U] = findop(SYS,'snapshot',T,UIN,X0), the algorithm simulates the model output until the snapshot time, T. At the snapshot time, the algorithm computes the inputs for the linear model block of the Hammerstein-Wiener model (LinearModel property of the idnlhw object) by transforming the given inputs using the input nonlinearity: w = f(u). findop uses the resulting w to compute x until the snapshot time using the following equation: x(t+1) = Ax(t) + Bw(t), where [A,B,C,D] = ssdata(model.LinearModel).