3
$\begingroup$

I have a MIMO transfer function model, and I'd like to know how to perform arithmetic on this model. For instance, to see the difference between two systems' outputs for arbitrary inputs, I'd like to be able to subtract one transfer matrix from another. However, Mathematica doesn't interpret the difference between TransferFunctionModels as the difference between transfer matrices. Does anyone know how to extract the transfer matrix from a TransferFunctionModel?

$\endgroup$
2
$\begingroup$
m1 = 1/(s + 1);
m2 = 1/(s + 1)^2;

TransferFunctionModel[m1, s][s] - TransferFunctionModel[m2, s][s]

{{-(1/(1 + s)^2) + 1/(1 + s)}}

TransferFunctionModel[
  TransferFunctionModel[m1, s][s] - TransferFunctionModel[m2, s][s], 
  s] == TransferFunctionModel[m1 - m2, s]

True

$\endgroup$
1
  • 1
    $\begingroup$ For the record, the trick is that a TransferFunctionModel can be called as a function, with s as the input. It returns a matrix, which can then be manipulated as expected. $\endgroup$
    – Ben Criger
    Jul 13 '15 at 12:09

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.