# Inverse and Series Connection - TransferFunctionModel

I need to perform certain operations on individual transfer functions. As an example,

sys=StateSpaceModel[{sysA,sysB,sysC,sysD}];
Tfsys=TransferFunctionModel[sys,s];


Now I extract the required transfer functions, say $P_1$ and $P_2$

P1=SystemsModelExtract[Tfsys,{1},{1}];
P2=SystemsModelExtract[Tfsys,{1},{2}];


Now I want to perform an operation like $\Gamma=P_2 (P_1)^{-1}$. So I use

T=SystemsModelSeriesConnect[P2,Inverse[P1]];


This gives me an error saying the first argument cannot be interpreted as a polynomial matrix in SystemsModelSeriesConnect[#1,#2]

I have tried writing it as $P_2.Inverse[P_1]$ but I cannot make it accept the argument. Additionally, I would need to do a lot of algebraic operations with the TransferFunctionModel which not always can be done with commands like SystemsModelSeriesConnect,SystemsModelParallelConnect, etc.

As you would have guessed, I am not too adept with the syntax in Mathematica, so please bear with my questions.

• Could you give an example for your system? – Phab Jul 20 '16 at 6:10
• As far as I know, Inverse[] works only on square matrices. – Phab Jul 20 '16 at 6:16

I dont know, if this is, what you want. But you might try this:

P1 = SystemsModelExtract[Tfsys, {1}, {1}]
P2 = SystemsModelExtract[Tfsys, {1}, {2}]

P3 = TransferFunctionModel[Inverse[P1[s]], s]

T = SystemsModelSeriesConnect[P2, P3]


How I did get this:

Documentation says:

Inverse[m] gives the inverse of a square matrix m.

And because

someTF = TransferFunctionModel[1/s, s]
someTF^-1


gives where the first one is a transfer function model, but the second one is mixed. It's 1/someTFmodel.

You have to get the inner of your transfer function model, invert it, and put it back into a transfer function model. Helpful for this is documentation's TransferFunctionModel section 'properties & relations': • How did you know it...it doesnt show up in the documentation...Can you give me a reasoning or insight into solving such issues? I seem to get in these minor issues a lot – Zero Jul 20 '16 at 7:47
• See my edit. Just click a bit around in the documentation, very often the solution is there, you just can't see it :) – Phab Jul 20 '16 at 8:28
• Really appreciate the response...cheers! – Zero Jul 20 '16 at 9:24