4.125

4.1 | 8 ratings Rate this file 36 Downloads (last 30 days) File Size: 3.4 KB File ID: #10183
image thumbnail

Bode plot with asymptotes

by Trond Andresen

 

28 Feb 2006 (Updated 06 Aug 2008)

Bode plot with asymptotes

| Watch this File

File Information
Description

The function asymp() corresponds to bode(), but it also plots asymptotes for the magnitude and phase graphs. Phase asymptotes are vertical.

asymp() only accepts monovariable transfer functions.

If the transfer function also has a time delay, the time delay is ignored
for the phase asymptotes.

asymp() may be called in two ways only, asymp(h), or asymp(h,wmin,wmax).

Required Products Control System Toolbox
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (12)
02 Mar 2006 Jiro Doke

A similar submission:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=2664&objectType=file

I would appreciate a more comprehensive help text at the top. The code is documented pretty well. There are some coding styles that could be better (i.e. the while loops). Since you are plotting the asymptotes, maybe the function could return the break frequencies and the corresponding slopes of the asymptotes. It can have the same behavior as BODE, in which if there are no output arugments, then it would create a plot, and if there are outputs, then it wouldn't create a plot.

18 Jun 2006 Zain Gurraya  
29 Sep 2006 Anton Cervin

It does not seem to work.

>> G = (s+1)/(s*(s+10))

Transfer function:
  s + 1
----------
s^2 + 10 s

>> asymp(G)
??? Error using ==> axes
Invalid object handle.

Error in ==> asymp at 120
axes(h);

04 Apr 2007 Trond Andresen

I am the author of asymp( ).The problem reported by Anton Cervin has now been fixed. Please tell me if problems still remain.

12 Nov 2007 Trung Duong

It's work. Nice job

04 Dec 2007 Joseph Birbiglia

Very good, but there are errors with the following transfer function:

G(s) = (s^2+1)/(s*(s^2+4))

---------
??? Error using ==> colon
Maximum variable size allowed by the program is exceeded.

Error in ==> asymp at 147
set(get(gcf, 'CurrentAxes'),'YTick',magmin:ydelta:magmax);
----------------

09 Apr 2008 John babs

great stuff. thanks!

12 May 2008 Nabil al-hadawy

******* Thank you **********
This is function (asymp.m) very nice

17 Oct 2009 Robert

i need help...it keeps saying error at asymp at 19

12 Mar 2010 Bennehar Moussâb

You're a Geeeeeeeeeeenius
really, great m file
thanx

12 Mar 2010 Bennehar Moussâb  
06 Jan 2011 Robert Stengel

It doesn't work with this simple test:
    f11 = -1.2794;
    f12 = -7.9856;
    f22 = -1.2709;
    F = [f11 f12;1 f22];
    G = [-f12;0];
    Hx = [1 0];
    B22 = inv(-Hx*inv(F)*G)
    sys = ss(F, G*B22, Hx,0);
    figure
    step(sys), grid
    figure
    bode(sys),grid
    figure
    asymp(sys)

Please login to add a comment or rating.
Updates
16 Mar 2007

Fix error: A reviewer pointed out that a certain transfer function didn't work with the current version.

06 Aug 2008

Bug fix.

Tag Activity for this File
Tag Applied By Date/Time
bode Trond Andresen 22 Oct 2008 08:17:11
asymptotes Trond Andresen 22 Oct 2008 08:17:11
control design Trond Andresen 22 Oct 2008 08:17:11
asymp Trond Andresen 22 Oct 2008 08:17:11
asymp Red Man 13 Mar 2009 05:10:39

Contact us at files@mathworks.com