File Exchange

image thumbnail

Pade Approximation

Computes the reduced order model for a given system by matching time moments

5 Downloads

Updated

View License

Given a transfer function G, the script computes an approximate reduced order model of the system using the technique of moment matching.
If
R=Pade_Approximation(G,r)

If the power series expansion of G is
G=c0+c1*s+c2*s^2+...+c_(2r)s^(2r)+c_(2r+1)s^(2r+1)+...
and then that of R would be
R=c0+c1*s+c2*s^2+...+c_(2r)s^(2r)+.....
with the first 2r coefficients of both series being matched.

Comments and Ratings (2)

Lee Ziyang

Seis Erres

Nice function especially useful for reducing systems coming from matlab linearizations.

There is a little mistake in the code easily catch by M-lint

wrong

if ~isreal(r) || (fix(r)~=r) || (r<1) || (r>n) %%% here n is undefined
error('Invalid value of reduced model order')
end
[num,den]=tfdata(G,'v');
D_fact=num(1)/den(1);
num=num-D_fact*den;
num1=num(end:-1:1)/den(1);
den1=den(end:-1:1)/den(1);
n=length(den1)-1;

right

[num,den]=tfdata(G,'v');
D_fact=num(1)/den(1);
num=num-D_fact*den;
num1=num(end:-1:1)/den(1);
den1=den(end:-1:1)/den(1);
n=length(den1)-1;

if ~isreal(r) || (fix(r)~=r) || (r<1) || (r>n)
error('Invalid value of reduced model order')
end

I would like to know if the author agree with this correction.

Apart from this correction the function works nicely. I find it very useful and I thank the author for sharing it.

Regards.

MATLAB Release
MATLAB 7 (R14)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video