Main Content

rss

Generate random continuous-time test model

    Description

    sys = rss(n) generates a SISO state-space model sys of order n. The poles of sys are random and stable with the possible exception of poles at s = 0 (integrators).

    example

    sys = rss(n,p,m) generates a state-space model with p outputs and m inputs.

    example

    sys = rss(n,p,m,s1,...,sk) generates an s1-by-...-by-sn array of state-space models.

    example

    Examples

    collapse all

    Generate a random SISO state-space model with two states.

    sys2 = rss(2)
    sys2 =
     
      A = 
                x1       x2
       x1  -0.8429  -0.2134
       x2  -0.5162   -1.214
     
      B = 
                 u1
       x1    0.7254
       x2  -0.06305
     
      C = 
               x1      x2
       y1       0  -0.205
     
      D = 
                u1
       y1  -0.1241
     
    Continuous-time state-space model.
    Model Properties
    

    Generate a model with four states, three outputs, and two inputs. The input arguments to rss are arranged in the order states, outputs, inputs.

    sys4 = rss(4,3,2)
    sys4 =
     
      A = 
                x1       x2       x3       x4
       x1    45.92    1.332   -9.841   -18.02
       x2   -3.679  -0.8695    2.348  -0.8719
       x3     89.8   -2.097   -22.31   -28.27
       x4    79.49   -2.367   -19.69    -24.7
     
      B = 
                u1       u2
       x1        0  -0.2256
       x2    1.533        0
       x3  -0.7697        0
       x4        0  0.03256
     
      C = 
                x1       x2       x3       x4
       y1   0.5525  0.08593   -1.062   0.7481
       y2    1.101        0     2.35  -0.1924
       y3    1.544        0  -0.6156   0.8886
     
      D = 
                u1       u2
       y1        0   0.4882
       y2   -1.402        0
       y3        0  -0.1961
     
    Continuous-time state-space model.
    Model Properties
    

    Generate a 4-by-5 array of SISO models with three states each.

    sysarray = rss(3,1,1,4,5);
    size(sysarray)
    4x5 array of state-space models.
    Each model has 1 outputs, 1 inputs, and 3 states.
    

    Input Arguments

    collapse all

    Model order, specified as a nonnegative integer. n determines the number of states in the generated model sys. If n=0, then sys is a static gain.

    Output and input dimensions of sys, specified as nonnegative integers.

    Example: sys = rss(5,4,3) generates a state-space model with five states, four outputs, and three inputs.

    Array dimensions of sys, specified as nonnegative integers. Specifying these values generates an k-dimensional array of state-space models where each entry in the array is a state-space model of order n with p outputs and m inputs.

    Example: sys = rss(1,1,1,2,3) generates a two-by-three array of SISO models.

    Output Arguments

    collapse all

    Random state-space model, returned as a ss model or array of ss models. The poles of sys are random and stable with the possible exception of poles at s = 0 (integrators).

    Tips

    • To convert the ss model sys to transfer-function, frequency-response, or zero-pole-gain form, use tf, frd, or zpk, respectively. For example, sys = tf(rss(3)) returns a third-order SISO transfer function as a tf model object.

    Version History

    Introduced before R2006a

    See Also

    | | | |