-
Notifications
You must be signed in to change notification settings - Fork 418
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
Fix for bug in margin.py #58
Comments
Good catch--thanks @callawaycass Now that you pointed this out, it seems inconsistent for this routine to take phase inputs in degrees, while
but the units of phase are wrong. So I wonder if we should change |
Fixes python-control#58. The documentation is also updated to specify the units of the inputs and outputs. Also, previously there was an optional argument `deg` which the docstring claimed was used to specify the units of the input/output phases, but this was never actually used in the implementation. This commit removes that optional argument.
Fixes python-control#58. The documentation is also updated to specify the units of the inputs and outputs. Also, previously there was an optional argument `deg` which the docstring claimed was used to specify the units of the input/output phases, but this was never actually used in the implementation. This commit removes that optional argument.
Calling margin() or stability_margins() with (mag, phase, omega) form yields incorrect result. I found that the issue is in line 125 of margin.py, where it calls frdata.FRD to create the system:
The phase angle conversion is incorrect. Changing this line to:
yields the correct result. Also, it may be good to clearly indicate that the magnitude data in this form must be absolute magnitude, not dB, and that the phase must be in degrees. The frequency can be either Hz or rad/s... the output frequency is in the same units as whatever you put in (Matlab's documentation has a similar note).
The text was updated successfully, but these errors were encountered: