aquakin.MassBalance#

class aquakin.MassBalance(components, window, influent_ports=<factory>, effluent_ports=<factory>, gas_detail=<factory>)[source]#

Bases: object

Per-component closure of a plant over a simulation window.

Returned by aquakin.plant.Plant.mass_balance(). Index it by component name (mb["COD"] -> ComponentBalance) and call closed() for a pass/fail, or summary() for a printable table.

Parameters:
  • components (dict[str, ComponentBalance])

  • window (tuple[float, float])

  • influent_ports (list[str])

  • effluent_ports (list[str])

  • gas_detail (dict[str, float])

__init__(components, window, influent_ports=<factory>, effluent_ports=<factory>, gas_detail=<factory>)#
Parameters:
  • components (dict[str, ComponentBalance])

  • window (tuple[float, float])

  • influent_ports (list[str])

  • effluent_ports (list[str])

  • gas_detail (dict[str, float])

Return type:

None

Methods

__init__(components, window[, ...])

closed([rtol])

True when every component's relative_imbalance is within rtol.

summary()

A printable per-component table (canonical g over the window).

Attributes

components

window

influent_ports

effluent_ports

gas_detail

closed(rtol=0.01)[source]#

True when every component’s relative_imbalance is within rtol.

Parameters:

rtol (float)

Return type:

bool

summary()[source]#

A printable per-component table (canonical g over the window).

Return type:

str