1515__all__ = ['bode' , 'nyquist' , 'ngrid' , 'rlocus' , 'pzmap' , 'dcgain' , 'connect' ]
1616
1717def bode (* args , ** kwargs ):
18- """bode(syslist [, omega, dB, Hz, deg, ...])
18+ """bode(sys [, omega, dB, Hz, deg, ...])
1919
2020 Bode plot of the frequency response.
2121
@@ -28,23 +28,22 @@ def bode(*args, **kwargs):
2828 a list of systems can be entered, or several systems can be
2929 specified (i.e. several parameters). The sys arguments may also be
3030 interspersed with format strings. A frequency argument (array_like)
31- may also be added, some examples::
32-
33- >>> bode(sys, w) # one system, freq vector # doctest: +SKIP
34- >>> bode(sys1, sys2, ..., sysN) # several systems # doctest: +SKIP
35- >>> bode(sys1, sys2, ..., sysN, w) # doctest: +SKIP
36- >>> bode(sys1, 'plotstyle1', ..., sysN, 'plotstyleN') # + plot formats # doctest: +SKIP
37-
38- omega: freq_range
39- Range of frequencies in rad/s
31+ may also be added (see Examples).
32+ omega : array
33+ Range of frequencies in rad/s.
4034 dB : boolean
41- If True, plot result in dB
35+ If True, plot result in dB.
4236 Hz : boolean
43- If True, plot frequency in Hz (omega must be provided in rad/sec)
37+ If True, plot frequency in Hz (omega must be provided in rad/sec).
4438 deg : boolean
45- If True, return phase in degrees (else radians)
39+ If True, return phase in degrees (else radians).
4640 plot : boolean
47- If True, plot magnitude and phase
41+ If True, plot magnitude and phase.
42+
43+ Returns
44+ -------
45+ mag, phase, omega : array
46+ Magnitude, phase, and frequencies represented in the Bode plot.
4847
4948 Examples
5049 --------
@@ -61,6 +60,12 @@ def bode(*args, **kwargs):
6160 * >>> bode(sys1, sys2, ..., sysN) # doctest: +SKIP
6261 * >>> bode(sys1, sys2, ..., sysN, w) # doctest: +SKIP
6362 * >>> bode(sys1, 'plotstyle1', ..., sysN, 'plotstyleN') # doctest: +SKIP
63+
64+ >>> bode(sys, w) # one system, freq vector # doctest: +SKIP
65+ >>> bode(sys1, sys2, ..., sysN) # several systems # doctest: +SKIP
66+ >>> bode(sys1, sys2, ..., sysN, w) # doctest: +SKIP
67+ >>> bode(sys1, 'plotstyle1', ..., sysN, 'plotstyleN') # doctest: +SKIP
68+
6469 """
6570 from ..freqplot import bode_plot
6671
@@ -99,19 +104,25 @@ def nyquist(*args, plot=True, **kwargs):
99104
100105 Parameters
101106 ----------
102- sys1, ..., sysn : list of LTI
107+ syslist : list of LTI
103108 List of linear input/output systems (single system is OK).
104109 omega : array_like
105110 Set of frequencies to be evaluated, in rad/sec.
111+ omega_limits : array_like of two values
112+ Set limits for plotted frequency range. If Hz=True the limits are
113+ in Hz otherwise in rad/s. Specifying ``omega`` as a list of two
114+ elements is equivalent to providing ``omega_limits``.
115+ plot : bool
116+ If `False`, do not generate a plot.
106117
107118 Returns
108119 -------
109120 real : ndarray (or list of ndarray if len(syslist) > 1))
110- real part of the frequency response array
121+ Real part of the frequency response array.
111122 imag : ndarray (or list of ndarray if len(syslist) > 1))
112- imaginary part of the frequency response array
123+ Imaginary part of the frequency response array.
113124 omega : ndarray (or list of ndarray if len(syslist) > 1))
114- frequencies in rad/s
125+ Frequencies in rad/s.
115126
116127 """
117128 from ..freqplot import nyquist_response , nyquist_plot
@@ -217,6 +228,8 @@ def rlocus(*args, **kwargs):
217228 ylim : tuple or list, optional
218229 Set limits of y axis, normally with tuple
219230 (see :doc:`matplotlib:api/axes_api`).
231+ plot : bool
232+ If `False`, do not generate a plot.
220233
221234 Returns
222235 -------
@@ -257,19 +270,19 @@ def pzmap(*args, **kwargs):
257270
258271 Parameters
259272 ----------
260- sys: LTI (StateSpace or TransferFunction)
273+ sys : LTI (StateSpace or TransferFunction)
261274 Linear system for which poles and zeros are computed.
262- plot: bool, optional
275+ plot : bool, optional
263276 If ``True`` a graph is generated with Matplotlib,
264277 otherwise the poles and zeros are only computed and returned.
265- grid: boolean (default = False)
278+ grid : boolean (default = False)
266279 If True plot omega-damping grid.
267280
268281 Returns
269282 -------
270- poles: array
283+ poles : array
271284 The system's poles.
272- zeros: array
285+ zeros : array
273286 The system's zeros.
274287
275288 Notes
@@ -302,26 +315,36 @@ def ngrid():
302315
303316
304317def dcgain (* args ):
305- '''Compute the gain of the system in steady state.
318+ '''dcgain(sys) \
319+ dcgain(num, den) \
320+ dcgain(Z, P, k) \
321+ dcgain(A, B, C, D)
322+
323+ Compute the gain of the system in steady state.
306324
307325 The function takes either 1, 2, 3, or 4 parameters:
308326
327+ * dcgain(sys)
328+ * dcgain(num, den)
329+ * dcgain(Z, P, k)
330+ * dcgain(A, B, C, D)
331+
309332 Parameters
310333 ----------
311- A, B, C, D: array-like
334+ A, B, C, D : array-like
312335 A linear system in state space form.
313- Z, P, k: array-like, array-like, number
336+ Z, P, k : array-like, array-like, number
314337 A linear system in zero, pole, gain form.
315- num, den: array-like
338+ num, den : array-like
316339 A linear system in transfer function form.
317- sys: LTI (StateSpace or TransferFunction)
340+ sys : LTI (StateSpace or TransferFunction)
318341 A linear system object.
319342
320343 Returns
321344 -------
322- gain: ndarray
345+ gain : ndarray
323346 The gain of each output versus each input:
324- :math:`y = gain \\ cdot u`
347+ :math:`y = gain \\ cdot u`.
325348
326349 Notes
327350 -----
@@ -354,8 +377,9 @@ def dcgain(*args):
354377
355378from ..bdalg import connect as ct_connect
356379def connect (* args ):
380+ """connect(sys, Q, inputv, outputv)
357381
358- """ Index-based interconnection of an LTI system.
382+ Index-based interconnection of an LTI system.
359383
360384 The system `sys` is a system typically constructed with `append`, with
361385 multiple inputs and outputs. The inputs and outputs are connected
@@ -378,9 +402,9 @@ def connect(*args):
378402 values mean the feedback is negative. A zero value is ignored. Inputs
379403 and outputs are indexed starting at 1 to communicate sign information.
380404 inputv : 1D array
381- list of final external inputs, indexed starting at 1
405+ List of final external inputs, indexed starting at 1.
382406 outputv : 1D array
383- list of final external outputs, indexed starting at 1
407+ List of final external outputs, indexed starting at 1.
384408
385409 Returns
386410 -------
0 commit comments