Skip to content

Commit

Permalink
add book reference of root locus calculation.
Browse files Browse the repository at this point in the history
fix a minor bug.
  • Loading branch information
gonmolina committed Jun 13, 2017
1 parent 6c813ce commit 6e4d14f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions control/rlocus.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ def root_locus(sys, kvect=None, xlim=None, ylim=None, plotstr='-', Plot=True,


def _default_gains(num, den, xlim, ylim):
"""Unsupervised gains calculation for root locus plot"""
"""Unsupervised gains calculation for root locus plot.
References:
Ogata, K. (2002). Modern control engineering (4th ed.). Upper Saddle River, NJ : New Delhi: Prentice Hall.."""

k_break, real_break = _break_points(num, den)
kmax = _k_max(num, den, real_break, k_break)
kvect = np.hstack((np.linspace(0, kmax, 50), np.real(k_break)))
Expand All @@ -169,7 +173,7 @@ def _default_gains(num, den, xlim, ylim):
"locus with equal order of numerator and denominator.")

if xlim is None and false_gain > 0:
x_tolerance = 0.03 * (np.max(np.real(mymat_xl)) - np.min(np.real(mymat_xl)))
x_tolerance = 0.05 * (np.max(np.real(mymat_xl)) - np.min(np.real(mymat_xl)))
xlim = _ax_lim(mymat_xl)
elif xlim is None and false_gain < 0:
axmin = np.min(np.real(important_points))-(np.max(np.real(important_points))-np.min(np.real(important_points)))
Expand Down

0 comments on commit 6e4d14f

Please sign in to comment.