aquakin.TemperatureModel#

class aquakin.TemperatureModel[source]#

Bases: ABC

Strategy for how a plant resolves unit temperatures.

Concrete models declare which units carry a temperature state, the initial values, and the state derivative. The base class derives state_size from tracked_units() so a subclass need only implement the three methods.

__init__()#

Methods

__init__()

initial_state(plant)

Initial temperatures (K) for the tracked units, shape (state_size,).

state_rhs(plant, temp_state, inlet_by_unit)

dT/dt for the temperature block, shape (state_size,).

state_size(plant)

Length of the appended temperature-state block.

tracked_units(plant)

Names of units that carry a dynamic temperature state, in unit order.

abstractmethod tracked_units(plant)[source]#

Names of units that carry a dynamic temperature state, in unit order.

Return type:

list[str]

state_size(plant)[source]#

Length of the appended temperature-state block.

Return type:

int

abstractmethod initial_state(plant)[source]#

Initial temperatures (K) for the tracked units, shape (state_size,).

Return type:

Array

abstractmethod state_rhs(plant, temp_state, inlet_by_unit)[source]#

dT/dt for the temperature block, shape (state_size,).

Parameters:
  • temp_state (jnp.ndarray) – Current temperatures of the tracked units (in tracked_units order).

  • inlet_by_unit (dict) – {unit_name: (Q_in, T_in)} – the resolved total inlet flow and flow-weighted inlet temperature of each tracked unit. T_in is None for a temperature-agnostic inlet (the model then holds that state fixed).

Return type:

Array