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(
14471447 else :
14481448 contour = np .exp (splane_contour * sys .dt )
14491449
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+
14501456 # Compute the primary curve
14511457 resp = sys (contour )
14521458
Original file line number Diff line number Diff line change @@ -517,6 +517,15 @@ def test_nyquist_frd():
517517 warnings .resetwarnings ()
518518
519519
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+
520529if __name__ == "__main__" :
521530 #
522531 # Interactive mode: generate plots for manual viewing
You can’t perform that action at this time.
0 commit comments