Main Content

idnlarx/linearize

Linearize nonlinear ARX model

Syntax

SYS = linearize(NLSYS,U0,X0)

Description

SYS = linearize(NLSYS,U0,X0) linearizes a nonlinear ARX model about the specified operating point U0 and X0. The linearization is based on tangent linearization. For more information about the definition of states for idnlarx models, see Definition of idnlarx States.

Input Arguments

  • NLSYS: idnlarx model.

  • U0: Matrix containing the constant input values for the model.

  • X0: Model state values. The states of a nonlinear ARX model are defined by the time-delayed samples of input and output variables. For more information about the states of nonlinear ARX models, see the getDelayInfo reference page.

Note

To estimate U0 and X0 from operating point specifications, use the idnlarx/findop command.

Output Arguments

  • SYS is an idss model.

    When the Control System Toolbox™ product is installed, SYS is an LTI object.

Examples

collapse all

Linearize a nonlinear ARX model around an operating point corresponding to a simulation snapshot at a specific time.

Load sample data.

load iddata2

Estimate nonlinear ARX model from sample data.

nlsys = nlarx(z2,[4 3 10],idTreePartition,'custom',...
  {'sin(y1(t-2)*u1(t))+y1(t-2)*u1(t)+u1(t).*u1(t-13)',...
   'y1(t-5)*y1(t-5)*y1(t-1)'},'nlr',[1:5, 7 9]);

Plot the response of the model for a step input.

step(nlsys, 20)

MATLAB figure

The step response is a steady-state value of 0.8383 at T = 20 seconds.

Compute the operating point corresponding to T = 20.

stepinput = iddata([],[zeros(10,1);ones(200,1)],nlsys.Ts);
[x,u] = findop(nlsys,'snapshot',20,stepinput);

Linearize the model about the operating point corresponding to the model snapshot at T = 20.

sys = linearize(nlsys,u,x);

Validate the linear model.

Apply a small perturbation delta_u to the steady-state input of the nonlinear model nlsys. If the linear approximation is accurate, the following should match:

  • The response of the nonlinear model y_nl to an input that is the sum of the equilibrium level and the perturbation delta_u.

  • The sum of the response of the linear model to a perturbation input delta_u and the output equilibrium level.

Generate a 200-sample perturbation step signal with amplitude 0.1.

delta_u = [zeros(10,1); 0.1*ones(190,1)];

For a nonlinear system with a steady-state input of 1 and a steady-state output of 0.8383, compute the steady-state response y_nl to the perturbed input u_nl. Use equilibrium state values x computed previously as initial conditions.

u_nl = 1 + delta_u;
y_nl = sim(nlsys,u_nl,x);

Compute response of linear model to perturbation input and add it to the output equilibrium level.

y_lin = 0.8383 + lsim(sys,delta_u);

Compare the response of nonlinear and linear models.

time = (0:0.1:19.9)';
plot(time,y_nl,time,y_lin)
legend('Nonlinear response','Linear response about op. pt.')
title('Nonlinear and linear model response for small step input')

Figure contains an axes object. The axes object with title Nonlinear and linear model response for small step input contains 2 objects of type line. These objects represent Nonlinear response, Linear response about op. pt..

Algorithms

The following equations govern the dynamics of an idnlarx model:

X(t+1)=AX(t)+Bu˜(t)y(t)=f(X,u)

where X(t) is a state vector, u(t) is the input, and y(t) is the output. A and B are constant matrices. u˜(t) is [y(t), u(t)]T.

The output at the operating point is given by

y* = f(X*, u*)

where X* and u* are the state vector and input at the operating point.

The linear approximation of the model response is as follows:

ΔX(t+1)=(A+B1fX)ΔX(t)+(B1fu+B2)Δu(t)Δy(t)=fXΔX(t)+fuΔu(t)

where

  • ΔX(t)=X(t)X*(t)

  • Δu(t)=u(t)u*(t)

  • Δy(t)=y(t)y*(t)

  • BU˜=[B1,B2][YU]=B1Y+B2U

  • fX=Xf(X,U)|X*,U*

  • fU=Uf(X,U)|X*,U*

Note

For linear approximations over larger input ranges, use linapp.

Version History

Introduced in R2014b