Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaaa2aba

Browse files
committed
fix bug in root_locus_plot identified by@NikolaiVChr in issue#1016
1 parentfeeb56a commitaaa2aba

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

‎control/pzmap.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -496,19 +496,17 @@ def _find_root_locus_gain(event, sys, ax):
496496
# Get the current axis limits to set various thresholds
497497
xlim,ylim=ax.get_xlim(),ax.get_ylim()
498498

499-
# Catch type error when event click is in the figure but notin an axis
499+
# Catch type error when event click is in the figure but noton curve
500500
try:
501501
s=complex(event.xdata,event.ydata)
502502
K=-1./sys(s)
503503
K_xlim=-1./sys(
504504
complex(event.xdata+0.05*abs(xlim[1]-xlim[0]),event.ydata))
505505
K_ylim=-1./sys(
506506
complex(event.xdata,event.ydata+0.05*abs(ylim[1]-ylim[0])))
507-
508507
exceptTypeError:
509-
K=float('inf')
510-
K_xlim=float('inf')
511-
K_ylim=float('inf')
508+
K,s=float('inf'),None
509+
K_xlim=K_ylim=float('inf')
512510

513511
#
514512
# Compute tolerances for deciding if we clicked on the root locus
@@ -526,9 +524,8 @@ def _find_root_locus_gain(event, sys, ax):
526524
ifabs(K.real)>1e-8andabs(K.imag/K.real)<gain_toleranceand \
527525
event.inaxes==ax.axesandK.real>0.:
528526
returnK.real,s
529-
530527
else:
531-
returnNone,s
528+
returnNone,None
532529

533530

534531
# Mark points corresponding to a given gain on root locus plot

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp