aquakin.fractionate#

aquakin.fractionate(*, total_cod, tkn, ammonia=None, nox=0.0, alkalinity=None, filtered_cod=None, flocculated_filtered_cod=None, soluble_inert_cod=None, fractions=InfluentFractions(f_sccod=0.405, f_scod=0.202, f_su=0.118, f_xu=0.14, f_oho=0.05, f_xe=0.2, f_cu=0.2, f_snh=0.7, iN_sb=0.04, iN_xb=0.086, iN_xp=0.06, caco3_eq=50.0, default_alkalinity_mol=7.0))[source]#

Split influent aggregate measurements into ASM1 state values.

Every argument may be a scalar or a same-shaped array (the array path is how a measurement time series is fractionated per row). Returns a mapping of ASM1 state name -> value (same scalar/array shape), suitable for model.influent(...) or assembling an InfluentSeries. See the module docstring for the scheme.

Parameters:
  • total_cod (float or array) – Total COD (g COD/m3) and total Kjeldahl nitrogen (g N/m3). Required.

  • tkn (float or array) – Total COD (g COD/m3) and total Kjeldahl nitrogen (g N/m3). Required.

  • ammonia (float or array, optional) – Ammonia (g N/m3; else f_snh*tkn), nitrate+nitrite (g N/m3; default 0 -> SNO), and alkalinity (mg CaCO3/L -> SALK; else a default).

  • nox (float or array, optional) – Ammonia (g N/m3; else f_snh*tkn), nitrate+nitrite (g N/m3; default 0 -> SNO), and alkalinity (mg CaCO3/L -> SALK; else a default).

  • alkalinity (float or array, optional) – Ammonia (g N/m3; else f_snh*tkn), nitrate+nitrite (g N/m3; default 0 -> SNO), and alkalinity (mg CaCO3/L -> SALK; else a default).

  • filtered_cod (float or array, optional) – Measured COD sub-fractions (g COD/m3). When given they drive the split; when absent the corresponding default fraction is used.

  • flocculated_filtered_cod (float or array, optional) – Measured COD sub-fractions (g COD/m3). When given they drive the split; when absent the corresponding default fraction is used.

  • soluble_inert_cod (float or array, optional) – Measured COD sub-fractions (g COD/m3). When given they drive the split; when absent the corresponding default fraction is used.

  • fractions (InfluentFractions) – The fraction parameters (SUMO Sumo1 defaults).

Raises:

ValueError – If ammonia exceeds tkn (TKN includes ammonia).

Warns:

UserWarning – If the COD fractionation does not close – a COD fraction clamped negative (unusual filtered_cod / flocculated_filtered_cod), so the ASM1 COD states sum to more than total_cod.

Return type:

dict