From 15650b21fb4f8e2835169546ab9390c432168ca8 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Fri, 19 Jun 2026 19:23:38 +0200 Subject: [PATCH] Plot the Sud demo's time axis in seconds instead of minutes Co-Authored-By: Claude Sonnet 4.6 --- scripts/demos/sud/demo_sud.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/scripts/demos/sud/demo_sud.py b/scripts/demos/sud/demo_sud.py index b8768d7..c65b505 100644 --- a/scripts/demos/sud/demo_sud.py +++ b/scripts/demos/sud/demo_sud.py @@ -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)