aquakin.canonical_content#

aquakin.canonical_content(model, component, composition=None, *, electron_acceptor_cod=True, params=None)[source]#

Per-species canonical content vector for one component, shape (n_species,).

Entry j is composition[species_j][component] × unit_factor – the grams of component (COD / N / P) per cubic metre of bulk per unit of the species’ native concentration. Dotting it with a concentration vector C gives that volume’s areal content in canonical g/m³, so inventories and fluxes are summable across models whose species use different units (the ASM water line in g/m³, the ADM digester in kg/m³ and kmol/m³).

Parameters:
  • model (CompiledModel)

  • component (str) – "COD", "N" or "P".

  • composition (dict, optional) – Override the shipped composition_table() (e.g. a hand-authored table for an unshipped model).

  • electron_acceptor_cod (bool, optional) – Passed to composition_table() when composition is not given (False selects the lab-COD convention; see there).

Return type:

np.ndarray