A mechanism-data-driven hybrid modeling approach for denitrification in municipal wastewater treatment
A hybrid modeling method combining mechanism and data-driven approaches for sewage treatment denitrification improves accuracy and interpretability, overcoming the limitations of existing models by integrating a simplified ASM1 model with a TS fuzzy neural network.
Patent Information
- Application Number
- CN202210381970.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-12
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2042-04-12
AI Technical Summary
Existing sewage treatment denitrification models, whether mechanism-based or data-based, suffer from inaccuracies, complexity, and lack of interpretability, making precise control of ammonia nitrogen and total nitrogen in urban sewage treatment challenging.
A hybrid modeling method integrating mechanism and data-driven approaches, using a simplified ASM1 model and a TS fuzzy neural network to compensate for errors, creating a parallel structure for improved accuracy and interpretability.
The hybrid model enhances accuracy and interpretability, providing clear physical meaning and suitability for optimization or control, addressing the limitations of simplified mechanism and data models.
Smart Images

Figure CN114783532B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of urban sewage treatment modeling, and in particular to a hybrid modeling method for a denitrification process of urban sewage treatment based on mechanism-data driving. Background Art
[0002] At present, environmental water pollution and water shortage have become serious problems facing the world. Through the urban sewage treatment system, sewage purification can be achieved and water resources can be effectively utilized, which is the theme of sustainable development in the future. In my country's sewage, the main pollutants are chemical oxygen demand and ammonia nitrogen emissions. Among them, chemical oxygen demand contains a large amount of organic nitrogen, which makes organic nitrogen and ammonia nitrogen occupy a large proportion of urban sewage. Therefore, controlling the concentration of ammonia nitrogen, organic nitrogen and total nitrogen in urban sewage has become an important indicator of sewage treatment. At the same time, the control of sewage treatment process is inseparable from the theory and method of sewage treatment modeling. Therefore, establishing an accurate sewage treatment denitrification model is the prerequisite for achieving precise control of the urban sewage treatment denitrification process.
[0003] In the prior art, there are two main modeling methods for the denitrification process in urban sewage treatment: mechanism modeling and data modeling. However, both mechanism modeling and data modeling have their own limitations. Mechanism modeling mainly relies on the ASM series of models developed by the International Water Quality Association (IWA), which can well describe the main dynamic behaviors and characteristics of the sewage treatment process. However, the mechanism model has many parameters and there are problems such as uncertainty and difficulty in measurement, which makes it difficult to design a controller and optimize the complete mechanism model. Therefore, it is necessary to make reasonable assumptions about the mechanism model to obtain a simplified mechanism model. Since the components related to the denitrification process are mainly retained during the simplification of the model, there may be a relatively large error between the output results of the simplified model and the original mechanism model; unlike mechanism modeling, data modeling does not require an accurate mechanism description of the sewage treatment process, but starts from the sewage data itself to establish a data relationship between the input and output, which is a black box modeling method. However, data modeling has shortcomings such as poor interpretability and unclear physical meaning. At the same time, since data modeling does not rely on accurate descriptions of system mechanisms but is obtained from sewage data, when the environmental conditions corresponding to the sewage data change, the data model is no longer applicable and it is necessary to re-collect data to build the model.
[0004] It can be seen that how to establish a sewage treatment denitrification process model with clear physical meaning, strong interpretability and high output accuracy to achieve precise control of the urban sewage treatment denitrification process is an urgent problem to be solved by technical personnel in this field. Summary of the invention
[0005] The purpose of the present invention is to provide a hybrid modeling method that integrates mechanism modeling and data modeling to establish a model of the urban sewage treatment denitrification process, thereby solving the shortcomings of poor applicability and difficulty in application of simply applying the ASM series simplified mechanism model or data model in the sewage treatment denitrification process modeling.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] A hybrid modeling method for denitrification process of urban sewage treatment based on mechanism-data driven, characterized by comprising the following specific steps:
[0008] S1. First, based on the activated sludge model No. 1 (ASM1), the denitrification process was mainly considered to reasonably simplify the ASM1 model and establish a simplified mechanism model;
[0009] S2. Based on the matlab platform, the TS fuzzy neural network is used to establish a data model for the water output index error between the simplified mechanism model and the original model to compensate for the modeling error of the simplified mechanism model;
[0010] S3. Based on the established simplified mechanism model and data model, a parallel structure was used for fusion to obtain a mechanism-data hybrid model of the denitrification process in urban sewage treatment. Finally, the effluent index of the hybrid model was verified, and the modeling evaluation index was compared with the simplified mechanism model to verify the effectiveness of the hybrid model.
[0011] The step S1 specifically includes the following contents:
[0012] S1-1. Reasonably simplify the ASM1 model:
[0013] The ASM1 model contains 13 components, 19 model parameters and 8 biochemical reaction processes. The model components and parameters are large and the model is complex, which leads to certain difficulties in simulating the denitrification process of sewage treatment when the model is used for optimization or control. Therefore, the present invention reasonably simplifies the ASM1 model and establishes a simplified mathematical model of ASM1;
[0014] Based on the purpose of studying the denitrification process of urban sewage treatment, considering the relevant biochemical reaction process of nitrate nitrogen and dissolved oxygen, the simplified basis of the ASM1 mechanism model is as follows:
[0015] (1) In the sewage treatment process, the hydrolysis of slow-degradable organic matter by microorganisms is mainly controlled by their own concentration. Therefore, the first-order reaction kinetic equation is used to express the hydrolysis reaction process.
[0016] (2) Microbial attenuation of particulate matter in the influent (X p) does not participate in the denitrification reaction process and is therefore not included in the model during the simplification process.
[0017] (3) Inert particulate organic matter in the influent (X I ) and inert dissolved organic matter (S I ) is relatively stable in the sewage treatment process and does not participate in the biochemical reaction process, so it is not included in the model during the simplification process;
[0018] (4) Alkalinity is independent of other components and has no correlation with them. Therefore, the pH value is assumed to be neutral and is not included in the model during the simplification process;
[0019] Based on the above reasonable simplification, the mechanism model was simplified from 13 components to only 9 components;
[0020] The simplified input components of the mechanism model are:
[0021] S=[S S ,X s ,X BH ,X BA ,S O ,S NO ,S NH ,S ND ,X ND ] T #(1)
[0022] S1-2. Establish a mathematical model for the biochemical reaction pool for sewage treatment. According to the law of conservation of mass, a mathematical model for the biochemical reaction pool is established. The mass conservation relationship can be expressed as:
[0023] Accumulation amount = input amount - output amount + reaction amount
[0024] According to the above formula, we can further get:
[0025]
[0026] Where V is the volume of the biochemical reaction pool (m 3 ), S i is the concentration of a component (mg / L), S in , S out are the concentrations of a component in the inlet and outlet water (mg / L), Q in is the water flow rate in the biochemical reaction pool (m 3 / h), r i is the reaction rate;
[0027] The reaction rate is obtained by multiplying the reaction stoichiometry and the reaction rate corresponding to the biochemical reaction process. The basic relationship can be expressed as:
[0028]
[0029] where v ij is the stoichiometric amount, θ j is the reaction rate corresponding to the biochemical reaction process;
[0030] The simplified biochemical reaction process, components and reaction rates of the mechanism model are:
[0031]
[0032] Where S S For the concentration of easily biodegradable substrate, Y H is the growth rate of heterotrophic organisms;
[0033] X S (i=2)r 2 =(1-f p )(θ 4 +θ 5 )-θ 7 #(5)
[0034] Where X S is the concentration of slowly biodegradable substrate, f p is the inert component value of biosolids;
[0035] X BH (i=3)r 3 =θ 1 +θ 2 -θ 4 #(6)
[0036] Where X BH is the concentration of active heterotrophic organisms;
[0037] X BA (i=4)r 4 =θ 3 -θ 5 #(7)
[0038] Where X BA is the concentration of active autotrophic organisms;
[0039]
[0040] Where S O is the dissolved oxygen concentration, Y A is the autotrophic rate;
[0041]
[0042] Where S NO is the nitrate and nitrite nitrogen concentration, f p is the inert component value of biosolids;
[0043]
[0044] Where S NH is the ammonia nitrogen concentration, i XB is the nitrogen content of the biosolids;
[0045] S ND (i=8)r 8 =-θ 6 +θ 8 #(11)
[0046] Where S ND is the concentration of soluble biodegradable organic nitrogen;
[0047] X ND (i=9)r 9 =(i XB -f p i XP )θ 4 +(i XB -f p i XP )θ 5 -θ 8 #(12) where X ND is the concentration of degradable organic nitrogen in particles, i XP is the nitrogen content of the biosolids;
[0048] The biochemical reaction process rate described in the formula is specifically:
[0049] j = 1: rate equation for aerobic growth of heterotrophic organisms;
[0050]
[0051] j = 2: rate equation for the anaerobic growth process of heterotrophic organisms;
[0052]
[0053] j = 3: rate equation for the aerobic growth process of autotrophic organisms;
[0054]
[0055] j = 4: rate equation for the decay process of heterotrophic organisms;
[0056] θ 4 =b H X BH #(16)
[0057] j = 5: rate equation for the decay process of autotrophic organisms;
[0058] θ5 =b A X BA #(17)
[0059] j=6: rate equation for the amination reaction of soluble organic nitrogen;
[0060] θ 6 =k a S ND X BH #(18)
[0061] j=7: rate equation of the hydrolysis reaction process of captured organic matter;
[0062]
[0063] j=8: Rate equation of the hydrolysis reaction process of capturing organic nitrogen.
[0064]
[0065] S1-3. According to S1-2, a mathematical model of the biochemical reaction pool is established.
[0066] S1-4. Establish a mathematical model of the secondary sedimentation tank.
[0067] At this point, the simplified mechanism model has been established.
[0068] The step S2 specifically includes the following contents:
[0069] S2-1. The structure of TS fuzzy neural network consists of two parts: the antecedent network and the posterior network. The antecedent network is divided into four layers, namely the input layer, the fuzzification layer, the fuzzy rule calculation layer and the output layer. The main function of the antecedent network is to perform fuzzy matching and determine the influence weight of the input variable through fuzzy calculation. The posterior network is divided into three layers, namely the input layer, the fully connected layer and the output layer. The main function of the posterior network is to learn and train the input data set, and at the same time, combine the influence weight of the antecedent network to obtain the final output value of the network.
[0070] S2-2. The rules of the fuzzy system of the TS fuzzy neural network are defined in the form of "IF-THEN" rules. The fuzzy rules are:
[0071]
[0072]
[0073]
[0074] Where R j is the jth fuzzy rule, x n is the input variable, n is the dimension of the input variable, For x n The jth fuzzy subset of is the parameter of fuzzy calculation, y rj is the output result of the network, and r is the dimension of the output variable.
[0075] S2-3, the input vector of TS fuzzy neural network is x=[x 1 ,x 2 ,…,x n ] T , the antecedent network calculates the membership of the input variable according to the fuzzy rules described in S2-2. The membership function here uses the Gaussian function, and the input variable x can be obtained. n Membership degree:
[0076]
[0077] in is the center of the membership function, is the width of the membership function.
[0078] Therefore, by changing and The value of can change the center and width of the membership function, that is, the position and shape of the membership function can be changed.
[0079] S2-4, calculation of fuzzy rule fitness, based on the membership obtained in S2-3, calculate the rule fitness to match the fuzzy rule:
[0080]
[0081] where b j is the fitness of the jth rule.
[0082] S2-5. Normalize the fitness obtained in S2-4 and use the obtained value as the output of the predecessor network:
[0083]
[0084] Where m is the number of fuzzy rules.
[0085] S2-6, the post-processing network learns the input data:
[0086]
[0087] S2-7, the subsequent network combines the influence weight of the preceding network to obtain the final output value of the network. :
[0088]
[0089] S2-8. The learning algorithm of the network adopts the gradient descent method, which is as follows:
[0090] The training error expression is:
[0091]
[0092] where y hi is the expected output value of the data model, y i is the actual output value of the data model. Before network training, set the error e. When the error e reaches the set value, stop network training. If it does not reach the set value, it is necessary to adjust the weights of the neural network and the center and width of the fuzzy system membership function, specifically:
[0093] Modify the neural network weights:
[0094]
[0095]
[0096] Where η is the network learning rate.
[0097] Correct the center and width of the membership function of the fuzzy system:
[0098]
[0099]
[0100] Where α is the learning rate.
[0101] S2-9. Establish a data set to train and test the data model.
[0102] At this point, the data model is complete.
[0103] The step S3 specifically includes the following contents:
[0104] S3-1. The basic idea of the mechanism-data hybrid modeling in the present invention is to respectively establish a simplified mechanism model of the sewage treatment denitrification process with clear physical meaning and a TS fuzzy neural network data model. Since there is an error between the output of the simplified model and the complete ASM1 model, in order to compensate for the output error of the mechanism model, a data model is used to compensate for it. Part of the input of the mechanism model is used as the input training data of the data model, and the output error is used as the output training data of the data model. The data model is trained and tested to obtain the data model.
[0105] S3-2. After establishing the mechanism model and data model respectively, the mechanism model and data model are integrated in parallel, and the expression is:
[0106]
[0107] in is the output value of the mixed model, y m To simplify the output value of the mechanism model, y e The output value of the data model.
[0108] Compared with the prior art, the present invention has the following beneficial effects:
[0109] The present invention provides a hybrid modeling method that integrates mechanism and data, establishes a model of the denitrification process of urban sewage treatment, calculates the biochemical reaction of the denitrification process of sewage treatment through the mechanism model, and uses the data model to compensate for the modeling error of the mechanism model. The technical advantages of the method of the present invention mainly include:
[0110] (I) The hybrid modeling method that integrates mechanism modeling and data modeling can take into account the advantages of both. To a certain extent, it can solve the shortcomings of poor applicability and difficulty in application of the simple application of simplified mechanism models or data models in the modeling of wastewater treatment denitrification processes.
[0111] (ii) The hybrid model combines the advantages of both the mechanism model and the data model. It not only has a clear physical meaning, but also makes better use of the causal relationship of the data.
[0112] (3) Compared with the simplified mechanism model, the accuracy of the hybrid model is greatly improved, the physical meaning is clear, the interpretability is strong, and it is more suitable for optimization or control. BRIEF DESCRIPTION OF THE DRAWINGS
[0113] Figure 1 It is a schematic diagram of the parallel hybrid model of the present invention;
[0114] Figure 2 This is the result diagram of the water index for the simplified mechanism model;
[0115] in:
[0116] (a) BOD output value of the simplified mechanism model;
[0117] (b) COD output value of the simplified mechanism model;
[0118] (c) TSS output value of the simplified mechanism model;
[0119] (d) N is the simplified mechanism model tot Output value;
[0120] Figure 3 The network structure topology diagram of the data model;
[0121] Figure 4 For data modelBOD Training and testing result graphs;
[0122] in:
[0123] (a) is e BOD Mean squared error (MSE) of training;
[0124] (b) is e BOD Test results;
[0125] (c) is e BOD The test error of
[0126] Figure 5 Output results for the hybrid model water output index;
[0127] in:
[0128] (a) is the BOD output value of the mixed model;
[0129] (b) is the COD output value of the hybrid model;
[0130] (c) is the TSS output value of the hybrid model;
[0131] (d) is N of the mixed model tot Output value. DETAILED DESCRIPTION
[0132] In order to clarify the technical problems, technical solutions, implementation processes and performance demonstrations, the present invention is further described in detail below in conjunction with embodiments. It should be understood that the specific embodiments described herein are for explanation only. The present invention is not intended to limit the present invention. Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings do not have to be drawn to scale unless otherwise specified.
[0133] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0134] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0135] Figure 1The embodiment 1 shown shows that the hybrid model of the method of the present invention is composed of a data model and a simplified mechanism model. Based on the denitrification process, the ASM1 model is reasonably simplified to obtain a simplified mechanism model. The simplified mechanism model calculates the complex biochemical reactions of the denitrification process and obtains the effluent index through calculation. Since some components and parameters are ignored in the simplification process, there is an error between the output and the ASM1 model, which is compensated by the data model.
[0136] Figure 2 The example 1 shown shows the output results of the four effluent indicators of the simplified mechanism model, which are compared with the ASM1 model respectively. It can be seen that the trend of the effluent indicators of the simplified mechanism model is consistent with the ASM1 model, indicating that the simplified mechanism model meets the requirements. However, since some components are ignored during the simplification process, there are errors in the effluent indicators of the simplified mechanism model, especially the COD indicator.
[0137] Figure 3 The illustrated embodiment 1 shows a network structure topology diagram of a data model, and the network structure adopts a 6×13×4 topology structure.
[0138] Figure 4 Example 1 shows the data model in e BOD The training and testing effect diagram of Figure 4 (a) is the training mean square error (MSE) graph, Figure 4 (b) is the test effect diagram. The mean square error (MSE) is used as the performance evaluation indicator of the network, and the number of network training iterations is set to 1000 times. Figure 4 (a), the minimum MSE value can reach below 0.02. Figure 4 In (b), the prediction results of the test data include e BOD The output and expected output of the model. From the predicted output results, it can be seen that the output of the data model can approximate the expected output, and the prediction error is small. Figure 4 (c) is the error of the test data, and the error range is kept within ±0.08. S ,X S ,X BH ,X BA ,X ND ,S ND ] T As input, the established data model has high predictive ability.
[0139] Figure 5 Example 1 shows four water output indicators of the hybrid model, which are compared with the ASM1 model. Figure 2,Compared with the simplified mechanism model, the accuracy of the water output indicators of the hybrid model has been greatly improved. Therefore, the mechanism-data hybrid modeling method can effectively improve the accuracy of the model.
[0140] Example 1
[0141] A hybrid modeling method for denitrification process of urban sewage treatment based on mechanism-data driven, characterized by comprising the following specific steps:
[0142] S1, based on the activated sludge model No. 1 (ASM1), mainly considering the denitrification process of sewage treatment, simplifying the ASM1 model to obtain a simplified mechanism model;
[0143] S2. Based on the matlab platform, the TS fuzzy neural network is used to establish a data model for the residual of the water discharge index between the simplified mechanism model and the original model to compensate for the modeling error of the simplified mechanism model;
[0144] S3. Based on the established simplified mechanism model and data model, a parallel structure was used for integration to establish a mechanism-data hybrid model of the denitrification process in urban sewage treatment. The model was verified and the modeling evaluation indicators of the hybrid model and the simplified mechanism model were compared to verify the effectiveness of the model.
[0145] The step S1 specifically includes the following contents:
[0146] S1-1. Reasonably simplify the ASM1 model:
[0147] The ASM1 model contains 13 components, 19 model parameters and 8 biochemical reaction processes. The model components and parameters are large and the model is complex, which leads to certain difficulties in simulating the denitrification process of sewage treatment when the model is used for optimization or control. Therefore, the present invention reasonably simplifies the ASM1 model and establishes a simplified mathematical model of ASM1;
[0148] Based on the purpose of studying the denitrification process of urban sewage treatment, considering the relevant biochemical reaction process of nitrate nitrogen and dissolved oxygen, the simplified basis of the ASM1 mechanism model is as follows:
[0149] (1) In the sewage treatment process, the hydrolysis of slow-degradable organic matter by microorganisms is mainly controlled by their own concentration. Therefore, the first-order reaction kinetic equation is used to express the hydrolysis reaction process.
[0150] (2) Microbial attenuation of particulate matter in the influent (X p ) does not participate in the denitrification reaction process and is therefore not included in the model during the simplification process.
[0151] (3) Inert particulate organic matter in the influent (X I) and inert dissolved organic matter (S I ) is relatively stable in the sewage treatment process and does not participate in the biochemical reaction process, so it is not included in the model during the simplification process;
[0152] (4) Alkalinity is independent of other components and has no correlation with them. Therefore, the pH value is assumed to be neutral and is not included in the model during the simplification process;
[0153] Based on the above reasonable simplification, the mechanism model was simplified from 13 components to only 9 components;
[0154] The simplified input components of the mechanism model are:
[0155] S=[S S ,X S ,X BH ,X BA ,S O ,S NO ,S NH ,S ND ,X ND ] T #(1)
[0156] S1-2. Establish a mathematical model for the biochemical reaction pool for sewage treatment. Since the reaction process in the biochemical reaction pool is open and under normal pressure, there is no need to perform momentum balance analysis. It is only necessary to establish a mathematical model for the biochemical reaction pool based on the law of conservation of mass. The mass conservation relationship can be expressed as:
[0157] Accumulation amount = input amount - output amount + reaction amount
[0158] According to the above formula, we can further get:
[0159]
[0160] Where V is the volume of the biochemical reaction pool (m 3 ), S i is the concentration of a component (mg / L), S in , S out are the concentrations of a component in the inlet and outlet water (mg / L), Q in is the water flow rate in the biochemical reaction pool (m 3 / h), r i is the reaction rate;
[0161] The reaction rate is obtained by multiplying the reaction stoichiometry and the reaction rate corresponding to the biochemical reaction process. The basic relationship can be expressed as:
[0162]
[0163] where vij is the stoichiometric amount, θ j is the reaction rate corresponding to the biochemical reaction process;
[0164] The simplified biochemical reaction process, components and reaction rates of the mechanism model are:
[0165]
[0166] Where S S For the concentration of easily biodegradable substrate, Y H is the growth rate of heterotrophic organisms;
[0167] X S (i=2)r 2 =(1-f p )(θ 4 +θ 5 )-θ 7 #(5)
[0168] Where X S is the concentration of slowly biodegradable substrate, f p is the inert component value of biosolids;
[0169] X BH (i=3)r 3 =θ 1 +θ 2 -θ 4 #(6)
[0170] Where X BH is the concentration of active heterotrophic organisms;
[0171] X BA (i=4)r 4 =θ 3 -θ 5 #(7)
[0172] Where X BA is the concentration of active autotrophic organisms;
[0173]
[0174] Where S O is the dissolved oxygen concentration, Y A is the autotrophic rate;
[0175]
[0176] Where S NO is the nitrate and nitrite nitrogen concentration, f p is the inert component value of biosolids;
[0177]
[0178] Where S NH is the ammonia nitrogen concentration, i XB is the nitrogen content of the biosolids;
[0179] S ND (i=8)r 8 =-θ 6 +θ 8 #(11)
[0180] Where S ND is the concentration of soluble biodegradable organic nitrogen;
[0181] X ND (i=9)r 9 =(i XB -f p i XP )θ 4 +(i xB -f p i xP )θ 5 -θ 8 #(12) where X ND is the concentration of degradable organic nitrogen in particles, i XP is the nitrogen content of the biosolids; the biochemical reaction process rate described in the formula is specifically:
[0182] j = 1: rate equation for aerobic growth of heterotrophic organisms;
[0183]
[0184] j = 2: rate equation for the anaerobic growth process of heterotrophic organisms;
[0185]
[0186] j = 3: rate equation for the aerobic growth process of autotrophic organisms;
[0187]
[0188] j = 4: rate equation for the decay process of heterotrophic organisms;
[0189] θ 4 =b H X BH #(16)
[0190] j = 5: rate equation for the decay process of autotrophic organisms;
[0191] θ 5 =b A X BA #(17)
[0192] j=6: rate equation for the amination reaction of soluble organic nitrogen;
[0193] θ 6 =k a S ND X BH #(18)
[0194] j=7: rate equation of the hydrolysis reaction process of captured organic matter;
[0195]
[0196] j=8: Rate equation of the hydrolysis reaction process of capturing organic nitrogen.
[0197]
[0198] S1-3. According to S1-2, a mathematical model of the biochemical reaction pool is established.
[0199] S1-4. Establish a mathematical model of the secondary sedimentation tank.
[0200] At this point, the simplified mechanism model has been established.
[0201] The step S2 specifically includes the following contents:
[0202] S2-1. The structure of TS fuzzy neural network consists of two parts: the antecedent network and the posterior network. The antecedent network is divided into four layers, namely the input layer, the fuzzification layer, the fuzzy rule calculation layer and the output layer. The main function of the antecedent network is to perform fuzzy matching and determine the influence weight of the input variable through fuzzy calculation. The posterior network is divided into three layers, namely the input layer, the fully connected layer and the output layer. The main function of the posterior network is to learn and train the input data set, and at the same time, combine the influence weight of the antecedent network to obtain the final output value of the network.
[0203] S2-2. The rules of the fuzzy system of the TS fuzzy neural network are defined in the form of "IF-THEN" rules. The fuzzy rules are:
[0204]
[0205]
[0206]
[0207] Where R j is the jth fuzzy rule, x n is the input variable, n is the dimension of the input variable, For x n The jth fuzzy subset of is the parameter of fuzzy calculation, yrj is the output result of the network, and r is the dimension of the output variable.
[0208] S2-3, the input vector of TS fuzzy neural network is x=[x 1 ,x 2 ,…,x n ] T , the antecedent network calculates the membership of the input variable according to the fuzzy rule. The membership function here uses the Gaussian function, and the input variable x can be obtained. n Membership degree:
[0209]
[0210] in is the center of the membership function, is the width of the membership function.
[0211] Therefore, by changing and The value of can change the center and width of the membership function, that is, the position and shape of the membership function can be changed.
[0212] S2-4. Calculation of fuzzy rule fitness: Based on the obtained membership, the rule fitness is calculated to match the fuzzy rule:
[0213]
[0214] where b j is the fitness of the jth rule.
[0215] S2-5. Normalize the fitness and use the obtained value as the output of the previous network:
[0216]
[0217] Where m is the number of fuzzy rules.
[0218] S2-6, the post-processing network learns the input data:
[0219]
[0220] S2-7, the subsequent network combines the influence weight of the preceding network to obtain the final output value of the network. :
[0221]
[0222] S2-8. The learning algorithm of the network adopts the gradient descent method, which is as follows:
[0223] The training error expression is:
[0224]
[0225] where y hi is the expected output value of the data model, y i is the actual output value of the data model. Before network training, set the error e. When the error e reaches the set value, stop network training. If it does not reach the set value, it is necessary to adjust the weights of the neural network and the center and width of the fuzzy system membership function, specifically:
[0226] Modify the neural network weights:
[0227]
[0228]
[0229] Where η is the network learning rate.
[0230] Correct the center and width of the membership function of the fuzzy system:
[0231]
[0232]
[0233] Where α is the learning rate.
[0234] S2-9. Establish a data set to train and test the data model.
[0235] At this point, the data model is complete.
[0236] The step S3 specifically includes the following contents:
[0237] S3-1. The basic idea of the mechanism-data hybrid modeling in the present invention is to respectively establish a simplified mechanism model of the sewage treatment denitrification process with clear physical meaning and a TS fuzzy neural network data model. Since there is an error between the output of the simplified model and the complete ASM1 model, in order to compensate for the output error of the mechanism model, a data model is used to compensate for it. Part of the input of the mechanism model is used as the input training data of the data model, and the output residual is used as the output training data of the data model. The data model is trained and tested to obtain the data model.
[0238] S3-2. After establishing the mechanism model and data model respectively, the mechanism model and data model are integrated in parallel, and the expression is:
[0239]
[0240] in is the output value of the mixed model, y mTo simplify the output value of the mechanism model, y e The output value of the data model.
[0241] Example 2
[0242] This embodiment is a mechanism-data hybrid modeling method based on the denitrification process of urban sewage treatment, and the specific steps are as follows:
[0243] Step 1: Based on the denitrification process, the ASM1 model is reasonably simplified:
[0244] Step 1-1, reasonable simplification basis:
[0245] (1) Usually in the sewage treatment process, the hydrolysis of slow-degradable organic matter by microorganisms is mainly controlled by their own concentration. Therefore, the first-order reaction kinetic equation is used to express the hydrolysis reaction process.
[0246] (2) Particulate organic matter (X P ) does not participate in the biochemical reaction of the denitrification process and is therefore not included in the model during the simplification process.
[0247] (3) Inert particulate organic matter in the influent (X I ) and inert dissolved organic matter (S I ) is relatively stable in the sewage treatment process and does not participate in the biochemical reaction process, so it is not included in the model during the simplification process;
[0248] (4) Alkalinity has no correlation with other components and is relatively independent. Therefore, the pH value is assumed to be neutral and is not included in the model during the simplification process.
[0249] Step 1-2, according to step 1-1, obtain the components and reaction rates of the simplified model:
[0250] The simplified biochemical reaction process, components and reaction rate of the mechanism model are:
[0251]
[0252] X S (i=2)r 2 =(1-f p )(θ 4 +θ 5 )-θ 7 #(34)
[0253] X BH (i=3)r 3 =θ 1 +θ 2 -θ 4 #(35)
[0254] XBA (i=4)r 4 =θ 3 -θ 5 #(36)
[0255]
[0256]
[0257]
[0258] S ND (i=8)r 8 =-θ 6 +θ 8 #(40)
[0259] X ND (i=9)r 9 =(i XB -f p i XP )θ 4 +(i XB -f p i XP )θ 5 -θ 8 #(40)
[0260] Where S s For the concentration of readily biodegradable substrate, X S is the concentration of slowly biodegradable substrate, X BH is the concentration of active heterotrophic organisms, X BA is the concentration of active autotrophic organisms, S O is the dissolved oxygen concentration, S NO is the nitrate and nitrite nitrogen concentration, S NH is the ammonia nitrogen concentration, S ND is the concentration of soluble biodegradable organic nitrogen, X ND is the concentration of degradable organic nitrogen in particles, f p is the inert component value of biosolids, Y H is the growth rate of heterotrophic organisms, Y A is the autotrophic rate, f p is the inert component value of biosolids, where i XB is the nitrogen content of biosolids, where i XP is the nitrogen content of biosolids.
[0261] The biochemical reaction process rate described in the formula is specifically:
[0262]
[0263]
[0264]
[0265] θ 4 =b H X BH #(44)
[0266] θ 5 =b A X BA #(45)
[0267] θ 6 =k a S ND X BH #(46)
[0268]
[0269]
[0270] Step 1-3, based on step 1-2, a mathematical model of the biochemical reaction pool is established.
[0271] Steps 1-4, establish the mathematical model of the secondary sedimentation tank.
[0272] In step 2, based on the mathematical model of the simplified mechanism model obtained in step 1, the mechanism model is established by writing an m file on the matlab platform, and then the simplified mechanism model is verified, specifically:
[0273] Step 2-1, according to the differential equation of the simplified mechanism model, a simplified mechanism model was established based on the MATLAB platform.
[0274] Step 2-2, based on the simplified mechanism model that has been established, the input variables are:
[0275] S=[t,X S ,X BH ,X BA ,S O ,S NO ,S NH ,S ND ,X ND ,S ND ,T Ss ,Q in ] T #(49)
[0276] Where t is the time variable, T SS is the total amount of suspended solids in the influent, Q in is the water inlet flow rate.
[0277] In step 2-3, the selection of model parameters should be consistent with the original model in order to verify the simplified mechanism model.
[0278] Step 2-3, calculate the sewage treatment effluent indicators, namely effluent BOD, COD, total nitrogen N tot And the total suspended solids TSS, the specific calculation formula is:
[0279] BOD=0.25·(S Se +X Se +(1-f P )·(X BHe +X BA_e ))#(50)
[0280] COD=S S_e +X _e +X BH_e +X BA_e #(51)
[0281]
[0282]
[0283] The water output index of the simplified mechanism model can be calculated according to the formula.
[0284] Steps 2-4, by Figure 2 It can be seen from the four figures that there are obvious errors in the effluent indicators of the simplified mechanism model. This is because the simplified mechanism model has fewer components and parameters than the original model, which leads to errors between the final effluent indicators and the effluent indicators of the original model. Therefore, in order to improve the accuracy of the model, it is necessary to perform data modeling on the residual of the effluent indicators to compensate for the simplified mechanism model. Through vector calculation, the effluent BOD, COD, and total nitrogen N can be obtained. tot And the error value of total suspended solids TSS.
[0285] Step 3: Use TS fuzzy neural network to establish a data model for the residual of the water discharge index in step 2 to compensate for the error of the simplified mechanism model. Specifically:
[0286] Step 3-1, the topological structure of the TS fuzzy neural network is as follows Figure 3 As shown in the figure, it consists of two parts: the antecedent network and the posterior network. The antecedent network is divided into four layers, namely the input layer, the fuzzification layer, the fuzzy rule calculation layer and the output layer. The main function of the antecedent network is to perform fuzzy matching and determine the influence weight of the input variable through fuzzy calculation. The posterior network is divided into three layers, namely the input layer, the fully connected layer and the output layer. The main function of the posterior network is to learn and train the input data set, and at the same time, combine the influence weight of the antecedent network to obtain the final output value of the network.
[0287] Step 3-2, the rules of the fuzzy system of the TS fuzzy neural network are defined in the form of "IF-THEN" rules. The fuzzy rules are:
[0288]
[0289]
[0290]
[0291] Where R j is the jth fuzzy rule, x n is the input variable, n is the dimension of the input variable, For x n The jth fuzzy subset of is the parameter of fuzzy calculation, y rj is the output result of the network, and r is the dimension of the output variable.
[0292] Step 3-3, the input vector of TS fuzzy neural network is x=[x 1 ,x 2 ,…,x n ] T , the antecedent network calculates the membership of the input variable according to the fuzzy rules described in step 3-2. The membership function here uses a Gaussian function, and the input variable x can be obtained. n Membership degree:
[0293]
[0294] in is the center of the membership function, is the width of the membership function.
[0295] Therefore, by changing and The value of can change the center and width of the membership function, that is, the position and shape of the membership function can be changed.
[0296] Step 3-4, calculation of fuzzy rule fitness. According to the membership degree obtained in step 3-3, the rule fitness is calculated to match the fuzzy rule:
[0297]
[0298] where b j is the fitness of the jth rule.
[0299] Step 3-5, normalize the fitness obtained in step 3-4, and the obtained value is used as the output of the previous network:
[0300]
[0301] Where m is the number of fuzzy rules.
[0302] Step 3-6, the subsequent network learns the input data:
[0303]
[0304] Step 3-7, the subsequent network combines the influence weight of the previous network to obtain the final output value of the network. :
[0305]
[0306] In steps 3-8, the network learning algorithm uses the gradient descent method, specifically:
[0307] The training error expression is:
[0308]
[0309] where y hi is the expected output value of the data model, y i is the actual output value of the data model. Before network training, set the error e. When the error e reaches the set value, stop network training. If it does not reach the set value, it is necessary to adjust the weights of the neural network and the center and width of the fuzzy system membership function, specifically:
[0310] Modify the neural network weights:
[0311]
[0312]
[0313] Where η is the network learning rate.
[0314] Correct the center and width of the membership function of the fuzzy system:
[0315]
[0316]
[0317] Where α is the learning rate.
[0318] Step 4: Determine the network structure parameters and establish a data set to train and test the data model. Specifically:
[0319] Step 4-1, network construction and training. The network structure in the present invention is determined by the dimensions of the input and output data. It can be obtained that the number of input nodes of the network is 6, the number of output nodes is 4, and the training effect of the network is measured by the mean square error. The mean square error of the training data can determine that when the number of neurons in the hidden layer of the network is 13, the training effect is the best. The structure and parameters of the network are shown in Table 1.
[0320] Table 1 Network structure parameters
[0321]
[0322] Step 4-2, data selection and processing. The present invention selects 400 sets of data to train and test the network, of which 300 sets of data are used to train the network and the remaining 100 sets are used to verify the network. In order to prevent the large difference in samples from affecting the training of the network, the data are normalized and denormalized before training. The data are all from the sunny data of the ASM1 model. In order to achieve the best effect of network training, the input data is preprocessed before network training. O , S NO , S NH are all 0, so the input of the data model ignores these three components, and the input vector and output vector of the network are:
[0323] x=[S S ,X S ,X BH ,X BA ,X ND ,S ND ] T #(65)
[0324] y=[e BOD ,e COD ,e Ntot ,e TSS ] T #(66)
[0325] Among them, x is the 6-dimensional input data, and t is the error between the simplified mechanism model and the ASM1 model water output index.
[0326] Step 4-2, network performance evaluation, using mean square error (MSE) as the network performance evaluation indicator, the number of network training iterations is set to 1000 times. BOD For example, according to Figure 4 (a), the minimum MSE value can reach below 0.02. Figure 4 In (b), the prediction results of the test data include the e in the data model BODThe output and expected output of the model. From the predicted output results, it can be seen that the output of the data model can approximate the expected output, and the prediction error is small. Figure 4 (c) is the error of the test data, and the error range is kept within ±0.08. S ,X S ,X BH ,X BA ,X ND ,S ND ] T As input, the established data model has high predictive ability.
[0327] Step 5: Based on the simplified mechanism model established in step 1 and the data model established in step 2, a parallel structure is used for fusion to obtain a mechanism-data hybrid model of the denitrification process of urban sewage treatment. The model is tested to see whether it meets the requirements. The mechanism and data models are fused in parallel, and the expression is:
[0328]
[0329] in is the output value of the mixed model, y m To simplify the output value of the mechanism model, y e The output value of the data model.
[0330] Example 3
[0331] The following steps are used to verify the beneficial effects of the present invention:
[0332] Step 1: In order to verify the effectiveness of the mechanism-data hybrid modeling method proposed in this invention, the root mean square error (RMSE) is used.
[0333]
[0334] And the average prediction accuracy (AC)
[0335]
[0336] As the modeling evaluation index, y n (t) is the expected output, e(t) is the error between the expected output and the actual output, and n is the number of samples.
[0337] Step 2: According to step 1, the modeling evaluation indicators of the simplified mechanism model and the mechanism-data hybrid model can be obtained as shown in Table 2:
[0338] Table 2 Comparison of modeling evaluation indicators between simplified mechanism model and hybrid model
[0339]
[0340] It can be seen from the data in Table 2 that the average prediction accuracy of effluent BOD is improved from 79.98% to 97.82%, the average prediction accuracy of COD is improved from 31.92% to 98.68%, and the average prediction accuracy of other effluent indicators is also significantly improved. Therefore, the mechanism-data hybrid modeling method proposed in the present invention is effective. Compared with the simple simplified mechanism model or data model, the hybrid model not only has a clear physical meaning, but also contains rich data relationships, and the model accuracy is greatly improved.
[0341] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A mechanism-data driven hybrid modeling approach for denitrification in urban sewage treatment, characterized in that: The specific steps include: S1. First, based on the activated sludge model ASM1, the denitrification process is mainly considered to reasonably simplify the ASM1 model and establish a simplified mechanism model; S2. Based on the matlab platform, the TS fuzzy neural network is used to establish a data model for the water output index error between the simplified mechanism model and the original model to compensate for the modeling error of the simplified mechanism model; S3. Based on the established simplified mechanism model and data model, a parallel structure was used for integration to establish a mechanism-data hybrid model of urban sewage treatment denitrification process. Finally, the effluent index of the hybrid model was verified, and the modeling evaluation index was compared with the simplified mechanism model to verify the effectiveness of the hybrid model. The step S1 specifically includes the following contents: S1-1. Reasonably simplify the ASM1 model: Based on the denitrification process of urban sewage treatment, the relevant biochemical reaction process of nitrate nitrogen and dissolved oxygen is mainly considered. The simplified basis of the ASM1 mechanism model is as follows: (1) In the sewage treatment process, the hydrolysis of slow-degradable organic matter by microorganisms is mainly controlled by their own concentration. Therefore, the first-order reaction kinetic equation is used to express the hydrolysis reaction process. (2) Microbial attenuation of particulate matter in the influent (X p ) does not participate in the denitrification reaction process, so it is not included in the model during the simplification process; (3) Inert particulate organic matter in the influent (X I ) and inert dissolved organic matter (S I ) is relatively stable in the sewage treatment process and does not participate in the biochemical reaction process, so it is not included in the model during the simplification process; (4) Alkalinity has no correlation with other components and is relatively independent; therefore, the pH value is assumed to be neutral and is not included in the model during the simplification process; Based on the above reasonable simplification, the mechanism model was simplified from 13 components to only 9 components; The simplified input components of the mechanism model are: S=[S S ,X S ,X BH ,X BA ,S O ,S NO ,S NH ,S ND ,X ND ] T #(1) S1-2. Establish a mathematical model for the biochemical reaction pool for sewage treatment. According to the law of conservation of mass, a mathematical model for the biochemical reaction pool is established. The mass conservation relationship can be expressed as: Accumulation amount = input amount - output amount + reaction amount According to the above formula, we can further get: Where V is the volume of the biochemical reaction pool (m 3 ), S i is the concentration of a component (mg / L), S in , S out are the concentrations of a component in the inlet and outlet water (mg / L), Q in is the water flow rate in the biochemical reaction pool (m 3 / h), r i is the reaction rate; The reaction rate is obtained by multiplying the reaction stoichiometry and the reaction rate corresponding to the biochemical reaction process. The basic relationship can be expressed as: where v ij is the stoichiometric amount, θ j is the reaction rate corresponding to the biochemical reaction process; The simplified biochemical reaction process, components and reaction rates of the mechanism model are: Where S S For the concentration of easily biodegradable substrate, Y H is the growth rate of heterotrophic organisms; X S (i=2)r2=(1-f p )(θ4+θ5)-θ7#(5) Where X S is the concentration of slowly biodegradable substrate, f p is the inert component value of biosolids; X BH (i=3)r3=θ1+θ2-θ4#(6) Where X BH is the concentration of active heterotrophic organisms; X BA (i=4)r4=θ3-θ5#(7) Where X BA is the concentration of active autotrophic organisms; Where S O is the dissolved oxygen concentration, Y A is the autotrophic rate; Where S NO is the nitrate and nitrite nitrogen concentration, f p is the inert component value of biosolids; Where S NH is the ammonia nitrogen concentration, i XB is the nitrogen content of the biosolids; S ND (i=8)r8=-θ6+θ8#(11) Where S ND is the concentration of soluble biodegradable organic nitrogen; Where X ND is the concentration of degradable organic nitrogen in particles, i XP is the nitrogen content of the biosolids; The biochemical reaction process rate described in the formula is specifically: i=1: Rate equation for aerobic growth of heterotrophic organisms; j = 2: rate equation for the anaerobic growth process of heterotrophic organisms; j = 3: rate equation for the aerobic growth process of autotrophic organisms; i = 4: rate equation for the decay process of heterotrophic organisms; θ4=b H X BH #(16) i = 5: rate equation for the decay process of autotrophic organisms; θ5=b A X BA #(17) j=6: rate equation for the amination reaction of soluble organic nitrogen; θ6=k a S ND X BH #(18) j=7: rate equation of the hydrolysis reaction process of captured organic matter; j=8: rate equation of the hydrolysis reaction process of capturing organic nitrogen; S1-3. According to S1-2, a mathematical model of a biochemical reaction pool is established; S1-4. Establish mathematical model of secondary sedimentation tank; At this point, the simplified mechanism model has been established.
2. According to claim 1, a hybrid modeling method for denitrification process of urban sewage treatment based on mechanism-data driven is characterized in that: The step S2 specifically includes the following contents: S2-1. The structure of TS fuzzy neural network consists of two parts: the antecedent network and the consequent network. The antecedent network is divided into four layers, namely the input layer, the fuzzification layer, the fuzzy rule calculation layer and the output layer. The main function of the antecedent network is to perform fuzzy matching and determine the influence weight of the input variable through fuzzy calculation; the consequent network is divided into three layers, namely the input layer, the fully connected layer and the output layer. The main function of the consequent network is to learn and train the input data set, and at the same time, combine the influence weight of the antecedent network to obtain the final output value of the network; S2-2. The rules of the fuzzy system of the TS fuzzy neural network are defined in the form of "IF-THEN" rules. The fuzzy rules are: Where R j is the jth fuzzy rule, x n is the input variable, n is the dimension of the input variable, For x n The j-th fuzzy subset of is the parameter of fuzzy calculation, y rj is the output result of the network, r is the dimension of the output variable; S2-3, the input vector of TS fuzzy neural network is x=[x1,x2,…,x n ] T , the antecedent network calculates the membership of the input variable according to the fuzzy rules described in step 3-2; the membership function here uses the Gaussian function, and the input variable x can be obtained n Membership degree: in is the center of the membership function, is the width of the membership function; Therefore, by changing and The value of can change the center and width of the membership function, that is, the position and shape of the membership function can be changed; S2-4, calculation of fuzzy rule fitness, based on the membership obtained in S2-3, calculate the rule fitness to match the fuzzy rule: where b j is the fitness of the jth rule; S2-5. Normalize the fitness obtained in S2-4 and use the obtained value as the output of the predecessor network: Where m is the number of fuzzy rules; S2-6, the post-processing network learns the input data: S2-7, the subsequent network combines the influence weight of the preceding network to obtain the final output value of the network: S2-8. The learning algorithm of the network adopts the gradient descent method, which is as follows: The training error expression is: where y hi is the expected output value of the data model, y i is the actual output value of the data model; Before network training, set the error e. When the error e reaches the set value, stop network training. If it does not reach the set value, adjust the weights of the neural network and the center and width of the fuzzy system membership function. Specifically: Modify the neural network weights: Where η is the network learning rate; Correct the center and width of the membership function of the fuzzy system: Where α is the learning rate; S2-9. Establish a data set to train and test the data model; At this point, the data model is complete.
3. The hybrid modeling method for denitrification process of urban sewage treatment based on mechanism-data driven according to claim 1 is characterized in that: The step S3 specifically Includes the following: S3-1. The basic idea of mechanism-data hybrid modeling is to respectively establish a simplified mechanism model of the sewage treatment denitrification process with clear physical meaning and a TS fuzzy neural network data model. Since there is an error between the output of the simplified model and the complete ASM1 model, in order to compensate for the output error of the mechanism model, a data model is used to compensate for it. Part of the input of the mechanism model is used as the input training data of the data model, and the output error is used as the output training data of the data model. The data model is trained and tested to establish the data model. S3-2. After establishing the mechanism model and data model respectively, the mechanism model and data model are integrated in parallel, and the expression is: in is the output value of the mixed model, y m To simplify the output value of the mechanism model, y e The output value of the data model.
