[Math] How to make a minimal realization of a transfer function

control theorylinear-controlMATLABoptimal control

Let's say that I have this transfer function.

$$G (s) = \frac {s^4 + 4s^3 + 7s^2 + 10s + 8}{s^5 + 6s^4 + 15s^3 + 25s^2 + 32s + 20}$$

And with MATLAB function minreal, I can get this transfer function

$$G_{min} (s) = \frac {s^3 + 2s^2 + 3s + 4}{s^4 + 4s^3 + 7s^2 + 11s +10}$$

If I have the numerators and denomerators from $G (s) $ in two vectors $num, den $. Which MATLAB command should I use to cansle out poles against zeros so I can get the minimal realization?

I have the poles and zeros in two separate vectors. How can I (easy) use MATLAB 's smart functions to check if I have equation zeros and poles and I have, remove them.

Best Answer

The command you are looking for is minreal:

num = [1, 4, 7, 10, 8];
den = [1, 6, 15, 25, 32, 20];

G = tf(num, den);

tol = 1.0e-9;

G_min = minreal(G, tol);

Gives you the desired minimal realization. Here, tol is the tolerance which is used for comparing poles and zeros.

Related Question