@@ -740,7 +740,7 @@ def step_response(sys, T=None, X0=0., input=None, output=None, T_num=None,
740
740
741
741
def step_info (sys , T = None , T_num = None , SettlingTimeThreshold = 0.02 ,
742
742
RiseTimeLimits = (0.1 , 0.9 )):
743
- '''
743
+ """
744
744
Step response characteristics (Rise time, Settling Time, Peak and others).
745
745
746
746
Parameters
@@ -781,7 +781,9 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
781
781
SteadyStateValue:
782
782
Steady-state value
783
783
784
- If `sys` is a MIMO system, S is a 2D-List of dicts.
784
+ If `sys` is a MIMO system, `S` is a 2D list of dicts. To get the
785
+ step response characteristics from the j-th input to the i-th output,
786
+ access ``S[i][j]``
785
787
786
788
787
789
See Also
@@ -790,8 +792,47 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
790
792
791
793
Examples
792
794
--------
793
- >>> info = step_info(sys, T)
794
- '''
795
+ >>> from control import step_info, TransferFunction
796
+ >>> sys = TransferFunction([-1, 1], [1, 1, 1])
797
+ >>> S = step_info(sys)
798
+ >>> for k in S:
799
+ ... print(f"{k}: {S[k]:3.4}")
800
+ ...
801
+ RiseTime: 1.256
802
+ SettlingTime: 9.071
803
+ SettlingMin: 0.9011
804
+ SettlingMax: 1.208
805
+ Overshoot: 20.85
806
+ Undershoot: 27.88
807
+ Peak: 1.208
808
+ PeakTime: 4.187
809
+ SteadyStateValue: 1.0
810
+
811
+ MIMO System: Simulate until a final time of 10. Get the step response
812
+ characteristics for the second input and specify a 5% error until the
813
+ signal is considered settled.
814
+
815
+ >>> from numpy import sqrt
816
+ >>> from control import step_info, StateSpace
817
+ >>> sys = StateSpace([[-1., -1.],
818
+ ... [1., 0.]],
819
+ ... [[-1./sqrt(2.), 1./sqrt(2.)],
820
+ ... [0, 0]],
821
+ ... [[sqrt(2.), -sqrt(2.)]],
822
+ ... [[0, 0]])
823
+ >>> S = step_info(sys, T=10., SettlingTimeThreshold=0.05)
824
+ >>> for k, v in S[0][1].items():
825
+ ... print(f"{k}: {float(v):3.4}")
826
+ RiseTime: 1.212
827
+ SettlingTime: 6.061
828
+ SettlingMin: -1.209
829
+ SettlingMax: -0.9184
830
+ Overshoot: 20.87
831
+ Undershoot: 28.02
832
+ Peak: 1.209
833
+ PeakTime: 4.242
834
+ SteadyStateValue: -1.0
835
+ """
795
836
if T is None or np .asarray (T ).size == 1 :
796
837
T = _default_time_vector (sys , N = T_num , tfinal = T , is_step = True )
797
838
T , Yout = step_response (sys , T , squeeze = False )
0 commit comments