Convert state-space representation (MIMO) to transfer function matrix

 Accepted Answer

But if you have an existing ss system created with https://www.mathworks.com/help/control/ref/ss.html then use tf()
A = [-1.5,-2;1,0];
B = [0.5;0];
C = [0,1];
D = 0;
sys = ss(A,B,C,D)
sys = A = x1 x2 x1 -1.5 -2 x2 1 0 B = u1 x1 0.5 x2 0 C = x1 x2 y1 0 1 D = u1 y1 0 Continuous-time state-space model.
sys_as_tf = tf(sys)
sys_as_tf = 0.5 --------------- s^2 + 1.5 s + 2 Continuous-time transfer function.

More Answers (2)

it is giving me wrong result I would like to have only four transfer function .
>> A = [ 0 0 -0.1 0.1;
0 0 -4.6 -4.5;-0.0008 0.0008 0 0;0 -4.0 0 5.6];
B = [ 14.8 32.2;
35 -24;-0.75 -0.41;0 0];
C = [ 1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1];
D = 0;
>> sys = ss(A,B,C,D )
sys =
A =
x1 x2 x3 x4
x1 0 0 -0.1 0.1
x2 0 0 -4.6 -4.5
x3 -0.0008 0.0008 0 0
x4 0 -4 0 5.6
B =
u1 u2
x1 14.8 32.2
x2 35 -24
x3 -0.75 -0.41
x4 0 0
C =
x1 x2 x3 x4
y1 1 0 0 0
y2 0 1 0 0
y3 0 0 1 0
y4 0 0 0 1
D =
u1 u2
y1 0 0
y2 0 0
y3 0 0
y4 0 0
Continuous-time state-space model.
>> sys_as_tf = tf(sys)
sys_as_tf =
From input 1 to output...
14.8 s^3 - 82.81 s^2 - 280.8 s - 3.019
1: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
35 s^3 - 192.6 s^2 - 19.27 s - 0.2893
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-0.75 s^3 + 4.216 s^2 + 13.41 s + 0.2243
3: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-140 s^2 - 13.8 s - 0.2067
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
From input 2 to output...
32.2 s^3 - 180.3 s^2 - 570.1 s - 2.167
1: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-24 s^3 + 136.3 s^2 - 10.44 s - 0.6743
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-0.41 s^3 + 2.251 s^2 + 7.632 s + 0.456
3: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
96 s^2 - 7.544 s - 0.4817
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
Continuous-time transfer function.

1 Comment

Your D is 4 x 2. That is the configuration for 2 inputs and 4 outputs per input

Sign in to comment.

thank you.
>> A = [ 0 0 -0.1 0.1;
0 0 -4.6 -4.5;-0.0008 0.0008 0 0;0 -4.0 0 5.6];
B = [ 14.8 32.2;
35 -24;-0.75 -0.41;0 0];
C = [ 1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1];
D = 0;
>> sys = ss(A,B,C,D )
sys =
A =
x1 x2 x3 x4
x1 0 0 -0.1 0.1
x2 0 0 -4.6 -4.5
x3 -0.0008 0.0008 0 0
x4 0 -4 0 5.6
B =
u1 u2
x1 14.8 32.2
x2 35 -24
x3 -0.75 -0.41
x4 0 0
C =
x1 x2 x3 x4
y1 1 0 0 0
y2 0 1 0 0
y3 0 0 1 0
y4 0 0 0 1
D =
u1 u2
y1 0 0
y2 0 0
y3 0 0
y4 0 0
Continuous-time state-space model.
>> sys_as_tf = tf(sys)
sys_as_tf =
From input 1 to output...
14.8 s^3 - 82.81 s^2 - 280.8 s - 3.019
1: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
35 s^3 - 192.6 s^2 - 19.27 s - 0.2893
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-0.75 s^3 + 4.216 s^2 + 13.41 s + 0.2243
3: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-140 s^2 - 13.8 s - 0.2067
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
From input 2 to output...
32.2 s^3 - 180.3 s^2 - 570.1 s - 2.167
1: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-24 s^3 + 136.3 s^2 - 10.44 s - 0.6743
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
-0.41 s^3 + 2.251 s^2 + 7.632 s + 0.456
3: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
96 s^2 - 7.544 s - 0.4817
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
Continuous-time transfer function.
>> C = [ 0 0 0 0;0 0 0 0;0 0 0 0;0 0 0 1];
>> sys = ss(A,B,C,D)
sys =
A =
x1 x2 x3 x4
x1 0 0 -0.1 0.1
x2 0 0 -4.6 -4.5
x3 -0.0008 0.0008 0 0
x4 0 -4 0 5.6
B =
u1 u2
x1 14.8 32.2
x2 35 -24
x3 -0.75 -0.41
x4 0 0
C =
x1 x2 x3 x4
y1 0 0 0 0
y2 0 0 0 0
y3 0 0 0 0
y4 0 0 0 1
D =
u1 u2
y1 0 0
y2 0 0
y3 0 0
y4 0 0
Continuous-time state-space model.
>> sys_as_tf = tf(sys)
sys_as_tf =
From input 1 to output...
1: 0
2: 0
3: 0
-140 s^2 - 13.8 s - 0.2067
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
From input 2 to output...
1: 0
2: 0
3: 0
96 s^2 - 7.544 s - 0.4817
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
Continuous-time transfer function.
>> C = [ 0 0 0 0;0 1 0 0;0 0 0 0;0 0 0 1];
>> sys = ss(A,B,C,D)
sys =
A =
x1 x2 x3 x4
x1 0 0 -0.1 0.1
x2 0 0 -4.6 -4.5
x3 -0.0008 0.0008 0 0
x4 0 -4 0 5.6
B =
u1 u2
x1 14.8 32.2
x2 35 -24
x3 -0.75 -0.41
x4 0 0
C =
x1 x2 x3 x4
y1 0 0 0 0
y2 0 1 0 0
y3 0 0 0 0
y4 0 0 0 1
D =
u1 u2
y1 0 0
y2 0 0
y3 0 0
y4 0 0
Continuous-time state-space model.
>> sys_as_tf = tf(sys)
sys_as_tf =
From input 1 to output...
1: 0
35 s^3 - 192.5 s^2 - 19.27 s - 0.2893
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
3: 0
-140 s^2 - 13.8 s - 0.2067
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
From input 2 to output...
1: 0
-24 s^3 + 136.3 s^2 - 10.44 s - 0.6743
2: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912
3: 0
96 s^2 - 7.544 s - 0.4817
4: ---------------------------------------------
s^4 - 5.6 s^3 - 18 s^2 - 0.02016 s + 0.002912

Categories

Find more on System Identification Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!