# Multiple Linear Regression Model Based on Neural Network and Its Application in the MBR Simulation

Authors: Chunqing Li; Zixiang Yang; Yiquan Deng; Tao Wang
Journal: Abstract and Applied Analysis
 (2012)

---

## Abstract

The computer simulation of the membrane bioreactor MBR has become the research focus of the MBR simulation. In order to compensate for the defects, for example, long test period, high cost, invisible equipment seal, and so forth, on the basis of conducting in-depth study of the mathematical model of the MBR, combining with neural network theory, this paper proposed a three-dimensional simulation system for MBR wastewater treatment, with fast speed, high efficiency, and good visualization. The system is researched and developed with the hybrid programming of VC++ programming language and OpenGL, with a multifactor linear regression model of affecting MBR membrane fluxes based on neural network, applying modeling method of integer instead of float and quad tree recursion. The experiments show that the three-dimensional simulation system, using the above models and methods, has the inspiration and reference for the future research and application of the MBR simulation technology.


---

## Body

## 1. Introduction

The MBR simulation is a simulation of the MBR water treatment process and is a system used for special engineering and researchers. It belongs to the visual simulation, is also a dynamic simulation, and uses visualization techniques to simulate the MBR water treatment process. Because of using the visual model designed by OpenGL technology to replace physical prototype, it greatly reduces the cost, improves the efficiency of research, makes security get a good guarantee, and improves the ability of facing customers and the market.The building of visual simulation system of MBR emulator uses the OpenGL graphics standards that are designed in accordance with the computer graphic technology and graphics principle. OpenGL technology system complies with the visual and optical principles necessary for system development. OpenGL technology has many advantages and is very suitable for the visual design of the MBR simulation system. OpenGL also has light processing technology, puts the parameters, the distance of light source and vertex, the light to the vertex and the direction vector of the vertex to the viewpoint, and so forth, into optical model, and calculates the color of each vertex, and can express the 3D optical properties of the objects through the whole lighting model. So the color of the visual simulation graphics shows the spatial relationship between the object and the viewpoint and light sources and demonstrates a strong sense of three dimensions in the visual features.This paper conducts the research of MBR water treatment process by combining numerical simulative computing and the method of visualization in scientific computing. It realized the one-piece conversion from simulative computing to computer visual graphics, eliminated the lengthy middle of the data processing, and observed the distribution, variation, and objective laws of the device fastly and intuitively. At the same time, it helps to understand the specific details of the water treatment, improve processing efficiency, and thus provide a reference and basis for the design, improvement, and optimization of the MBR. This paper will discuss it by two aspects, the data modeling and visualization realized.


## 2. Multifactor Mathematical Experimental Model Based on NNs

### 2.1. Modeling Method of MBR

The test of this paper mainly inspects pollution load, pollutant removal, the performance of sludge sedimentation, organics removal, and so forth, all of which impact membrane fouling of the reactor. Thus, its feedback pollution situation through three-dimensional simulation of the MBR and measures through the membrane fouling indexf:
(2.1)f=(1-JvJ0)×100%.Known by the membrane fouling of the filter model, the initial statesRg and Rc are 0, and the MLSS is also 0. So the initial viscosity is μ0, and the initial membrane fluxes are set by the following formula J0:
(2.2)J0=Δpμ0Rm.The set of the final membrane fluxes is determined by many factors, so we will discuss and research it later in this paper.


### 2.2. Data Analysis of the MBR Modeling

Collecting actual operating data is the basis of establishing the mathematical model of the MBR. To collect relevant data, it is necessary to clear the quantitative relationship between the various elements, also observe and analyse systematically for the research problems, and summarize the goal of the decision and the restrictions of all the aspects of decision making.For the collection of field data, this paper extracts the required data sources by using the field test data based on the MBR system, as Table1 shows.Table 1
Data table of the collected fluxes, pressure, and so forth.
Time
Temperature
Pressure
MLSS of inflow
MLSS of outflow
Total resistance
Fluxes
(h)
(∘C)
(MPa)
(mg/L)
(mg/L)
(×1012m-1)
(L/m2h)
1
24
0.016
343.38
70.48
0.185
46.4
2
24
0.0168
378.15
83.87
0.2403
45.5
3
24
0.0175
392.42
87.06
0.2989
45.3
4
24
0.0243
472.43
85.63
0.3796
42.2
5
24
0.0268
483.73
59.62
0.3957
45.1
6
24
0.0291
583.16
95.05
0.441
42.2
7
24
0.0325
556.43
85.46
0.5119
39.7
8
24
0.0362
503.56
71.91
0.6075
37.3
9
24
0.0351
591.41
105.46
0.7143
31.4
10
24
0.0385
561.85
107.63
0.8421
28.9
11
24
0.0269
612.42
107.95
0.7623
21.7
12
24
0.0226
655.47
81.61
0.9737
14.5
13
24
0.0198
712.43
103.98
1.1659
11.2
14
24
0.0193
615.12
91.01
1.2911
10.5
15
24
0.0187
715.89
95.52
1.254
9.4It can be seen from the data of Table1, and after 15 hours, the relationship between total resistance and membrane fluxes as showen in Figure 1. The relationship between pressure and membrane fluxes is shown in Figure 2. The relationship between MLSS of inflow and membrane fluxes is shown in Figure 3.Figure 1
The data contrast diagram of total resistance and membrane fluxes.Figure 2
The data contrast diagram of pressure and membrane fluxes.Figure 3
The data contrast diagram of MLSS of inflow and membrane fluxes.


### 2.3. Establishment of an MBR Mathematically Experimental Model

For MBR simulation system, the establishment of an appropriate mathematically experimental model can evaluate and simulate the existing system. Through the simulation system, we can find problems in time, adjust the system’s parameters, and get a more stable and reasonable treatment effect. We can also guide the design of the new system, so that researchers can design the reactor more reasonably and scientifically.Mathematical modeling is a complex process. For the relationship between the total drag and membrane fluxes, we can see the inverse relationship in Figure1. The resistance gradually becomes larger, while the membrane fluxes gradually become smaller, as the relationship between them is
(2.3)Jv=ΔPμR.There are many other factors affecting the membrane fluxes, in addition to including the resistance. In the previous research, we have established the mathematical model between COD and MLSS. In order to be closer to the actual simulation environment, on the basis of that, this paper studies the mathematical model between multiple factors, such as pressure difference, and MLSS and membrane resistance. Through the mathematical model between the many factors and the membrane resistance, we finally establish the mathematically experimental model between multifactor and membrane fouling indexes.The relationship between the important parameters such as pressure difference, time, and MLSS and the total resistance of the membrane is complex and not a simple linear relationship. At the beginning of establishing mathematical model, we try to use only a single multiple linear regression to establish a simple relationship between the parameters and use it to analyze the relationship between the factors. Through discussing, researching, and testing the model established, we found that a single multiple linear regression is the sensitivity of the parameters, and the model of parameters is easy to deform for the abnormality of a parameter, and the model also has small tolerance for the new parameters. So a single multiple linear regression model is only applicable in the test conditions of the stable parameters and the small environmental changes, that is, lacking close to actual simulation environment research. So after reading a large portion of literature and researching the actual MBR processing environment, this paper proposes a multiple linear regression experimental model based on neural network, suited for MBR sewage treatment environment.


### 2.4. Multiple Linear Regression Model Based on Neural Network

According to the charts in Section2.2 and membrane fouling factors, it can be analyzed that each factor is not a single linear relationship for membrane fluxes. A single factor for membrane flux shows a kind of influence, and a multifactor combined with membrane flux shows with another influence. It is like neurons in the neural network, consisting of a separate nerve cell and forming the entire system by interaction of each unit.Neural network (NN) [1, 2] is a kind of algorithm mathematical model, which can imitate behavior characteristic of the animal neural network and conduct distributed and parallel information processing. A very important research content of neural network is learning. It achieves adaptability by learning, adjusts the weights, and improves the behavior of the system by the change of environment. In the MBR simulation system and establishing of multifactor membrane fouling model, it uses self-learning and adaptive ability of artificial neural network. The structure of neural network is shown in Figure 4.Figure 4
The structure of neural network.As shown in Figure4, the entire neural network is divided into three layers: input layer, hidden layer, and output layer. The number of hidden layers is variable, and the number of hidden layers and hidden units determines the complexity of the entire neural network. The type of treatment unit in neural network is divided into three categories: input units, output units, and hidden units. The input unit receives the information and data of the system external input; the output unit outputs system processing results; the hidden unit is not observed is controled by external system, and locates between input and output units. The kinds of connection relationship between network processing units reflect the representation and processing of information, and the connection weights between neurons reflect the connection strength between the units.


### 2.5. Multiple Factors Mathematically Experimental Model of Impacting MBR Flux

According to the neural network theory, combined with the characteristics of impacting membrane factors, this paper presents a kind of neural network system suitable for MBR, and the factor affecting the membrane is called neural factors unit, as shown in Figure5.Figure 5
The structure of neural network of impacting MBR factors.As Figure5 shows, the structure of the MBR neural network also consists of three layers, but the output layer only has one target variable, namely, the final membrane flux. Each unit has the learning function in neural network. Neural units get raw data in the network input, and they output the corresponding expected value. Comparing with network output, they obtain error signal, so as to adjust the control over the connection strength of the weight. And after much training, the weight converges to a certain weight. But in MBR neural network, each nerve cell has the learning ability though introducing established mathematical model. These mathematical models have been verified by many scientific researchers and many experiments, whose accuracy has been guaranteed. They do not need a lot of learning, and they only need automatic output for referencing to multi-factor model according to the input parameters. So this paper focused on the unknown mathematical models of the joint action of multiple factors.For the structure diagram of MBR neural network, the output layer, namely, the final membrane flux, is the combined effect of the various flux of the hidden layer. Setting the total membrane fluxes, it can be shown specifically by the following formula:(2.4)JVA=Jv1+Jv2+⋯+Jvn.The membrane fluxJv1, combined effect of the known flux, such as the pressure and membrane resistance, is shown in formula (2.5). And membrane flux impacted by MLSS is shown in formula (2.6). These factors for affecting membrane flux Jv2 have been in a number of researches and discussions, but the combined effect of multiple factors needs further discussions:
(2.5)Jv1=Δpμ(Rm+Rg+Rc),(2.6)Jv2=-1.57log(MLSS)+7.84.Viscosity valuesμ are calculated by researching results of Sato and others and the sludge viscosity with the growth of the sludge concentration is index μ=0.282exp(0.127MLSS).According to the experimental studies, after excepting the known effect of the factors for membrane flux, the effect of the unknown relationships of the factors for membrane flux is small but cannot been ignored. So for the small part, we try to establish mathematical model with simple methods, and this paper uses the multiple linear to establish the relationship between them. This paper uses the knowledge based on neural network to solve the multiple factors. It is not only to ensure the independent effects of the various factors for membrane fluxes, but also not to neglect the common effects of the factors for membrane fluxes. So this model will be more close to realistic simulation environment.The uncertainty of the effect of various factors for membrane fluxes increases the difficulty of building model. Since the regression equation based on multiply linear is easy to fluctuate with changing the single factor, it is very suitable for the processing environment to change very little like the MBR reactor in a short time. To establish multiple linear regression equation is a process to estimate multi-factor linear model and seek the estimator. Similar to a linear regression analysis, the basic idea of that is also based on the principle of the least square, solving the multicoefficient to make the residual sum of squares observationsyi and regression value y^i reach the minimum. As the residual sum of squares
(2.7)Q=∑i=1n‍(yi-y^i)2=∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]2
is nonnegative quadratic of b0,b1,…,bp, so the minimum must exist. According to the extremism principle, when Q is set in extremism, b0,b1,…,bp must meet
(2.8)∂Q∂bj=0(j=0,1,2,…,p).
Accordingly (2.7) namely meets
(2.9)∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]=0,∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xi1=0,∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xij=0,⋮∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xip=0.The normal equations of (2.9) show the following:
(2.10)nb0+(∑i=1n‍xi1)b1+⋯+(∑i=1n‍xip)bp=∑i=1n‍yi,(∑i=1n‍xi1)b0+(∑i=1n‍xi12)b1+⋯+(∑i=1n‍xi1xip)bp=∑i=1n‍xi1yi,⋮(∑i=1n‍xip)b0+(∑i=1n‍xipxi1)b1+⋯+(∑i=1n‍xip2)bp=∑i=1n‍xipyi.If coefficient matrix of (2.10) is set, then it can be seen that it is a symmetric matrix. Then,
(2.11)A0=(n∑i=1n‍xi1⋯∑i=1n‍xip∑i=1n‍xi1∑i=1n‍xi12⋯∑i=1n‍xi1xip⋮⋮⋯⋮∑i=1n‍xip∑i=1n‍xipxi1⋯∑i=1n‍xip2)=(11⋯1x11x21⋯xn1⋮⋮⋯⋮x1px2p⋯xnp)=(1x11⋯x1p1x21⋯x2p⋮⋮⋯⋮1xn1⋯xnp)=X′X.The structure matrix of the multiple linear regression model of the data of that formula isX;X′ is the transposed matrix of the structure matrix X. The right-hand constant item of (2.10) is generally expressed by matrix E, then
(2.12)E=(∑i=1n‍yi∑i=1n‍xi1yi⋮∑i=1n‍xipyi)=(11⋯1x11x21⋯xn1⋮⋮⋯⋮x1px2p⋯xnp)(y1y2⋮yn)=X′Y.So, (2.10) can be shown as
(2.13)Ab=E
or
(2.14)(X′X)b=X′Y.If the determinant ofA is |A|≠0, then A is a full rank. Then, A has the inverse matrix A-1. According to (2.13) and (2.14), the least-squares estimation of β is
(2.15)b=A-1E=(X′X)-1X′Y.These are regression coefficients of the multiple linear regression equations. As (2.10) is the linear equations with p+1 unknown quantities, so the first equation of it can be simplified as
(2.16)b0=y¯-b1x¯1-b2x¯2-⋯-bpx¯p.Among this,(2.17)x¯j=1n∑i=1n‍xij,j=1,2,3,…,p,y¯=1n∑i=1n‍yi.Putting (2.16) into the rest of equations in (2.10), then
(2.18)L11b1+L12b2+⋯+L1pbp=L1y,L21b1+L22b2+⋯+L2pbp=L2y,⋮Lp1b1+Lp2b2+⋯+Lppbp=Lpy.Among this,(2.19)Ljk=∑i=1n‍(xji-x¯j)(xki-x¯k)=∑i=1n‍xjixki-1n(∑j=1n‍xji)(∑j=1n‍xki),Ljy=∑i=1n‍(xji-x¯j)(y-y¯)=∑i=1n‍xjiyi-1n(∑j=1n‍xij)(∑j=1n‍yi).Equations (2.15) are shown by matrix, then
(2.20)L·b=F.Therefore, the coefficient of the multiple linear regression equation can first solveL by (2.19) and then go back to (2.20). Then we can solve coefficient b by Gauss transform and put coefficient b into regression equation
(2.21)y^=b0+b1x1+b2x2+⋯+bnxn.We put the regression equation of membrane fluxes between the multiple factors that is solved into the index equation of the membrane fouling. Then,(2.22)f=(1-JVAJ0)×100%=(1-Jv1+Jv2+⋯+μ(b0+b1x1+b2x2+⋯+bnxn)μ0Rm)×100%.Here, the mathematically experimental model of the MBR membrane fouling index has been built.


## 2.1. Modeling Method of MBR

The test of this paper mainly inspects pollution load, pollutant removal, the performance of sludge sedimentation, organics removal, and so forth, all of which impact membrane fouling of the reactor. Thus, its feedback pollution situation through three-dimensional simulation of the MBR and measures through the membrane fouling indexf:
(2.1)f=(1-JvJ0)×100%.Known by the membrane fouling of the filter model, the initial statesRg and Rc are 0, and the MLSS is also 0. So the initial viscosity is μ0, and the initial membrane fluxes are set by the following formula J0:
(2.2)J0=Δpμ0Rm.The set of the final membrane fluxes is determined by many factors, so we will discuss and research it later in this paper.


## 2.2. Data Analysis of the MBR Modeling

Collecting actual operating data is the basis of establishing the mathematical model of the MBR. To collect relevant data, it is necessary to clear the quantitative relationship between the various elements, also observe and analyse systematically for the research problems, and summarize the goal of the decision and the restrictions of all the aspects of decision making.For the collection of field data, this paper extracts the required data sources by using the field test data based on the MBR system, as Table1 shows.Table 1
Data table of the collected fluxes, pressure, and so forth.
Time
Temperature
Pressure
MLSS of inflow
MLSS of outflow
Total resistance
Fluxes
(h)
(∘C)
(MPa)
(mg/L)
(mg/L)
(×1012m-1)
(L/m2h)
1
24
0.016
343.38
70.48
0.185
46.4
2
24
0.0168
378.15
83.87
0.2403
45.5
3
24
0.0175
392.42
87.06
0.2989
45.3
4
24
0.0243
472.43
85.63
0.3796
42.2
5
24
0.0268
483.73
59.62
0.3957
45.1
6
24
0.0291
583.16
95.05
0.441
42.2
7
24
0.0325
556.43
85.46
0.5119
39.7
8
24
0.0362
503.56
71.91
0.6075
37.3
9
24
0.0351
591.41
105.46
0.7143
31.4
10
24
0.0385
561.85
107.63
0.8421
28.9
11
24
0.0269
612.42
107.95
0.7623
21.7
12
24
0.0226
655.47
81.61
0.9737
14.5
13
24
0.0198
712.43
103.98
1.1659
11.2
14
24
0.0193
615.12
91.01
1.2911
10.5
15
24
0.0187
715.89
95.52
1.254
9.4It can be seen from the data of Table1, and after 15 hours, the relationship between total resistance and membrane fluxes as showen in Figure 1. The relationship between pressure and membrane fluxes is shown in Figure 2. The relationship between MLSS of inflow and membrane fluxes is shown in Figure 3.Figure 1
The data contrast diagram of total resistance and membrane fluxes.Figure 2
The data contrast diagram of pressure and membrane fluxes.Figure 3
The data contrast diagram of MLSS of inflow and membrane fluxes.


## 2.3. Establishment of an MBR Mathematically Experimental Model

For MBR simulation system, the establishment of an appropriate mathematically experimental model can evaluate and simulate the existing system. Through the simulation system, we can find problems in time, adjust the system’s parameters, and get a more stable and reasonable treatment effect. We can also guide the design of the new system, so that researchers can design the reactor more reasonably and scientifically.Mathematical modeling is a complex process. For the relationship between the total drag and membrane fluxes, we can see the inverse relationship in Figure1. The resistance gradually becomes larger, while the membrane fluxes gradually become smaller, as the relationship between them is
(2.3)Jv=ΔPμR.There are many other factors affecting the membrane fluxes, in addition to including the resistance. In the previous research, we have established the mathematical model between COD and MLSS. In order to be closer to the actual simulation environment, on the basis of that, this paper studies the mathematical model between multiple factors, such as pressure difference, and MLSS and membrane resistance. Through the mathematical model between the many factors and the membrane resistance, we finally establish the mathematically experimental model between multifactor and membrane fouling indexes.The relationship between the important parameters such as pressure difference, time, and MLSS and the total resistance of the membrane is complex and not a simple linear relationship. At the beginning of establishing mathematical model, we try to use only a single multiple linear regression to establish a simple relationship between the parameters and use it to analyze the relationship between the factors. Through discussing, researching, and testing the model established, we found that a single multiple linear regression is the sensitivity of the parameters, and the model of parameters is easy to deform for the abnormality of a parameter, and the model also has small tolerance for the new parameters. So a single multiple linear regression model is only applicable in the test conditions of the stable parameters and the small environmental changes, that is, lacking close to actual simulation environment research. So after reading a large portion of literature and researching the actual MBR processing environment, this paper proposes a multiple linear regression experimental model based on neural network, suited for MBR sewage treatment environment.


## 2.4. Multiple Linear Regression Model Based on Neural Network

According to the charts in Section2.2 and membrane fouling factors, it can be analyzed that each factor is not a single linear relationship for membrane fluxes. A single factor for membrane flux shows a kind of influence, and a multifactor combined with membrane flux shows with another influence. It is like neurons in the neural network, consisting of a separate nerve cell and forming the entire system by interaction of each unit.Neural network (NN) [1, 2] is a kind of algorithm mathematical model, which can imitate behavior characteristic of the animal neural network and conduct distributed and parallel information processing. A very important research content of neural network is learning. It achieves adaptability by learning, adjusts the weights, and improves the behavior of the system by the change of environment. In the MBR simulation system and establishing of multifactor membrane fouling model, it uses self-learning and adaptive ability of artificial neural network. The structure of neural network is shown in Figure 4.Figure 4
The structure of neural network.As shown in Figure4, the entire neural network is divided into three layers: input layer, hidden layer, and output layer. The number of hidden layers is variable, and the number of hidden layers and hidden units determines the complexity of the entire neural network. The type of treatment unit in neural network is divided into three categories: input units, output units, and hidden units. The input unit receives the information and data of the system external input; the output unit outputs system processing results; the hidden unit is not observed is controled by external system, and locates between input and output units. The kinds of connection relationship between network processing units reflect the representation and processing of information, and the connection weights between neurons reflect the connection strength between the units.


## 2.5. Multiple Factors Mathematically Experimental Model of Impacting MBR Flux

According to the neural network theory, combined with the characteristics of impacting membrane factors, this paper presents a kind of neural network system suitable for MBR, and the factor affecting the membrane is called neural factors unit, as shown in Figure5.Figure 5
The structure of neural network of impacting MBR factors.As Figure5 shows, the structure of the MBR neural network also consists of three layers, but the output layer only has one target variable, namely, the final membrane flux. Each unit has the learning function in neural network. Neural units get raw data in the network input, and they output the corresponding expected value. Comparing with network output, they obtain error signal, so as to adjust the control over the connection strength of the weight. And after much training, the weight converges to a certain weight. But in MBR neural network, each nerve cell has the learning ability though introducing established mathematical model. These mathematical models have been verified by many scientific researchers and many experiments, whose accuracy has been guaranteed. They do not need a lot of learning, and they only need automatic output for referencing to multi-factor model according to the input parameters. So this paper focused on the unknown mathematical models of the joint action of multiple factors.For the structure diagram of MBR neural network, the output layer, namely, the final membrane flux, is the combined effect of the various flux of the hidden layer. Setting the total membrane fluxes, it can be shown specifically by the following formula:(2.4)JVA=Jv1+Jv2+⋯+Jvn.The membrane fluxJv1, combined effect of the known flux, such as the pressure and membrane resistance, is shown in formula (2.5). And membrane flux impacted by MLSS is shown in formula (2.6). These factors for affecting membrane flux Jv2 have been in a number of researches and discussions, but the combined effect of multiple factors needs further discussions:
(2.5)Jv1=Δpμ(Rm+Rg+Rc),(2.6)Jv2=-1.57log(MLSS)+7.84.Viscosity valuesμ are calculated by researching results of Sato and others and the sludge viscosity with the growth of the sludge concentration is index μ=0.282exp(0.127MLSS).According to the experimental studies, after excepting the known effect of the factors for membrane flux, the effect of the unknown relationships of the factors for membrane flux is small but cannot been ignored. So for the small part, we try to establish mathematical model with simple methods, and this paper uses the multiple linear to establish the relationship between them. This paper uses the knowledge based on neural network to solve the multiple factors. It is not only to ensure the independent effects of the various factors for membrane fluxes, but also not to neglect the common effects of the factors for membrane fluxes. So this model will be more close to realistic simulation environment.The uncertainty of the effect of various factors for membrane fluxes increases the difficulty of building model. Since the regression equation based on multiply linear is easy to fluctuate with changing the single factor, it is very suitable for the processing environment to change very little like the MBR reactor in a short time. To establish multiple linear regression equation is a process to estimate multi-factor linear model and seek the estimator. Similar to a linear regression analysis, the basic idea of that is also based on the principle of the least square, solving the multicoefficient to make the residual sum of squares observationsyi and regression value y^i reach the minimum. As the residual sum of squares
(2.7)Q=∑i=1n‍(yi-y^i)2=∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]2
is nonnegative quadratic of b0,b1,…,bp, so the minimum must exist. According to the extremism principle, when Q is set in extremism, b0,b1,…,bp must meet
(2.8)∂Q∂bj=0(j=0,1,2,…,p).
Accordingly (2.7) namely meets
(2.9)∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]=0,∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xi1=0,∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xij=0,⋮∑i=1n‍[yi-(b0+b1xi1+⋯+bpxip)]xip=0.The normal equations of (2.9) show the following:
(2.10)nb0+(∑i=1n‍xi1)b1+⋯+(∑i=1n‍xip)bp=∑i=1n‍yi,(∑i=1n‍xi1)b0+(∑i=1n‍xi12)b1+⋯+(∑i=1n‍xi1xip)bp=∑i=1n‍xi1yi,⋮(∑i=1n‍xip)b0+(∑i=1n‍xipxi1)b1+⋯+(∑i=1n‍xip2)bp=∑i=1n‍xipyi.If coefficient matrix of (2.10) is set, then it can be seen that it is a symmetric matrix. Then,
(2.11)A0=(n∑i=1n‍xi1⋯∑i=1n‍xip∑i=1n‍xi1∑i=1n‍xi12⋯∑i=1n‍xi1xip⋮⋮⋯⋮∑i=1n‍xip∑i=1n‍xipxi1⋯∑i=1n‍xip2)=(11⋯1x11x21⋯xn1⋮⋮⋯⋮x1px2p⋯xnp)=(1x11⋯x1p1x21⋯x2p⋮⋮⋯⋮1xn1⋯xnp)=X′X.The structure matrix of the multiple linear regression model of the data of that formula isX;X′ is the transposed matrix of the structure matrix X. The right-hand constant item of (2.10) is generally expressed by matrix E, then
(2.12)E=(∑i=1n‍yi∑i=1n‍xi1yi⋮∑i=1n‍xipyi)=(11⋯1x11x21⋯xn1⋮⋮⋯⋮x1px2p⋯xnp)(y1y2⋮yn)=X′Y.So, (2.10) can be shown as
(2.13)Ab=E
or
(2.14)(X′X)b=X′Y.If the determinant ofA is |A|≠0, then A is a full rank. Then, A has the inverse matrix A-1. According to (2.13) and (2.14), the least-squares estimation of β is
(2.15)b=A-1E=(X′X)-1X′Y.These are regression coefficients of the multiple linear regression equations. As (2.10) is the linear equations with p+1 unknown quantities, so the first equation of it can be simplified as
(2.16)b0=y¯-b1x¯1-b2x¯2-⋯-bpx¯p.Among this,(2.17)x¯j=1n∑i=1n‍xij,j=1,2,3,…,p,y¯=1n∑i=1n‍yi.Putting (2.16) into the rest of equations in (2.10), then
(2.18)L11b1+L12b2+⋯+L1pbp=L1y,L21b1+L22b2+⋯+L2pbp=L2y,⋮Lp1b1+Lp2b2+⋯+Lppbp=Lpy.Among this,(2.19)Ljk=∑i=1n‍(xji-x¯j)(xki-x¯k)=∑i=1n‍xjixki-1n(∑j=1n‍xji)(∑j=1n‍xki),Ljy=∑i=1n‍(xji-x¯j)(y-y¯)=∑i=1n‍xjiyi-1n(∑j=1n‍xij)(∑j=1n‍yi).Equations (2.15) are shown by matrix, then
(2.20)L·b=F.Therefore, the coefficient of the multiple linear regression equation can first solveL by (2.19) and then go back to (2.20). Then we can solve coefficient b by Gauss transform and put coefficient b into regression equation
(2.21)y^=b0+b1x1+b2x2+⋯+bnxn.We put the regression equation of membrane fluxes between the multiple factors that is solved into the index equation of the membrane fouling. Then,(2.22)f=(1-JVAJ0)×100%=(1-Jv1+Jv2+⋯+μ(b0+b1x1+b2x2+⋯+bnxn)μ0Rm)×100%.Here, the mathematically experimental model of the MBR membrane fouling index has been built.


## 3. The Process of Three-Dimensional Simulation of the MBR

This subject is based on VC++ 6.0 and OpenGL, combines the real-time processing of the data of the MBR simulation system with the three-dimensional graphics processing module, and conducts the real-time three-dimensional solid model and data generated.It is a good support for OpenGL in the Windows operating system, which makes developing OpenGL applications become more simple and fast by using the VC++ 6.0 or the Visual C++ of other versions, such as VS2005 and others in Windows system [3, 4]. The development tool used by this topic is VC++ 6.0 with a good support for the OpenGL library and uses a visual programming environment provided by the OpenGL graphics library. These series of instructions and functions cooperate with flexible application guides AppWizard and the basic class libraries MFC sound of VC++ 6.0, which can greatly simplify the development of three-dimensional graphic programming in the MBR three-dimensional simulation system [5, 6].


### 3.1. Application Interface of VC++ 6.0 and OpenGL

It needs to establish the interface application [7] of VC++ 6.0 and OpenGL to develop applications by cooperating development tools of VC++ 6.0 with OpenGL, and we must configure the parameters in the VC++ 6.0 development environment. It is not consistent with the method of the establishment of OpenGL graphics libraries, graphics device interface GDI of the Windows, and most of MFC applications, whose graphics libraries have nothing to do with the operating system and whose unique design makes the Windows provide it with some special API function libraries.After related parameters are set, in order to meet the special needs of the OpenGL pixel format, we need to reset the pixel format of the drawing window. Here, we declare a structure variable Pixelformatdescriptor and make the structure variable support OpenGL and the color mode of it, but we also need to set appropriately some structural members. Then, we use the structure variable as parameter to call function ChoosePixelFormat(), so as to allocate a number pixel formats. Then we call SetPixelFormat() to set the number of pixel formats allocated to the current pixel format. After reseting the pixel format, the next step is to establish the coloring scene for OpenGL. The role of the coloring scene is equivalent to the scene of the device in Windows and is similar to the equipment scene. Only after setting the coloring scene, OpenGL can call the drawing statement by itself to draw graphics in Windows.Win32API provides several scene functions operating coloring with the prefix wgl, including wglCreateContext(), wglDeleteContext(), wglGetCurrentContent(), wglGetCurrentDC(), and wglDeleteContent(). What we need to know is that the coloring scene has set thread for unit. Namely, in order to execute statements of the drawing function of the coloring scene in OpenGL, each drawing thread must use a coloring scene as the scene coloring scene. In these functions of the coloring scene, wglCreateContext() is the function established by the coloring scene, with a handle of the device scene as its parameter and returning a handle of the coloring scene linking with the handle of the equipment scene. Then we call the function wglMakeCurrent() with these two handle as parameters, which makes the coloring scene as the coloring scene used by the current thread. Then, it is built the application programming interface of the VC++ 6.0 and OpenGL in Windows.


### 3.2. Method of Building Virtual Model of the MBR Simulation

In the virtual system of the MBR simulation, the MBR water treatment is the most important part of the simulation and also the researching focus of this subject. Through providing these advanced features of the OpenGL for the MBR mathematical model that has been established, including modeling, coordinate transformation, coloring, light, and smooth of the two-dimensional and three-dimensional graphics functions and texture mapping and NURBS curve, the virtual model of the MBR simulation can generate the three-dimensional simulation scene of the MBR and draw three-dimensional objects [8].The synthesis method is the basic method of building a virtual model in OpenGL. Using OpenGL to draw the three-dimensional entity model is the same with other entity models, and they all are synthesized through the simple rule and have three cases as follows.(1)
The synthesis of the rule entity, such as the design of the rule entity of shape model of the MBR reactor, can simply use the spatial geometry provided by the OpenGL, such as the combination of cylinder, the cone, and the sphere. Then changing the size and location of these spatial geometries, through adjusting some parameters of OpenGL functions, makes them combine into the entity rule that meets the demand.(2)
The synthesis of the surfacely complex entity, such as the design of the sludge layer of the MBR reactor, can use the backup provided by NURBS functions in OpenGL Glu library. Through the evaluating program, OpenGL can draw the number of the NURBSs and can also calculate the number of the curves and surfaces of the Bezier. When we need to draw the curved surface, we must first determine  the most similar polygon to the maximum plane of this surface or use directly the polygon of the physical interface to ensure that the vertexes of the polygon locate in the edge of the surface basically. After the polygon is established, we construct the surface based on that again, and the degree of the bump of the surface can be determined by controlling the position of the point. For the construction of the closed surface, we need to ensure the smoothness of the junctions by arranging the same control points in the junction.(3)
The synthesis of irregular complex entities: the triangle can join into any polygon, and its function is outstanding in the OpenGL programming design. So it is preferred in the design of OpenGL physical synthetic, and in the hardware level, the drawing of the triangle is highly optimized by most of the three-dimensional accelerated hardware and the accelerated card of the graphics. For some irregular entities, we can first synthesize some simple geometry through the triangle or polygon and then combine them. And for those like the membrane module of the MBR, they need to show the detail feature of the local one, while the surface of the membrane module changes with membrane fouling. For the kind of the object with changable, complex graphics or needing to express the detail feature of the local, it is especially suitable to join with the triangle.


### 3.3. Build the Virtual System of the MBR Simulation

The virtual object of this paper is mainly the virtual device class including the simulation of the MBR water treatment. In order to simulate all kinds of virtual objects in the process of the MBR water treatment, we need to build the behavior model of various objects, and they have the essential difference of this simple geometric model. The object-oriented technology is the ideal choice in the design and realization of the virtual object. Through the object-oriented technology, it is easy to make the object of the virtual entity show consistency with the behavior of the physical object that it corresponds to, and then the kind of virtual system can show authenticity. For the kind of virtual device of the MBR membrane module having the capacity of the conduct, the object of object-oriented technology corresponds to the virtual device, object’s properties show the properties of the virtual device, and the method of the object shows the behavior of the device. The encapsulation of the object makes them maintain the excellent interface between objects and the independence at the same time, and the polymorphism of the object makes the class library have a good extensibility, and the inheritance of the object reflects the classifiable level of the device.


## 3.1. Application Interface of VC++ 6.0 and OpenGL

It needs to establish the interface application [7] of VC++ 6.0 and OpenGL to develop applications by cooperating development tools of VC++ 6.0 with OpenGL, and we must configure the parameters in the VC++ 6.0 development environment. It is not consistent with the method of the establishment of OpenGL graphics libraries, graphics device interface GDI of the Windows, and most of MFC applications, whose graphics libraries have nothing to do with the operating system and whose unique design makes the Windows provide it with some special API function libraries.After related parameters are set, in order to meet the special needs of the OpenGL pixel format, we need to reset the pixel format of the drawing window. Here, we declare a structure variable Pixelformatdescriptor and make the structure variable support OpenGL and the color mode of it, but we also need to set appropriately some structural members. Then, we use the structure variable as parameter to call function ChoosePixelFormat(), so as to allocate a number pixel formats. Then we call SetPixelFormat() to set the number of pixel formats allocated to the current pixel format. After reseting the pixel format, the next step is to establish the coloring scene for OpenGL. The role of the coloring scene is equivalent to the scene of the device in Windows and is similar to the equipment scene. Only after setting the coloring scene, OpenGL can call the drawing statement by itself to draw graphics in Windows.Win32API provides several scene functions operating coloring with the prefix wgl, including wglCreateContext(), wglDeleteContext(), wglGetCurrentContent(), wglGetCurrentDC(), and wglDeleteContent(). What we need to know is that the coloring scene has set thread for unit. Namely, in order to execute statements of the drawing function of the coloring scene in OpenGL, each drawing thread must use a coloring scene as the scene coloring scene. In these functions of the coloring scene, wglCreateContext() is the function established by the coloring scene, with a handle of the device scene as its parameter and returning a handle of the coloring scene linking with the handle of the equipment scene. Then we call the function wglMakeCurrent() with these two handle as parameters, which makes the coloring scene as the coloring scene used by the current thread. Then, it is built the application programming interface of the VC++ 6.0 and OpenGL in Windows.


## 3.2. Method of Building Virtual Model of the MBR Simulation

In the virtual system of the MBR simulation, the MBR water treatment is the most important part of the simulation and also the researching focus of this subject. Through providing these advanced features of the OpenGL for the MBR mathematical model that has been established, including modeling, coordinate transformation, coloring, light, and smooth of the two-dimensional and three-dimensional graphics functions and texture mapping and NURBS curve, the virtual model of the MBR simulation can generate the three-dimensional simulation scene of the MBR and draw three-dimensional objects [8].The synthesis method is the basic method of building a virtual model in OpenGL. Using OpenGL to draw the three-dimensional entity model is the same with other entity models, and they all are synthesized through the simple rule and have three cases as follows.(1)
The synthesis of the rule entity, such as the design of the rule entity of shape model of the MBR reactor, can simply use the spatial geometry provided by the OpenGL, such as the combination of cylinder, the cone, and the sphere. Then changing the size and location of these spatial geometries, through adjusting some parameters of OpenGL functions, makes them combine into the entity rule that meets the demand.(2)
The synthesis of the surfacely complex entity, such as the design of the sludge layer of the MBR reactor, can use the backup provided by NURBS functions in OpenGL Glu library. Through the evaluating program, OpenGL can draw the number of the NURBSs and can also calculate the number of the curves and surfaces of the Bezier. When we need to draw the curved surface, we must first determine  the most similar polygon to the maximum plane of this surface or use directly the polygon of the physical interface to ensure that the vertexes of the polygon locate in the edge of the surface basically. After the polygon is established, we construct the surface based on that again, and the degree of the bump of the surface can be determined by controlling the position of the point. For the construction of the closed surface, we need to ensure the smoothness of the junctions by arranging the same control points in the junction.(3)
The synthesis of irregular complex entities: the triangle can join into any polygon, and its function is outstanding in the OpenGL programming design. So it is preferred in the design of OpenGL physical synthetic, and in the hardware level, the drawing of the triangle is highly optimized by most of the three-dimensional accelerated hardware and the accelerated card of the graphics. For some irregular entities, we can first synthesize some simple geometry through the triangle or polygon and then combine them. And for those like the membrane module of the MBR, they need to show the detail feature of the local one, while the surface of the membrane module changes with membrane fouling. For the kind of the object with changable, complex graphics or needing to express the detail feature of the local, it is especially suitable to join with the triangle.


## 3.3. Build the Virtual System of the MBR Simulation

The virtual object of this paper is mainly the virtual device class including the simulation of the MBR water treatment. In order to simulate all kinds of virtual objects in the process of the MBR water treatment, we need to build the behavior model of various objects, and they have the essential difference of this simple geometric model. The object-oriented technology is the ideal choice in the design and realization of the virtual object. Through the object-oriented technology, it is easy to make the object of the virtual entity show consistency with the behavior of the physical object that it corresponds to, and then the kind of virtual system can show authenticity. For the kind of virtual device of the MBR membrane module having the capacity of the conduct, the object of object-oriented technology corresponds to the virtual device, object’s properties show the properties of the virtual device, and the method of the object shows the behavior of the device. The encapsulation of the object makes them maintain the excellent interface between objects and the independence at the same time, and the polymorphism of the object makes the class library have a good extensibility, and the inheritance of the object reflects the classifiable level of the device.


## 4. Visual Simulation of the MBR Mathematically Experimental Model

After the mathematic test model and the virtual model built, it still needs to research the state of the MBR reactor by combining the method of numerical simulation and scientific visualization. It abandons the original output of the tedium digital form and realizes the conversion from mathematical simulation to visual graphics. It can also observe the state, change, and related rules of the MBR water treatment fastly and intuitively, so as to offer the reference and basis for the design, improvement and optimization of the MBR.The equipments need for research include sewage pumps, air pump, flow meter, vacuum gauge, and MBR. The component of the membrane that this subject adopts is hollow fiber membrane microporous filter (MF) components of polyvinylidene fluoride (PVDF) from the research center of Tianjin Motimo, and fiber aperture is 0.2μm of the external pressure type water; the efficient area used is 25 m2. For the MBR test model, according to the entity parameters of the model given, we first build a virtual three-dimensional model using OpenGL.


### 4.1. Equipment Specifications of the MBR

PVDF has the characteristics of good antipollution performance, high flux, the smoothness in the surface of inside and outside, relatively high strength, good recovery in cleaning flux, and so on. The parameters of the main performance are as in Table2.Table 2
The membrane parameter of PVDF.
Physical parameters
Index
Inner diameter (mm)
0.7
~
0.9
Wall thickness (mm)
0.6
Fiber aperture (m)
0.2
External diameter (mm)
1.3
~
1.5
Area (m2)
20
Tolerance range of PH value
2
~
13
Tolerance range of temperature (∘C)
1
~
40
Effluent turbidity (NTU)
<0.2
Pressure load (MPa)
-
0.01
~
-
0.05In this paper, we use water processor composed of 15 pieces of membrane biological reactor fixed volume, and the specific parameters of the equipment are shown in Table3.Table 3
Equipment specifications of the MBR.
Physical parameters
Index
Number of membranes (slice)
15
Area of membrane (m2)
300
Design flux of membrane (T/D)
50
~
75
Size of membrane reactor (mm)
1450 * 780 * 2000


### 4.2. Visual Programming

The visualization of the MBR is mainly divided into two parts of the visualization of the shape space and the internal component and is shown in Figure6.Figure 6
Process of the MBR visualization.The shape and components of the MBR reactor are using all types of primitives and more complex three-dimensional graphics in basic libraries and auxiliary libraries of OpenGL. In the establishment of the MBR simulation system, this paper adopts integer instead of float and uses integer to establish the model as far as possible. The benefits of doing that can improve the speed of system modeling and postprocessing of the graphic by reducing operations of the floating point, so as to improve the speed and efficiency of the processing of the MBR three-dimensional simulation system.(1)The Establishment of the Coordinate SystemIt has the initial coordinate system and the coordinate system of the current drawing in simulation system, and their length is from(-1,-1) to (1,1). The coordinate system of the current drawing is a coordinate system of drawing the object, and at the beginning, the initial coordinate system is coincides with the coordinate system of the current drawing. After using the glTranslatef (), glRotatef (), and other functions to translate, scale, and rotate transformation for the coordinate system of the current drawing, the initial coordinate system is separated with the coordinate system of the current drawing.(2)Establishment of the ModelThe establishment of the MBR reactor model requires the extraction, expression, and quantization of the data. The extraction of data is according to the parameters of the MBR equipment provided. And after extracting the parameter, we need the parameter to abstract, analyse and correct. Then we can quantify the data and model it.(a)Establishment of the FrameworkThe construction of the graphics is composed of point, line, and surface in the MBR three-dimensional system. After the establishment of the coordinate system, we extract the parameter of the above physical model, such as length, width, high, thickness, and the number, scale it in proportion in the coordinate system, and get the coordinate of each point in the simulated environment of the specific model. Then, we get the virtual model of the MBR reactor by using the line. According to four vertexes, we draw a rectangle as follows:glBegin(m_nPattern);  // Begin to draw in the method of m_ nPatternglVertex3fv(v1);   // Vertex 1glVertex3fv(v2);   // Vertex 2glVertex3fv(v3);   // Vertex 3glVertex3fv(v4);   // Vertex 4glEnd();  // End of drawing.Six faces of this cube are drown according to the four vertexes of each surface and shown in Figure7.Figure 7
Framework model of the MBR reactor.After establishing the framework model, we draw the outline of the model. Then, we quantify the point of the framework spaced, so as to obtain the extension of the model in space. The specific method is as follows:// Standardization of vector, and standardized by the length, width, and heightGLfloat d = (GLfloat)sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);if(d == 0.0)return;v
[
0
]/ = d; v[1]/ = d; v[2]/ = d;v
[
0
]
* = x_length/2; v[1]* = y_length/2; v[2]* = z_length/2.After quantification, we refine the structure texture of the model for the framework model by using the method of the recursion of the four-binary tree. Because a rectangle of the model composes of four small, if we adopt the method of the single recursion, the processing efficiency of program modeling will be very low. In fact, using the method of the recursion of the four-binary tree is a way, which uses the space for the time and uses a certain memory space for the considerable speed of the modeling. The experimental results show that it is feasible. The result is shown in Figure8.Figure 8
The texture structure of the reactor.(b)Establishment of the ModelAfter building the framework of the MBR reactor, it needs to add the modules, and these modules are variable. For example, membrane modules can be simulated by using the mathematical model established according to the input data and can adjust the color of the membrane module according to the results of the simulation. Then according to color, we can distinguish the state and the level of the contamination of the current membrane module.Adding the module has the sewage model, pipe model, and so on. This paper used the method of adding surface to the framework for this kind of model, such as some common plane and curve surfaces:// Set some parametersglPushMatrix();glEnable(GL_COLOR_MATERIAL);glDepthMask(GL_FALSE);glEnable(GL_BLEND);glBlendFunc(GL_SRC_ALPHAGL_ONE_MINUS_SRC_ALPHA);glBegin(GL_QUADS);  //Begin to draw plan figureglVertex3fv(&vertex_list [index_list [i][0][0]);glVertex3fv(&vertex_list [index_list [i][1][0]);glVertex3fv(&vertex_list [index_list [i][2][0]);glVertex3fv(&vertex_list [index_list [i][3][0]);glEnd();glDepthMask(GL_TRUE);glPopMatrix().The modeling diagram adding modules is shown in Figure9. The model of the MBR reactor is established basically. We use different colors to judge the state of the membrane module, and the white color indicates the lowest level of alert that the membrane module had not been contaminated. The deeper the color is, the higher degree of the pollution of the membrane module is, and the worse the state is, and the red color represents the highest level of alert.Figure 9
Modules diagram of the MBR reactor.


## 4.1. Equipment Specifications of the MBR

PVDF has the characteristics of good antipollution performance, high flux, the smoothness in the surface of inside and outside, relatively high strength, good recovery in cleaning flux, and so on. The parameters of the main performance are as in Table2.Table 2
The membrane parameter of PVDF.
Physical parameters
Index
Inner diameter (mm)
0.7
~
0.9
Wall thickness (mm)
0.6
Fiber aperture (m)
0.2
External diameter (mm)
1.3
~
1.5
Area (m2)
20
Tolerance range of PH value
2
~
13
Tolerance range of temperature (∘C)
1
~
40
Effluent turbidity (NTU)
<0.2
Pressure load (MPa)
-
0.01
~
-
0.05In this paper, we use water processor composed of 15 pieces of membrane biological reactor fixed volume, and the specific parameters of the equipment are shown in Table3.Table 3
Equipment specifications of the MBR.
Physical parameters
Index
Number of membranes (slice)
15
Area of membrane (m2)
300
Design flux of membrane (T/D)
50
~
75
Size of membrane reactor (mm)
1450 * 780 * 2000


## 4.2. Visual Programming

The visualization of the MBR is mainly divided into two parts of the visualization of the shape space and the internal component and is shown in Figure6.Figure 6
Process of the MBR visualization.The shape and components of the MBR reactor are using all types of primitives and more complex three-dimensional graphics in basic libraries and auxiliary libraries of OpenGL. In the establishment of the MBR simulation system, this paper adopts integer instead of float and uses integer to establish the model as far as possible. The benefits of doing that can improve the speed of system modeling and postprocessing of the graphic by reducing operations of the floating point, so as to improve the speed and efficiency of the processing of the MBR three-dimensional simulation system.(1)The Establishment of the Coordinate SystemIt has the initial coordinate system and the coordinate system of the current drawing in simulation system, and their length is from(-1,-1) to (1,1). The coordinate system of the current drawing is a coordinate system of drawing the object, and at the beginning, the initial coordinate system is coincides with the coordinate system of the current drawing. After using the glTranslatef (), glRotatef (), and other functions to translate, scale, and rotate transformation for the coordinate system of the current drawing, the initial coordinate system is separated with the coordinate system of the current drawing.(2)Establishment of the ModelThe establishment of the MBR reactor model requires the extraction, expression, and quantization of the data. The extraction of data is according to the parameters of the MBR equipment provided. And after extracting the parameter, we need the parameter to abstract, analyse and correct. Then we can quantify the data and model it.(a)Establishment of the FrameworkThe construction of the graphics is composed of point, line, and surface in the MBR three-dimensional system. After the establishment of the coordinate system, we extract the parameter of the above physical model, such as length, width, high, thickness, and the number, scale it in proportion in the coordinate system, and get the coordinate of each point in the simulated environment of the specific model. Then, we get the virtual model of the MBR reactor by using the line. According to four vertexes, we draw a rectangle as follows:glBegin(m_nPattern);  // Begin to draw in the method of m_ nPatternglVertex3fv(v1);   // Vertex 1glVertex3fv(v2);   // Vertex 2glVertex3fv(v3);   // Vertex 3glVertex3fv(v4);   // Vertex 4glEnd();  // End of drawing.Six faces of this cube are drown according to the four vertexes of each surface and shown in Figure7.Figure 7
Framework model of the MBR reactor.After establishing the framework model, we draw the outline of the model. Then, we quantify the point of the framework spaced, so as to obtain the extension of the model in space. The specific method is as follows:// Standardization of vector, and standardized by the length, width, and heightGLfloat d = (GLfloat)sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);if(d == 0.0)return;v
[
0
]/ = d; v[1]/ = d; v[2]/ = d;v
[
0
]
* = x_length/2; v[1]* = y_length/2; v[2]* = z_length/2.After quantification, we refine the structure texture of the model for the framework model by using the method of the recursion of the four-binary tree. Because a rectangle of the model composes of four small, if we adopt the method of the single recursion, the processing efficiency of program modeling will be very low. In fact, using the method of the recursion of the four-binary tree is a way, which uses the space for the time and uses a certain memory space for the considerable speed of the modeling. The experimental results show that it is feasible. The result is shown in Figure8.Figure 8
The texture structure of the reactor.(b)Establishment of the ModelAfter building the framework of the MBR reactor, it needs to add the modules, and these modules are variable. For example, membrane modules can be simulated by using the mathematical model established according to the input data and can adjust the color of the membrane module according to the results of the simulation. Then according to color, we can distinguish the state and the level of the contamination of the current membrane module.Adding the module has the sewage model, pipe model, and so on. This paper used the method of adding surface to the framework for this kind of model, such as some common plane and curve surfaces:// Set some parametersglPushMatrix();glEnable(GL_COLOR_MATERIAL);glDepthMask(GL_FALSE);glEnable(GL_BLEND);glBlendFunc(GL_SRC_ALPHAGL_ONE_MINUS_SRC_ALPHA);glBegin(GL_QUADS);  //Begin to draw plan figureglVertex3fv(&vertex_list [index_list [i][0][0]);glVertex3fv(&vertex_list [index_list [i][1][0]);glVertex3fv(&vertex_list [index_list [i][2][0]);glVertex3fv(&vertex_list [index_list [i][3][0]);glEnd();glDepthMask(GL_TRUE);glPopMatrix().The modeling diagram adding modules is shown in Figure9. The model of the MBR reactor is established basically. We use different colors to judge the state of the membrane module, and the white color indicates the lowest level of alert that the membrane module had not been contaminated. The deeper the color is, the higher degree of the pollution of the membrane module is, and the worse the state is, and the red color represents the highest level of alert.Figure 9
Modules diagram of the MBR reactor.


## 5. Conclusions

This paper proposed multiple linear regression models based on neural network. Though to collect and analyse the real data, we draw the relationship chart of membrane flux, pressure difference, MLSS, and total resistance and establish the three-dimensional simulation model of the MBR reactor. After analyzing data relationship chart between the parameters, we know the influence of various parameters for the membrane resistance using multiple linear regression equation, and then we establish the mathematical model between each parameter and membrane fouling by the relationship of the membrane resistance and flux. The membrane pollution index can be intuitive shown in the graphics of the MBR three-dimensional simulation model, which is obtained by the relationship of this experimental model. The flexible application of the computer visualization technology in the MBR three-dimensional simulation system effectively shortened the researching cycle of the MBR sewage treatment and improved the efficiency of the work. The researching and designing idea has the inspiring and reference effect on the research, application, and development of the future about the MBR simulation technology.



---

*Source: 703153-2012-11-13.xml*