Main Content

ss2ss

State coordinate transformation for state-space model

    Description

    ss2ss performs the similarity transformation z = Tx on the state vector x of a state-space model. For more information, see Algorithms.

    sysT = ss2ss(sys,T) performs the state-coordinate transformation of sys using the specified transformation matrix T. The matrix T must be invertible.

    example

    Examples

    collapse all

    Perform a similarity transform for a state space model.

    Generate a random state-space model and a transformation matrix.

    rng(0)
    sys = rss(5);  
    t = randn(5);

    Perform the transformation and plot the frequency response of both models.

    tsys = ss2ss(sys,t);
    bode(sys,'b',tsys,'r--')
    legend

    MATLAB figure

    ans = 
      Legend (sys, tsys) with properties:
    
             String: {'sys'  'tsys'}
           Location: 'northeast'
        Orientation: 'vertical'
           FontSize: 8.1000
           Position: [0.8116 0.8814 0.1429 0.0884]
              Units: 'normalized'
    
      Use GET to show all properties
    
    

    The responses of both models match closely.

    ss2ss applies state transformation only to the state vectors of the numeric portion of the generalized model.

    Create a genss model.

    sys = rss(2,2,2) * tunableSS('a',2,2,3) + tunableGain('b',2,3)
    Generalized continuous-time state-space model with 2 outputs, 3 inputs, 4 states, and the following blocks:
      a: Tunable 2x3 state-space model, 2 states, 1 occurrences.
      b: Tunable 2x3 gain, 1 occurrences.
    
    Type "ss(sys)" to see the current value and "sys.Blocks" to interact with the blocks.
    

    Specify a transformation matrix and obtain the transformation.

    T = [1 -2;3 5];
    tsys = ss2ss(sys,T)
    Generalized continuous-time state-space model with 2 outputs, 3 inputs, 4 states, and the following blocks:
      a: Tunable 2x3 state-space model, 2 states, 1 occurrences.
      b: Tunable 2x3 gain, 1 occurrences.
    
    Type "ss(tsys)" to see the current value and "tsys.Blocks" to interact with the blocks.
    

    Decompose both models.

    [H,B,~,~] = getLFTModel(sys);
    [H1,B1,~,~] = getLFTModel(tsys);

    Obtain the transformation separately on the model from decomposed sys.

    H2 = ss2ss(H,T);

    Compare this transformed model with the model from decomposed tsys.

    isequal(H1,H2)
    ans = logical
       1
    
    

    Both models are equal.

    The file icEngine.mat contains one data set with 1500 input-output samples collected at the a sampling rate of 0.04 seconds. The input u(t) is the voltage (V) controlling the By-Pass Idle Air Valve (BPAV), and the output y(t) is the engine speed (RPM/100).

    Use the data in icEngine.mat to create a state-space model with identifiable parameters.

    load icEngine.mat
    z = iddata(y,u,0.04);
    sys = n4sid(z,4,'InputDelay',2);

    Specify a random transformation matrix.

    T = randn(4);

    Obtain the transformation.

    sysT = ss2ss(sys,T);

    Compare the frequency responses.

    bode(sys,'b',sysT,'r--')
    legend

    MATLAB figure

    ans = 
      Legend (sys, sysT) with properties:
    
             String: {'sys'  'sysT'}
           Location: 'northeast'
        Orientation: 'vertical'
           FontSize: 8.1000
           Position: [0.8059 0.8257 0.1486 0.0884]
              Units: 'normalized'
    
      Use GET to show all properties
    
    

    The responses match closely.

    ss2ss also lets you perform similarity transformation for models with complex coefficients.

    For this example, generate a random state-space model with complex coefficients.

    rng(0)
    sys = ss(randn(5)+1i*randn(5),randn(5,3),randn(2,5)+1i*randn(2,5),0,.1);

    Specify a transformation matrix containing complex data.

    T = randn(5)+1i*randn(5);

    Obtain the transformation.

    sysT = ss2ss(sys,T);

    Compare the singular values of the frequency response.

    sigma(sys,'b',sysT,'r--')
    legend

    MATLAB figure

    ans = 
      Legend (sys, sysT) with properties:
    
             String: {'sys'  'sysT'}
           Location: 'northeast'
        Orientation: 'vertical'
           FontSize: 9
           Position: [0.7459 0.7968 0.1401 0.0789]
              Units: 'normalized'
    
      Use GET to show all properties
    
    

    The responses match closely for both branches.

    Input Arguments

    collapse all

    Dynamic system, specified as a SISO, or MIMO dynamic system model. Dynamic systems that you can use include:

    • Continuous-time or discrete-time numeric LTI models, such as ss (Control System Toolbox) or dss (Control System Toolbox) models.

    • Generalized or uncertain LTI models, such as genss (Control System Toolbox) or uss (Robust Control Toolbox) models. (Using uncertain models requires Robust Control Toolbox™ software.)

      For such models, the state transformation is applied only to the state vectors of the numeric portion of the model. For more information about decomposition of these models, see getLFTModel (Control System Toolbox) and Internal Structure of Generalized Models (Control System Toolbox).

    • Identified state-space idss models.

    If sys is an array of state-space models, ss2ss applies the transformation T to each individual model in the array.

    Transformation matrix, specified as an n-by-n matrix, where n is the number of states. T is the transformation between the state vector of the state-space model sys and the state vector of the transformed model sysT. (See Algorithms.)

    Output Arguments

    collapse all

    Transformed state-space model, returned as a dynamic system model of the same type as sys.

    Algorithms

    ss2ss performs the similarity transformation x¯=Tx on the state vector x of a state-space model.

    This table summarizes the transformations returned by ss2ss for each model form.

    Input ModelTransformed Model

    Explicit state-space models of the form:

    x˙=Ax+Buy=Cx+Du

    x¯˙=TAT1x¯+TBuy=CT1x¯+Du

    Descriptor (implicit) state-space models for the form:

    Ex˙=Ax+Buy=Cx+Du

    ET1x¯˙=AT1x¯+Buy=CT1x¯+Du

    Identified state-space (idss) models of the form:

    dxdt=Ax+Bu+Key=Cx+Du+e

    x¯˙=TAT1x¯+TBu+TKey=CT1x¯+Du+e

    Version History

    Introduced before R2006a

    expand all

    See Also

    (Control System Toolbox) | (Control System Toolbox) |