Skip to content

Commit 6e4d14f

Browse files
committed
add book reference of root locus calculation.
fix a minor bug.
1 parent 6c813ce commit 6e4d14f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

control/rlocus.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None, plotstr='-', Plot=True,
143143

144144

145145
def _default_gains(num, den, xlim, ylim):
146-
"""Unsupervised gains calculation for root locus plot"""
146+
"""Unsupervised gains calculation for root locus plot.
147+
148+
References:
149+
Ogata, K. (2002). Modern control engineering (4th ed.). Upper Saddle River, NJ : New Delhi: Prentice Hall.."""
150+
147151
k_break, real_break = _break_points(num, den)
148152
kmax = _k_max(num, den, real_break, k_break)
149153
kvect = np.hstack((np.linspace(0, kmax, 50), np.real(k_break)))
@@ -169,7 +173,7 @@ def _default_gains(num, den, xlim, ylim):
169173
"locus with equal order of numerator and denominator.")
170174

171175
if xlim is None and false_gain > 0:
172-
x_tolerance = 0.03 * (np.max(np.real(mymat_xl)) - np.min(np.real(mymat_xl)))
176+
x_tolerance = 0.05 * (np.max(np.real(mymat_xl)) - np.min(np.real(mymat_xl)))
173177
xlim = _ax_lim(mymat_xl)
174178
elif xlim is None and false_gain < 0:
175179
axmin = np.min(np.real(important_points))-(np.max(np.real(important_points))-np.min(np.real(important_points)))

0 commit comments

Comments
 (0)