Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 4, No. 3, 2022 195 Study on Calibration Method for Ion Concentration Measurement Parameters of Ion Selective Electrode Based on Multiple Linear Regression Jingjin Li, Zhang He* School of Mechatronic Engineering, Southwest Petroleum University, Chengdu 610500, China * Corresponding author Abstract: In the drilling industry, the change of ion concentration of drilling fluid can provide a basis for judging whether it enters the target layer and whether there is a layer penetration phenomenon during the drilling process. Traditional ion concentration determination methods require manual operation, time-consuming and labor-intensive, and most of them have problems such as large measurement errors, measurement cycles and in-line measurements, so for these problems, there is an urgent need for a fast and real-time measurement measurement method. The ion-selective electrode method allows accurate and real-time measurement of chloride, sulfur and potassium ions, but due to the mechanism of the ion selective electrode method, mutual interference occurs when multiple ions coexist. Aiming at the problem of low efficiency of traditional measurement methods and multi-ion interference with each other in ion-selective electrode method. In this paper, an ion concentration calibration method based on multiple linear regression is proposed, and the error cause of the ion selective electrode method is analyzed first, and the measurement value is calibrated in combination with the multiple linear regression model, and finally the ion concentration experimental platform is established, and the results of the measurement accuracy of chlorine, sulfur and potassium ions are improved by more than 90%, which proves the effectiveness of the proposed method. Keywords: Drilling fluid ion concentration, Ion-selective electrode method, In-line measurement, Multiple linear regression. 1. Quote During drilling, changes in ion concentration in drilling fluid often predict changes in downhole conditions. If the concentration of chloride ions is significantly increased, it means that drilling into the salt bed or underground salt water intrusion. If the drilling fluid does not have sufficient salt resistance, it will flocculate and deteriorate performance. If the concentration of chloride ions in the drilling fluid drops significantly, it means that groundwater has invaded the hole, which can also damage the performance of the drilling fluid. An increase in the concentration of sulfur ions, for example, means drilling into sulfur-containing formations. If the drilling fluid does not have sufficient acid resistance, the pH value of the drilling fluid will be weakened, and the function and effect of the colloidal properties of the drilling fluid will be reduced, and the overall drilling fluid property will be greatly affected. It can be seen that the determination of ion concentration is very important for timely maintenance of drilling fluid and prediction of formation changes, and it is of practical significance to find a fast, accurate and applicable measurement method [1,2] At present, the measurement of plasma concentration of chloride ion, potassium ion and sulfur ion mainly uses standard solution titration filtrate, but this method needs to extract filtrate and adjust pH value, and it takes a long time to provide timely on-site guidance. If the pH is too high or too low, the measured results of ion concentration will be affected [3,4].There are also ion chromatography [5,6], inductively coupled ion mass spectrometry [7,8], atomic absorption method [9], etc., but most of them have problems such as large measurement error, long measurement period and inability to realize automatic online measurement. In order to avoid these problems, there is an urgent need for a simple, fast, inexpensive measurement method suitable for the simultaneous presence of multiple ions, and can be used as a continuous mud logging device to measure ion concentration. Compared with the conventional test method, the ion selective electrode method is more suitable for the online measurement of ion concentration. Its advantages are convenient, rapid and accurate operation, and it does not need complex pretreatment operations such as dilution and filtration, and can maintain the in-situ properties of water samples to the greatest extent. The application of ion-selective electrode in chemical analysis and detection by Wang Yalin et al. has also shown high applicability, gradually becoming a mainstream analysis technology in the field of chemical analysis [10].Based on the discovery of several new mechanisms in ionic interface reactions, Li Hang et al. established an ion-selective electrode method based on the multi-parameter joint analysis principle of soil particle surface properties, realizing the joint determination of soil surface property parameters [11].KaliszJustyna used AgCl electrode as working electrode, ion-selective electrode as reference electrode, and "reverse" amperage setting to significantly amplify the potential response of ISE [12].Using this method, the linear dependence of the current on the concentration of the model analyte (potassium and calcium ions) can be recorded even in a narrow concentration range (e.g., 1.34 to 1.10mA for calcium ions), and the change in the open-circuit potential recorded there is negligible. KhoshnoodRaziehSanavi prepared an aluminum ion selective electrode, which is used for quantitative analysis of aluminum ions in the presence of various cations such as alkaline ions, neutral ions and heavy metal ions [13].According to the results, the aluminum ion nanocomposite carbon slurry sensor shows good selectivity in the presence of a few metal ions, and the response of the 196 sensor is independent of pH value, the range is 24, and the response time is less than 5s. There are many kinds of ion-selective electrodes, different membrane types, and different mechanism of ion-selective electrode testing. According to the membrane materials, it can be divided into several categories, namely potassium ions, sulfur ions and nitrate ions based on polymer membrane, sodium ions based on glass material, calcium ions based on polymer film, ammonium ions based on gas-sensitive film, and chloride ions, bromine ions and iodine ions based on solid film.At present, there have been relevant studies on the mutual interference effects measured by ion-selective electrode method. Through the determination of a single ion in the mixed solution where bromine ions and iodide ions coexist, the influence of the presence of congener elements on the testing of the elements in the same group is studied. However, this method is only applicable to the interference study of electrode testing when two halogen elements exist at the same time [14]. Aiming at the problems that the traditional ion concentration measurement method can not be measured online and the multi-ion solution will interfere with each other, this paper proposes a study on the interference effect of chlorine, sulfur and potassium ions based on the ion selection electrode method. Firstly, the principle and error source of the ion selection electrode are analyzed. Then the calibration method of ion concentration based on multiple linear regression was used to correct the error of the actual measurement, and then the ion concentration measurement device was built. By designing the mixed solution of chlorine, sulfur and potassium ion with different concentration differences, the measurement results of the device were compared with the standard titration results to verify the effectiveness of the method proposed in this paper. 2. Measurement Principle of Ion- selective Electrode The ion-selective electrode is also known as a membrane electrode in principle because of the function of a sensitive membrane in its structure.Ion selective electrode is a tool for analyzing ion concentration in solution. Its main structures include working electrode, reference electrode and sensitive membrane.The membrane potential related to the activity of measured ions is generated at the phase interface through the sensitive membrane and the solution. The relationship between the electrode membrane potential and measured ion content satisfies the Nernst equation [15] as shown below. 𝐸 𝑙𝑛 (1) In the above equation, 𝛾 of the ion-selective electrode is a fixed value, so it can be expressed as 𝐸 𝐸 𝐸 𝐸 𝑙𝑛𝛾 (2) Type: 𝐸 for ion selective electrodes in thermodynamic temperature T, the output of the electric potential; 𝐸 as working electrode potential output; 𝐸 as the reference electrode potential output; 𝐸 for ion selective electrode standard output voltage;R is the molar gas constant;T is the thermodynamic absolute temperature; 𝑧 ion charge number under test;F is Faraday's constant; 𝛾 ion concentration under test. As can be seen from the formula of the output voltage 𝐸 and ion concentration 𝛾 of numerical linearly related.Thus the corresponding ion concentration can be obtained by measuring the response potential of the ion selective electrode. In actual measurement, the appropriate electrode should be selected according to the measurement object, which is based on the selectivity of ionic electrode, usually expressed by a selectivity coefficient. When the tested ion species exists a mixed solution of one or more ions, in order to represent the interference degree, the following formula can be used to express the interference degree. 𝐸 𝐸 log π‘Ÿ βˆ‘ 𝐾 、 π‘Ÿ / (3) Type, 𝐾 、 π‘Ÿ / for ion selective coefficient, 𝑧 ion charge number for interference.According to the method of equal potentials, 𝐾 、 (4) 3. An Ion Concentration Calibration Method Based on Multiple Linear Regression When measuring the ion concentration in the mixed solution, the ion selective electrode is easy to be interfered by other ions in the solution when measuring a single ion in the mixed solution, which will cause the ion concentration error in the ion selective electrode measurement. Considering the error factors and measurement principles of the ion-selective electrode, considering that the output potential and ion concentration are linear in the measurement principles of the ion-selective electrode under the interference of various ion factors, multiple linear regression model (MLR)[16,17] is selected to calibrate the errors of the ion-selective electrode. 3.1. Multiple linear regression model for calibration of ion concentration Multiple linear regression is a typical multivariable correction method applied to the simultaneous measurement of multiple components. It can be obtained from various discrete data obtained from ion concentration measurement to obtain the relationship between various variables affecting ion concentration measurement, linear regression equation, and through multiple linear regression can be calibrated for the measurement value of ion selective electrode. Assumes that the chloride ion concentration on numerical lgC as the independent variable 𝑋 , sulphur ion concentration on numerical lgC as the independent variable𝑋 , the concentration of potassium ions to numerical lgC as the independent variable 𝑋 , the actual measurement of the potential value of the independent variable𝑋 , potential response of the ideal value of the dependent variable Y.The linear regression model of the ion to be measured is as follows: y Ξ± Ξ± X Ξ± X Ξ± X Ξ± X Ξ± X (5) 197 The unknown parameters are Ξ± , Ξ± , Ξ± , Ξ± , Ξ± (5 in total), the linear regression constant is Ξ± , and the linear regression coefficient isΞ± , Ξ± , Ξ± , Ξ± .Called y ions under the ideal point response values (i.e., dependent variable), the X , X , X , 𝑋 are numerical, sulfur, chlorine ion concentration on the concentration of potassium ion concentration of numerical, numerical and actual measurement of the ion under test for potential value, is four can accurately measure and control variables (independent variables). The above multiple linear regression model is proposed for the calibration of ion concentration, using regression equation to measure the coefficient of determination 𝑅 and the actual measurement of the ion under test potential value of goodness of fit: R βˆ‘ βˆ‘ βˆ‘ (6) 𝑅 sample r-squared figures of the value of 0 𝑅 1, 𝑅 numerical and the closer to 1, the greater the goodness of fit of the regression equation, regression linear fitting effect will be better;On the other hand, if the value of 𝑅 and 0 the closer, the regression linear fitting effect will be worse. Above the multiple linear regression model is proposed for the calibration of ion concentration using statistic regression equation F test of significance, i.e. to test model of ion concentration on numericalX , X , X , 𝑋 as a whole on the potential response of ideal value if there is a significant impact on y.Put forward the hypothesis: 𝐻 : Ξ± Ξ± Ξ± Ξ± Ξ± 0, 𝐻 : Ξ± , Ξ± , Ξ± , Ξ± , Ξ± insufficiency is zero, in order to establish the test𝐻 F statistics, using the decomposition of the total sum of squared residuals from the SST SSR SSE structure F test statistics are as follows: F / / (7) A given level of significance of Ξ±, check F distribution table, get the critical value 𝐹 π‘˜, 𝑛 π‘˜ 1 .If F>𝐹 π‘˜, 𝑛 π‘˜ 1 , then, suppose is rejected, at this point shows that regression effect;If F𝐻 ≀𝐹 π‘˜, 𝑛 π‘˜ 1 , then, suppose 𝐻 is accepted, the regression effect is not significant. In addition, can also according to the output of the test P value to determine the significance of the regression equation was: if P Ξ± , reject the null hypothesis 𝐻 to adopt assumption 𝐻 , the smaller the P value, namely, F series. 0.The larger the measurement, the more significant the regression equation. 4. Experimental Verification 4.1. Construction of experimental equipment The ion concentration measuring device is shown in Figure 1. The ion concentration measuring device includes the following parts: 1) chloride ion selective electrode, sulfur ion selective electrode, potassium ion selective electrode 2) dilution stirring device 3) ion concentration demodulation instrument (a) 3D model (b) Actual view of the device Figure 1. Ion concentration measuring device Ion selective electrode measures ion concentration in mixed solution.The dilution stirring device includes water- based drilling fluid inlet, outlet and exhaust port. The whole device is divided into two parts through flange connection, and three ion selective electrodes are fixed on the tank through threaded connection.According to the requirements of the experiment in the dilution stirring device to modulate different concentrations of solution, so that the solution mixed more evenly.The ion concentration demodulation instrument collects data and records the output signal of the ion selective electrode.See Table 1 for relevant parameters of ion selective electrode. Table 1. Technical parameters of ion selective electrode Name Parameter Measuring range 1.8-40000mg/L Measurement accuracy 5% Signal output 4-20mA Communication signal Modbus RTU via RS485 Power supply 220VAC Profile size 96(W)*96(H)*119(D) Hole size 92mm*92mm 4.2. Experiment and Data Analysis In order to verify the accuracy of the proposed method, the measurement results of the ion concentration measuring device were compared with the results of each ion concentration in the standard titration mixed solution, and the effectiveness of the proposed method was obtained by analyzing the data results. By preparing a mixed solution of 1mol/L chloride ion, potassium ion and 0.1mol/L sulfur ion, the concentrations of three ions in the mixed solution were measured by titration, and then three ion selective electrodes were inserted into the mixed solution to measure the concentrations of three ions. After the measurement, 100mL distilled water was added to the mixed solution for dilution, and then the above ion- selective electrode measurement operation was repeated and diluted 10 times in total, and the data were recorded and processed. FIG. 2 shows the curves of chloride ion concentration titration, uncalibrated and calibrated. FIG. 3 and Table 2 show the error of chloride ion titration in multi- ion environment compared with uncalibrated and calibrated. 198 Figure 2. Comparison of chloride ion concentration measurement Figure 3. Comparison of errors before and after chloride calibration Table 2. Comparison table of errors before and after After calibration pre-calibration Serial number Absolute error (mg/L) Relative error (%) Absolute error (mg/L) Relative error (%) 1 720 2.03 4220 11.89 2 -174 -0.98 1326 7.47 3 -151.33 -1.28 348.67 2.95 4 81 0.91 -219 -2.47 5 -14 -0.20 -614 -8.65 6 -16.17 -0.27 -716.17 -12.10 7 -85.4 -1.68 -785.4 -15.49 8 -99.9 -2.25 -899.9 -20.28 9 -55.44 -1.41 -655.44 -16.62 10 -121.1 -3.41 -721.1 -20.31 It can be seen from the data in the figure and table that the relative error of the calibrated chloride ion selective electrode is far less than that before calibration and the absolute value of the relative error is within 5%. The comparison of the measured value after calibration is 90% higher than that before calibration, which verifies the effectiveness of the proposed method in measuring chloride ion concentration. FIG. 3 shows the curves of potassium ion concentration 199 titration, uncalibrated and calibrated. Table 3 shows the error of potassium ion titration in multi-ion environment compared with uncalibrated and calibrated. Figure 4. Comparison of potassium ion concentration measurement Figure 5. Comparison of errors before and after potassium ion Calibration Table 3. Comparison table of errors before and after potassiumion calibration After calibration pre-calibration Serial number Absolute error (mg/L) Relative error (%) Absolute error (mg/L) Relative error (%) 1 -99 -0.25 2351 6.01 2 70 0.36 1686 8.62 3 160.7 1.23 1709.7 13.12 4 -77 -0.79 1343 13.74 5 -30 -0.38 900 11.51 6 144.33 2.22 644.33 9.89 7 50 0.90 550 9.85 8 -47.5 -0.97 652.4 13.35 9 -114.9 -2.65 485.1 11.17 10 -47.9 -1.23 311.3 7.96 It can be seen from the data in the figure and table that the relative error of the calibrated potassium ion selective 200 electrode is far less than that before calibration and the absolute value of the relative error is stable within 5%. The comparison of the measured value after calibration is 95.2% higher than that before calibration, which verifies the effectiveness of the proposed method in measuring the concentration of potassium ion. FIG. 4 shows the curves of titration, uncalibrated and calibrated ion concentration of sulfur ion, and Table 4 shows the error of uncalibrated and calibrated titration of sulfur ion in a multi-ion environment. Figure 6. Comparison of sulfur ion concentration measurements Figure 7. Comparison of errors before and after sulfur ion Calibration Table 4. Comparison table of errors before and after sulfur ion calibration After calibration pre-calibration Serial number Absolute error (mg/L) Relative error (%) Absolute error (mg/L) Relative error (%) 1 35 1.53 378 11.81 2 29 1.81 192 12.00 3 17 1.28 161 15.09 4 14 1.75 90 11.25 5 17 2.66 70 10.94 6 -21 -3.94 29 5.44 7 -10 -2.19 33 7.22 8 20 5.00 57 14.25 9 7 1.97 26 7.32 10 -8 -2.50 27 8.44 201 It can be seen from the data in the figure and table that the relative error of the calibrated sulfur ion selective electrode is far less than that before calibration and the absolute value of the relative error is stable within 5%. The comparison of the measured value after calibration is 91.5% higher than that before calibration, which verifies the effectiveness of the proposed method in measuring the ion concentration of sulfur ion. It can be seen from the above three groups of results that, for the mixed solution of chlorine, sulfur and potassium, combined with the error calibration model of multiple linear regression, the measurement results of the ion-selective electrode are relatively accurate in the environment of multi- ion interference, which proves the accuracy and effectiveness of the method proposed in this question. 5. Summarize In this paper, the mutual interference effect of chlorine, sulfur and potassium ions based on the ion selective electrode method is studied. First, the measurement principle of the ion selective electrode is proposed. By analyzing the error causes and combining with the multiple linear regression error calibration model, the error correction of the actual measured value is carried out.Finally, through the establishment of experimental equipment and multi-ion interference experiments, the accuracy of chloride ion selective electrode after calibration is increased by 90%, potassium ion selective electrode after calibration is increased by 95.2%, sulfur ion selective electrode after calibration is increased by 91.5%, and the relative errors of the three kinds of ion selective electrode are all within 5%.The feasibility of the proposed method is proved by combining the corresponding graph and data table.1 References [1] Zhang Zhicai, Liu Baoshuang, Wang Zhongjie, Luo Yunfeng, Liu Zhendong, Tu Dehong, Xu Yunbo. Development and field application of online monitoring system for drilling fluid performance [J]. Drilling fluid and completion fluid 2020,37 (05), 597-601+607. [2] Zhang Zhicai, Liu Baoshuang, Wang Zhongjie, Luo Yunfeng, Liu Zhendong, Tu Dehong, Xu Yunbo. Development and field application of online monitoring system for drilling fluid performance [J]. Drilling fluid and completion fluid 2020,37 (05), 597-601+607. [3] Fu Liping, Zhong Hongpeng, Xie Weihao, Chen Jinding, Zhang Yaoyuan. Evaluation of uncertainty of measurement results for determination of chloride ion content in oilfield water by Mohr titration [J]. Guangzhou Chemical Industry Co., Ltd. 2019, 47 (24), 120-121+130. [4] Shen Zhijun, Ren Wenqing, Liu Shan, Kang Yikui, Sun Yuanming. Pretreatment of water samples in chloride ion titration of oilfield water [J]. Henan Petroleum. 2001, 15 (01), 37-38. [5] Tang Yulin, Liu Weili, Yan Xu, Wang Wenli, Sun Qiang, Geng Tie Validation of the method for the determination of Na+, K+, Mg2+, Ca2+, Cl -, SO2-4 in oilfield water by ion chromatography [J]. Guangdong Chemical Industry, 2022,49 (12), 183-186. [6] Wang Wenli, Chen Fanbin, Liu Weili, Ding Yu Determination of Cl - and SO42 - in dispersants for oil well cement by ion chromatography [J] Chemical Engineering and Equipment 2021, (03), 215-216+234. [7] Hou Yanxia, Liu Liping, Du Zhenxia. Determination of Iodate and Iodine Ion in Drinking Water by High Performance Liquid Chromatography Inductively Coupled Plasma Mass Spectrometry [J]. Physical and Chemical Inspection (Chemical Volume), 2011,47 (11): 1262-1265. [8] Dong Si'en. Determination of rare earth elements in tea by inductively coupled plasma mass spectrometry [J]. Anhui Agricultural Bulletin (the second half of the month), 2010,16 (22): 106-107+119. [9] Liu Yanming. Determination of trace elements in Chinese patent medicines by atomic absorption spectrometry [J]. Spectroscopy and Spectral Analysis, 2000 (03): 373-375. [10] Wang Yalin. Application of ion selective electrode in chemical analysis and detection. Chemical Management 2022, (02), 25- 28. [11] Hou Jie New theory of soil ion exchange equilibrium based on electric field effect and its application in the determination of material surface properties [D]. Chongqing, Southwest University, 2010. [12] Kalisz Justyna, WΔ™grzyn Katarzyna, Michalska Agata, Maksymiuk Krzysztof. Resolution increase of ion-selective electrodes response by using a reversed amperometric setup[J]. Electrochimica Acta, 2022,427. [13] Khoshnood Razieh Sanavi,Akbari Setareh,Chenarbou Toktam Mashayekhi. Determination of Aluminium by Potentiometry Using Carbon Paste Ion Selective Electrode Based on N,N'- bis(salicylidene)-1,3-Propanediamine Ligand [J]. Journal of Analytical Chemistry, 2022, 77(8). [14] Wang Jianya, Xue Bin, Yu Shijun, Zhao Lijie, Bai Xiaolin. Application of PVC membrane iodine ion selective electrode in the analysis of bromine iodine ion coexistence system [J]. Physical and Chemical Testing (Chemical Volume) 2006, (12), 1010-1012. [15] Chai Jiali, Ma Jianqi. Writing Nernst equation with electrode potential [J]. Chemical Design Communication, 2020, 46 (09): 140-142. [16] Wu Liping, Xia Nianfei, Yuan Weibin. Multi factor statistical model of critical chloride ion concentration in concrete [J]. New building materials 2020, 47 (12), 22-26. [17] Gao Yunxia, Sun Baosheng, Feng Haiying. Determination of lead and cadmium by multiple linear regression ion selective electrode method [J]. Journal of Hebei Institute of Architecture and Technology 2006, (01), 17-19+26.