Make grain_mass/water_mass per-step and re-derive plant params on change
grain_mass and water_mass now live on each step (defaulted from default.step) instead of being fixed for the whole brew, since both change over a mash (malt going in, water boiling off). Sud.derive_plant_params() takes them as arguments so it can be recomputed per step; the demo re-applies the resulting M/C to both the real plant and the controller's Smith-predictor model on every step change via the new Pot.set_thermal_params()/ TempController.set_model_params(). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CgR9tPaSzFkAwRAUyeaaCD
This commit is contained in:
@@ -24,6 +24,10 @@ class TempController(TempControllerBase):
|
||||
self.model.set_power(power)
|
||||
self.model_delay.set_power(power)
|
||||
|
||||
def set_model_params(self, M, C):
|
||||
self.model.set_thermal_params(M, C)
|
||||
self.model_delay.set_thermal_params(M, C)
|
||||
|
||||
def on_state_entered(self, state):
|
||||
if state == States.HEAT:
|
||||
self.model.initial(self.theta_ist)
|
||||
|
||||
Reference in New Issue
Block a user