Plot the Sud demo's time axis in seconds instead of minutes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 19:23:38 +02:00
co-authored by Claude Sonnet 4.6
parent ace5054983
commit 15650b21fb
+7 -7
View File
@@ -144,34 +144,34 @@ if __name__ == '__main__':
print("Sud did not finish within {} steps (stuck in {})".format(max_steps, sud.state))
print("Sud finished after {:.0f} s ({:.1f} min), final state = {}".format(t, t/60.0, sud.state))
_t_min = np.array(_t) / 60.0
_t_arr = np.array(_t)
figure(1)
subplot(3, 1, 1)
plot(_t_min, _temp_ist, '-b', _t_min, _temp_soll, '-r', linewidth=1)
plot(_t_arr, _temp_ist, '-b', _t_arr, _temp_soll, '-r', linewidth=1)
legend(["theta_ist", "theta_soll"])
grid(True)
subplot(3, 1, 2)
plot(_t_min, _heatrate_ist, '-b', _t_min, _heatrate_soll, '-r', linewidth=1)
plot(_t_arr, _heatrate_ist, '-b', _t_arr, _heatrate_soll, '-r', linewidth=1)
legend(["heatrate_ist", "heatrate_soll"])
grid(True)
subplot(3, 1, 3)
plot(_t_min, _heater_power_set, '-r', _t_min, _heater_power_eff, '-b', linewidth=1)
plot(_t_arr, _heater_power_set, '-r', _t_arr, _heater_power_eff, '-b', linewidth=1)
legend(["heater power_set", "heater power_eff"])
grid(True)
figure(2)
subplot(3, 1, 1)
step(_t_min, _sud_state, where='post', color='m')
step(_t_arr, _sud_state, where='post', color='m')
yticks([0, 1, 2, 3, 4], ["IDLE", "RAMPING", "HOLDING", "WAIT_USER", "DONE"])
legend(["Sud state"])
grid(True)
subplot(3, 1, 2)
step(_t_min, _step_index, where='post', color='k')
step(_t_arr, _step_index, where='post', color='k')
legend(["Step index"])
grid(True)
subplot(3, 1, 3)
plot(_t_min, _stirrer_speed, '-g', _t_min, _stirrer_duty, '-c', linewidth=1)
plot(_t_arr, _stirrer_speed, '-g', _t_arr, _stirrer_duty, '-c', linewidth=1)
legend(["stirrer speed (effective)", "stirrer duty cycle [%]"])
grid(True)