Skip to content

Nyquist plot improvements #534

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

Merged
merged 8 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion control/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ def reset_defaults():
# System level defaults
defaults.update(_control_defaults)

from .freqplot import _bode_defaults, _freqplot_defaults
from .freqplot import _bode_defaults, _freqplot_defaults, _nyquist_defaults
defaults.update(_bode_defaults)
defaults.update(_freqplot_defaults)
defaults.update(_nyquist_defaults)

from .nichols import _nichols_defaults
defaults.update(_nichols_defaults)
Expand Down Expand Up @@ -138,9 +139,11 @@ def use_fbs_defaults():
The following conventions are used:
* Bode plots plot gain in powers of ten, phase in degrees,
frequency in rad/sec, no grid
* Nyquist plots use dashed lines for mirror image of Nyquist curve

"""
set_defaults('bode', dB=False, deg=True, Hz=False, grid=False)
set_defaults('nyquist', mirror_style='--')


# Decide whether to use numpy.matrix for state space operations
Expand Down Expand Up @@ -239,4 +242,7 @@ def use_legacy_defaults(version):
# time responses are only squeezed if SISO
set_defaults('control', squeeze_time_response=True)

# switched mirror_style of nyquist from '-' to '--'
set_defaults('nyqist', mirror_style='-')

return (major, minor, patch)
5 changes: 3 additions & 2 deletions control/descfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,9 @@ def describing_function_plot(

"""
# Start by drawing a Nyquist curve
H_real, H_imag, H_omega = nyquist_plot(H, omega, plot=True, **kwargs)
H_vals = H_real + 1j * H_imag
count, contour = nyquist_plot(
H, omega, plot=True, return_contour=True, **kwargs)
H_omega, H_vals = contour.imag, H(contour)

# Compute the describing function
df = describing_function(F, A)
Expand Down
Loading