Code covered by the BSD License  

Highlights from
Pade Approximation

4.0

4.0 | 2 ratings Rate this file 10 Downloads (last 30 days) File Size: 1.75 KB File ID: #21466

Pade Approximation

by Janardhanan Sivaramakrishnan

 

18 Sep 2008 (Updated 19 Sep 2008)

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

| Watch this File

File Information
Description

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.

Required Products Control System Toolbox
MATLAB release MATLAB 7 (R14)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
24 Jul 2009 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.

02 Feb 2012 Lee Ziyang  
Please login to add a comment or rating.
Updates
19 Sep 2008

Corrected : Errors in handing number of inputs/outputs.

Tag Activity for this File
Tag Applied By Date/Time
pade Janardhanan Sivaramakrishnan 22 Oct 2008 10:19:57
model reduction Janardhanan Sivaramakrishnan 22 Oct 2008 10:19:57
moment matching Janardhanan Sivaramakrishnan 22 Oct 2008 10:19:57
design Janardhanan Sivaramakrishnan 22 Oct 2008 10:19:57

Contact us at files@mathworks.com