Wastewater management using artificial intelligence

. The subject matter, as well as the objectives of this article, was the usage and the modelling of the rainwater management process using artificial intelligence. The article deals with the research on how and why water should be used more effectively whether it is rainwater or greywater. In Slovakia, the usage of rainwater or greywater is not so popular. However, such usage has many advantages from an ecological, economical and technical viewpoint. In this article, a proposal was created of rainwater usage in a school building and this usage was realized by using Fuzzy cognitive maps. Fuzzy cognitive maps represent a well-oriented and evaluated diagram and it helped us to create a concrete process of water usage. The output of this experiment will be the decision system for the most effective use of water in a building, as well as the most effective way for the recycling of wastewater in buildings.


Introduction
We are living in an age where the topic of water scarcity is often discussed. While water supplies are decreased due to the decline of groundwater reserves, waste and pollution, the demand of water is increasing quite quickly. Currently, 338 million people are sometimes subject to severe water shortages, and by 2025 this number is projected to jump to about 3 billion [1].
Water conservation and management are becoming a global survival issue. This escalating issue of water conservation and management is still seeking the best water efficiency, sustainable and innovative rainwater as well as greywater harvesting system and management designs [7,8].
The paper describes the modelling of rainwater and greywater management process using artificial intelligence for an actual school building which is located on the campus of the Technical University in Košice, Slovakia. The fuzzy cognitive maps represent a welloriented and evaluated diagram which helped us to create the specific processes of water usage in the school building. The design of the management processes of collected water in this building was created through the use of fuzzy cognitive maps. The decision-making system using fuzzy cognitive maps will be considered the most appropriate and efficient usage of rain and greywater in a building as alternative water sources. This decision-making system will be working with requirements given by the abovementioned fuzzy cognitive maps. Primarily, it will be a system using greywater and rain water as alternative water sources and in the case of a bigger volume of water as is needed in the building and it will be this water which is drained into the infiltration well. The discharge of waters into the sewer will be the last solution in our decision-making system.

Fuzzy cognitive maps
The cognitive map is a graded oriented graph. Its nodes are concepts and the connections are the causal links between them. Fig. 1 is a simplified cognitive map. Mostly, the terms of states or the conditions and boundaries are actions or portable functions that transform states into nodes. Cognitive maps are able to describe complex dynamic systems. It is also possible to examine cycles, collisions, etc. An advantage is also the definition of the strength of relationships. They were originally represented by three values of -1, 0, and 1. A great advantage is the graphical representation: Fuzzy cognitive maps are an extension of cognitive maps and were designed by Kosko in 1986. The extension is that a fixed value of their joint can be obtained from the interval [-1; 1], as well as the nodes can be represented by membership functions [6].
There are several possible definitions of fuzzy cognitive maps, but still the most used of them is by the author Chen, who respects the original numerical matrix designed by Kosko, where the fuzzy cognitive map is defined as:

Decision system of the wastewater management process
The structure of the rainwater management system will be needed as a base for the work, and how the wastewater management system should operate and look. The diagram in Fig.  3 depicts a simplified structure of water management. This structure served as a basis for this work. At the beginning, there will be a database which we will store data that will represent inputs or defined conditions. This data is for example: • water consumption • rainfall • water level in the tank • discharge of the tank • need for lawn irrigation • discharge of water from the toilet • supply of greywater to the tank • consumption of greywater in the tank • drainage of greywater • draining the water into the infiltration or drainage system The database will still be interconnected with the wastewater management or otherwise called the decision-making system.
In the decision-making system, how to properly use rainfall or greywater will be considered. For this decision, the conditions of the above-mentioned fuzzy cognitive maps are used. In the decision-making system, we will pay particular attention to making the most efficient use of water. If it is necessary to drain rainwater from the precipitation water tank, it is preferable to drain into the infiltration well. Draining into the drainage system is only possible if the infiltration well is not able to infiltrate the rainwater in the well. However, this form of discharge is chosen as a last resort, because it is disadvantageous for both environmental reasons as well as financial reasons. The rainwater management system will be based on the decision of how to efficiently use all the wastewater to minimize water costs. It will deal with minimizing the water to the drainage system in the conception of finding the most effective way to handle wastewater. Another observed factor will be the water from the water main during a water deficit needed for the lawn and toilet supply in the building.

Visualization system
When creating water management using the classic rules, it would take a lot of rules, which would be very complicated and also time-consuming. Therefore, we used the means of artificial intelligence represented by the fuzzy cognitive map. The proposed fuzzy cognitive map for the making of a water management decision system is depicted in Fig. 4.   Fig. 4. Proposed fuzzy cognitive map for a decision-making water management system.

PK6 building -source of the data needed for the decision system
Creating a decision system for the management of rainwater and greywater was applied to the PK6 building. The PK6 building at the Technical University of Kosice campus was selected in 2011 for research into the quality and volume of the rainwater draining into existing underground drainage wells. Two vertical wells are located next to the PK6 building. All of the run-off rainwater falling onto the roof flows into these underground pipes ( Figure 5). The initial measurement started and continued in infiltration well 'A' since March 2011, when measurements of the inflow of rainwater runoff from the roof of building PK6 began .
The headquarters, respectively a control / data unit for generating of measurement data, is a M4016 universal data unit, which is situated in infiltration well A' (Fig. 6). Infiltration well 'B,' respectively the devices located in this well, are also connected to the control unit.
The equipped M4016 registration and control unit includes a universal data logger, telemetric station with build-in GSM module, programmable control automat and multiple flow meter. Fig. 6. M4016 Data unit in well 'A' [5].
Under inflow, respectively the rain outlet pipe in the well, there are measurement flumes for the metering of inflow rainwater from the roof of building PK6 in both of the infiltration wells (figure 7). Rainwater from the roof of building PK6 is fed by rainwater pipes directly into measurement flumes, which are placed under an ultrasonic level sensor which transmits the data on the water level in the measurement flumes to the M4016 data unit [5].
The M4016 unit, in which the signal is transmitted from the ultrasonic level sensor is preset up to 14 equations or the most used sharp crested weirs. The flow rate is calculated from the relationship water level/flow rate. For the purposes of our measurements it calculates the instantaneous and cumulative flow, calculated from the water level used by the predefined profile -Thomson weir [5]. Thomson weir consists of two overflow edges with an angle of 90°. The axis of this angle must be vertical (figure 7) [3].
The data represent the flow of precipitation water from the roof of builing PK6 [4,5]. This flow rate, i.e. the rainfall value, was calculated using the Thomson weir. This is the calculation of instantaneous and cumulated flow. The flow calculated using the Thomson weir is determined by the equation: Where: Q -flow, (l/s), K -hydraulic constant (K = 0,0146 -iron construction, K = 0,0159wood construction), H -the height of the overflow beam, (cm).
The second type of water to be used at work, except rainwater, and as mentioned above, will be greywater. The calculation of the consumption and production of greywater, will be carried out on the same building PK6.
For greywater production in the PK6 building, we will only count on experiments with a water inflow from the sinks in this building. Water production is described in Table 1. Table 1. Theoretical greywater production in the PK6 building.

Rules for the decision system
Rules resulting from a fuzzy cognitive map for water management: • Rule for lawn irrigation : the required volume of water for the lawn is 62.5 l/day • Rule for rainwater age: rainwater can be in the tank for a maximum 21 days • Rule for greywater age: greywater can be in the tank for a maximum 24 hours • Rule for the retention of greywater : -If the age of the greywater in the greywater tank is < 24 hours, then we can release the greywater for the required water supply to the building.
-If the age of the greywater in the greywater tank is = 24 hours, then we can release the greywater for the required water supply to the building, but the remaining water must be released into the sewerage -If the volume of greywater in the greywater tank is < the predicted water demand of greywater for the building, then discharge the water requirement for rainwater from the rainwater tank -If the inflow of greywater volume from a building is > 300 liters, then count -300 liters from the inflow volume and discharge the rest to sewerage -If the inflow of greywater volume from the building + the greywater located in the tank is > 300 liters, then count -300 from the sum and discharge the rest to sewerage • Rule for the retention of rainwater : -If the age of the rainwater in the rainwater tank is < 21 days, then release the required volume of water into the greywater tank as well as for lawn irrigation -If the age of the rainwater in the rainwater tank is = 21 days, then release the required volume of water into the greywater tank as well as for lawn irrigation and then discharge the rest into the infiltration well -If the inflow of rainwater volume from a building is > 3500 liters, then count -3500 liters from inflow volume and discharge the rest into the infiltration well -If the inflow of rainwater volume from the building + the rainwater located in the tank is > 3500 liters, then count -3500 from the sum and discharge the rest into the infiltration well • Rule for the infiltration well : -If the inflow of rainwater volume is > the maximum water capacity in m 3 of the infiltration well, then the rest of the water is discharged to the sewerage -If the capacity of the infiltration well in m 3 < the sum of the water in the infiltration well + the water inflow from the rainwater tank, and discharge the rest to sewerage

Conclusion
Creating a decision system for rainwater and greywater management was the main purpose for making the most effective wastewater management for the existing PK6 building. The proposed rainwater management using fuzzy cognitive maps was subsequently tested in Matlab. Matlab software is one of the most appropriate programs for this work because it is an excellent program for numerical computations that will be needed for decision-making management. The wastewater management system will be based on the decision on how to efficiently use all of the wastewater to minimize water costs. It will deal with minimizing water into drainage system. Within our research, many time periods from the year 2011 to the year 2017 will be evaluated with different decision scale changes. In conclusion, one of the outputs of the proposed decision-making system is listed: Observation period: School winter semester (19.09. 2011 -16. 12. 2011) Decision scales: Requirement of building : 0,9 Requirement of greywater age: 0 Requirement of greywater tank: 0,9 Requirement of lawn: 0,5 Requirement of rainwater age: 0