4
$\begingroup$

Given a transfer funtion

TransferFunctionModel[1/(s + I) + 1/(s - I) + 1/(s + 1) + 1/(s - 2)^2,s]

we can obtain the polinomial form by using TransferFunctionExpand

TransferFunctionModel[{{{5 + 5 s + 6 s^2 - 9 s^3 + 3 s^4}}, 4 + s^2 + s^3 - 3 s^4 + s^5}, s]

enter image description here

But what is the reverse opeation of such tranform? For example, assume we have a transfer function

(a3*s^3+a2*s^2+a1*s+a0)/(b4*s^4+b3*s^3+b2*s^2+b1*s+b0)

How can we get the sum form with all poles? When we design an analog filter we usually express the transfer function in the product form using zeros and poles and then tranfer to the sum form.

$\endgroup$
3
  • $\begingroup$ I must be overlooking something. You have the original factored form that you want. It is what you used to generate the TransferFunctionModel from. So why is an inverse operation needed? What should this inverse function return for the example you showed? Also you can look at Apart if needed. $\endgroup$
    – Nasser
    Apr 22 at 4:29
  • $\begingroup$ Because in general case when we design a filter we usually have the form e.g. (a3*s^3+a2*s^2+a1*s+a0)/((b4*s^4+b3*s^3+b2*s^2+b1*s+b0) first and then try to transform to the sum of all poles.@Nasser $\endgroup$
    – metroidman
    Apr 22 at 5:40
  • $\begingroup$ Ok, in this case you could always use Apart. To get complex Apart, Mathematica used to have Integrate`ComplexApart but this no longer works in recent versions. Need to use extension as Syed shows below. $\endgroup$
    – Nasser
    Apr 22 at 5:45

1 Answer 1

6
$\begingroup$

I agree with @Nasser's comment. If you are starting with the model expression however, then Apart can be used as follows:

model = TransferFunctionModel[{{{5 + 5 s + 6 s^2 - 9 s^3 + 3 s^4}}, 
   4 + s^2 + s^3 - 3 s^4 + s^5}, s]

pzform = model[[1]] // Flatten // Apply[Divide] // 
   Factor[#, Extension -> I] & // Apart

$\frac{1}{s+1}+\frac{1}{s-i}+\frac{1}{s+i}+\frac{1}{(s-2)^2}$


Addendum

Logically, the reverse operation should be TransferFunctionFactor and you can peruse the docs to see if it suits your needs better.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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