# idnlarx/findop

Compute operating point for Nonlinear ARX model

## Description

example

[X,U] = findop(sys,'steady',InputLevel,OutputLevel) returns the operating-point state values, X, and input values, U, for theidnlarx model, sys, using steady-state input and output specifications.

example

[X,U] = findop(sys,spec) returns the steady-state operating point for sys using the operating-point specification, spec.

example

[X,U] = findop(___,Options) specifies optimization search options for all of the previous syntaxes.

example

[X,U,Report] = findop(___) returns a summary report on the optimization search results for all of the previous syntaxes.

example

[X,U] = findop(sys,'snapshot',T,Uin) returns the operating point for sys at a simulation snapshot at time, T, using the specified input, Uin. The initial states of sys are assumed to be zero.

example

[X,U] = findop(sys,'snapshot',T,Uin,X0) specifies the initial states of the simulation.

## Examples

collapse all

Estimate a nonlinear ARX model.

M = nlarx(z6,[4 3 1]);

Find the steady-state operating point where the input level is fixed to 1 and the output is unknown.

Estimate a nonlinear ARX model.

M = nlarx(z7,[4 3*ones(1,2) 2*ones(1,2)]);

Create a default operating point specification object.

spec = operspec(M);

Set the values for the input signals.

spec.Input.Value(1) = -1;
spec.Input.Value(2) = 1;

Set the maximum and minimum values for the output signal.

spec.Output.Max = 10;
spec.Output.Min = -10;

Find the steady-state operating point using the given specifications.

[X,U] = findop(M,spec);

Estimate a nonlinear ARX model.

M = nlarx(z6,[4 3 2]);

Create a default findopOptions option set.

opt = findopOptions(M);

Modify the option set to specify a steepest descent gradient search method with a maximum of 50 iterations.

opt.SearchOptions.MaxIterations = 50;

Find the steady-state operating point using the specified options.

Estimate a nonlinear ARX model.

M = nlarx(z7,[4 3*ones(1,2) 2*ones(1,2)]);

Find the steady-state operating point where input 1 is set to 1 and input 2 is unrestricted. The initial guess for the output value is 2.

Display the summary report.

disp(R);
SearchMethod: 'auto'
WhyStop: 'Near (local) minimum, (norm(g) < tol).'
Iterations: 12
FinalCost: 0
FirstOrderOptimality: 0
SignalLevels: [1x1 struct]

Load the estimation data and estimate a nonlinear ARX model.

z = iddata(y,u,1);
M = nlarx(z,[4 3 1]);

Find the simulation snapshot after 10 seconds, assuming initial states of zero.

[X,U] = findop(M,'snapshot',10,z);

Load the estimation data and estimate a nonlinear ARX model.

z = iddata(y,u,1);
M = nlarx(z,[4 3 1]);

Create an initial state vector. The first four states correspond to delayed output values and the final three states correspond to delayed inputs.

X0 = [2;2;2;2;5;5;5];

Find the simulation snapshot after 10 seconds using the specified initial states.

[X,U] = findop(M,'snapshot',10,z,X0);

## Input Arguments

collapse all

Nonlinear ARX model, specified as an idnlarx object.

Steady-state input level for computing the operating point, specified as a vector. The length of InputLevel must equal the number of inputs specified in sys.

The optimization algorithm assumes that finite values in InputLevel are fixed input values. Use NaN to specify unknown input signals with initial guesses of 0. The minimum and maximum bounds for all inputs have default values of -Inf and +Inf respectively.

Steady-state output level for computing the operating point, specified as a vector. The length of OutputLevel must equal the number of outputs specified in sys.

The values in OutputLevel indicate initial guesses for the optimization algorithm. Use NaN to specify unknown output signals with initial guesses of 0. The minimum and maximum bounds for all outputs have default values of -Inf and +Inf respectively.

Operating-point specifications, such as minimum and maximum input/output constraints and known inputs, specified as anoperspec object.

Operating point snapshot time, specified as a positive scalar. The value of T must be in the range [T0, N*Ts], where N is the number of input samples, Ts is the sample time and T0 is the input start time (Uin.Tstart).

Snapshot simulation input, specified as one of the following:

• Time-domain iddata object with a sample time and input size that matches sys.

• Matrix with as many columns as there are input channels. If the matrix has N rows, the input data is assumed to correspond to the time vector (1:N)*sys.Ts.

Initial states of the simulation, specified as a column vector with size equal to the number of states in sys. X0 provides the initial conditions at the time corresponding to the first input sample (Uin.Start, if Uin is an iddata object, or sys.Ts if Uin is a double matrix).

Operating point search options, specified as a findopOptions option set.

## Output Arguments

collapse all

Operating point state values, returned as a column vector of length equal to the number of model states.

Operating point input values, returned as a column vector of length equal to the number of inputs.

Search result summary report, returned as a structure with the following fields:

FieldDescription
SearchMethodSearch method used for iterative parameter estimation. See SearchMethod in findopOptions for more information.
WhyStopSearch algorithm termination condition.
IterationsNumber of estimation iterations performed.
FinalCostFinal value of the minimization objective function (sum of the squared errors).
FirstOrderOptimality$\infty$-norm of the search gradient vector when the search algorithm terminates.
SignalLevelsStructure containing the fields Input and Output, which are the operating point input and output signal levels respectively.

## Algorithms

collapse all

findop computes the operating point from steady-state operating point specifications or at a simulation snapshot.

### Computing the Operating Point from Steady-State Specifications

To compute the steady-state operating point, call findop using either of the following syntaxes:

[X,U] = findop(sys,spec)

To compute the states, X, and the input, U, of the steady-state operating point, findop minimizes the norm of the error e(t) = y(t)-f(x(t), u(t)), where:

• f is the nonlinearity estimator.

• u(t) is the input.

• x(t) is the model state.

• y(t) is the model output.

You can specify the search algorithm and search options using the findopOptions option set.

The algorithm uses the following independent variables for minimization:

• Unknown (unspecified) input signal levels

• Output signal levels

Because idnlarx model states are delayed samples of the input and output variables, the state values are the constant values of the corresponding steady-state inputs and outputs. For more information about the definition of nonlinear ARX model states, see Definition of idnlarx States.

### Computing the Operating Point at a Simulation Snapshot

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 passes the input and output samples to the data2state command to map these values to the current state vector.

Note

For snapshot-based computations, findop does not perform numerical optimization.