Skip to content

Commit f1a9860

Browse files
authored
Merge pull request #600 from bnavigator/fix-598
Include InfValue into settling min/max calculation for step_info
2 parents 9edc768 + e06197c commit f1a9860

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

control/tests/timeresp_test.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,23 @@ def siso_tf_kneg(self):
243243
'SteadyStateValue': -1.0}
244244
return T
245245

246+
@pytest.fixture
247+
def siso_tf_asymptotic_from_neg1(self):
248+
# Peak_value = Undershoot = y_final(y(t=inf))
249+
T = TSys(TransferFunction([-1, 1], [1, 1]))
250+
T.step_info = {
251+
'RiseTime': 2.197,
252+
'SettlingTime': 4.605,
253+
'SettlingMin': 0.9,
254+
'SettlingMax': 1.0,
255+
'Overshoot': 0,
256+
'Undershoot': 100.0,
257+
'Peak': 1.0,
258+
'PeakTime': 0.0,
259+
'SteadyStateValue': 1.0}
260+
T.kwargs = {'step_info': {'T': np.arange(0, 5, 1e-3)}}
261+
return T
262+
246263
@pytest.fixture
247264
def siso_tf_step_matlab(self):
248265
# example from matlab online help
@@ -348,7 +365,8 @@ def tsystem(self,
348365
pole_cancellation, no_pole_cancellation, siso_tf_type1,
349366
siso_tf_kpos, siso_tf_kneg,
350367
siso_tf_step_matlab, siso_ss_step_matlab,
351-
mimo_ss_step_matlab, mimo_tf_step_info):
368+
mimo_ss_step_matlab, mimo_tf_step_info,
369+
siso_tf_asymptotic_from_neg1):
352370
systems = {"siso_ss1": siso_ss1,
353371
"siso_ss2": siso_ss2,
354372
"siso_tf1": siso_tf1,
@@ -373,6 +391,7 @@ def tsystem(self,
373391
"siso_ss_step_matlab": siso_ss_step_matlab,
374392
"mimo_ss_step_matlab": mimo_ss_step_matlab,
375393
"mimo_tf_step": mimo_tf_step_info,
394+
"siso_tf_asymptotic_from_neg1": siso_tf_asymptotic_from_neg1,
376395
}
377396
return systems[request.param]
378397

@@ -466,7 +485,8 @@ def assert_step_info_match(self, sys, info, info_ref):
466485
"siso_ss_step_matlab",
467486
"siso_tf_kpos",
468487
"siso_tf_kneg",
469-
"siso_tf_type1"],
488+
"siso_tf_type1",
489+
"siso_tf_asymptotic_from_neg1"],
470490
indirect=["tsystem"])
471491
def test_step_info(self, tsystem, systype, time_2d, yfinal):
472492
"""Test step info for SISO systems."""

control/timeresp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,8 @@ def step_info(sysdata, T=None, T_num=None, yfinal=None,
912912
if settled < len(T):
913913
settling_time = T[settled]
914914

915-
settling_min = (yout[tr_upper_index:]).min()
916-
settling_max = (yout[tr_upper_index:]).max()
915+
settling_min = min((yout[tr_upper_index:]).min(), InfValue)
916+
settling_max = max((yout[tr_upper_index:]).max(), InfValue)
917917

918918
# Overshoot
919919
y_os = (sgnInf * yout).max()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy