@@ -59,10 +59,6 @@ def bode(syslist, omega=None, dB=False, Hz=False, deg=True,
5959 color = None , Plot = True ):
6060 """Bode plot for a system
6161
62- Usage
63- =====
64- (mag, phase, omega) = bode(syslist, omega=None, dB=False, Hz=False, color=None, deg=True, Plot=True)
65-
6662 Plots a Bode plot for the system over a (optional) frequency range.
6763
6864 Parameters
@@ -82,17 +78,26 @@ def bode(syslist, omega=None, dB=False, Hz=False, deg=True,
8278 Plot : boolean
8379 If True, plot magnitude and phase
8480
85- Return values
86- -------------
87- mag : magnitude array (list if len(syslist) > 1)
88- phase : phase array (list if len(syslist) > 1)
89- omega : frequency array (list if len(syslist) > 1)
90-
81+ Returns
82+ -------
83+ mag : array (list if len(syslist) > 1)
84+ magnitude
85+ phase : array (list if len(syslist) > 1)
86+ phase
87+ omega : array (list if len(syslist) > 1)
88+ frequency
89+
9190 Notes
9291 -----
9392 1. Alternatively, you may use the lower-level method
9493 (mag, phase, freq) = sys.freqresp(freq) to generate the frequency
9594 response for a system, but it returns a MIMO response.
95+
96+ Examples
97+ --------
98+ >>> from matlab import ss
99+ >>> sys = ss("1. -2; 3. -4", "5.; 7", "6. 8", "9.")
100+ >>> mag, phase, omega = bode(sys)
96101 """
97102 # If argument was a singleton, turn it into a list
98103 if (not getattr (syslist , '__iter__' , False )):
@@ -176,26 +181,31 @@ def bode(syslist, omega=None, dB=False, Hz=False, deg=True,
176181def nyquist (syslist , omega = None , Plot = True ):
177182 """Nyquist plot for a system
178183
179- Usage
180- =====
181- real, imag, freq = nyquist(sys, omega=None, Plot=True)
182-
183184 Plots a Nyquist plot for the system over a (optional) frequency range.
184185
185186 Parameters
186187 ----------
187- syslist : linsys
188+ syslist : list of Lti
188189 List of linear input/output systems (single system is OK)
189190 omega : freq_range
190191 Range of frequencies (list or bounds) in rad/sec
191192 Plot : boolean
192193 if True, plot magnitude
193194
194- Return values
195- -------------
196- real : real part of the frequency response array
197- imag : imaginary part of the frequency response array
198- freq : frequencies
195+ Returns
196+ -------
197+ real : array
198+ real part of the frequency response array
199+ imag : array
200+ imaginary part of the frequency response array
201+ freq : array
202+ frequencies
203+
204+ Examples
205+ --------
206+ >>> from matlab import ss
207+ >>> sys = ss("1. -2; 3. -4", "5.; 7", "6. 8", "9.")
208+ >>> real, imag, freq = nyquist(sys)
199209 """
200210 # If argument was a singleton, turn it into a list
201211 if (not getattr (syslist , '__iter__' , False )):
@@ -238,22 +248,18 @@ def nyquist(syslist, omega=None, Plot=True):
238248def gangof4 (P , C , omega = None ):
239249 """Plot the "Gang of 4" transfer functions for a system
240250
241- Usage
242- =====
243- gangof4(P, C, omega=None)
244-
245251 Generates a 2x2 plot showing the "Gang of 4" sensitivity functions
246252 [T, PS; CS, S]
247253
248254 Parameters
249255 ----------
250- P, C : linsys
256+ P, C : Lti
251257 Linear input/output systems (process and control)
252- omega : freq_range
258+ omega : array
253259 Range of frequencies (list or bounds) in rad/sec
254260
255- Return values
256- -------------
261+ Returns
262+ -------
257263 None
258264 """
259265 if (P .inputs > 1 or P .outputs > 1 or C .inputs > 1 or C .outputs > 1 ):
@@ -400,22 +406,24 @@ def default_frequency_range(syslist):
400406 """Compute a reasonable default frequency range for frequency
401407 domain plots.
402408
403- Usage
404- =====
405- omega = default_frequency_range(syslist)
406-
407409 Finds a reasonable default frequency range by examining the features
408410 (poles and zeros) of the systems in syslist.
409411
410412 Parameters
411413 ----------
412- syslist : linsys
414+ syslist : list of Lti
413415 List of linear input/output systems (single system is OK)
414416
415- Return values
416- -------------
417- omega : freq_range
417+ Return
418+ ------
419+ omega : array
418420 Range of frequencies in rad/sec
421+
422+ Examples
423+ --------
424+ >>> from matlab import ss
425+ >>> sys = ss("1. -2; 3. -4", "5.; 7", "6. 8", "9.")
426+ >>> omega = default_frequency_range(sys)
419427 """
420428 # This code looks at the poles and zeros of all of the systems that
421429 # we are plotting and sets the frequency range to be one decade above
0 commit comments