Re: bode diagram
- To: mathgroup at smc.vnet.net
- Subject: [mg57098] Re: bode diagram
- From: "Nasser Abbasi" <nma at 12000.org>
- Date: Sun, 15 May 2005 03:03:57 -0400 (EDT)
- References: <d64fjl$9gl$1@smc.vnet.net>
- Reply-to: "Nasser Abbasi" <nma at 12000.org>
- Sender: owner-wri-mathgroup at wolfram.com
"DrBob" <drbob at bigfoot.com> wrote in message news:d64fjl$9gl$1 at smc.vnet.net... > 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? DrBob; In example 4, when the phase reached -180 degree, it should continue in the same direction, i.e. -185, -190, etc.. i.e. around the circle in the same clockwise direction. (for purposes of plotting). However, when taking the Arg[], when the phase actually went from -180 to say -181, Arg will return the angle as +179 and not -181 degree as what happens in the 'normal' Bode plots. This is what causing the sudden jump you see in your phase diagram for this example. Notice that in all the other phase plots, the angle happened to remain in the 'bottom' half of the circle, i.e. from 0 to -180, and so this effect did not show up there. Nasser > > 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 > > > > > > 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* > > > -- > DrBob at bigfoot.com >