Main Content

polydata

Access polynomial coefficients and uncertainties of identified model

    Description

    [A,B,C,D,F] = polydata(sys) returns the coefficients of the polynomials A, B, C, D, and F that describe the identified model sys. The polynomials describe the idpoly representation of sys as follows.

    • For discrete-time sys:

      A(q1)y(t)=B(q1)F(q1)u(tnk)+C(q1)D(q1)e(t).

      u(t) are the inputs to sys. y(t) are the outputs. e(t) is a white noise disturbance.

    • For continuous-time sys:

      A(s)Y(s)=B(s)F(s)U(s)eτs+C(s)D(s)E(s).

      U(s) are the Laplace transformed inputs to sys. Y(s) are the Laplace transformed outputs. E(s) is the Laplace transform of a white noise disturbance.

    If sys is an identified model that is not an idpoly model, polydata converts sys to idpoly form to extract the polynomial coefficients.

    [A,B,C,D,F,dA,dB,dC,dD,dF] = polydata(sys) also returns the uncertainties dA, dB, dC, dD, and dF of each of the corresponding polynomial coefficients of sys.

    [___] = polydata(sys,J1,...,JN) returns the polynomial coefficients for the J1,...,JN entry in the array sys of identified models.

    [___] = polydata(___,'cell') returns all polynomials as cell arrays of double vectors, regardless of the input and output dimensions of sys.

    example

    Examples

    collapse all

    Load system data and estimate a 2-input, 2-output model.

    load iddata1 z1
    load iddata2 z2
    data = [z1 z2(1:300)];
    
    nk = [1 1; 1 0];
    na = [2 2; 1 3];
    nb = [2 3; 1 4];
    nc = [2;3];
    nd = [1;2];
    nf = [2 2;2 1];
    
    sys = polyest(data,[na nb nc nd nf nk]);

    The data loaded into z1 and z2 is discrete-time iddata with a sample time of 0.1 s. Therefore, sys is a two-input, two-output discrete-time idpoly model of the form:

    A(q-1)y(t)=B(q-1)F(q-1)u(t-nk)+C(q-1)D(q-1)e(t)

    The inputs to polyest set the order of each polynomial in sys.

    Access the estimated polynomial coefficients of sys and the uncertainties in those coefficients.

    [A,B,C,D,F,dA,dB,dC,dD,dF] = polydata(sys);

    The outputs A, B, C, D, and F are cell arrays of coefficient vectors. The dimensions of the cell arrays are determined by the input and output dimensions of sys. For example, A is a 2-by-2 cell array because sys has two inputs and two outputs. Each entry in A is a row vector containing identified polynomial coefficients. For example, examine the second diagonal entry in A.

    A{2,2}
    ans = 1×4
    
        1.0000   -0.8825   -0.2030    0.4364
    
    

    For discrete-time sys, the coefficients are arranged in order of increasing powers of q-1. Therefore, A{2,2} corresponds to the polynomial 1-0.8682q-1-0.2244q-2+0.4467q-3.

    The dimensions of dA match those of A. Each entry in dA gives the standard deviation of the corresponding estimated polynomial coefficient in A. For example, examine the uncertainties of the second diagonal entry in A.

    dA{2,2}
    ans = 1×4
    
             0    0.2849    0.4269    0.2056
    
    

    The lead coefficient of A{2,2} is fixed at 1, and therefore has no uncertainty. The remaining entries in dA{2,2} are the uncertainties in the q-1, q-2, and q-3 coefficients, respectively.

    Input Arguments

    collapse all

    Identified model or array of identified models. sys can be continuous-time or discrete-time. sys can be SISO or MIMO.

    Indices selecting a particular model from an N-dimensional array sys of identified models.

    Output Arguments

    collapse all

    Polynomial coefficients of the idpoly representation of sys.

    • If sys is a SISO model, each of A, B, C, D, and F is a row vector. The length of each row vector is the order of the corresponding polynomial.

      • For discrete-time sys, the coefficients are ordered in ascending powers of q–1. For example, B = [1 -4 9] means that B(q–1) = 1 – 4q–1 + 9q–2.

      • For continuous-time sys, the coefficients are ordered in descending powers of s. For example, B = [1 -4 9] means that B(s) = s2 – 4s + 9.

    • If sys is a MIMO model, each of A, B, C, D, and F is a cell array. The dimensions of the cell arrays are determined by the input and output dimensions of sys as follows:

      • ANy-by-Ny cell array

      • B, FNy-by-Nu cell array

      • C, DNy-by-1 cell array

      Ny is the number of outputs of sys, and Nu is the number of inputs.

      Each entry in a cell array is a row vector that contains the coefficients of the corresponding polynomial. The polynomial coefficients are ordered the same way as the SISO case.

    Data Types: cell

    Uncertainties in the estimated polynomial coefficients of sys.

    dA, dB, dC, dD, and dF are row vectors or cell arrays whose dimensions exactly match the corresponding A, B, C, D, and F outputs.

    Each entry in dA, dB, dC, dD, and dF gives the standard deviation of the corresponding estimated coefficient. For example, dA{1,1}(2) gives the standard deviation of the estimated coefficient returned at A{1,1}(2).

    Data Types: cell

    Version History

    Introduced before R2006a