0
$\begingroup$

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.

$\endgroup$
1
$\begingroup$

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.

$\endgroup$
  • $\begingroup$ I know. But I trying to cansle out zeros with poles, then use zpk function . $\endgroup$ – Daniel Mårtensson Oct 15 '17 at 11:05
  • $\begingroup$ If you know, why do you ask then? I don't see how zpk is related to this. You can of course use zpk on both $G$ and $G_{\text{min}}$. The first will contain all poles and zeros, the second will only contain those that were not cancelled out, just as one would expect. $\endgroup$ – SampleTime Oct 15 '17 at 11:09
  • $\begingroup$ Here is my question "If I have the numerators and denomerators from$ G (s) $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." $\endgroup$ – Daniel Mårtensson Oct 15 '17 at 11:14
  • $\begingroup$ Thats exactly the same question as in the original post which I already answered: use minreal. $\endgroup$ – SampleTime Oct 15 '17 at 11:44
  • $\begingroup$ I posted the answer here now. :) $\endgroup$ – Daniel Mårtensson Oct 15 '17 at 11:45
0
$\begingroup$

Here is the answer:

>> [a,b,c] = intersect(round(z*1/tol)*tol, round(p*1/tol)*tol)
z(b) = []
p(c) = []
G = zpk(z, p, k)

Done!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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