Products & Services Solutions Academia Support User Community Company

Learn more about System Identification Toolbox   

linearize(idnlarx) - 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

Output

Algorithm

The following equations govern the dynamics of an idnlarx model:

where X(t) is a state vector, u(t) is the input, and y(t) is the output. A and B are constant matrices. 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:

where

Example

Linearize a nonlinear ARX model around an operating point corresponding to a simulation snapshot at a specific time. Create an idnlarx model estimated using sample data.

  1. Load sample data:

    load iddata2
    
  2. Estimate idnlarx model from sample data:

    nlsys = nlarx(z2,[4 3 10],'tree','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]);
  3. Plot the response of the model for a step input:

    step(nlsys, 20)

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

  4. Compute the operating point corresponding to T = 20.

    stepinput = iddata([],[zeros(10,1);ones(200,1)],...
                       nlsys.Ts);
    % Compute operating point.
    [x,u] = findop(nlsys,'snapshot',20,stepinput);
    
    
  5. Linearize the model about the operating point corresponding to the model snapshot at T=20.

    sys = linearize(nlsys,u,x)
    
  6. To 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 step signal with amplitude 0.1
    % This is the perturbation signal.
    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 as initial conditions (see Step 4).
    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'])
    

    The linearized model response tracks the nonlinear model output.

See Also

findop(idnlarx) | getDelayInfo | idnlarx | linapp

How To

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS