control.step_info
- control.step_info(sysdata, timepts=None, timepts_num=None, final_output=None, params=None, SettlingTimeThreshold=0.02, RiseTimeLimits=(0.1, 0.9), **kwargs)[source]
Step response characteristics (rise time, settling time, etc).
- Parameters
- sysdata
StateSpace
orTransferFunction
or array_like The system data. Either LTI system to simulate (
StateSpace
,TransferFunction
), or a time series of step response data.- timepts (or T)array_like or float, optional
Time vector, or simulation time duration if a number (time vector is auto-computed if not given, see
step_response
for more detail). Required, if sysdata is a time series of response data.- timepts_num (or T_num)int, optional
Number of time steps to use in simulation if
T
is not provided as an array; auto-computed if not given; ignored if sysdata is a discrete-time system or a time series or response data.- final_output (or yfinal)scalar or array_like, optional
Steady-state response. If not given, sysdata.dcgain() is used for systems to simulate and the last value of the the response data is used for a given time series of response data. Scalar for SISO, (noutputs, ninputs) array_like for MIMO systems.
- paramsdict, optional
If system is a nonlinear I/O system, set parameter values.
- SettlingTimeThresholdfloat, optional
Defines the error to compute settling time (default = 0.02).
- RiseTimeLimitstuple (lower_threshold, upper_threshold)
Defines the lower and upper threshold for RiseTime computation.
- sysdata
- Returns
- Sdict or list of list of dict
If
sysdata
corresponds to a SISO system,S
is a dictionary containing:‘RiseTime’: Time from 10% to 90% of the steady-state value.
‘SettlingTime’: Time to enter inside a default error of 2%.
‘SettlingMin’: Minimum value after
RiseTime
.‘SettlingMax’: Maximum value after
RiseTime
.‘Overshoot’: Percentage of the peak relative to steady value.
‘Undershoot’: Percentage of undershoot.
‘Peak’: Absolute peak value.
‘PeakTime’: Time that the first peak value is obtained.
‘SteadyStateValue’: Steady-state value.
If
sysdata
corresponds to a MIMO system,S
is a 2D list of dicts. To get the step response characteristics from the jth input to the ith output, accessS[i][j]
.
See also
Examples
>>> sys = ct.TransferFunction([-1, 1], [1, 1, 1]) >>> S = ct.step_info(sys) >>> for k in S: ... print(f"{k}: {S[k]:3.4}") ... RiseTime: 1.256 SettlingTime: 9.071 SettlingMin: 0.9011 SettlingMax: 1.208 Overshoot: 20.85 Undershoot: 27.88 Peak: 1.208 PeakTime: 4.187 SteadyStateValue: 1.0
MIMO System: Simulate until a final time of 10. Get the step response characteristics for the second input and specify a 5% error until the signal is considered settled.
>>> from math import sqrt >>> sys = ct.StateSpace([[-1., -1.], ... [1., 0.]], ... [[-1./sqrt(2.), 1./sqrt(2.)], ... [0, 0]], ... [[sqrt(2.), -sqrt(2.)]], ... [[0, 0]]) >>> S = ct.step_info(sys, T=10., SettlingTimeThreshold=0.05) >>> for k, v in S[0][1].items(): ... print(f"{k}: {float(v):3.4}") RiseTime: 1.212 SettlingTime: 6.061 SettlingMin: -1.209 SettlingMax: -0.9184 Overshoot: 20.87 Undershoot: 28.02 Peak: 1.209 PeakTime: 4.242 SteadyStateValue: -1.0