We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c87a5b commit b36d053Copy full SHA for b36d053
control/tests/sisotool_test.py
@@ -68,8 +68,8 @@ def test_sisotool(self, sys):
68
69
# Check the step response before moving the point
70
step_response_original = np.array(
71
- [0. , 0.0366, 0.2032, 0.4857, 0.82 , 1.1358, 1.3762, 1.507 ,
72
- 1.5206, 1.4326])
+ [0. , 0.021 , 0.124 , 0.3146, 0.5653, 0.8385, 1.0969, 1.3095,
+ 1.4549, 1.5231])
73
assert_array_almost_equal(
74
ax_step.lines[0].get_data()[1][:10], step_response_original, 4)
75
@@ -113,8 +113,8 @@ def test_sisotool(self, sys):
113
114
# Check if the step response has changed
115
step_response_moved = np.array(
116
- [0. , 0.0415, 0.2687, 0.7248, 1.3367, 1.9505, 2.3765, 2.4469,
117
- 2.0738, 1.2926])
+ [0. , 0.023 , 0.1554, 0.4401, 0.8646, 1.3722, 1.875 , 2.2709,
+ 2.4633, 2.3827])
118
119
ax_step.lines[0].get_data()[1][:10], step_response_moved, 4)
120
control/tests/timeresp_test.py
@@ -310,6 +310,10 @@ def test_step_pole_cancellation(self, pole_cancellation,
310
step_info_no_cancellation = step_info(no_pole_cancellation)
311
step_info_cancellation = step_info(pole_cancellation)
312
for key in step_info_no_cancellation:
313
+ if key == 'Overshoot':
314
+ # skip this test because these systems have no overshoot
315
+ # => very sensitive to parameters
316
+ continue
317
np.testing.assert_allclose(step_info_no_cancellation[key],
318
step_info_cancellation[key], rtol=1e-4)
319
@@ -522,7 +526,7 @@ def test_step_robustness(self):
522
526
523
527
@pytest.mark.parametrize(
524
528
"tfsys, tfinal",
525
- [(TransferFunction(1, [1, .5]), 17.034386), # pole at 0.5
529
+ [(TransferFunction(1, [1, .5]), 13.81551), # pole at 0.5
530
(TransferFunction(1, [1, .5]).sample(.1), 25), # discrete pole at 0.5
531
(TransferFunction(1, [1, .5, 0]), 25)]) # poles at 0.5 and 0
532
def test_auto_generated_time_vector_tfinal(self, tfsys, tfinal):
control/timeresp.py
@@ -792,7 +792,7 @@ def step_info(sys, T=None, T_num=None, SettlingTimeThreshold=0.02,
792
T, yout = step_response(sys, T)
793
794
# Steady state value
795
- InfValue = yout[-1]
+ InfValue = sys.dcgain()
796
797
# RiseTime
798
tr_lower_index = (np.where(yout >= RiseTimeLimits[0] * InfValue)[0])[0]
@@ -1124,7 +1124,7 @@ def _ideal_tfinal_and_dt(sys, is_step=True):
1124
default_dt = 0.1
1125
total_cycles = 5 # number of cycles for oscillating modes
1126
pts_per_cycle = 25 # Number of points divide a period of oscillation
1127
- log_decay_percent = np.log(5000) # Factor of reduction for real pole decays
+ log_decay_percent = np.log(1000) # Factor of reduction for real pole decays
1128
1129
if sys._isstatic():
1130
tfinal = default_tfinal
0 commit comments