1
$\begingroup$

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.

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

1 Answer 1

4
$\begingroup$

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

enter image description here

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':

enter image description here

$\endgroup$
3
  • $\begingroup$ 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 $\endgroup$
    – Zero
    Jul 20, 2016 at 7:47
  • $\begingroup$ See my edit. Just click a bit around in the documentation, very often the solution is there, you just can't see it :) $\endgroup$
    – Phab
    Jul 20, 2016 at 8:28
  • $\begingroup$ Really appreciate the response...cheers! $\endgroup$
    – Zero
    Jul 20, 2016 at 9:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.