Main Content

Arithmetic Operations on Matrix Signals

This example shows how to perform arithmetic operations on signals carrying matrix and vector data.

In this example, the model performs a series of matrix operations on the input matrices and vectors to transform a system with state-space representation to its controllable canonical form, also known as phase variable form. The phase variable form provides a simplified representation of the system that eases the controllability analysis and helps in model reduction.

The sstocanonical model contains these components that show different mathematical operations.

  • Input data

  • Multiplication

  • Inverse

  • Canonical Form

Open the model.

mdl = "sstocanonical.slx";
open_system(mdl)

Arithmetic operations on signals carrying matrix signals.

Input Data

The Input data component represents the input matrix and vectors in state-space form.

x˙=Ax+Bu

y=Cx+Du

In this example, A is 3-by-3 matrix that represents the system, B is 3-by-1 input vector, C is 3-by-1 output vector, and the model assumes D to be 0.

Input data.

Multiplication

The controllability matrix for the state-space system is defined as:

Q=[BABA2B.....An-1B], where n represents the number of states.

The Multiplication component computes the controllability matrix Q from the state-space system.

Multiplication operations for controllability matrix Q.

Controllable Canonical Form

The model modifies the state-space equation using the substitution x=P-1z and D=0 as:

z˙=PAP-1z+PBu

y=CP-1z

In these equations, P=[P1P1AP1A2], where P1 is the last row of Qinv. The Inverse component computes the inverse of the controllability matrix Q and transformation matrix P.

P Matrix computation.

The equation is further simplified as:

z˙=A0+B0u

y=C0z

where A0=PAP-1, B0=PB, and C0=CP-1.

The Canonical Form component computes the canonical form of the state-space system.

Simulation and Results

Simulate the model and visualize A0, B0, C0 using Display blocks.

out = sim(mdl);

Inverse operations and substitutions renders the canonical form.

Verification Using MATLAB

You can verify the simulation result by comparing it with the controllable canonical form of the system obtained programmatically using MATLAB functions. Observe that, first the ss2tf function is used to obtain the transfer function coefficients.

A = [ 2 7 -3
    -3 1 1.5
    -7 2 9];
B = [0
    2 
    1];
C = [10 0 1];

D = 0;

[b,a] = ss2tf (A,B,C,D);

Then, the transfer function coefficients are used from the arrays b and a to obtain the controllable canonical form of the system. Observe that the matrices match the simulation results.

α2=-12.00,α1=26.00,α0=-124.50

β2=1.00,β1=111.00,β0=-1328.00

A0=(010001124.50-26.0012.00)

B0=(001)

C0=(-1328.00111.001.00)

See Also

| | | | | |

Topics

References

[1] Ramaswami, B., and K. Ramar. "Transformation to the phase-variable canonical form." IEEE Transactions on Automatic Control 13, no. 6 (1968): 746-747. https://doi.org/10.1109/TAC.1968.1099061.