# How to convert a transfer function model to a zero-pole-gain model?

Mathematica has a function to convert TransferFunctionModels to StateSpaceModels:

mytf=TransferFunctionModel[(2 s + 3)/(s^3 + 4 s^2 + 5), s]
StateSpaceModel[mytf]


Is there a corresponding function that will convert to a zero-pole-gain model?

• I asked this question simply because I knew the answer and had blogged about it ages ago. If such behaviour is frowned upon, please delete. Commented Nov 26, 2012 at 16:45
• Asking and answering your own question is specifically encouraged as a way of passing your own hard earned knowledge onto others. Commented Nov 26, 2012 at 16:52

It turns out that there is a function that will do this but it is hidden from the user a little in an internal function

In[]:= ControlZeroPoleGainModel[mytf]

Out[]=
ControlZeroPoleGainModel[{{{{-(3/2)}}},
{1/3 (-4 - 16 (2/(263 - 3 Sqrt[5865]))^(1/3) -
(1/2 (263 - 3 Sqrt[5865]))^(1/3)),
-(4/3) + 8/3 (1 + I Sqrt[3]) (2/(263 - 3 Sqrt[5865]))^(1/3) +
1/6 (1 - I Sqrt[3]) (1/2 (263 - 3 Sqrt[5865]))^(1/3),
-(4/3) + 8/3 (1 - I Sqrt[3]) (2/(263 - 3 Sqrt[5865]))^(1/3) +
1/6 (1 + I Sqrt[3]) (1/2 (263 - 3 Sqrt[5865]))^(1/3)},
{{2}}}, s]


original source: http://www.walkingrandomly.com/?p=2799