3

I am trying to generate a transfer function from the state space matrices that I have. The problem is that the matrices have variables and not numeric values so I have to use symbolic variables in Matlab.

So I started with:

A =

[  -a0,    0,    0,    0,    0,    0,   a1]
[    0,  -a2,    0,    0,    0,    0,   a3]
[    0,    0,  -a4,    0,    0,    0,   a5]
[    0,    0,    0,  -a6,    0,    0,   a7]
[    0,    0,    0,    0,  -a8,    0,   a9]
[    0,    0,    0,    0,    0, -a10,  a11]
[  a12,  a13,  a14,  a15,  a16,  a17, -a18]

B =

[ b0, b1]
[  0, b2]
[  0, b3]
[  0, b4]
[  0, b5]
[  0, b6]
[  0,  0]

C = 

[ 0, 0, 0, 0, 0, 0, 1]

D = 0

I then found a method online by using

Phi=inv(s*eye(7)-A)

Where Phi is a transfer matirx. Then using

H = C * Phi * B + D

H is supposed to be the result.

However MATLAB cant handle the 7 by 7 matrix and ends up truncating the results.

Is there a better way I can achieve the Transfer Function I require?

CMacDady
  • 227
  • 2
  • 8
  • Looks like it's easier to do by hand. Have you tried simply working out the formula you have there? – Phonon Nov 17 '11 at 20:02
  • Yeah. Its not. I tried it by hand but it becomes ridiculous fast. – CMacDady Nov 24 '11 at 20:23
  • What exactly do you mean by "truncating the results"? – silvado Nov 25 '11 at 08:17
  • The result had more than 25000 terms, according to Matlab and would not display any more thus stopped displaying them and calculating them. Possibly due to a lack of memory. Im not sure. – CMacDady Dec 12 '11 at 08:39

2 Answers2

4

Take a look at this Wikipedia article on matrix inversion. When considering matrix (Is-A), it has a very special shape and you can invert it using some of the identities given in that article. All you have to do is to split it into blocks, where A is your diagonal part, B is a vertical vector on the right, C is horizontal vector on the bottom and D is a single element in the lower right corner of your matrix. The only inversions you would have to do this way are inverting A, which is diagonal and very easily invertible, and (D-C*inv(A)*B) which is a single number because your C and B are row and column vectors respectively. This can very manageably be done by hand or with symbolic toolbox.

Phonon
  • 12,549
  • 13
  • 64
  • 114
1

In order to be compatible with the dimension of B, your D matrix should be

D = [0 0];

Maybe the truncation of H is due to this?

silvado
  • 17,202
  • 2
  • 30
  • 46
  • I've since changed that. However it was still doing the same thing. Now I have simplified the model to be 3x3 matrix. The code now works and outputs two transfer functions. They are large even when simplified. I wonder if matlab simply can not handle symbolic structures of that size. – CMacDady Nov 24 '11 at 20:22