Re: Re: Re: Re: bode diagram

*To*: mathgroup at smc.vnet.net*Subject*: [mg57097] Re: [mg57075] Re: [mg57040] Re: [mg57016] Re: [mg56979] bode diagram*From*: Pratik Desai <pdesai1 at umbc.edu>*Date*: Sun, 15 May 2005 03:03:55 -0400 (EDT)*References*: <200505140858.EAA09479@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

DrBob wrote: >I used the code below for each example at the link: > >http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/BodeRules.html#Examples > >In several cases I got what appears to be the same result as pictured at the link, but in other cases I got very different plots. The fourth example is particularly strange. Am I doing this wrong? > >I'm plotting magnitude and phase on a single plot in each case, and I'm ONLY plotting the exact curves -- assuming I have the right formulae for them. I see no point in approximate plotting techniques, with exact plots readily available. > >Needs["Graphics`Graphics`"] >SetOptions[LogLinearPlot, PlotStyle -> > {Red, Blue}, PlotRange -> All, > ImageSize -> 500]; >db = 20*Log[10, Abs[#1]] & ; > >Clear[h] >h[s_] = 100/(s + 20); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 1, 10^3}]; > >h[s_] = (100*s + 100)/(s^2 + 110*s + 1000); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 10^(-2), 10^4}]; > >h[s_] = 10*((s + 10)/(s^2 + 3*s)); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 10^(-1), 10^3}]; > >h[s_] = (-100*s)/(s^3 + 12*s^2 + 21*s + 10); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 10^(-2), 10^3}]; > >h[s_] = 30*((s + 10)/(s^2 + 3*s + 50)); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 10^(-1), 10^3}]; > >h[s_] = 4*((s^2 + s + 25)/(s^3 + 100*s^2)); >LogLinearPlot[{db[h[s]], Arg[h[I*s]]*(180/Pi)}, > {s, 10^(-1), 10^3}]; > >Bobby > >From: Pratik Desai <pdesai1 at umbc.edu> To: mathgroup at smc.vnet.net >References: <200505120633.CAA08967 at smc.vnet.net> > >David Park wrote: > > > >>I'm fairly certain it could be done with Mathematica if you would only tell >>us what a bode diagram is and give us some sample data of function that you >>want to plot in the diagram. >> >>David Park >>djmp at earthlink.net >>http://home.earthlink.net/~djmp/ >> >>From: GaLoIs [mailto:lanellomancante at inwind.it] To: mathgroup at smc.vnet.net >> >> >To: mathgroup at smc.vnet.net > > >>hi, like plotting simple bode diagrams of systems. could you give me some >>information about it? i can do it with another program, but i'd like to see >>how mathematica works >>thank you >> >> >> >> >> >> >> >> >> >Here is a nice example from a website I found. > >*http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/Bode.html* > > > > The plot look excellent... In standard practice one replaces the laplace variable s with I*w.. w is the frequency of the input signal. Usually the magnitude and phase plots are plotted in seperate plot, furthermore it would be nice to have the gridlines for the log scale frequency (I tried but the gridlines option is not available for the LogLinear Plot Needs["Graphics`Graphics`"] SetOptions[LogLinearPlot, PlotStyle -> {Red, Blue}, PlotRange -> All, ImageSize -> 500]; db = 20*Log[10, Abs[#1]] &; Clear[h] s = I*w h[s_] = 100/(s + 30); LogLinearPlot[db[h[s]], {w, 1, 10^3}]; LogLinearPlot[Arg[h[s]]*(180/Pi), {w, 1, 10^3}]; > I see no point in approximate plotting techniques, with exact plots readily available. > > Sometimes one has to get a qualitative view of the problem, hence using the assymptotic approach one can plot the bode diagram quickly, and for example one can identify corner frequencies--places where the plot suddenly changes. The corner frequency distinguish the bode plot in to high frequency response region and low frequency response region which can be used to design filters in DSP. Furthermore, the error due to the approximation is known and is about -3db. >The fourth example is particularly strange > http://www.swarthmore.edu/NatSci/echeeve1/Ref/Bode/Example4/index.html If you start you starting plot point at 10^-3 as in the example you will get the same magnitude plot with corner frequency at 1. However the phase plot is troublesome. I think the reason is that the system has a zero at the origin, like a corner frequency hence the plot flips from negative to poisitive and vice versa Pratik -- Pratik Desai Graduate Student UMBC Department of Mechanical Engineering Phone: 410 455 8134

**References**:**Re: Re: Re: bode diagram***From:*DrBob <drbob@bigfoot.com>