We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 854f5f7 commit a709dd6Copy full SHA for a709dd6
control/lti.py
@@ -211,8 +211,14 @@ def bandwidth(self, dbdrop=-3):
211
# solve for the bandwidth, use scipy.optimize.root_scalar() to
212
# solve using bisection
213
import scipy
214
+
215
+ if self.isdtime(strict=True):
216
+ cvt_w = lambda w: np.exp(1j * w * self.dt)
217
+ else:
218
+ cvt_w = lambda w: 1j * w
219
220
result = scipy.optimize.root_scalar(
- lambda w: np.abs(self(w*1j)) - np.abs(dcgain)*10**(dbdrop/20),
221
+ lambda w: np.abs(self(cvt_w(w))) - np.abs(dcgain)*10**(dbdrop/20),
222
bracket=[omega[idx_dropped[0] - 1], omega[idx_dropped[0]]],
223
method='bisect')
224
0 commit comments