# What's the reverse operation of TransferFunctionExpand?

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]

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.

• 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. Apr 22 at 4:29
• 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 Apr 22 at 5:40
• 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. Apr 22 at 5:45

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}$$