Main Content

ctrb

Controllability of state-space model

    Description

    A dynamic system is said to be controllable if it is possible to apply control signals that drive the system to any state within a finite amount of time. This characteristic is also called reachability. ctrb computes a controllability matrix from state matrices or from a state-space model. You can use this matrix to determine controllability.

    For instance, consider a continuous-time state-space model with Nx states, Ny outputs, and Nu inputs:

    x˙=Ax+Buy=Cx+Du

    Here, x, u and y represent the states, inputs and outputs respectively, while A, B, C and D are the state-space matrices with the following sizes:

    • A is an Nx-by-Nx real-valued or complex-valued matrix.

    • B is an Nx-by-Nu real-valued or complex-valued matrix.

    • C is an Ny-by-Nx real-valued or complex-valued matrix.

    • D is an Ny-by-Nu real-valued or complex-valued matrix.

    The system is controllable if the controllability matrix generated by ctrb Co=[BABA2BAn1B] has full rank, that is, the rank is equal to the number of states in the state-space model. The controllability matrix Co has Nx rows and Nxu columns. For an example, see Controllability of SISO State-Space Model.

    example

    Co = ctrb(A,B) returns the controllability matrix Co using the state matrix A and input-to-state matrix B. The system is controllable if Co has full rank, that is, the rank of Co is equal to the number of states.

    example

    Co = ctrb(sys) returns the controllability matrix of the state space model sys. This syntax is equivalent to:

    Co = ctrb(sys.A,sys.B);

    Examples

    collapse all

    Define A and B matrices.

    A = [1  1;
         4 -2];
    B = [1 -1;
         1 -1];

    Compute controllability matrix.

    Co = ctrb(A,B);

    Determine the number of uncontrollable states.

    unco = length(A) - rank(Co)
    unco = 1
    

    The uncontrollable state indicates that Co does not have full rank 2. Therefore the system is not controllable.

    For this example, consider the following SISO state-space model with 2 states:

    A=[-1.5-210]B=[0.50]C=[01]D=1SISO State-Space Model

    Create the SISO state-space model defined by the following state-space matrices:

    A = [-1.5,-2;1,0];
    B = [0.5;0];
    C = [0,1];
    D = 1;
    sys = ss(A,B,C,D);

    Compute the controllability matrix and find the rank.

    Co = ctrb(sys)
    Co = 2×2
    
        0.5000   -0.7500
             0    0.5000
    
    

    The size of the controllability matrix depends on the size of the A and B matrices. For instance, if matrix A is an Nx-by-Nx matrix and matrix B is an Nx-by-Nu matrix, then the resultant matrix Co has Nx rows and Nxu columns. Here, Nx is the number of states and Nu is the number of inputs.

    rank(Co)
    ans = 2
    

    Since the rank of the controllability matrix Co is equal to the number of states, the system sys is controllable.

    Alternatively, you can also use just the A and B matrices to find the controllability matrix.

    Co = ctrb(sys.A,sys.B);
    rank(Co)
    ans = 2
    

    Input Arguments

    collapse all

    State matrix, specified as an Nx-by-Nx matrix where, Nx is the number of states.

    Input-to-state matrix, specified as an Nx-by-Nu matrix where Nx is the number of states and Nu is the number of inputs.

    State-space model or model array, specified as:

    • A state-space (ss) model object, when the inputs A, B, C and D are numeric matrices or when converting from another model object type.

    • A generalized state-space model (genss) object, when one or more of the matrices A, B, C and D includes tunable parameters, such as realp parameters or generalized matrices (genmat). The function uses the current values for tunable parameters.

    • An uncertain state-space model (uss) object, when one or more of the inputs A, B, C and D includes uncertain matrices. The function uses the nominal values for uncertain parameters. Using uncertain models requires Robust Control Toolbox™ software.

    Output Arguments

    collapse all

    Controllability matrix, returned as an array. When sys is:

    • A single state-space model with Nx states and Nu inputs, then the resultant array Co has Nx rows and Nxu columns.

    • An array of state-space models sys(:,:,j1,...,jN), then Co is an array with N+2 dimensions, that is, Co(:,:,j1,...,jN).

    References

    [1] Paige, C. C. "Properties of Numerical Algorithms Related to Computing Controllability." IEEE Transactions on Automatic Control. Vol. 26, Number 1, 1981, pp. 130-138.

    Version History

    Introduced before R2006a