Skip to content

Commit 7acd3fc

Browse files
committed
added signature for drss, import missing stochsys for matlab module, docstring typos
1 parent 2311a4d commit 7acd3fc

File tree

4 files changed

+12
-37
lines changed

4 files changed

+12
-37
lines changed

control/iosys.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,10 @@ def rss(states=1, outputs=1, inputs=1, strictly_proper=False, **kwargs):
24282428

24292429

24302430
def drss(*args, **kwargs):
2431-
"""Create a stable, discrete-time, random state space system
2431+
"""
2432+
drss([states, outputs, inputs, strictly_proper])
2433+
2434+
Create a stable, discrete-time, random state space system
24322435
24332436
Create a stable *discrete time* random state space object. This
24342437
function calls :func:`rss` using either the `dt` keyword provided by
@@ -2466,7 +2469,7 @@ def ss2io(*args, **kwargs):
24662469

24672470
# Convert a transfer function into an input/output system (wrapper)
24682471
def tf2io(*args, **kwargs):
2469-
"""tf2io(sys)
2472+
"""tf2io(sys[, ...])
24702473
24712474
Convert a transfer function into an I/O system
24722475

control/matlab/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@
8484
from ..rlocus import rlocus
8585
from ..dtime import c2d
8686
from ..sisotool import sisotool
87+
from ..stochsys import *
8788

8889
# Functions that are renamed in MATLAB
8990
pole, zero = poles, zeros

control/matlab/timeresp.py

+5-33
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
__all__ = ['step', 'stepinfo', 'impulse', 'initial', 'lsim']
88

99
def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
10-
'''
11-
Step response of a linear system
10+
'''Step response of a linear system
1211
1312
If the system has multiple inputs or outputs (MIMO), one input has
1413
to be selected for the simulation. Optionally, one output may be
@@ -20,35 +19,27 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
2019
----------
2120
sys: StateSpace, or TransferFunction
2221
LTI system to simulate
23-
2422
T: array-like or number, optional
2523
Time vector, or simulation time duration if a number (time vector is
2624
autocomputed if not given)
27-
2825
X0: array-like or number, optional
2926
Initial condition (default = 0)
30-
3127
Numbers are converted to constant arrays with the correct shape.
32-
3328
input: int
3429
Index of the input that will be used in this simulation.
35-
3630
output: int
3731
If given, index of the output that is returned by this simulation.
3832
3933
Returns
4034
-------
4135
yout: array
4236
Response of the system
43-
4437
T: array
4538
Time values of the output
46-
4739
xout: array (if selected)
4840
Individual response of each x variable
4941
5042
51-
5243
See Also
5344
--------
5445
lsim, initial, impulse
@@ -67,8 +58,7 @@ def step(sys, T=None, X0=0., input=0, output=None, return_x=False):
6758

6859
def stepinfo(sysdata, T=None, yfinal=None, SettlingTimeThreshold=0.02,
6960
RiseTimeLimits=(0.1, 0.9)):
70-
"""
71-
Step response characteristics (Rise time, Settling Time, Peak and others).
61+
"""Step response characteristics (Rise time, Settling Time, Peak and others)
7262
7363
Parameters
7464
----------
@@ -137,8 +127,7 @@ def stepinfo(sysdata, T=None, yfinal=None, SettlingTimeThreshold=0.02,
137127
return S
138128

139129
def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
140-
'''
141-
Impulse response of a linear system
130+
'''Impulse response of a linear system
142131
143132
If the system has multiple inputs or outputs (MIMO), one input has
144133
to be selected for the simulation. Optionally, one output may be
@@ -150,30 +139,24 @@ def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
150139
----------
151140
sys: StateSpace, TransferFunction
152141
LTI system to simulate
153-
154142
T: array-like or number, optional
155143
Time vector, or simulation time duration if a number (time vector is
156144
autocomputed if not given)
157-
158145
X0: array-like or number, optional
159146
Initial condition (default = 0)
160147
161148
Numbers are converted to constant arrays with the correct shape.
162-
163149
input: int
164150
Index of the input that will be used in this simulation.
165-
166151
output: int
167152
Index of the output that will be used in this simulation.
168153
169154
Returns
170155
-------
171156
yout: array
172157
Response of the system
173-
174158
T: array
175159
Time values of the output
176-
177160
xout: array (if selected)
178161
Individual response of each x variable
179162
@@ -193,8 +176,7 @@ def impulse(sys, T=None, X0=0., input=0, output=None, return_x=False):
193176
return (out[1], out[0], out[2]) if return_x else (out[1], out[0])
194177

195178
def initial(sys, T=None, X0=0., input=None, output=None, return_x=False):
196-
'''
197-
Initial condition response of a linear system
179+
'''Initial condition response of a linear system
198180
199181
If the system has multiple outputs (?IMO), optionally, one output
200182
may be selected. If no selection is made for the output, all
@@ -204,31 +186,25 @@ def initial(sys, T=None, X0=0., input=None, output=None, return_x=False):
204186
----------
205187
sys: StateSpace, or TransferFunction
206188
LTI system to simulate
207-
208189
T: array-like or number, optional
209190
Time vector, or simulation time duration if a number (time vector is
210191
autocomputed if not given)
211-
212192
X0: array-like object or number, optional
213193
Initial condition (default = 0)
214194
215195
Numbers are converted to constant arrays with the correct shape.
216-
217196
input: int
218197
This input is ignored, but present for compatibility with step
219198
and impulse.
220-
221199
output: int
222200
If given, index of the output that is returned by this simulation.
223201
224202
Returns
225203
-------
226204
yout: array
227205
Response of the system
228-
229206
T: array
230207
Time values of the output
231-
232208
xout: array (if selected)
233209
Individual response of each x variable
234210
@@ -250,8 +226,7 @@ def initial(sys, T=None, X0=0., input=None, output=None, return_x=False):
250226

251227

252228
def lsim(sys, U=0., T=None, X0=0.):
253-
'''
254-
Simulate the output of a linear system.
229+
'''Simulate the output of a linear system
255230
256231
As a convenience for parameters `U`, `X0`:
257232
Numbers (scalars) are converted to constant arrays with the correct shape.
@@ -261,16 +236,13 @@ def lsim(sys, U=0., T=None, X0=0.):
261236
----------
262237
sys: LTI (StateSpace, or TransferFunction)
263238
LTI system to simulate
264-
265239
U: array-like or number, optional
266240
Input array giving input at each time `T` (default = 0).
267241
268242
If `U` is ``None`` or ``0``, a special algorithm is used. This special
269243
algorithm is faster than the general algorithm, which is used otherwise.
270-
271244
T: array-like, optional for discrete LTI `sys`
272245
Time steps at which the input is defined; values must be evenly spaced.
273-
274246
X0: array-like or number, optional
275247
Initial condition (default = 0).
276248

control/matlab/wrappers.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ def ngrid():
178178

179179

180180
def dcgain(*args):
181-
'''
182-
Compute the gain of the system in steady state.
181+
'''Compute the gain of the system in steady state
183182
184183
The function takes either 1, 2, 3, or 4 parameters:
185184

0 commit comments

Comments
 (0)