diff --git a/control/freqplot.py b/control/freqplot.py index 3bc3a0c24..456431f38 100644 --- a/control/freqplot.py +++ b/control/freqplot.py @@ -1447,6 +1447,12 @@ def nyquist_response( else: contour = np.exp(splane_contour * sys.dt) + # Make sure we don't try to evaluate at a pole + if isinstance(sys, (StateSpace, TransferFunction)): + if any([pole in contour for pole in sys.poles()]): + raise RuntimeError( + "attempt to evaluate at a pole; indent required") + # Compute the primary curve resp = sys(contour) diff --git a/control/tests/nyquist_test.py b/control/tests/nyquist_test.py index 0d6907b64..8d6fd8561 100644 --- a/control/tests/nyquist_test.py +++ b/control/tests/nyquist_test.py @@ -517,6 +517,15 @@ def test_nyquist_frd(): warnings.resetwarnings() +def test_no_indent_pole(): + s = ct.tf('s') + sys = ((1 + 5/s)/(1 + 0.5/s))**2 # Double-Lag-Compensator + + with pytest.raises(RuntimeError, match="evaluate at a pole"): + resp = ct.nyquist_response( + sys, warn_encirclements=False, indent_direction='none') + + if __name__ == "__main__": # # Interactive mode: generate plots for manual viewing pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy