File tree 3 files changed +37
-0
lines changed
3 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 66
66
from .frdata import *
67
67
from .canonical import *
68
68
from .robust import *
69
+ from .config import *
69
70
70
71
# Exceptions
71
72
from .exception import *
Original file line number Diff line number Diff line change 16
16
17
17
# Set defaults to match MATLAB
18
18
def use_matlab_defaults ():
19
+ """
20
+ Use MATLAB compatible configuration settings
21
+ * Bode plots plot gain in dB, phase in degrees, frequency in Hertz
22
+ """
19
23
# Bode plot defaults
20
24
global bode_dB ; bode_dB = True
21
25
global bode_deg ; bode_deg = True
22
26
global bode_Hz ; bode_Hz = True
23
27
24
28
# Set defaults to match FBS (Astrom and Murray)
25
29
def use_fbs_defaults ():
30
+ """
31
+ Use `Astrom and Murray <http://fbsbook.org>`_ compatible settings
32
+ * Bode plots plot gain in powers of ten, phase in degrees,
33
+ frequency in Hertz
34
+ """
26
35
# Bode plot defaults
27
36
global bode_dB ; bode_dB = False
28
37
global bode_deg ; bode_deg = True
Original file line number Diff line number Diff line change 1
1
.. _conventions-ref :
2
2
3
+ .. currentmodule :: control
4
+
3
5
###################
4
6
Library conventions
5
7
###################
@@ -74,3 +76,28 @@ can be computed like this::
74
76
75
77
ft = D * U
76
78
79
+ Package configuration
80
+ =====================
81
+
82
+ The python-control library can be customized to allow for different plotting
83
+ conventions. The currently configurable options allow the units for Bode
84
+ plots to be set as dB for gain, degrees for phase and Hertz for frequency
85
+ (MATLAB conventions) or the gain can be given in magnitude units (powers of
86
+ 10), corresponding to the conventions used in `Feedback Systems
87
+ <http://www.cds.caltech.edu/~murray/FBSwiki> `_.
88
+
89
+ Variables that can be configured, along with their default values:
90
+ * bode_dB (False): Bode plot magnitude plotted in dB (otherwise powers of 10)
91
+ * bode_deg (True): Bode plot phase plotted in degrees (otherwise radians)
92
+ * bode_Hz (False): Bode plot frequency plotted in Hertz (otherwise rad/sec)
93
+ * bode_number_of_samples (None): Number of frequency points in Bode plots
94
+ * bode_feature_periphery_decade (1.0): How many decades to include in the
95
+ frequency range on both sides of features (poles, zeros).
96
+
97
+ Functions that can be used to set standard configurations:
98
+
99
+ .. autosummary ::
100
+ :toctree: generated/
101
+
102
+ use_fbs_defaults
103
+ use_matlab_defaults
You can’t perform that action at this time.
0 commit comments