bsm1_ol ¶
BSM1OL ¶
BSM1OL(data_in=None, timestep=None, endtime=None, evaltime=None, data_out=None, *, tempmodel=False, activate=False)
Creates a BSM1OL object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_in | ndarray(n, 22) | str(optional) | Influent data. Has to be a 2D array. [SI, SS, XI, XS, XBH, XBA, XP, SO, SNO, SNH, SND, XND, SALK, TSS, Q, TEMP, SD1, SD2, SD3, XD4, XD5] | None |
timestep | float(optional) | Timestep for the simulation [d]. | None |
endtime | float(optional) | Endtime for the simulation [d]. | None |
evaltime | int | ndarray(2)(optional) | Evaluation time for the simulation [d]. [starttime, self.simtime[-1]] | None |
data_out | str(optional) | Path to the output data file. | None |
tempmodel | bool(optional) | If | False |
activate | bool(optional) | If | False |
Source code in src/bsm2_python/bsm1_ol.py
def __init__(
self,
data_in: np.ndarray | str | None = None,
timestep: float | None = None,
endtime: float | None = None,
evaltime: int | np.ndarray | None = None,
data_out: str | None = None,
*,
tempmodel: bool = False,
activate: bool = False,
):
super().__init__(
data_in=data_in,
timestep=timestep,
endtime=endtime,
evaltime=evaltime,
tempmodel=tempmodel,
activate=activate,
data_out=data_out,
)
step ¶
step(i, klas=None)
Simulates one time step of the BSM1 model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
i | int | Index of the current time step [-]. | required |
klas | ndarray(optional) | Array with the values of the oxygen transfer coefficients for the 5 ASM1 reactors. Default is: [reginit.KLA1, reginit.KLA2, reginit.KLA3, reginit.KLA4, reginit.KLA5] | None |
Source code in src/bsm2_python/bsm1_ol.py
def step(
self,
i: int,
klas: np.ndarray | None = None,
):
"""Simulates one time step of the BSM1 model.
Parameters
----------
i : int
Index of the current time step [-].
klas : np.ndarray (optional)
Array with the values of the oxygen transfer coefficients for the 5 ASM1 reactors. \n
Default is: [reginit.KLA1, reginit.KLA2, reginit.KLA3, reginit.KLA4, reginit.KLA5]
"""
if klas is None:
self.klas = np.array([reginit.KLA1, reginit.KLA2, reginit.KLA3, reginit.KLA4, reginit.KLA5])
else:
self.klas = klas
super().step(i)