Main Content

idNeuralStateSpace/linearize

Linearize a neural state-space model around an operating point

    Description

    example

    sys = linearize(nss,x0) linearizes the time-invariant autonomous (that is with no input) neural state-space model nss about the operating point specified by x0.

    sys = linearize(nss,x0,u0) linearizes the time-invariant neural state-space model nss about the operating point specified by both x0 and u0.

    sys = linearize(nss,t0,x0,u0) linearizes the time-varying neural state-space model nss about the operating point specified by both x0 and u0 at the time specified by t0.

    Examples

    collapse all

    Use idNeuralStateSpace to create a time-invariant continuous-time neural state-space system with four states, three inputs and two outputs with direct feedthrough between input and output. The state and output networks are initialized randomly.

    nss = idNeuralStateSpace(4, ...
        NumInputs=3, ...
        NumOutputs=4+2, ...
        HasFeedthrough=true);

    Define a random operating point.

    x0 = randn(4,1);
    u0 = randn(3,1);

    Linearize nss around the operating point.

    sys = linearize(nss,x0,u0)
    sys =
     
      A = 
                  x1         x2         x3         x4
       x1      0.151    -0.2278     0.1158     0.1099
       x2    0.08884     0.1399    -0.2044     0.2675
       x3  -0.007885   -0.02822    0.09201    0.05594
       x4     0.1636   -0.08727    -0.1423      0.215
     
      B = 
                 u1        u2        u3
       x1   0.06339  -0.08697   -0.1408
       x2   0.01672   0.09515   0.09784
       x3   0.08283   0.05558   0.05497
       x4    0.1125    0.3448  -0.05313
     
      C = 
                x1       x2       x3       x4
       y1        1        0        0        0
       y2        0        1        0        0
       y3        0        0        1        0
       y4        0        0        0        1
       y5   0.0434    0.262  0.02895   0.2251
       y6   0.1057  -0.2593  0.03562   0.0264
     
      D = 
                 u1        u2        u3
       y1         0         0         0
       y2         0         0         0
       y3         0         0         0
       y4         0         0         0
       y5   -0.2282  -0.02673    0.2128
       y6    0.1513  -0.01861   -0.1221
     
    Continuous-time state-space model.
    

    Since the first output elements are the four states of nss, the first four rows of C matrix form an identity matrix, and the first four rows of D are zero.

    You can now apply linear control analysis and synthesis methods on the linear state-space system sys.

    Input Arguments

    collapse all

    Neural state-space system, specified as an idNeuralStateSpace object.

    Example: myNrlSS

    Value of the time variable at the operating point, specified as a scalar, for time-varying idNeuralStateSpace systems.

    Example: 5.75

    Value of the state at the operating point, specified as a vector.

    Example: [-0.2 0.3]'

    Value of the input at the operating point, specified as a vector, for non-autonomous idNeuralStateSpace systems.

    Example: 2.4

    Output Arguments

    collapse all

    Linearized model, returned as an ss (Control System Toolbox) object, when Control System Toolbox™ is installed, or as an idss object otherwise. For more information on linearization, see Linearize Nonlinear Models (Simulink Control Design).

    Note

    The first output elements are all the states of nss. Therefore, their corresponding entries in the C matrix form an identity matrix, and their corresponding entries in the D matrix are zero.

    Version History

    Introduced in R2022b