@@ -186,16 +186,30 @@ def test_nyquist_indent():
186
186
# FBS Figure 10.10
187
187
s = ct .tf ('s' )
188
188
sys = 3 * (s + 6 )** 2 / (s * (s + 1 )** 2 )
189
+ # poles: [-1, -1, 0]
189
190
190
191
plt .figure ();
191
192
count = ct .nyquist_plot (sys )
192
193
plt .title ("Pole at origin; indent_radius=default" )
193
194
assert _Z (sys )== count + _P (sys )
194
195
196
+ # first value of default omega vector was 0.1, replaced by 0. for contour
197
+ # indent_radius is larger than 0.1 -> no extra quater circle around origin
198
+ count ,contour = ct .nyquist_plot (sys ,plot = False ,indent_radius = .1007 ,
199
+ return_contour = True )
200
+ np .testing .assert_allclose (contour [0 ],.1007 + 0.j )
201
+ # second value of omega_vector is larger than indent_radius: not indented
202
+ assert np .all (contour .real [2 :]== 0. )
203
+
195
204
plt .figure ();
196
- count = ct .nyquist_plot (sys ,indent_radius = 0.01 )
205
+ count ,contour = ct .nyquist_plot (sys ,indent_radius = 0.01 ,
206
+ return_contour = True )
197
207
plt .title ("Pole at origin; indent_radius=0.01; encirclements = %d" % count )
198
208
assert _Z (sys )== count + _P (sys )
209
+ # indent radius is smaller than the start of the default omega vector
210
+ # check that a quarter circle around the pole at origin has been added.
211
+ np .testing .assert_allclose (contour [:50 ].real ** 2 + contour [:50 ].imag ** 2 ,
212
+ 0.01 ** 2 )
199
213
200
214
plt .figure ();
201
215
count = ct .nyquist_plot (sys ,indent_direction = 'left' )