Azzera filtri
Azzera filtri

What to do in the case of a matrix 2x2 .......tf2ss

8 visualizzazioni (ultimi 30 giorni)
Convert it to state-space form using tf2ss.
b = [0 2 3; 1 2 1];
a = [1 0.4 1];
[A,B,C,D] = tf2ss(b,a)
A = 2×2
-0.4000 -1.0000
1.0000 0
B = 2×1
1
0
C = 2×2
2.0000 3.0000
1.6000 0
D = 2×1
0
1

Risposte (1)

Star Strider
Star Strider il 2 Nov 2019
Note that the present problem uses the Control System Toolbox. The tf2ss function is in the Signal Processing Toolbox. To convert Control System Toolbox models from transfer functions to state space, use ss instead.
The correct procedure to do what you want is:
s = tf('s'); % Define Continuous Time
b = {[0 2 3]; [1 2 1]}; % Numerator Cell Array
a = [1 0.4 1]; % Denominator Vector (Cell Array If Different Denominators)
systf = tf(b,a) % Define Transfer Function
sysss = ss(systf) % Convert To State Space Representation
producing:
systf =
From input to output...
2 s + 3
1: ---------------
s^2 + 0.4 s + 1
s^2 + 2 s + 1
2: ---------------
s^2 + 0.4 s + 1
Continuous-time transfer function.
sysss =
A =
x1 x2
x1 -0.4 -1
x2 1 0
B =
u1
x1 2
x2 0
C =
x1 x2
y1 1 1.5
y2 0.8 0
D =
u1
y1 0
y2 1
Continuous-time state-space model.
Remember that to simulate it, the input signal ‘u’ must be the same column size as ‘B’, for example:
[u,t] = gensig('square',4,10,0.1);
u = u*ones(1,size(sysss.B,2)); % Create Appropriate Size for ‘u’
lsim(sysss,u,t)
This will automatically adjust to give the same vector to each input of a MIMO or MISO system. If you want different vectors to different inputs, they need to be individually created.
Experiment to get different results.

Categorie

Scopri di più su Dynamic System Models in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by