Reinforcement learning for H2S abatement

11772985 · 2023-10-03

Assignee

Inventors

Cpc classification

International classification

Abstract

A computer implemented method and a system abates the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network from an upstream pumping pit to a downstream pumping pit or manhole. The computer implemented method and a system includes dosing into the wastewater at a position upstream of the downstream pit or manhole a chemical for abatement of sulphide, determining by use of a sensor the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream manhole. The amount of chemical dosed is determined by use of a general agent and a specific agent.

Claims

1. A computer-implemented method for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network from an upstream pumping pit to a downstream pumping pit or manhole wherein the specific wastewater network being an existing or planned physical realization of a wastewater network, the method comprising: providing the specific wastewater network comprising the upstream pit and the downstream pit or manhole; providing a dosing unit configured for dosing a chemical capable of sulphide abatement upstream of the downstream pit or manhole; providing a sensor downstream of the dosing unit, said sensor being capable of measure concentration of sulphide and provide a readout indicative of the sulphide concentration in a region surrounding the sensor; providing a control unit configured for providing the dosing unit with a dosing signal and for receiving as input the readout from the sensor; dosing into the wastewater at a position upstream of the downstream pit or manhole said chemical for abatement of sulphide; and determining by use of the sensor the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater; wherein the amount dosed of said chemical for abatement of sulphide is determined by providing a general agent being a software implement algorithm and at least one of: training the general agent by reinforcement learning (A), to determine a dosing amount of chemical for abatement of H.sub.2S on the basis of a concentration of sulphide, the training of the general agent (A) is based on numerical simulations of a plurality of real wastewater networks; training the general agent (A) by reinforcement learning (B), on a numerical simulation of the specific wastewater network to determine a dosing amount of chemical for abatement of H.sub.2S on the basis of a concentration of sulphide; training the general agent by reinforcement learning (B), on a numerical simulation of another specific wastewater network to determine a dosing amount of chemical for abatement of H.sub.2S on the basis of a concentration of sulphide; deploying the general agent (A or B) to determine amounts of said chemical for abatement of sulphide to be dosed into said specific wastewater network and dosing the determined amounts of chemical into the specific wastewater network by the dosing unit, wherein the deployment and dosing comprises: training by reinforcement learning the general agent (A, B), to obtain a specific trained agent (C), the specific trained agent (C) being a computer implemented algorithm, wherein the reinforcement learning comprises: initially, determining by use of the general agent (A, B) an amount of said chemical for abatement of sulphide to be dosed by the dosing unit on the basis of a determined concentration of sulphide in the specific wastewater network by the sensor, dosing the determined amount into the wastewater by the dosing unit, and after dosing of said chemical determining the concentration of sulphide in the specific wastewater system by the sensor and further train the general agent (A, B) to obtain the specific trained agent (C); subsequently determining by use of the specific trained agent (C) an amount of said chemical for abatement of sulphide to be dosed on the basis of a determined concentration of sulphide in the specific wastewater network, dosing the determined amount into the wastewater by the dosing unit, and after dosing said chemical determining the concentration of sulphide in the specific wastewater system by the sensor and further train the specific trained agent (C).

2. A method according to claim 1, wherein the further training the specific agent comprising an exploratory element, where the specific agent comprising the exploratory element executes a different amount of dosing of chemical to abate sulphide than what would have been determined by the specific agent without the exploratory element.

3. A method according to claim 1, wherein training the general agent comprising an exploratory element, where the general agent comprising the exploratory element executes a different amount of dosing of chemical to abate sulphide than what would have been determined by the general agent without the exploratory element.

4. A method according to claim 1, wherein the reinforcement learning comprises a reinforcement learning reward.

5. A method according to claim 1, wherein the reinforcement learning is implemented as a reinforcement learning reward routine based on the negative absolute difference between a pre-selected level of sulphide concentration and an actual determination of sulphide concentration.

6. A method according to claim 1, wherein the numerical simulation of a wastewater network system(s) is/are based on the basis of a plurality of data sets from real dosing scenario(s) from wastewater network system(s).

7. A method according to claim 1, wherein the determined concentration of sulphide is a value timely averaged over a preselected time.

8. A method according to claim 1, wherein the determined concentration of sulphide is determined at preselected points in time.

9. A method according to claim 1, wherein the general agent (B) is trained on the basis of simulations on at least some characteristics of the specific wastewater network, wherein the characteristics includes one or more of geometries of the specific network system, expected timewise load exposure, expected quality, expected rain, specific information including houses connected, number of dimension, and policy from agents acting in other wastewater network system(s).

10. A method according to claim 1, wherein the general agent (A, B) and the specific agent (C) use a policy, for determining the best action given the state of the system and its surroundings, trained on Q learning, deep Q learning, model-based algorithms, actor-critique algorithm, federated learning or transfer_learning the state of the system being e.g. the sulphide concentration history and flow history of the system, the time of the week, the rain in the area, the temperature of the waste water.

11. A method according to claim 1, wherein the pre-selected level of sulphide concentration is a concentration interval, and where in the reinforcement learning comprising providing the specific agent (C) with a negative reward if a determined concentration of sulphide is outside the concentration interval.

12. A method according to claim 1, wherein the pre-selected level of sulphide concentration is a concentration value, and where in the reinforcement learning comprising providing the specific agent (C) with a negative reward if a determined concentration of sulphide is larger or smaller than the concentration value.

13. A method according to claim 1, wherein the chemical dosed for abatement of sulphide is iron in one of its common oxidation states.

14. A method according to claim 1, wherein the specific wastewater network further comprising: an inlet for receiving wastewater provided in the upstream pumping pit; an outlet for discharging wastewater provided in the downstream pumping pit or manhole; a pumping main fluidicly connecting the upstream pumping pit with the downstream pumping pit or manhole; a pump arranged to pump wastewater from the upstream pumping pit to the downstream pumping pit or manhole through the pumping main, said pump being configured to pump in response to receiving a pump control signal, and wherein: said sensor is arranged downstream of the position at which chemical is dosed into the wastewater, said sensor providing a readout indicative of the sulphide concentration in a region surrounding the sensor.

15. A system for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network from an upstream pumping pit to a downstream pumping pit or manhole, the system comprising: an upstream manhole having an inlet for receiving wastewater; a downstream manhole having an outlet for discharging wastewater; a pumping main fluidicly connecting the upstream pumping pit with the downstream pumping pit or manhole; a pump arranged to pump wastewater from the upstream manhole to the downstream pumping pit or manhole through the pumping main, said pump being configured to pump in response to receiving a pump control signal; a dosing unit configured for dosing chemical into pumping main upstream of the downstream pumping pit or manhole, said dosing unit being configured to dose a specific amount in response to receiving a dosing control signal; a sensor arranged downstream of the position at which chemical is dosed into the wastewater, said sensor provides a readout indicative of the sulphide concentration in a region surrounding the sensor, a control unit configured for providing the pump with a pump control signal, providing the dosing unit with a dosing control signal, and for receiving as input the readout from the sensor, said control unit being further configured to establishing and execute a specific trained agent (C), the specific trained agent being obtained by training a general agent (A, B) by reinforcement learning, wherein the reinforcement learning comprises initially, determining by use of the general agent (A, B) an amount of chemical for abatement of sulphide to be dosed by the dosing unit on the basis of a determined concentration of sulphide in the specific wastewater network by the sensor, dosing the determined amount into the wastewater by the dosing unit, and after dosing of the chemical determining the concentration of sulphide in the specific wastewater system by the sensor.

16. A method according to claim 4, wherein the reinforcement learning reward is based on a negative absolute difference between a pre-selected level of sulphide concentration and an actual determination of sulphide concentration or based on a negative sum of estimated cost of sulphide and an estimated cost of chemical.

Description

BRIEF DESCRIPTION OF THE FIGURES

(1) The present invention and in particular preferred embodiments thereof will now be disclosed in greater details with reference to the accompanying figures. The figures show way of implementing the present invention and are not be construed as being limiting to other possible embodiments falling within the scope of the attached claim set.

(2) FIG. 1 schematically illustrates a wastewater network according to a preferred embodiment of the invention;

(3) FIG. 2A schematically illustrates providing a general trained agent according to a preferred embodiment of the invention;

(4) FIG. 2B schematically illustrates providing a specific trained agent according to a preferred embodiment of the invention;

(5) FIG. 3A is a flow chart schematically illustrating steps involved in establishing a specific trained agent according to a preferred embodiment of the invention, particularly two sub-processes, namely providing an general trained agent and the subsequent process of deploying the general trained agent and training the same;

(6) FIG. 3B is a flow chart schematically illustrating steps involved in establishing a specific trained agent according to a preferred embodiment of the invention with details of steps of the sub-process of providing an general trained agent;

(7) FIG. 3C is a flow chart schematically illustrating steps involved in establishing a specific trained agent according to a preferred embodiment of the invention with details of steps of the sub-process of deploying the general trained agent and training the same;

(8) FIG. 4A shows an embodiment of the training of a general agent in an embodiment on a specific network. showing the network simulation tree;

(9) FIG. 4B is continuation of FIG. 4A;

(10) FIG. 4C is a graph showing the average reward as a function of episode number;

(11) FIG. 4D is a graph showing data from an episode in the mid-range of the training of agent; and

(12) FIG. 4E is a graph showing data from the last episode of the training of the general agent.

DETAILED DESCRIPTION OF AN EMBODIMENT

(13) Reference is made to FIG. 1 schematically illustrates a wastewater network 1 according to a preferred embodiment of the invention. The figure shows various parts in cross sectional views. FIG. 1 is not drawn in a physical scale which is indicated e.g. by the pumping main being drawn with broken lines. As illustrated, the wastewater network 1 comprises an upstream pumping pit 9 inside which a pump 3 is arranged. The pumping pit 9 has an inlet 14 through which wastewater, such as sewage water is fed into the pumping pit 9. The grey shaded area inside the pumping pit 9 indicates the filling level of the pumping pit 9.

(14) The upstream pumping pit 9 is fluidicly connected with a downstream manhole 4 (which may be a pumping pit) through a pumping main 2 which is a piping inside which wastewater fluid flows. The downstream manhole 4 comprises an outlet 16 through which wastewater can leave the manhole 4. Also in this case, the grey shading indicates the filling level in the manhole 4. The labelling upstream and downstream refers to the flow direction, which in the shown embodiment is from the pumping pit 9 to the manhole 4.

(15) As presented herein, wastewater produces H2S if no measures are taken to avoid this. In the specific embodiment, a dosing unit 6 is fitted which by use of a pump 10 doses metered amounts of chemical to abate formation of H2S into the wastewater. The actual dosing position may be different from the position illustrated in FIG. 1, such as more upstream or downstream than illustrated or even positioned to dose into the sewage fluid inside the pumping pit 9.

(16) The dosing of chemical and the control of the pump 3 (stop, start and pumping amounts) are controlled by a control unit 7. This is shown in FIG. 1 by dotted lines from the control unit 7 to the dosing unit 6 and the pump 3, which dotted lines illustrates control signals connections. As will be detailed below, the amount of chemical dosed resides, inter alia, in a determination of concentration of sulphide.

(17) It has been found that a practical and efficient determination of concentration of sulphide can be carried out in the headspace inside the manhole 4. Accordingly, the wastewater network 1 according to the illustrated embodiment comprises a sulphide sensor 5 arranged in the headspace inside the manhole 4, and readouts from the sensor is fed into the control unit 7 through a data connection 13. The sensor 5 may alternatively be placed in liquid phase of the sewage.

(18) The dosing of chemical utilizes a computer implemented method for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in the specific wastewater network 1 illustrated in FIG. 1. The wastewater network 1 is labelled a specific wastewater system since it is an existing or planned physical realization of a wastewater network. As mentioned, the method comprises the steps of dosing into the wastewater at a position upstream of the downstream manhole 4 a chemical for the abatement of H2S, and determining by use of the sensor 5 the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream manhole 4.

(19) The amount of chemical dosed is determined by training a general agent A by reinforcement learning to determine a dosing amount of chemical on the basis of a concentration of sulphide. An agent is a software implemented algorithm for which details will be provided below. This agent is labelled “general agent” as it is not provided on the basis of being trained on a specific physical wastewater network, which may have physical deviations and imperfections. By general is preferably meant where data is not obtained in real-time and where the agent is not connected, learning or dosing to a real live operating wastewater network.

(20) On the contrary, the training of the general agent A is, in some embodiments, based on a numerical simulation of a plurality of real wastewater networks. This plurality of wastewater network may be labelled “wastewater network resembling real wastewater network” as the real wastewater networks are simulated. These simulations are preferable based on dynamical equations, which could be based on data from wastewater network system, specific inflow profiles etc. Further, a range of data sources and computation techniques can be utilized in the simulation of the networks, such as real data from the network, such as a plurality of data sets from real dosing scenarios from wastewater networks, dynamical equations based on experimental data, theoretical considerations, knowledge about the systems etc. The general agent A is preferable trained on a plurality of wastewater networks, such that the agent is diversely trained and in some cases to avoid overfitting of the general agent A.

(21) The general agent A may in some embodiments after this first training be trained to dose chemical to the wastewater network. This will advantageously remove the vast majority of the exploration time associated with reinforced learning when deploying the agent to a real system. The training is done on a plurality of wastewater networks in order for the general agent A to be trained to deal with a number of different scenarios and parameterizations and for the agent to be able to explore the vast majority of the “exploration space” associated with the wastewater networks.

(22) In some embodiments, when the general agent A has been trained to be able to dose chemicals using simulated data from a number of wastewater networks, the agent is further trained on a specific simulation of a specific wastewater network. This will produce a more specific general agent, denoted general agent B, since it is preferable a trained agent A on a specific simulated wastewater network.

(23) This specific wastewater network could have been part of the training material for general agent A, but may be a completely different wastewater network and/or a more specific simulation, where further information about the network system is included. The general idea is to train the general agent on the specific system it is to be deployed. By training material is preferably meant suitable parameterized and structured data for use in reinforcement learning in wastewater network.

(24) This may reduce the exploration time further, when the general agent B is deployed to a real system. This simulated wastewater network is preferably based on attributes of a real wastewater network and can include all of the networks specifications, such as, number of dimensions, houses connected, etc.

(25) This simulated wastewater network may therefore be as close to the real network as possible or desired and in order to create the simulation, a range of data sources and computation techniques can be utilized, such as real data from the network, dynamical equations based on experimental data, theoretical considerations, knowledge about the systems etc.

(26) In some embodiments, the general agent (B) can also be trained straight from one specific simulated wastewater network, such that the general agent (A) is not used in order to provide the general agent (B).

(27) The training of the general agent is in some embodiments carried out by training a general agent B by reinforcement learning to determine a dosing amount of chemical on the basis of a concentration of sulphide, the training of the general agent B is based on a plurality of data sets from real dosing scenarios from a specific wastewater networks, which may or may not form part of the simulation.

(28) After the general agent A, B has been trained (preferably decided based on a preselected criteria such as the convergence of successive rewards, level of H2S or other preselected criteria), either from a plurality of networks and/or further on a specific wastewater network, the general agent A, B is deployed to be used in dosing chemical in the specific wastewater network such as the one disclosed in FIG. 1. The dissimilarities in between the different networks of the plurality of networks may be both on pipe network, load and quality, and timely distribution of those.

(29) When the general agent A, B is deployed, an overall concept of the invention is that this general trained agent should be further trained based on the dynamics of the specific wastewater network 1, thereby becoming a specific trained agent C.

(30) This training is typically done through reinforced learning, and the training may occur throughout the utilization of the agent C to determine chemical dosing to the wastewater network. The specific agent C is therefore specific to a physical, real, wastewater system, which means that the agent C is adapted to dynamics, quirks and imperfections of that specific system, which the simulation or training material may not have taken into account. Agent C therefore dose to the real wastewater system and learns from this.

(31) Thus, after the general agent, which could either be agent A or agent B, has been provided, it is deployed to determine amounts of chemical to be dosed into specific wastewater network 1 and dosing the determined amounts of chemical into the specific wastewater network 1. In the specific embodiment shown in FIG. 1, the general agent is deployed into the control unit 7; however, the general agent may employed based a cloud based implementation. Once deployed, the general agent is subjected to reinforcement learning, learning from the real system, to obtain a specific trained agent C. The control unit 7 comprising at least one computer having data storage means in connection therewith and comprising program instructions which, when the program is executed by the computer, cause the computer to carry out steps of the method according to the invention.

(32) At the very first instance of using the general agent A, B on the specific wastewater network 1, the general agent A, B is not yet trained on a specific, real wastewater network and the amount of chemical to be dosed is thus determined on the basis of determined concentration of sulphide in the specific wastewater network 1 and input this concentration into the general agent A, B and dosing the determined amount into the wastewater.

(33) Subsequently, a state (concentration of sulphide) is obtained from the wastewater network by use of the sensor 6 and this state is used to establish the specific trained agent C by providing a reinforcement learning initially on the general trained agent A, B and subsequently to the specific trained agent C.

(34) The reinforcement learning is implemented as a reinforcement learning reward routine based on the negative absolute difference between a pre-selected level of sulphide concentration and an actual determination of sulphide concentration. This is based on that in many implementations, the sulphide level is specified as a level and that an aim is to obtain a concentration level as close as possible to this level.

(35) In another embodiment (which may be combined with the negative absolute difference embodiment) the reinforcement learning is based on the negative sum of estimated cost of H2S and the estimated cost of chemical. Cost of H2S may include two components cost of smell, cost of degradation of pipe, e.g. estimated by considering cost of replacing the pipe and manhole and the effect of H2S on the life time of the pipes and manholes.

(36) FIG. 2 schematically illustrates providing of the general agent, in this case agent B and the specific agent, here agent C. In FIG. 2A, the agent is referred to as an “Algorithm” and the numerical simulation as an “Environment”. The numerical simulation is illustrated as a circuit. As illustrated, the algorithm provides an action, in this case a dosing amount, to be supplied to the environment. The environment, the numerical simulation, respond to this by a state, in this case a sulphide concentration. Based on the state, a reward is determined and the state together with the reward is supplied to the algorithm.

(37) In FIG. 2B, the general agent is deployed to the specific wastewater network. The Environment is schematically illustrated with elements recognizable from FIG. 1. The process of FIG. 2B is as in FIG. 2A except that now the reinforcement learning is based a real state (sulphide concentration) provided by the specific wastewater network 1.

(38) In FIG. 2B, the general agent B has become the specific agent C and is determining dosing on a real wastewater, learning and adapting through reinforcement learning.

(39) FIG. 3 is a flow chart schematically illustrating steps involved in establishing a specific trained agent according to a preferred embodiment of the invention. FIG. 3A illustrate two sub-processes, namely providing a general trained agent which corresponds to FIG. 2A and the subsequent process of deploying the general trained agent and training the same which corresponds to FIG. 2B.

(40) FIGS. 3B and C each illustrates in greater details steps of the two sub-processes; Referring to FIG. 4, an example of training the general agent B from scratch is shown. In some embodiments, a general agent A is trained beforehand on a plurality of simulated wastewater networks.

(41) The simulated wastewater network used in the training can be seen in FIG. 4a, which is based on dynamical equations and information about the specific system, which could, but is not limited to, data, dimension of pipes, location of measuring devices, houses connected, etc. The wastewater network has two pits (such as pits disclosed in connection with FIG. 1), with their in-flow profiles being created to have a non-constant, but repeating pattern with a small amount of added noise. The dosing is done at the end of the system, and the H2S level is measured 5 meters after dosing.

(42) The agent can change the dosing level every 6.sup.th hour and has three options, increase/decrease the dosing level by 0.0001, 0.0005, 0.001 absolute percentages or keep the current dosing. This gives the agent seven actions, which it can take.

(43) The observation, which the agent must determine the actions from, consists of the systems state for the previous 16 cycles, where one cycle is 6 hours. The level H2S level is therefore measured every 6 hour. Thus, the agent has available 16*6=96 hours of the most recent history to base its decision on. The system state contains the following: Mean H2S level measured at output, Absolut H2S error relative to the desired H2S level, Dosing level, Time-indicator: the week is divided into 7*4=28 segments, so the agent knows whether it is Monday morning or Saturday afternoon.

(44) The reward functions is given as the negative absolute difference between the desired H2S level and the measured average H2S level, thus the highest reward is 0. The agent was implemented using a recurrent neural network with 8 layers and a layer size of 32.

(45) The agent is trained on 238 episodes, where each episode consists of 42 days, which equals 42*4=168 cycles/observations per episode, which yields a total of 238*168=39984 action/reward pairs to be trained on.

(46) The average reward per episode can be seen in FIG. 4b, which shows that the rewards, which is an indicator of the level of exploration of the algorithm, increases and converges towards a fixed high level. This indicates that optimal parameterization has occur by reinforcement learning.

(47) To further examine the agent, episode 105 (approximately half-way training) and final episode, 260 is compared. These can respectively be seen in FIGS. 4c and 4d. The two top plots shows the inflow to the two pits over time. The two middle plots show the H2S level at 15 seconds and at 6 hours interval respectively, where the latter further contains a constant level indicator of the desired level of H2S. The two bottom plots show the dosing set point (reflects the chosen actions) and the reward, respectively.

(48) By comparing the two plots from the bottom for both the episodes, it is seen that the agent learns how to adjust the dosing level in order to control the H2S level. Further, it is seen that the trained agent achieved a more desirable H2S level.

(49) It is further observed that the training time is 39984*6=239904 hours, and an acceptable deviation is achieved after half that, at approximately 125000 hours or 5208 days. Training the agent on a real system would therefore produce unfavorable results for at least that period.

(50) The trained general agent B can now be deployed to a real live wastewater network and used to dose chemicals, with a low exploration time.

(51) Concentration levels when measured in e.g. the headspace may have a tendency to fluctuate rapidly rendering it ineffective to train the specific agent and determine the amount to be dosed based thereon. Thus, the determined concentration of sulphide used for training and determining the amount to be dosed may be a concentration value timely averaged over a preselected time, such as over 5.0 minutes, such as over 10.0 minutes or even longer, such as an over 1.0 hours, such as 2.0 hours, or even 3.0 hours. In a specific embodiment, peaks the 50 highest peaks of H2S occurring during a 6.0 hours' time window were averaged to provide the concentration to the agent.

(52) While the invention has the capabilities of operating in essence continuously where a substantial continuous determination of concentration is provided by the sensor 6 and the specific agent substantially continuously is trained and determines an amount to be dosed, it has been found that it can be more effective to abate sulphide if the determined concentration of sulphide is determined at preselected points in time, such as at regular intervals, such as with a time interval of 15.0 seconds, such as 1.0 minutes, preferably 1.0 minutes, such as 20.0 minutes. The regular intervals for abatement of sulphide may, in an embodiment, be the same as intervals used in the previous section for determining the concentration of the sulphide.

(53) Although the method of the invention can be used intermittently, that is turned off and on intermittently, it is often preferred that the reinforcement learning of the specific trained agent C is applied while the specific wastewater network is in service.

(54) The general agent as disclosed, is in some embodiments trained based on numerical simulations. Such numerical simulations may often reside in a generic wastewater network e.g. characterized by different characteristic volume flows of wastewater, with different load and simulated state in response to simulated dosing of chemicals. While this provides a useable general agent, the general agent may before being deployed be further trained on the basis of simulations on at least some characteristics of the specific wastewater network 1. Such characteristics of the specific wastewater network 1 may include geometries of the networks system 1, expected timewise load exposure, expected quality, such as sewage water's potential to produce H2S, expected rain. By this, the exploration time for specific agent may be made even shorter which has the benefit of an efficient abatement of sulphide may be established faster. Such a further training is typically also performed by reinforcement learning as used otherwise for the general agent.

(55) In some preferred embodiments, the general agent A and the specific agent B use a policy, for determining the best action given the state of the system and its surroundings, trained on Q learning, deep Q learning, model-based algorithms, actor-critique algorithm, federated learning or transfer_learning the state of the system being e.g. the H2S concentration history and flow history of the system, the time of the week, the rain in the area, the temperature of the waste water.

(56) In some preferred embodiments, the pre-selected level of sulphide concentration is selected as a concentration interval, such as 5.0±0.1 ppm, preferably 4.0±0.1 ppm, such as 3.0±0.1 ppm, and where in the reinforcement learning comprising providing the specific agent C with a negative reward if a determined concentration of sulphide is outside the concentration interval.

(57) In some preferred embodiments, the pre-selected level of sulphide concentration is selected a concentration value, such as 5.0 ppm, preferably 4.0 ppm, such as 3.0 ppm, and where in the reinforcement learning comprising providing the specific agent C with a negative reward if a determined concentration of sulphide is larger or smaller than the concentration value.

(58) A method according to the present invention, wherein the pre-selected level of sulphide concentration is determined based on an estimated cost of dosing iron and estimated maintenance cost for the wastewater network as function of sulphide concentration.

(59) While many different chemical may be used to abate formation or presence of sulphide, the chemical dosed is in many preferred embodiments, iron in one of its common oxidation states, such as Fe.sup.2+, Fe.sup.3+ and/or Fe.sup.6+, or NO.sub.3.

(60) The invention can be implemented by means of hardware, software, firmware or any combination of these. The invention or some of the features thereof can also be implemented as software running on one or more data processors and/or digital signal processors.

(61) The individual elements of an embodiment of the invention may be physically, functionally and logically implemented in any suitable way such as in a single unit, in a plurality of units or as part of separate functional units. The invention may be implemented in a single unit, or be both physically and functionally distributed between different units and processors.

(62) H2S and sulphide are used interchangeably herein.

(63) Although the present invention has been described in connection with the specified embodiments, it should not be construed as being in any way limited to the presented examples. The scope of the present invention is to be interpreted in the light of the accompanying claim set. In the context of the claims, the terms “comprising” or “comprises” do not exclude other possible elements or steps. Also, the mentioning of references such as “a” or “an” etc. should not be construed as excluding a plurality. The use of reference signs in the claims with respect to elements indicated in the figures shall also not be construed as limiting the scope of the invention. Furthermore, individual features mentioned in different claims, may possibly be advantageously combined, and the mentioning of these features in different claims does not exclude that a combination of features is not possible and advantageous.

LIST OF REFERENCE SYMBOLS USED

(64) 1 Wastewater network 2 Pumping main 3 Waste water pump 4 Downstream manhole such as a pumping pit 5 Sensor 6 Dosing unit 7 Control unit 8 Side branch 9 Upstream manhole such as a pumping pit 10 Dosing pump 11 Control connection to waste water pump 3 12 Control connection to dosing unit 6 13 Data connection from sensor 5 14 Inlet to manhole or pumping pit 9 16 Outlet from downstream manhole

Itemized List of Preferred Embodiments

(65) Item 1. A method for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network (1) from an upstream pumping pit (9) to a downstream pumping pit or manhole (4), the method comprising dosing into the wastewater at a position upstream of the downstream pit or manhole (4) a chemical for abatement of H2S, determining by use of a sensor (5) the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream manhole (4);

(66) wherein the amount of chemical dosed is determined by training a general agent by reinforcement learning (A), to determine a dosing amount of chemical on the basis of a concentration of sulphide, the training of the general agent (A) is based on numerical simulations of a plurality of wastewater networks resembling real wastewater networks, and/or: training the/a general agent (A) by reinforcement learning (B), on a numerical simulation of a specific wastewater network to determine a dosing amount of chemical on the basis of a concentration of sulphide; deploying the general agent (A or B) to determine amounts of chemical to be dosed into said specific wastewater network (1) and dosing the determined amounts of chemical into the specific wastewater network (1), wherein the deployment and dosing comprising training by reinforcement learning the general agent (A, B), to obtain a specific trained agent (C), wherein the reinforcement learning comprising: initially, determining by use of the general agent (A, B) an amount of chemical to be dosed on the basis of determined concentration of sulphide in the specific wastewater network (1) and dosing the determined amount into the wastewater, subsequently, establishing the specific trained agent (C) by determining the concentration of sulphide in the specific wastewater system and provide a reinforcement learning initially on the general trained agent (A, B) and subsequently to the specific trained agent (C).

(67) Item 2. A method according to item 1, wherein the reinforcement learning comprises a reinforcement learning reward, preferably based on the negative absolute difference between a pre-selected level of sulphide concentration and an actual determination of sulphide concentration or based on the negative sum of estimated cost of H2S and the estimated cost of chemical.

(68) Item 3. A method according to item 1 or 2, wherein the numerical simulation of a wastewater network system(s) is/are based on the basis of a plurality of data sets from real dosing scenario(s) from wastewater network system(s).

(69) Item 4. A method according to any of the preceding items, wherein the determined concentration of sulphide is a value timely averaged over a preselected time, such as over 5.0 minutes, such as over 10.0 minutes.

(70) Item 5. A method according any of the preceding items, wherein the determined concentration of sulphide is determined at preselected points in time, such as at regular intervals.

(71) Item 6. A method according to any of the preceding items, wherein the reinforcement learning of the specific trained agent (C) is applied while the specific wastewater network is in service.

(72) Item 7. A method according to any of the preceding items, wherein the general agent (B) is trained on the basis of simulations on at least some characteristics of the specific wastewater network (1), wherein the characteristics includes one or more of geometries of the networks system (1), expected timewise load exposure, expected quality, expected rain, specific information, such as houses connected, number of dimension, and policy from agents acting in other wastewater networks system(s).

(73) Item 8. A method according to any of the preceding items, wherein the training comprising reinforcement learning.

(74) Item 9. A method according to any of the preceding items, wherein the general agent (A, B) and the specific agent (C) use a policy, for determining the best action given the state of the system and its surroundings, trained on Q learning, deep Q learning, model-based algorithms, actor-critique algorithm, federated learning or transfer_learning the state of the system being e.g. the H2S concentration history and flow history of the system, the time of the week, the rain in the area, the temperature of the waste water.

(75) Item 10. A method according to any of the preceding items, wherein the pre-selected level of sulphide concentration is a concentration interval, such as 5.0±0.1 ppm, preferably 4.0±0.1 ppm, such as 3.0±0.1 ppm, and where in the reinforcement learning comprising providing the specific agent (C) with a negative reward if a determined concentration of sulphide is outside the concentration interval.

(76) Item 11. A method according to any of the preceding items, wherein the pre-selected level of sulphide concentration is a concentration value, such as 5.0 ppm, preferably 4.0 ppm, such as 3.0 ppm, and where in the reinforcement learning comprising providing the specific agent (C) with a negative reward if a determined concentration of sulphide is larger or smaller than the concentration value.

(77) Item 12. A method according to any of the preceding items, wherein the chemical dosed is iron in one of its common oxidation states, such as Fe.sup.2+, Fe.sup.3+ and/or Fe.sup.6+, or NO.sub.3.

(78) Item 13. A system for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network (1) from an upstream pumping pit (9) to a downstream pumping pit or manhole (4), the system comprising an upstream manhole (9) having an inlet (14) for receiving wastewater, a downstream manhole (14) having an outlet (16) for discharging wastewater, a pumping main (2) fluidicly connecting the upstream pumping pit (9) with the downstream pumping pit or manhole (4), a pump (3) arranged to pump wastewater from the upstream manhole (9) to the downstream pumping pit or manhole (4) through the pumping main (2), said pump (3) is configured to pump in response to receiving a pump control signal, a dosing unit (6) configured for dosing chemical into pumping main (2) upstream of the downstream pumping pit or manhole (4), said dosing unit (6) is configured to dose a specific amount in response to receiving a dosing control signal, a sensor (5) arranged downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream pumping pit or manhole (4), said sensor provides a readout indicative of the sulphide concentration in a region surrounding the sensor (5), a control unit (7) configured for providing the pump (3) with a pump control signal, providing the dosing unit (6) with a dosing control signal, and for receiving as input the readout from the sensor (5), said control unit (7) is further configured to establishing and execute the specific trained agent (C) according to any of the preceding items.

(79) Item 14. A method for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network (1) from an upstream pumping pit (9) to a downstream pumping pit or manhole (4), the method comprising dosing into the wastewater at a position upstream of the downstream pit or manhole (4) a chemical for abatement of H2S, determining by use of a sensor (5) the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream manhole (4);

(80) wherein the amount of chemical dosed is determined by deploying a general agent (A or B) to determine amounts of chemical to be dosed into said specific wastewater network (1) and dosing the determined amounts of chemical into the specific wastewater network (1), wherein the deployment and dosing comprising training by reinforcement learning the general agent (A, B), to obtain a specific trained agent (C), wherein the reinforcement learning comprising: initially, determining by use of the general agent (A, B) an amount of chemical to be dosed on the basis of determined concentration of sulphide in the specific wastewater network (1) and dosing the determined amount into the wastewater, subsequently, establishing the specific trained agent (C) by determining the concentration of sulphide in the specific wastewater system and provide a reinforcement learning initially on the general trained agent (A, B) and subsequently to the specific trained agent (C).

(81) Item 15. A method according to item 14, wherein the general agent is provided by: training a general agent by reinforcement learning (A), to determine a dosing amount of chemical on the basis of a concentration of sulphide, the training of the general agent (A) is based on numerical simulations of a plurality of wastewater networks resembling real wastewater networks, and/or: training the/a general agent (A) by reinforcement learning (B), on a numerical simulation of a specific wastewater network to determine a dosing amount of chemical on the basis of a concentration of sulphide.

(82) Item 16. A method for abating the presence of sulphide (H2S(g), H2S(aq) or HS-(aq)) in a wastewater flowing in a specific wastewater network (1) from an upstream pumping pit (9) to a downstream pumping pit or manhole (4), the method comprising dosing into the wastewater at a position upstream of the downstream pit or manhole (4) a chemical for abatement of H2S, determining by use of a sensor (5) the concentration of sulphide at a position downstream of the position at which chemical is dosed into the wastewater, such as located in the downstream manhole (4);

(83) wherein the amount of chemical dosed is determined by inputting the determined concentration of sulphide into a specific agent whereby the specific agent provides an amount of chemical to the be dosed and dosing said amount into the wastewater network.

(84) Item 17. A method according to item 16, wherein the specific agent is provided by training a general agent before being deployed on a specific wastewater network.

(85) Item 18. A method according to item 17, wherein specific agent is trained by being deployed on said specific wastewater network(s).

(86) Item 19. A method according to any of items 16-18, wherein the specific agent is according to any of the preceding items 1 to 13.