Skip to content

Commit fe0cd47

Browse files
committed
make frdata/xferfcn parameters and attributes more consistent
1 parent 23cbde9 commit fe0cd47

File tree

16 files changed

+370
-220
lines changed

16 files changed

+370
-220
lines changed

control/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ def use_matlab_defaults():
256256
The following conventions are used:
257257
* Bode plots plot gain in dB, phase in degrees, frequency in
258258
rad/sec, with grids
259+
* Frequency plots use the label "Magnitude" for the system gain.
259260
260261
Examples
261262
--------
@@ -264,6 +265,7 @@ def use_matlab_defaults():
264265
265266
"""
266267
set_defaults('freqplot', dB=True, deg=True, Hz=False, grid=True)
268+
set_defaults('freqplot', magnitude_label="Magnitude")
267269

268270

269271
# Set defaults to match FBS (Astrom and Murray)
@@ -275,6 +277,7 @@ def use_fbs_defaults():
275277
276278
* Bode plots plot gain in powers of ten, phase in degrees,
277279
frequency in rad/sec, no grid
280+
* Frequency plots use the label "Gain" for the system gain.
278281
* Nyquist plots use dashed lines for mirror image of Nyquist curve
279282
280283
Examples
@@ -284,6 +287,7 @@ def use_fbs_defaults():
284287
285288
"""
286289
set_defaults('freqplot', dB=False, deg=True, Hz=False, grid=False)
290+
set_defaults('freqplot', magnitude_label="Gain")
287291
set_defaults('nyquist', mirror_style='--')
288292

289293

control/descfcn.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ def describing_function_response(
336336
>>> response = ct.describing_function_response(H_simple, F_saturation, amp)
337337
>>> response.intersections # doctest: +SKIP
338338
[(3.343844998258643, 1.4142293090899216)]
339-
>>> lines = response.plot()
339+
>>> cplt = response.plot()
340340
341341
"""
342342
# Decide whether to turn on warnings or not
@@ -484,7 +484,7 @@ def describing_function_plot(
484484
>>> H_simple = ct.tf([8], [1, 2, 2, 1])
485485
>>> F_saturation = ct.saturation_nonlinearity(1)
486486
>>> amp = np.linspace(1, 4, 10)
487-
>>> lines = ct.describing_function_plot(H_simple, F_saturation, amp)
487+
>>> cplt = ct.describing_function_plot(H_simple, F_saturation, amp)
488488
489489
"""
490490
# Process keywords
@@ -521,8 +521,8 @@ def describing_function_plot(
521521
lines = np.empty(2, dtype=object)
522522

523523
# Plot the Nyquist response
524-
cfig = dfresp.response.plot(**kwargs)
525-
lines[0] = cfig.lines[0] # Return Nyquist lines for first system
524+
cplt = dfresp.response.plot(**kwargs)
525+
lines[0] = cplt.lines[0] # Return Nyquist lines for first system
526526

527527
# Add the describing function curve to the plot
528528
lines[1] = plt.plot(dfresp.N_vals.real, dfresp.N_vals.imag)
@@ -533,7 +533,7 @@ def describing_function_plot(
533533
# Add labels to the intersection points
534534
plt.text(pos.real, pos.imag, point_label % (a, omega))
535535

536-
return ControlPlot(lines, cfig.axes, cfig.figure)
536+
return ControlPlot(lines, cplt.axes, cplt.figure)
537537

538538

539539
# Utility function to figure out whether two line segments intersection

0 commit comments

Comments
 (0)