Skip to content

Commit 95ca297

Browse files
authored
Update timeresp.py
1 parent a95f75f commit 95ca297

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

control/timeresp.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,6 @@ def step_info(sysdata, T=None, T_num=None, yfinal=None,
882882

883883
# Steady state value
884884
InfValue = InfValues[i, j]
885-
InfValue_sign = np.sign(InfValue)
886885
sgnInf = np.sign(InfValue.real)
887886

888887
rise_time: float = np.NaN
@@ -925,9 +924,9 @@ def step_info(sysdata, T=None, T_num=None, yfinal=None,
925924
overshoot = 0
926925

927926
# Undershoot
928-
y_us = (InfValue_sign*yout).min()
929-
y_us_index = (InfValue_sign*yout).argmin()
930-
if (InfValue_sign * yout[y_us_index]) < 0: # must have oposite sign
927+
y_us = (sgnInf*yout).min()
928+
y_us_index = (sgnInf*yout).argmin()
929+
if (sgnInf * yout[y_us_index]) < 0: # must have oposite sign
931930
undershoot = np.abs(100. * np.abs(y_us) / InfValue)
932931
else:
933932
undershoot = 0

0 commit comments

Comments
 (0)