File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1447,6 +1447,12 @@ def nyquist_response(
1447
1447
else :
1448
1448
contour = np .exp (splane_contour * sys .dt )
1449
1449
1450
+ # Make sure we don't try to evaluate at a pole
1451
+ if isinstance (sys , (StateSpace , TransferFunction )):
1452
+ if any ([pole in contour for pole in sys .poles ()]):
1453
+ raise RuntimeError (
1454
+ "attempt to evaluate at a pole; indent required" )
1455
+
1450
1456
# Compute the primary curve
1451
1457
resp = sys (contour )
1452
1458
Original file line number Diff line number Diff line change @@ -517,6 +517,15 @@ def test_nyquist_frd():
517
517
warnings .resetwarnings ()
518
518
519
519
520
+ def test_no_indent_pole ():
521
+ s = ct .tf ('s' )
522
+ sys = ((1 + 5 / s )/ (1 + 0.5 / s ))** 2 # Double-Lag-Compensator
523
+
524
+ with pytest .raises (RuntimeError , match = "evaluate at a pole" ):
525
+ resp = ct .nyquist_response (
526
+ sys , warn_encirclements = False , indent_direction = 'none' )
527
+
528
+
520
529
if __name__ == "__main__" :
521
530
#
522
531
# Interactive mode: generate plots for manual viewing
You can’t perform that action at this time.
0 commit comments