Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 249d85e

Browse files
committed
use Hz=False for MATLAB + docstring corrections
1 parent dcf12fd commit 249d85e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

control/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,11 +114,11 @@ def use_matlab_defaults():
114114
115115
The following conventions are used:
116116
* Bode plots plot gain in dB, phase in degrees, frequency in
117-
Hertz, with grids
117+
rad/sec, with grids
118118
* State space class and functions use Numpy matrix objects
119119
120120
"""
121-
set_defaults('bode', dB=True, deg=True, Hz=True, grid=True)
121+
set_defaults('bode', dB=True, deg=True, Hz=False, grid=True)
122122
set_defaults('statesp', use_numpy_matrix=True)
123123

124124

@@ -128,7 +128,7 @@ def use_fbs_defaults():
128128
129129
The following conventions are used:
130130
* Bode plots plot gain in powers of ten, phase in degrees,
131-
frequency in Hertz, no grid
131+
frequency in rad/sec, no grid
132132
133133
"""
134134
set_defaults('bode', dB=False, deg=True, Hz=False, grid=False)

control/tests/config_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ def test_matlab_bode(self):
107107
mag_data = mag_line[0].get_data()
108108
mag_x, mag_y = mag_data
109109

110-
# Make sure the x-axis is in Hertz and y-axis is in dB
111-
np.testing.assert_almost_equal(mag_x[0], 0.001 / (2*pi), decimal=6)
110+
# Make sure the x-axis is in rad/sec and y-axis is in dB
111+
np.testing.assert_almost_equal(mag_x[0], 0.001, decimal=6)
112112
np.testing.assert_almost_equal(mag_y[0], 20*log10(10), decimal=3)
113113

114114
# Get the phase line
@@ -117,8 +117,8 @@ def test_matlab_bode(self):
117117
phase_data = phase_line[0].get_data()
118118
phase_x, phase_y = phase_data
119119

120-
# Make sure the x-axis is in Hertz and y-axis is in degrees
121-
np.testing.assert_almost_equal(phase_x[-1], 1000 / (2*pi), decimal=1)
120+
# Make sure the x-axis is in rad/sec and y-axis is in degrees
121+
np.testing.assert_almost_equal(phase_x[-1], 1000, decimal=1)
122122
np.testing.assert_almost_equal(phase_y[-1], -180, decimal=0)
123123

124124
# Override the defaults and make sure that works as well

0 commit comments

Comments
 (0)