lahidj
lahidj

Reputation: 127

How to get transfer function of multi input-multi output system using system Matrices in Matlab

Here I've matrices of multi input-multi output system (matrix D is not zero) and I want to take transfer function of this model. size A [9*9]

A = [-6.932e-2,17.41,-36.75,0,0,0,-6.0660,-31.54,0;
    -1.435e-4,2.719e-2,-1.411e-3,3.467e-1,0,-9.380e-1,7.139e-2,-1.691e-2,0;
    -4.537e-4,1.870e-3,-2.025e-1,0,1,0,-4.688e-2,7.563e-3,0;
    -1.304e-4,-7.179,-4.916e-1,-6.172e-1,-3.689e-2,7.631e-1,0,0,0;
    2.297e-5,0,-8.667e-1,4.393e-2,-1.947e-1,-2.026e-2,0,0,0;
    1.964e-5,4.263e-2,-1.329e-2,1.233e-3,1.579e-2,-1.600e-1,0,0,0;
    0,0,0,1,1.941e-1,2.771e-1,0,6.258e-2,0;
    0,0,0,0,8.192e-1,-5.736e-1,-5.612e-2,0,0;
    0,0,0,0,6.055e-1,8.648e-1,0,2.006e-2,0]

size  B = [9*4]

B = [0,0,-7.560,9.067e-4;
     -6.952e-3,1.293e-2,0,0;
     0,0,-3.425e-2,-9.577e-7;
     4.249,5.989e-1,0,0;
     0,0,-1.796,0;
     -7.287e-2,-2.877e-1,0,0;
     0,0,0,0;
     0,0,0,0;
     0,0,0,0]

size  C = [7*9]

C = [0,-5.758e-1,0,0,0,0,0,0,0;
     0,0,0,1,0,0,0,0,0;
     0,0,0,0,0,1,0,0,0;
     0,0,1,0,0,0,0,0,0;
     0,1,0,0,0,0,0,0,0;
     0,0,0,0,1,0,0,0,0;
     0,2.719e-2,-1.411e-3,3.467e-1,0,-9.380e-1,7.139e-2,0,0]

size D = [7*4]

D = [-1.298e-1,-1.610e-1,0,0;
     0,0,0,0;
     0,0,0,0;
     0,0,0,0;
     0,0,0,0;
     0,0,0,0;
     -6.952e-3,1.293e-2,0,0]

How Can I get Transfer function of this model using Matlab?

Upvotes: 2

Views: 826

Answers (1)

hbaderts
hbaderts

Reputation: 14316

You can create a state space model from the system matrices using the ss command. It doesn't matter that D is non-zero, as MATLAB uses the standard form when creating a model with ss:

model (Image from Wikipedia.org)

equations

So you create the model with

sys = ss(A,B,C,D);

and read out the transfer function:

tf(sys)

which returns a 7x4 tf object containing the transfer function from every input to every output.

Note: The matrix A you posted here is not correct: there are too many zeros in some lines, but I assume that is a simple copy-paste mistake. After removing them, this works fine.

Upvotes: 3

Related Questions