Repository navigation
-3 dB Bandwidth Function Appears To Only Work For Specific Transfer Functions #1213
Replies: 3 comments 1 reply
|
That nan is expected here, and it is not about series or tf, it is the integrator. ct.bandwidth is defined as the first frequency where the magnitude drops dbdrop dB (default -3) below the DC gain, abs(H(0)). Your open-loop L = GsGc has a pole at the origin (Gs = 20/(0.5 s^2 + s) = 20/(s(0.5 s + 1)) is an integrator), so its DC gain is infinite. With no finite low-frequency level to measure the -3 dB point against, the bandwidth is undefined and the function returns nan. It is documented: the docstring says it returns "nan if the system has infinite dc gain", and the code just does So the pattern is "has an integrator or not", not "simple vs combined". Gc, sys1/2/3 and sys4 all have a finite DC gain, so they return a value. If you call ct.bandwidth(Gs) on its own you get nan too, because Gs has the integrator. I think that is the part that looked inconsistent. What to use instead depends on what you want. If you want the loop bandwidth, take it on the closed loop, which has a finite DC gain: T = ct.feedback(L, 1)
print(ct.bandwidth(T)) # about 2.59 rad/s hereIf you want an open-loop number, "-3 dB below DC" does not apply to an integrator. The usual open-loop measure is the gain-crossover frequency, where abs(L(jw)) = 1 (0 dB): gm, pm, wcg, wcp = ct.margin(L)
print(wcp) # gain-crossover frequency, about 1.58 rad/s hereBoth give you a finite number for your L(s). |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello,
I am attempting to obtain the -3 dB bandwidth of an open-loop transfer function L(s) via the control library. When I attempt to do so, I get a
nandvalue. It appears to work for only the simplest cases. If I pass in either "Gc" or "Gs", a valid value is returned. When I attempt to pass in with both of them passed in as a series combination or passed in as it converted to a "tf" function, a "nand" value is also returned.Can someone please provide a workaround.
Much appreciated.
All reactions