aquakin.TemperatureModel#
- class aquakin.TemperatureModel[source]#
Bases:
ABCStrategy 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_sizefromtracked_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/dtfor 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]
- 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/dtfor the temperature block, shape(state_size,).- Parameters:
temp_state (jnp.ndarray) – Current temperatures of the tracked units (in
tracked_unitsorder).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_inisNonefor a temperature-agnostic inlet (the model then holds that state fixed).
- Return type:
Array