Skip to content
Prev Previous commit
Next Next commit
Fixing a possible mistake
  • Loading branch information
joaoantoniocardoso committed Apr 17, 2019
commit 90374b62030839a78561723017b0f67adbd5ff04
6 changes: 4 additions & 2 deletions control/timeresp.py
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,10 @@ def step_info(sys, T=None, SettlingTimeThreshold=0.02, RiseTimeLimits=(0.1,0.9))
inf_margin = (1. - SettlingTimeThreshold) * InfValue
# find Steady State looking for the first point out of specified limits
for i in reversed(range(T.size)):
if((yout[i] <= inf_margin) | (yout[i] >= sup_margin)):
SettlingTime = T[i + 1]
if (yout[i] <= inf_margin) | (yout[i] >= sup_margin):
if T.size > i + 1:
i = i + 1
SettlingTime = T[i]
break

# Peak
Expand Down