I want to convert a transfer function to zero-pole-gain and then back to transfer function form.
As I understand the output of zp2tf
should return the original transfer function. However I cannot seem to get this to work.
I have a 5th order transfer function of the form:
I proceeded to find the zeros and poles for this transfer function to see which pole could be removed in order to reduce the order. Since this model consists of both an electrical and a mechanical part, the time constant for the electrical part is very small when compared to the mechanical time constants and due to this we can replace the electrical system with a gain and get an equivalent 4th order system.
To do so, I used this piece of code available on MathWorks, with the 5th order TF above:
b = [0.0001 10];
a = [0.005 5.00010060 0.661600001 61.01102010 2.1101 10];
fvtool(b,a,'polezero')
[b,a] = eqtflength(b,a);
[z,p,k] = tf2zp(b,a)
The output was as follows, which is exactly what I had expected:
z = -100000
k = 0.02
and the equivalent PZ-map:
The above results show the pole associated with the electrical circuit, which is far to the left. This can be removed, thus reducing the order of the transfer function from 5th order to 4th order.
In order to reduce the order, I tried removing
My problem is that I cannot convert from zero-pole form to tf form using zp2tf
(official docs here).
I followed the docs and entered my p, z and k values:
z = [-100000]';
p = roots([0.005 5.00010060 0.661600001 61.01102010 2.1101 10]);
k = 0.0200;
[b,a] = zp2tf(z,p,k)
I expected to see my original numerator and denominator, however the values are completely different:
Why am I not getting the poles and zeros that I started out with in the original transfer function?
a = [0.005 5.00010060 0.661600001 61.01102010 2.1101 10];
but it is something else in the image – Sardar Usamaa = [0.0005 0.5 0.5596 49.11 0.1121 10]
– Sardar Usama