-
Notifications
You must be signed in to change notification settings - Fork 438
Create matlab's equivalent to bandwidth. #690
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Definitely possible, although this can also be done with the output from If you (or someone) want to contribute code to do this, we can put it either in the main package or in the MATLAB compatibility module. |
Here is roughly how I solved it for me, I don't have time for providing a pull request, but maybe someone writing the pull request can get inspired. import scipy
import numpy as np
def bandwidth(sys,dbgain=-3):
result=scipy.optimize.root(lambda s:control.matlab.freqresp(sys,s)[0][0]-control.matlab.dcgain(sys)*10**(dbgain/20),1)
if result.success:
return np.abs(result.x)[0]
else:
raise Exception(result.message) |
Looks like merged #889 closes this? |
I have not used control in years, but I am happy it got solved |
Is it possible to create matlab's equivalent to bandwidth in control?
https://www.mathworks.com/help/control/ref/lti.bandwidth.html
or are there any alternatives available?
The text was updated successfully, but these errors were encountered: