8000 simplify undershoot calculation · lesreaper/python-control@14a92fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 14a92fe

Browse files
committed
simplify undershoot calculation
1 parent 11d89b3 commit 14a92fe

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

control/timeresp.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -923,11 +923,11 @@ def step_info(sysdata, T=None, T_num=None, yfinal=None,
923923
else:
924924
overshoot = 0
925925

926-
# Undershoot
927-
y_us = (sgnInf*yout).min()
928-
y_us_index = (sgnInf*yout).argmin()
929-
if (sgnInf * yout[y_us_index]) < 0: # InfValue and undershoot must have opposite sign
930-
undershoot = np.abs(100. * np.abs(y_us) / InfValue)
926+
# Undershoot : InfValue and undershoot must have opposite sign
927+
y_us_index = (sgnInf * yout).argmin()
928+
y_us = yout[y_us_index]
929+
if (sgnInf * y_us) < 0:
930+
undershoot = (-100. * y_us / InfValue)
931931
else:
932932
undershoot = 0
933933

0 commit comments

Comments
 (0)
0