@@ -793,16 +793,17 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
793
793
--------
794
794
>>> info = step_info(sys, T)
795
795
'''
796
-
797
-
798
- if T is None or np .asarray (T ).size == 1 :
799
- T = _default_time_vector (sys , N = T_num , tfinal = T , is_step = True )
800
-
801
- ret = [[None ] * sys .ninputs ] * sys .noutputs
796
+ ret = []
802
797
for i in range (sys .noutputs ):
798
+ retrow = []
803
799
for j in range (sys .ninputs ):
804
800
sys_siso = sys [i , j ]
805
- T , yout = step_response (sys_siso , T )
801
+ if T is None or np .asarray (T ).size == 1 :
802
+ Ti = _default_time_vector (sys_siso , N = T_num , tfinal = T ,
803
+ is_step = True )
804
+ else :
805
+ Ti = T
806
+ Ti , yout = step_response (sys_siso , Ti )
806
807
807
808
# Steady state value
808
809
InfValue = sys_siso .dcgain ()
@@ -826,12 +827,12 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
826
827
tr_upper_index = np .where (
827
828
sgnInf * (yout - RiseTimeLimits [1 ] * InfValue ) >= 0
828
829
)[0 ][0 ]
829
- rise_time = T [tr_upper_index ] - T [tr_lower_index ]
830
+ rise_time = Ti [tr_upper_index ] - Ti [tr_lower_index ]
830
831
831
832
# SettlingTime
832
833
settling_th = np .abs (SettlingTimeThreshold * InfValue )
833
834
not_settled = np .where (np .abs (yout - InfValue ) >= settling_th )
834
- settling_time = T [not_settled [0 ][- 1 ] + 1 ]
835
+ settling_time = Ti [not_settled [0 ][- 1 ] + 1 ]
835
836
836
837
settling_min = (yout [tr_upper_index :]).min ()
837
838
settling_max = (yout [tr_upper_index :]).max ()
@@ -855,12 +856,12 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
855
856
# Peak
856
857
peak_index = np .abs (yout ).argmax ()
857
858
peak_value = np .abs (yout [peak_index ])
858
- peak_time = T [peak_index ]
859
+ peak_time = Ti [peak_index ]
859
860
860
861
# SteadyStateValue
861
862
steady_state_value = InfValue
862
863
863
- ret [ i ][ j ] = {
864
+ retij = {
864
865
'RiseTime' : rise_time ,
865
866
'SettlingTime' : settling_time ,
866
867
'SettlingMin' : settling_min ,
@@ -871,6 +872,9 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
871
872
'PeakTime' : peak_time ,
872
873
'SteadyStateValue' : steady_state_value
873
874
}
875
+ retrow .append (retij )
876
+
877
+ ret .append (retrow )
874
878
875
879
return ret [0 ][0 ] if sys .issiso () else ret
876
880
0 commit comments