Skip to content

Commit ab555dd

Browse files
committed
include yfinal in matlab.stepinfo call signature
1 parent 6587f69 commit ab555dd

File tree

2 files changed

+47
-24
lines changed

2 files changed

+47
-24
lines changed

control/matlab/timeresp.py

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,38 +64,59 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
6464
transpose=True, return_x=return_x)
6565
return (out[1], out[0], out[2]) if return_x else (out[1], out[0])
6666

67-
def stepinfo(sys, T=None, SettlingTimeThreshold=0.02,
67+
68+
def stepinfo(sysdata, T=None, yfinal=None, SettlingTimeThreshold=0.02,
6869
RiseTimeLimits=(0.1, 0.9)):
69-
'''
70+
"""
7071
Step response characteristics (Rise time, Settling Time, Peak and others).
7172
7273
Parameters
7374
----------
74-
sys: StateSpace, or TransferFunction
75-
LTI system to simulate
76-
77-
T: array-like or number, optional
75+
sysdata : StateSpace or TransferFunction or array_like
76+
The system data. Either LTI system to similate (StateSpace,
77+
TransferFunction), or a time series of step response data.
78+
T : array_like or float, optional
7879
Time vector, or simulation time duration if a number (time vector is
7980
autocomputed if not given)
80-
81-
SettlingTimeThreshold: float value, optional
81+
Required, if sysdata is a time series of response data.
82+
yfinal : scalar or array_like, optional
83+
Steady-state response. If not given, sysdata.dcgain() is used for
84+
systems to simulate and the last value of the the response data is
85+
used for a given time series of response data. Scalar for SISO,
86+
(noutputs, ninputs) array_like for MIMO systems.
87+
SettlingTimeThreshold : float, optional
8288
Defines the error to compute settling time (default = 0.02)
83-
84-
RiseTimeLimits: tuple (lower_threshold, upper_theshold)
89+
RiseTimeLimits : tuple (lower_threshold, upper_theshold)
8590
Defines the lower and upper threshold for RiseTime computation
8691
8792
Returns
8893
-------
89-
S: a dictionary containing:
90-
RiseTime: Time from 10% to 90% of the steady-state value.
91-
SettlingTime: Time to enter inside a default error of 2%
92-
SettlingMin: Minimum value after RiseTime
93-
SettlingMax: Maximum value after RiseTime
94-
Overshoot: Percentage of the Peak relative to steady value
95-
Undershoot: Percentage of undershoot
96-
Peak: Absolute peak value
97-
PeakTime: time of the Peak
98-
SteadyStateValue: Steady-state value
94+
S : dict or list of list of dict
95+
If `sysdata` corresponds to a SISO system, S is a dictionary
96+
containing:
97+
98+
RiseTime:
99+
Time from 10% to 90% of the steady-state value.
100+
SettlingTime:
101+
Time to enter inside a default error of 2%
102+
SettlingMin:
103+
Minimum value after RiseTime
104+
SettlingMax:
105+
Maximum value after RiseTime
106+
Overshoot:
107+
Percentage of the Peak relative to steady value
108+
Undershoot:
109+
Percentage of undershoot
110+
Peak:
111+
Absolute peak value
112+
PeakTime:
113+
time of the Peak
114+
SteadyStateValue:
115+
Steady-state value
116+
117+
If `sysdata` corresponds to a MIMO system, `S` is a 2D list of dicts.
118+
To get the step response characteristics from the j-th input to the
119+
i-th output, access ``S[i][j]``
99120
100121
101122
See Also
@@ -105,11 +126,13 @@ def stepinfo(sys, T=None, SettlingTimeThreshold=0.02,
105126
Examples
106127
--------
107128
>>> S = stepinfo(sys, T)
108-
'''
129+
"""
109130
from ..timeresp import step_info
110131

111132
# Call step_info with MATLAB defaults
112-
S = step_info(sys, T, None, SettlingTimeThreshold, RiseTimeLimits)
133+
S = step_info(sysdata, T=T, T_num=None, yfinal=yfinal,
134+
SettlingTimeThreshold=SettlingTimeThreshold,
135+
RiseTimeLimits=RiseTimeLimits)
113136

114137
return S
115138

control/timeresp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -752,12 +752,12 @@ def step_info(sysdata, T=None, T_num=None, yfinal=None,
752752
Number of time steps to use in simulation if T is not provided as an
753753
array; autocomputed if not given; ignored if sysdata is a
754754
discrete-time system or a time series or response data.
755-
yfinal: scalar or array_like, optional
755+
yfinal : scalar or array_like, optional
756756
Steady-state response. If not given, sysdata.dcgain() is used for
757757
systems to simulate and the last value of the the response data is
758758
used for a given time series of response data. Scalar for SISO,
759759
(noutputs, ninputs) array_like for MIMO systems.
760-
SettlingTimeThreshold : float value, optional
760+
SettlingTimeThreshold : float, optional
761761
Defines the error to compute settling time (default = 0.02)
762762
RiseTimeLimits : tuple (lower_threshold, upper_theshold)
763763
Defines the lower and upper threshold for RiseTime computation

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