Asm1 Steady

ADVANTAGES2 · dim 13

SolvSRK wins. At the comparison noise level, SolvSRK beats the best baseline by at least 10 percentage points of survival, or by at least 0.05 balanced score when survival is tied. Use SolvSRK for this class of problem. All verdicts →

IWA Activated Sludge Model No. 1: 13-state CSTR with Monod kinetics, 8 biological processes (aerobic/anoxic growth, decay, hydrolysis, ammonification). Steady-state approach over 20 days. Stiffness from fast O2 dynamics (KLa=120 d^-1) vs slow biomass growth (b_A=0.15 d^-1).

Water treatment & environmental

Problem definition

Canonical benchmark implementation

Canonical RHS excerpt from the registered callable used for this benchmark cell. Expand it to verify the state equations; it is not a standalone runnable fixture.

Show canonical RHS excerpt
def _monod(s, k):
    """Monod saturation term: s / (k + s), safe for s near zero."""
    return s / (k + s) if (k + s) > 0.0 else 0.0

def _asm1_process_rates(y):
    """Compute the 8 ASM1 biological process rates from state vector y.

    Returns array of 8 rates (rho_1 .. rho_8).
    """
    S_I, S_S, X_I, X_S, X_BH, X_BA, X_P = y[0], y[1], y[2], y[3], y[4], y[5], y[6]
    S_O, S_NO, S_NH, S_ND, X_ND, S_ALK = y[7], y[8], y[9], y[10], y[11], y[12]

    mon_ss = _monod(S_S, _K_S)
    mon_o_h = _monod(S_O, _K_OH)
    inh_o_h = _K_OH / (_K_OH + S_O) if (_K_OH + S_O) > 0.0 else 0.0
    mon_no = _monod(S_NO, _K_NO)
    mon_nh = _monod(S_NH, _K_NH)
    mon_o_a = _monod(S_O, _K_OA)

    # Process 1: aerobic growth of heterotrophs
    rho1 = _MU_H * mon_ss * mon_o_h * X_BH

    # Process 2: anoxic growth of heterotrophs
    rho2 = _MU_H * mon_ss * inh_o_h * mon_no * _ETA_G * X_BH

    # Process 3: aerobic growth of autotrophs
    rho3 = _MU_A * mon_nh * mon_o_a * X_BA

    # Process 4: decay of heterotrophs
    rho4 = _B_H * X_BH

    # Process 5: decay of autotrophs
    rho5 = _B_A * X_BA

    # Process 6: ammonification of soluble organic nitrogen
    rho6 = _K_A_AMMON * S_ND * X_BH

    # Process 7: hydrolysis of slowly biodegradable substrate
    xs_xbh_ratio = (X_S / X_BH) if X_BH > 1e-12 else 0.0
    mon_hyd = xs_xbh_ratio / (_K_X + xs_xbh_ratio) if (_K_X + xs_xbh_ratio) > 0.0 else 0.0
    hyd_switch = mon_o_h + _ETA_H * inh_o_h * mon_no
    rho7 = _K_H * mon_hyd * hyd_switch * X_BH

    # Process 8: hydrolysis of organic nitrogen
    xnd_xs_ratio = (X_ND / X_S) if X_S > 1e-12 else 0.0
    rho8 = rho7 * xnd_xs_ratio

    return np.array([rho1, rho2, rho3, rho4, rho5, rho6, rho7, rho8])

def _asm1_reaction_vector(rho):
    """Petersen matrix: convert 8 process rates to 13 state derivatives."""
    rho1, rho2, rho3, rho4, rho5, rho6, rho7, rho8 = rho

    dy = np.zeros(13)

    # dS_I/dt   = 0 (inert, only dilution)
    # dS_S/dt   = -(1/Y_H)*rho1 - (1/Y_H)*rho2 + rho7
    dy[1] = -(1.0 / _Y_H) * rho1 - (1.0 / _Y_H) * rho2 + rho7

    # dX_I/dt   = 0 (inert particulate, only dilution)
    # dX_S/dt   = (1-f_p)*rho4 + (1-f_p)*rho5 - rho7
    dy[3] = (1.0 - _F_P) * rho4 + (1.0 - _F_P) * rho5 - rho7

    # dX_BH/dt  = rho1 + rho2 - rho4
    dy[4] = rho1 + rho2 - rho4

    # dX_BA/dt  = rho3 - rho5
    dy[5] = rho3 - rho5

    # dX_P/dt   = f_p*rho4 + f_p*rho5
    dy[6] = _F_P * rho4 + _F_P * rho5

    # dS_O/dt   = -((1-Y_H)/Y_H)*rho1 - ((4.57-Y_A)/Y_A)*rho3 + KLa*(S_O_sat - S_O)
    #             (aeration handled separately in the full RHS)
    dy[7] = -((1.0 - _Y_H) / _Y_H) * rho1 - ((4.57 - _Y_A) / _Y_A) * rho3

    # dS_NO/dt  = -((1-Y_H)/(2.86*Y_H))*rho2 + (1/Y_A)*rho3
    dy[8] = -((1.0 - _Y_H) / (2.86 * _Y_H)) * rho2 + (1.0 / _Y_A) * rho3

    # dS_NH/dt  = -i_XB*rho1 - i_XB*rho2 - (i_XB + 1/Y_A)*rho3 + rho6
    dy[9] = -_I_XB * rho1 - _I_XB * rho2 - (_I_XB + 1.0 / _Y_A) * rho3 + rho6

    # dS_ND/dt  = -rho6 + rho8
    dy[10] = -rho6 + rho8

    # dX_ND/dt  = (i_XB - f_p*i_XP)*rho4 + (i_XB - f_p*i_XP)*rho5 - rho8
    dy[11] = (_I_XB - _F_P * _I_XP) * rho4 + (_I_XB - _F_P * _I_XP) * rho5 - rho8

    # dS_ALK/dt = -(i_XB/14)*rho1 + ((1-Y_H)/(14*2.86*Y_H))*rho2
    #             - (i_XB/14 + 1/(7*Y_A))*rho3 + rho6/14
    dy[12] = (
        -(_I_XB / 14.0) * rho1
        + ((1.0 - _Y_H) / (14.0 * 2.86 * _Y_H)) * rho2
        - (_I_XB / 14.0 + 1.0 / (7.0 * _Y_A)) * rho3
        + rho6 / 14.0
    )

    return dy

def _nonneg_clamp(y, dy):
    """IWA-standard non-negativity enforcement at the RHS level.

    If a state is at (or below) zero and the derivative would push it
    further negative, clamp the derivative to zero.  This prevents
    physically impossible negative concentrations without modifying the
    solver.
    """
    for i in range(len(y)):
        if y[i] <= 0.0 and dy[i] < 0.0:
            dy[i] = 0.0
    return dy

def _rhs_asm1_steady(t, y):
    """ASM1 CSTR mass balance — steady-state approach to equilibrium."""
    y_safe = np.maximum(y, 0.0)

    rho = _asm1_process_rates(y_safe)
    r = _asm1_reaction_vector(rho)

    # Convert time from hours to days for kinetic parameters
    D_h = _D / _H_PER_D  # dilution rate in h^-1

    dy = np.zeros(13)
    for i in range(13):
        dy[i] = r[i] / _H_PER_D + D_h * (_Y_IN_ASM1[i] - y_safe[i])

    # Aeration term for S_O (index 7) — in h^-1
    dy[7] += (_KLA / _H_PER_D) * (_S_O_SAT - y_safe[7])

    return _nonneg_clamp(y, dy)
Parameters
  • _B_A = 0.15
  • _B_H = 0.62
  • _D = 0.0833333333333
  • _ETA_G = 0.8
  • _ETA_H = 0.4
  • _F_P = 0.08
  • _H_PER_D = 24
  • _I_XB = 0.086
  • _I_XP = 0.06
  • _KLA = 120
  • _K_A_AMMON = 0.08
  • _K_H = 3
  • _K_NH = 1
  • _K_NO = 0.5
  • _K_OA = 0.4
  • _K_OH = 0.2
  • _K_S = 20
  • _K_X = 0.03
  • _MU_A = 0.8
  • _MU_H = 6
  • _S_O_SAT = 8
  • _Y_A = 0.24
  • _Y_H = 0.67
  • _Y_IN_ASM1 = [30, 69.5, 51.2, 202.3, 0, 0, …] [shape=(13,), min=0, max=202.3]
Initial condition
y(0) = [30, 5, 1000, 100, 2500, 150, …] [shape=(13,), min=1, max=2500]
Horizon
t ∈ [0, 480]

Canonical RHS excerpt captured from the same registered callable used for the published benchmark. Frozen closure values are summarized below; helper imports and solver settings are intentionally omitted.

Fingerprint

Spread: high

Default noise: none

Recommendation snapshot

Clean best: SolvSRK

Noisy best: SolvSRK

Coverage

14 solver arms · clean + 5 noise levels

Ranked on survival, precision, and speed

Versions & freeze

Methodology →
Freeze
2026-08-13
libsolvsrk
2.3.0
SciPy
1.14
SUNDIALS
CVODE (bundled backend)

20 seeds/cell default · 14 arms · TRL 4–5 · simulation-lab validated · this page: Asm1 Steady (asm1-steady)

Governed SolvTune benchmark freeze; per-arm medians only. RHS definitions and raw trial rows are not published.

Self-reported by Resonix Labs · not independently verified

Results matrix

Pick an objective and a noise level to rank all arms on survival, median SCD, median nfev, and median wall time. Medians across seeds.

Objective

Best overall trade-off of survival, precision, and speed.

Noise level

#SolverSurvivalSCDnfevWallScore
1SolvSRK
100%
11.74,01797 ms0.896
2SciPy RadauSciPy
100%
11.55,798189 ms0.892
3SciPy DOP853SciPy
100%
9.513,214282 ms0.845
4SciPy RK23SciPy
100%
9.310,238248 ms0.840
5SciPy RK45SciPy
100%
8.911,924263 ms0.831
6CVODE BDFexternal
100%
8.51,44343 ms0.821
7Tsit5external
100%
8.310,6741.84 s0.818
8SciPy LSODASciPy
100%
8.23,15860 ms0.814
9CVODE Adamsexternal
100%
7.81,87947 ms0.804
10SciPy BDFSciPy
100%
7.72,27799 ms0.801

At Clean, best balanced arm is SolvSRK.

Values are medians across seeds, measured by Resonix Labs on Resonix hardware and not independently verified; nfev and wall are on reference lab hardware (indicative). Under injected noise only SolvSRK and the SciPy arms are run. How we measure accuracy → · Verification status →

SolvScout · free

Profile your problem for free

This page shows one published benchmark cell. SolvScout fingerprints your ODE, compares it to the full corpus, and recommends a solver with the same survival / precision / speed ranking you see here — including when a SciPy arm wins.

SolvSRK · 30-day trial

Run the winner on your machine

SolvSRK is the stiffness-adaptive integrator behind the SolvSRK column in these tables. Create an account, activate a machine, and take a 30-day trial — same binary you'd ship after purchase.

Cite this page

Replace the access date. Pin the freeze ID and library versions when comparing against a later export. Cite it as what it is — a self-reported vendor benchmark, not an independently verified result. The note field says so; please keep it.

@misc{resonix_evidence_asm1_steady_2026,
  title        = {Resonix Evidence Portal: Asm1 Steady},
  author       = {{Resonix Labs (Canada) Inc.}},
  year         = {2026},
  howpublished = {\url{https://resonix.tech/evidence/problems/asm1-steady}},
  note         = {Self-reported vendor benchmark; internally generated by Resonix Labs and not independently verified. Accessed YYYY-MM-DD. Freeze 2026-08-13; libsolvsrk 2.3.0; SciPy 1.14.}
}

Related

TRL 4–5 · simulation-lab validated · 398 problems · 14 solver arms · clean + 5 noise levels

Freeze: 2026-08-13 · scipy 1.14 · libsolvsrk 2.3.0 · Methodology

Self-reported by Resonix Labs · not independently verified · Verification status