Application of Neural Network in the Measuring System On-line for Water Content of Crude Oil

The aim of this study is to introduce a new way to measure the water content of Crude Oil. In this measurement system, capacitive sensor is used as sensitive element and BP neural network model is adopted to deal with data. Water content and temperature are used as input parameters to set up BP neural network model. By MATLAB simulation, a moisture content of crude oil is forecasted, so that the influence comes from temperature variation is compensated and the accuracy of the measurement result is improved.


INTRODUCTION
In the petroleum chemical industry, water content of crude oil is an important parameter in the process of oil production, transport, measurement, marketing and refining.It is an important index of metering well yield, evaluating of oil reservoir exploitation value, degree of recovery and developing mining scheme.In order to determine the oil production of oilfield crude wells, observe the variation of water content of the reservoir, determine the water layer and oil layer and estimate the prediction of oil production and the development life of oil well, on-line measurement of crude oil and water's volume or mass flow.Of pipeline are in need.Water content of crude oil on-line accurate measurement plays an important role to the decision making department to control production's dynamic process, determine the yield distribution, control the production and quality of oil well and detect the oil well state.So, how to control the water content in crude oil effectively, enhance oil recovery and reduce mining cost has been a major problem to be solved in oil field production.
At present, there are two main measuring methods of water content in crude oil in the domestic oil industry: artificial sampling and on-line measurement.In the artificial sampling method, sampling cycle is long and human factor error is large.On-line measurement commonly used is: density method, ray method, short wave, microwave method and capacitance method.Now, on-line water content measuring instrument has been used more and more widely, which reduces the labor intensity of manual sampling inspection (Li-Tian et al., 2000) and improving the measurement of water content in crude oil by the rationality of science.But these measuring instruments are usually less accurate, not long-term stability problems during using process, because of instrument field environmental complexity and the instrument's design defects itself.For example, capacitance water content meter's measure range is limited for water conductive effect and its precision of measurement is low because the liquid dielectric constant is affected by temperature.Therefore, to solve the existing problems of capacitance type moisture measurement system, this study improves the capacitive sensor structure and the internal electrode, builds a BP neural network model for data processing, adopts online compensation water content rate's change in Crude Oil, caused by temperature and improves measurement accuracy of the capacitance water content of crude oil.

CAPACITANCE WATER CONTENT OF CRUDE OIL MEASURING SYSTEM BASED ON NEURAL NETWORK
Capacitance water content of crude oil measuring system based on Neural Network measures crude oil water parameters by adopting capacitance type sensor, a thermostat in the probe measures the temperature of crude oil.Sensor probe is inserted into the measured crude oil during measuring to detect the moisture content and temperature parameters.After being processed by the filter circuit and amplifier, two voltage signals are sent to the treatment data acquisition card A/D to conversion, data processing and display (Shi-Gao and Yuan-Xian, 2010).
Capacitance type sensor probe structure: Capacitance type sensor converts crude oil water content signal into electrical signal.Capacitance type sensor usually used is coaxial capacitor and the inner and the outer conductor exposed, which has a good job characteristics in low water.When the moisture content is in the range of 30~50%, it lost the resolution ability of moisture content due to the large number of conductive particles making up the conductor between two plates of capacitor conductor.Self equalizing is adopted in the design of capacitance type sensor in the study.The sensor structure are still using the concentric sleeve, but on the outer surface of the inner electrode, Teflon insulation layer is uniformly coated titanium, so the crude oil is no longer in contact with the inner conductor, polarization electric field (He et al., 2000) power line starts from the inner conductor's outer surface and terminates in an outer conductor's inner surface through the insulating layer and the measured object.At the same time ensuring uniform thickness, smooth surface and no eye, water conductive effect can be eliminated because it has excellent water and oil repellency, so that the measurement of water content ratio reaches 100%.The sensor probe is shown as in Fig. 1.
The sensor electrode internal diameter is R, the inner electrode diameter is r, titanium Teflon coating thickness is δ, electrode length is l, insulating material relative dielectric constant is ε 1 , the measured oil dielectric constant is ε 2 and ε 0 is the vacuum permittivity.The total capacitance of probe is the series capacitor of insulating layer capacitance and measured crude.Formula for calculating are as following: Considering the insulating coating is very thin and ignoring the sensor edge effect, it can be got: It shows, the capacitance of capacitor with certain geometry is the single value function of measuring dielectric constant, so the change value of measured medium dielectric constant can be changed into the corresponding capacitance output.
The structure of neural network: BP neural network is constructed as a parallel information processing Considering the influence to water content of crude oil from temperature change, the crude oil moisture online measurement system is considered as a nonlinear system affected by many factors.Using neural network to predict the water content of crude oil, the mathematical model of the system needn't to be established and with the help of the sample data, the highly nonlinear mapping can be realized from the input to the output.The system adopts BP neural network structure, as shown in Fig. 2.
In Fig. 2, with the change of crude oil temperature, training moisture content signal is required to close to the water ratio actual value ρ that is the output value we expected in an allowable deviation.The neurons serial number of input layer, hidden layer and output layer are i, j and k respectively, i = 2, k = 1, j = 1, 2, 3…l (where l is 6).The same layer of neurons are not connected with each other, the adjacent layers of neurons are associated through the connection weights.Learning and training process is composed of two parts, which are network input signal forward propagation (Ping-Fan and Chang-Shui, 2000) and error signal back propagation, training in accordance with the supervised learning methods.In the forward propagation of information, the input information is calculated by layer and transmitted from the input layer, hidden layer to the output layer, the Neurons output of output layer corresponds to the network response of input mode.If it isn't the desired output, then the error turns to the back-propagation, connection weights of various layers are modified by layer, from the output layer, the hidden layer and finally back to the input layer, according to the principle of reducing the expected output and actual output error.With the error back propagation training is doing constantly, network's response accuracy to input signal continues to improve, until the error signal reaches within the permit scope (Jin-Ming and Yong-Li, 2004).The i th node's input of the input layer is: where, x i = The Neural network input θ i = The threshold value of the i th node The response output is: The input of j node in the hidden layer is: where, ω i,j = The wight value of the hide layer θ j = The threshold value of the j th node The response output is: The input of the k th node is: where, ω jk = The wight value of the output layer θ k = The threshold value of the k th node The response output is: If the system deviation is ε, the error judgment rule is:

SIMULATION RESULTS
If the BP learning algorithm as shown in Fig. 3 is used to train samples, corresponding weights and thresholds of BP neural network to each input and output can be obtained.Then the detection sample can test whether network can give the correct input output relationship or not.
Samples are trained off-line in the MATLAB environment, the error curve is shown as in Fig. 4.
The neural network is constructed by C language programming and embedded in software.When collected moisture detecting sensor signals and temperature signals are input to it, the output is the moisture content after compensation.
When the crude oil temperature is 55°C, compared with laboratory manual method on crude oil sampling, results of repeated measurement contrast are as shown in the following Table 1.
Dates in the Table 1 shows that the output value of neural network is more approaching the sample laboratory values than the direct output value of

CONCLUSION
Based on analysis of the actual situation, water content of crude oil's temperature compensation is gave on-line by crude oil moisture detection system designed by neural network.So the complex multivariate signal processing problem is solved, which can be not realized in the hardware circuit and the measurement accuracy is improved as also.

Fig. 2 :
Fig.2: BP network structure model to simulate the human information processing mechanism(Lu-Jing and Hua, 2006), which has a distributed storage and associative memory function, the strong adaptability and self organization and arbitrary nonlinear mapping ability.It is often used to analysis and synthesis the output results of 2 estimate models effectively and improve the estimation accuracy and reliability.Considering the influence to water content of crude oil from temperature change, the crude oil moisture online measurement system is considered as a nonlinear system affected by many factors.Using neural network to predict the water content of crude oil, the mathematical model of the system needn't to be established and with the help of the sample data, the highly nonlinear mapping can be realized from the input to the output.The system adopts BP neural network structure, as shown in Fig.2.In Fig.2, with the change of crude oil temperature, training moisture content signal is required to close to the water ratio actual value ρ that is the output value we expected in an allowable deviation.The neurons serial number of input layer, hidden layer and output layer are i, j and k respectively, i = 2, k = 1, j = 1, 2, 3…l (where l is 6).The same layer of neurons are not connected with each other, the adjacent layers of neurons are associated through the connection weights.Learning and training process is composed of two parts, which are network input signal forward propagation (Ping-Fan and Chang-Shui, 2000) and error signal back propagation, training in accordance with the supervised learning methods.In the forward propagation of information, the input information is calculated by layer and transmitted from the input layer, hidden layer to the output layer, the Neurons output of output layer corresponds to the network response of input mode.If it isn't the desired output, then the error turns to the back-propagation, connection weights of various layers are modified by layer, from the output layer, the hidden layer and finally back to the input layer, according to the principle of reducing the expected output and actual output error.With the error back propagation training is doing constantly, network's response accuracy to input signal continues to improve, until the error signal reaches within the permit scope (Jin-Ming and Yong-Li, 2004).

Fig. 3 :
Fig. 3: BP learning algorithmIf the excitation function adopts "sigmoid" type, then: The i th node's input of the input layer is:

Table 1 :
Water content contrast of crude oil Water content measured by capacitance method ρ′ (%)