# ssequiv

Equivalence transformation for state-space models

Since R2023b

## Syntax

``sysT = ssequiv(sys,T1,e1,T2,e2)``

## Description

`ssequiv` performs an equivalence transformation on a state-space model.

Input ModelTransformed Model
`$\begin{array}{c}E\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$`
`$\begin{array}{c}{T}_{L}E{T}_{R}\stackrel{˙}{x}={T}_{L}A{T}_{R}x+{T}_{L}Bu\\ y=C{T}_{R}x+Du\end{array}$`

Here:

• The left-transformation matrix is defined as ${T}_{L}={T}_{1}^{{e}_{1}}$.

• The right-transformation matrix is defined as ${T}_{R}={T}_{2}^{{e}_{2}}$.

• `e1` and `e2` are either –1 or 1. That is, TL is `T1` or its inverse and TR is `T2` or its inverse.

example

````sysT = ssequiv(sys,T1,e1,T2,e2)` performs the equivalence transformation for `sys`.```

## Examples

collapse all

Perform an equivalence transform for a state space model.

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

```rng(0) sys = rss(5); T1 = randn(5); rng(2) T2 = randn(5);```

Perform the following transformation on `sys`.

`$\begin{array}{l}\stackrel{˙}{\mathit{x}}={\mathit{T}}_{1}^{-1}\mathit{A}{\mathit{T}}_{2}\mathit{x}+{\mathit{T}}_{1}^{-1}\mathit{B}\\ \mathit{y}={\mathit{CT}}_{2}\end{array}$`

`sysT = ssequiv(sys,T1,-1,T2,1);`

Plot the frequency response of both models.

```bode(sys,'b',sysT,'r--') legend``` The responses of both models match closely.

`ssequiv` 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 matrices.

```T1 = [1 -2;3 5]; T2 = T1;```

Apply the transformation

`$\begin{array}{l}\stackrel{˙}{\mathit{x}}={\mathit{T}}_{\mathit{L}}\mathit{A}{\mathit{T}}_{\mathit{R}}^{-1}\mathit{x}+{\mathit{T}}_{\mathit{L}}\mathit{B}\\ \mathit{y}=\mathit{C}{\mathit{T}}_{\mathit{R}}^{-1}+\mathit{Du}\end{array}$`

`tsys = ssequiv(sys,T1,1,T2,-1);`

Compare this transformed model with the model from decomposed `tsys`.

`sigma(sys,tsys,"r--")` The responses of both models match closely.

## Input Arguments

collapse all

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

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

Left-transformation matrix, specified as an n-by-n square invertible matrix, where n is the number of states. The left-transformation matrix is defined as ${T}_{L}={T}_{1}^{{e}_{1}}$, that is, `T1` or its inverse.

To omit the left transformation, specify `T1` and `e1` as `[]`.

For example, the following code transforms A, B, C, E of `sys` to ATT, B, CTT, ETT.

`sys = ssequiv(sys,[],[],T',1);`

Left-transformation matrix exponent, specified as `–1` or `1`.

To omit the left transformation, specify `T1` and `e1` as `[]`.

For example, the following code transforms A, B, C, E of `sys` to ATT, B, CTT, ETT.

`sys = ssequiv(sys,[],[],T',1);`

Right-transformation matrix, specified as an n-by-n square invertible matrix, where n is the number of states. The right-transformation matrix is defined as ${T}_{R}={T}_{2}^{{e}_{2}}$, that is, `T1` or its inverse.

To omit the right transformation, specify `T2` and `e2` as `[]`.

For example, the following code transforms A, B, C, E of `sys` to T-1A, T-1B, C, T-1E.

`sys = ssequiv(sys,T,-1,[],[]);`

Right-transformation matrix exponent, specified as `–1` or `1`.

To omit the right transformation, specify `T2` and `e2` as `[]`.

For example, the following code transforms A, B, C, E of `sys` to T-1A, T-1B, C, T-1E.

`sys = ssequiv(sys,T,-1,[],[]);`

## Output Arguments

collapse all

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

## Version History

Introduced in R2023b