Long-term observation of pH electrode potential continuous drift compensation and pH dynamic calculation method
Through the variable step size adaptive index smoothing dynamic prediction method and the time series of electrode drift dynamic update, the calculation error problem caused by pH electrode time drift is solved, real-time correction and accurate calculation of pH electrode response potential is realized, and long-term observations are improved. Data accuracy and stability.
Patent Information
- Application Number
- CN202111457975.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-12-02
AI Technical Summary
The lack of effective identification and compensation for the time drift of pH electrodes in the prior art leads to large errors in pH value calculation, limiting the application of pH composite glass electrodes in long-term in-situ observation.
By using the variable step size adaptive index smoothing dynamic prediction method, by judging the turning trend of the smoothing coefficient α and the square sum of error SSE, intelligently select the moving average method, primary index smoothing method or quadratic index smoothing method, dynamically adjust the smoothing index to achieve the correct Fast and accurate prediction of electrode drift, and the pH electrode response potential is corrected in real time through dynamic update method of electrode drift time series.
Real-time correction of pH electrode response potential is achieved, the accuracy of pH value calculation is improved, the need for regular correction is reduced, and the accuracy and stability of data in long-term in-situ observations are ensured.
Smart Images

Figure QLYQS_1 
Figure QLYQS_2 
Figure QLYQS_4
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of pH electrode calibration, and in particular to a method for long-term observation of continuous drift compensation of pH electrode potential and pH dynamic calculation. Background Art
[0002] pH value is an important conventional indicator of groundwater environmental quality and pollutant control. In recent years, with the urgent requirements of groundwater environmental monitoring and groundwater pollution early warning, groundwater in-situ online monitoring has gradually replaced manual monitoring in order to obtain real-time, true and accurate monitoring data of groundwater and timely control the water quality of groundwater.
[0003] However, due to the continuous changes in the hydration layer structure of the glass working electrode of the electrode sensor, the changes in the reference electrode electrolyte, the complex and variable application environment, etc., the response voltage output of the electrode sensor will undergo significant potential drift with temperature and time, causing the nonlinearity and drift characteristics of the electrode sensor, resulting in obvious measurement errors, which seriously limits the application of water quality sensors in in-situ monitoring.
[0004] At present, the relationship between temperature and the nonlinear characteristics of the pH electrode response voltage has been studied in depth, mainly through the quantitative correction compensation relationship between the slope and temperature, combined with regular manual correction of the electrode sensor, to a certain extent, compensate for the influence of potential drift on measurement accuracy and stability. In the case of long-term in-situ monitoring, although real-time temperature compensation can be achieved, the lack of effective identification and compensation for time drift leads to obvious limitations in the actual application of the pH value quantitative calculation method based on the Nernst equation in in-situ measurement, which causes large measurement errors and distorts the monitoring data, seriously restricting the application of pH composite glass electrodes in long-term in-situ observations. Summary of the invention
[0005] The present invention proposes a method for long-term observation of continuous drift compensation of pH electrode potential and dynamic calculation of pH. Based on the law of long-term drift of pH electrode, an exponential smoothing prediction method is introduced to solve the problem of lack of effective identification and compensation of time drift in the prior art, thereby causing large errors in pH value calculation.
[0006] The technical solution of the present invention is as follows:
[0007] Long-term observation of pH electrode potential continuous drift compensation and pH dynamic calculation method,
[0008] The method includes a variable step-size adaptive exponential smoothing dynamic prediction method, which specifically includes the following steps:
[0009] S101: Input electrode drift time series {X t}, where t = (1, 2, ..., N), the electrode drift is the cumulative difference between the pH electrode response potential before and after;
[0010] S102: Input a smoothing index α, where α∈(0,1), and take 0.1 as the long step value of the smoothing index α to obtain a smoothing coefficient sequence {α n}, where n = (1, 2, ..., 10), α1∈(0, 0.1);
[0011] S103: According to the smoothing coefficient sequence {α n}, the electrode drift time series {X t} to obtain the exponential smoothing error sum of squares sequence {SSE 1 n}, the electrode drift time series {X t} to obtain the quadratic exponential smoothing error sum of squares sequence {SSE 2 n};
[0012] Error sum of squares Where N represents the number of periods of electrode drift used in modeling, represents the electrode drift time series {X t}tth predicted data, X t represents the electrode drift time series {X t}'s tth actual data;
[0013] S104: establishing a continuous function relationship SSE=f(α) between the sum of square errors SSE and the smoothing coefficient α through variable step-size search and polynomial curve fitting least squares method;
[0014] S105: Determine the exponential smoothing error sum of squares sequence {SSE 1 n} and the quadratic exponential smoothing error sum of squares series {SSE 2 n} trend,
[0015] If {SSE 1 n} and {SSE 2 n} are not at the turning point, and the moving average method is used to calculate the electrode drift time series {X t} Make predictions;
[0016] If {SSE 1 n There is a turning point, 2 n}If there is no turning point, get the SSE of the turning point 1 n The corresponding smoothing coefficient α n , in [α n -0.1, alpha n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02. n , the electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient;
[0017] If {SSE 1 n} and {SSE 2 n} have turning points, execute step S108 to determine the SSE with turning points 1 n Corresponding to α n Is it greater than 0.5?
[0018] If yes, get the SSE with turning point 2 n The corresponding smoothing coefficient α n , in [α n -0.1,α n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02 n The electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient,
[0019] If not, get the SSE with turning point 1 n The corresponding smoothing coefficient α n , in [α n -0.1,α n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02 n , the electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient.
[0020] S106: Use the optimal smoothing coefficient α best, and specify the exponential smoothing method for the electrode drift time series {X t} Make predictions and output the prediction results X N+1 ;
[0021] S107: Obtain the actual response potential V(t) output by the current pH electrode and calculate the current Wherein, pH0 represents the zero-crossing pH value during the initial calibration of the pH electrode, and K T Indicates the electrode slope at the measured temperature of the measured solution, K T =0.1984073×(273.16+t).
[0022] Furthermore, the present invention also includes a method for dynamically updating the electrode drift time series, which specifically includes the following steps:
[0023] S201: After obtaining the pH electrode response potential V at the N+1th moment N+1 When , execute S202 to S204;
[0024] S202: Calculate the difference ΔV between the pH electrode output voltage at time N+1 and time N N+1 =V N+1 -V N ;
[0025] S203: Determine |ΔV N+1 | Is it less than 1mV?
[0026] If so, calculate the electrode drift X N+1 =X N +ΔV N+1 ,
[0027] If not, calculate the electrode drift X N+1 =X N ;
[0028] S204: Remove the current electrode drift time series {X t}, where t = the first number in (1,2,...,N), and the X obtained by S204 N+1 As the time series of the front electrode drift {X t}, and get the updated electrode drift time series;
[0029] Among them, the electrode drift time series {X t The initial value of} is: Get the pH electrode response potential {V t}, calculate the pH electrode response voltage difference ΔV t =V t -V t-1The accumulated difference of the pH electrode response potential before and after is taken as the electrode drift X0=0, and the electrode drift time series {X t}, t=(1,2,...,N).
[0030] The working principle and beneficial effects of the present invention are:
[0031] The variable step-size adaptive exponential smoothing dynamic prediction method in the present invention mainly realizes the intelligent selection of the moving average method, the first exponential smoothing method and the second exponential smoothing method by judging the turning trend of the size of the smoothing coefficient α and the error square sum SSE; establishes the continuous function relationship between the error square sum SSE and the smoothing coefficient α by establishing the variable step-size search and the polynomial curve fitting least squares method, and then solves f'(α)=0 to realize the dynamic and rapid optimization of the smoothing index α, takes the error square sum SSE as the main basis for evaluating the quality of the smoothing coefficient α, realizes the automatic adjustment of the smoothing coefficient α, and ensures the prediction accuracy of the exponential smoothing. Compared with the global search optimization, it has faster efficiency and accuracy.
[0032] Through the variable step-size adaptive exponential smoothing dynamic prediction method of the present invention, the electrode drift can be predicted faster and more accurately. Through the predicted electrode drift, the response potential actually detected by the pH electrode can be corrected in real time, and the corrected response potential is input into the Nernst equation to obtain a more accurate pH value. The requirement for regular calibration of pH electrodes during normal use is eliminated. In long-term in-situ observations, the pH electrode only needs to be calibrated once before installation and use, and long-term observation without calibration can be achieved in the later stage. DETAILED DESCRIPTION
[0033] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0034] The invention proposes a method for long-term observation of continuous drift compensation of pH electrode potential and dynamic calculation of pH, which includes a variable step-size adaptive exponential smoothing dynamic prediction method and a method for dynamic updating of electrode drift time series.
[0035] Example 1
[0036] The variable step-size adaptive exponential smoothing dynamic prediction method in the present invention mainly realizes the intelligent selection of the moving average method, the first exponential smoothing method and the second exponential smoothing method by judging the turning trend of the size of the smoothing coefficient α and the error square sum SSE; establishes the continuous function relationship between the error square sum SSE and the smoothing coefficient α by establishing the variable step-size search and the polynomial curve fitting least squares method, and then solves f'(α)=0 to realize the dynamic and rapid optimization of the smoothing index α, takes the error square sum SSE as the main basis for evaluating the quality of the smoothing coefficient α, realizes the automatic adjustment of the smoothing coefficient α, and ensures the prediction accuracy of the exponential smoothing. Compared with the global search optimization, it has faster efficiency and accuracy.
[0037] The specific steps of the variable step-size adaptive exponential smoothing dynamic prediction method are as follows:
[0038] (1) The electrode drift is characterized by the cumulative potential difference before and after the pH electrode response, and the pH electrode response potential V at multiple times is obtained. t , calculate the pH electrode response voltage difference ΔV t =V t -V t-1 The accumulated difference of the pH electrode response potential before and after is taken as the electrode drift X0=0, and the electrode drift time series {X t}, where t = (1, 2, ..., N).
[0039] (2) Input the smoothing index α, where α∈(0,1), and take 0.1 as the long step value of the smoothing index α to obtain the smoothing coefficient sequence {α n}, where n = (1, 2, ..., 10), α1∈(0, 0.1), in this embodiment, α n =(0.02, 0.1, 0.2, ..., 0.9). In order to avoid the possibility that some inflection points may appear below 0.1, if no inflection point can be found from 0.1 to 0.9, it is impossible to perform a small step search calculation. Therefore, 0.02 is used as the starting value for the large step calculation, and 0.1, 0.2, ..., 0.9 are selected later to facilitate the calculation.
[0040] (3) According to the obtained smoothing coefficient sequence {α n}, for each smoothing index α, an exponential smoothing method is used to smooth the electrode drift time series {X t} to obtain the exponential smoothing error sum of squares sequence {SSE 1 n}, the electrode drift time series {X t} to obtain the quadratic exponential smoothing error sum of squares sequence {SSE 2n}; where the error sum of squares N represents the number of periods of electrode drift used in modeling, represents the electrode drift time series {X t} the t-th prediction data, X t represents the electrode drift time series {X t} the tth actual data.
[0041] (4) Establishing a continuous function relationship SSE=f(α) between the sum of squared errors SSE and the smoothing coefficient α through variable step-size search and polynomial curve fitting least squares method;
[0042] (5) Determine the sum of squares of errors in the exponential smoothing method {SSE 1 n} and the quadratic exponential smoothing error sum of squares series {SSE 2 n} trend,
[0043] If {SSE 1 n} and {SSE 2 n} are not at the turning point, and the moving average method is used to calculate the electrode drift time series {X t} Make predictions;
[0044] If {SSE 1 n There is a turning point, 2 n}If there is no turning point, get the SSE of the turning point 1 n The corresponding smoothing coefficient α n , in [α n -0.1, alpha n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02. n , the electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient;
[0045] If {SSE 1 n} and {SSE 2 n} have turning points, and the SSE for judging turning points 1 n Corresponding to α n Is it greater than 0.5?
[0046] If yes, get the SSE with turning point 2 n The corresponding smoothing coefficient α n , in [α n -0.1,α n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02 n The electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient,
[0047] If not, get the SSE with turning point 1 n The corresponding smoothing coefficient α n , in [α n -0.1,α n +0.1], multiple smoothing coefficients α are obtained with a short step length of 0.02 n , the electrode drift time series {X t} to make predictions and calculate the sum of squared errors SSE. best )=0, the corresponding α best is the optimal smoothing coefficient;
[0048] (6) Use the optimal smoothing coefficient α best and the specified exponential smoothing method for the electrode drift time series {X t} Make predictions and output the prediction results X N+1 ;
[0049] The pH electrode response potential characteristics were tested using three pH electrodes of the same specifications at three different temperatures and three different pH standard solutions to obtain the continuous response potential changes. The pH drift experimental data at different times were selected and the pH values were calculated under different [α n -0.1,α n +0.1], with 0.02 as the short step value, the variable step exponential smoothing method is used for prediction, and the corresponding SSE is calculated. The nonlinear relationship between SSE and α can be obtained. The minimum SSE and the corresponding final α of each index are calculated by fitting and derivative, as shown in Table 1.
[0050] Table 1 Optimal α and SSE of time data series calculated with variable step size
[0051]
[0052] The results show that SSE and α are in [α n -0.1,α n +0.1] has a strong nonlinear correlation. The α optimization accuracy can be further improved by fitting and derivation. The entire long-step and short-step optimization process only requires 31 steps, which is more efficient than the global search optimization.
[0053] (7) Based on the Nernst equation, the quantitative calculation formula of pH value established by the two-point correction method is: Where pH is the pH value of the solution being tested, pH0 is the pH value corresponding to the electrode response potential of 0 V. V is the voltage value output by the pH electrode in the solution being tested. T is the electrode slope at the measured temperature of the solution being tested, K T =0.1984073×(273.16+t).
[0054] Normally, the pH electrode used can be calibrated regularly according to the situation. However, when the pH electrode cannot be calibrated in time, the pH electrode response potential will drift over time, resulting in the pH0 obtained in the initial calibration state being unable to be used for the quantitative calculation of the current pH value. Therefore, a new dynamic quantitative calculation model for pH value is defined: Among them, X N+1 To predict the result, obtain the actual response potential V(t) output by the current pH electrode and calculate the current corresponding pH value.
[0055] Example 2
[0056] The method for dynamically updating the electrode drift time series in the present invention starts updating after the initial pH electrode calibration. Based on the characteristic that the electrode response potential decreases by ≦1mV per day, whether the electrode potential difference is less than 1mV / day is used as the threshold for judging whether drift occurs. When the electrode potential difference is greater than 1mV / day, the monitoring failure is determined to be invalid, and the electrode drift remains the same as the last time. By dynamically updating the electrode drift time series, it is only necessary to calibrate once before installing the pH electrode to achieve long-term dynamic monitoring of the pH value without calibration.
[0057] The specific steps of the dynamic update method of electrode drift time series are as follows:
[0058] (1) After the initial calibration of the pH electrode, long-term monitoring of the pH value is started. The time between two monitoring values is set to be less than or equal to 1 day. The first N monitoring data are considered to be true values. N = 30 can be taken, because generally the electrode will not drift within 30 days of the initial calibration.
[0059] Get the pH electrode response potential V at N moments after initial calibration t, perform threshold judgment on the pH electrode response voltage difference between the tth period and the t-1th period, and calculate the pH electrode response voltage difference ΔV t =V t -V t-1 , determine |ΔV t | Is it less than 1mV? If |ΔV t |<1mV, the accumulated difference of pH electrode response potential before and after is taken as electrode drift If |ΔV t |≥1mV, then X t =X t-1 , where X0 = 0, according to the above algorithm, the time series of the electrode drift amount in the first N periods after correction {X t}, where t = (1, 2, ..., N).
[0060] (2) Obtain the pH electrode response potential V at the N+1th moment N+1 ; Calculate the difference ΔV between the pH electrode output voltage at time N+1 and time N N+1 =V N+1 -V N ; Judgement |ΔV N+1 | Is it less than 1mV? If so, calculate the electrode drift X N+1 =X N +ΔV N+1 If not, calculate the electrode drift X N+1 =X N .
[0061] (3) Remove the current electrode drift time series {X t}, the first number in the N+1 As the time series of the front electrode drift {X t}, and the updated electrode drift time series is obtained; based on the updated electrode drift time series, the next electrode drift prediction and pH value calculation can be performed.
[0062] (4) Repeat steps (2) and (3) to ensure the continuous updating of the electrode drift time series. By dynamically identifying and compensating the drift data in real time, the pH sensor only needs to be calibrated once before installation to achieve long-term dynamic monitoring of pH value without calibration.
[0063] The long-term observation of the pH electrode potential continuous drift compensation and pH dynamic calculation method proposed in the present invention is based on the law of pH time drift. In the process of long-term in-situ measurement of pH value, the pH electrode is placed in the measured solution for a long time, and the saturated filling liquid in the pH electrode will slowly diffuse outward through the osmotic membrane, causing the concentration of the filling liquid to gradually decrease, causing the pH electrode potential to drift, which is the main reason for the pH electrode potential drift.
[0064] To this end, the present invention uses a pH composite electrode filled with KCl reference solution of different concentrations, and conducts a series of experiments on the response potential characteristics of the pH electrode at different temperatures and pH standard solutions. The experimental results show that:
[0065] At a fixed temperature, the electrode potential difference between different pH standard solutions under different concentrations of reference solution remains basically unchanged, and the electrode potential difference between different pH standard solutions is positively correlated with the measurement temperature. This means that the electrode potential difference under different standard solutions obtained under saturated filling solution can still be used in quantitative calculations even if the filling solution concentration changes.
[0066] At a fixed temperature, the zero value of the pH electrode is positively correlated with the filling solution concentration. At a fixed filling solution concentration, the zero value of the pH electrode remains basically unchanged at different temperatures. Therefore, the concentration of the filling solution is the main factor affecting the zero value of the pH electrode. Once the filling solution concentration of the pH electrode changes during use, resulting in a potential drift of the pH electrode, the quantitative calculation formula obtained under the original calibration conditions has become invalid, and recalibration or compensation for the drift potential must be performed.
[0067] The electrode slope coefficient K remains basically unchanged at different temperatures and different filling solution concentrations. This shows that the electrode slope coefficient K calibrated when the pH electrode is in good condition can be used even if the pH electrode is drifting.
[0068] After the pH electrode drifts, the electrode response potential gradually decreases over time. The daily decrease in the electrode response potential is ≤ 1mV, so whether the electrode potential difference is less than 1mV / day can be used as the threshold for judging whether drift has occurred.
[0069] The present invention uses the cumulative amount of the difference before and after the pH electrode response potential to characterize the electrode drift. When no drift occurs, the drift is a time series with a horizontal development trend close to zero. When drift occurs, the drift is a time series with a linear downward trend. Since the exponential smoothing method has the advantages of simple calculation, small number of samples required, strong adaptability, fast calculation, and especially easy to be built into the sensor terminal, combined with the characteristics of pH electrode drift, the present invention adopts the exponential smoothing prediction method as the main method for pH drift prediction.
[0070] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. Long-term observation of pH electrode potential continuous drift compensation and pH dynamic calculation method, characterized in that: The method includes a variable step-size adaptive exponential smoothing dynamic prediction method, which specifically includes the following steps: S101: Input electrode drift time series ,in , the electrode drift is the cumulative difference before and after the pH electrode response potential; S102: Input smoothing index ,in , with 0.1 as the smoothing index Long step length value, get smooth exponential series ,in , ; S103: Based on the smoothed exponential sequence , the electrode drift time series is smoothed by exponential smoothing Perform calculations to obtain the error sum of squares sequence of the exponential smoothing method The electrode drift time series is smoothed by quadratic exponential smoothing Perform calculations to obtain the error sum of squares sequence of the quadratic exponential smoothing method ; S104: Establish the error sum of squares by variable step search and polynomial curve fitting least squares method With smoothing index The continuous function relationship between ; S105: Determine the error sum of squares sequence of the exponential smoothing method and quadratic exponential smoothing error sum of squares series The trend if and The electrode drift time series is not at the turning point. Make predictions; if There is a turning point. There is no turning point, get the turning point The corresponding smoothing index ,exist In the range, multiple smoothing indices are obtained with a short step length of 0.
02. , the electrode drift time series is smoothed by exponential smoothing Make predictions and calculate the sum of squared errors ,when When is the optimal smoothing index; if and There are turning points. correspond Is it greater than 0.5? If so, get the turning point The corresponding smoothing index ,exist[ -0.1, +0.1], multiple smoothing indices are obtained with a short step length of 0.02 The electrode drift time series is smoothed by quadratic exponential smoothing Make predictions and calculate the sum of squared errors ,when When is the optimal smoothing index, If not, get the number of turning points. The corresponding smoothing index ,exist[ -0.1, +0.1], multiple smoothing indices are obtained with a short step length of 0.02 , the electrode drift time series is smoothed by exponential smoothing Make predictions and calculate the sum of squared errors ,when When is the optimal smoothing index.
2. The method for long-term observation of pH electrode potential continuous drift compensation and pH dynamic calculation according to claim 1, characterized in that: Error sum of squares , where N represents the number of periods of electrode drift used in modeling, Represents the time series of electrode drift The t-th prediction data, Represents the time series of electrode drift The tth actual data.
3. The method for long-term observation of pH electrode potential continuous drift compensation and pH dynamic calculation according to claim 2, characterized in that: The variable step-size adaptive exponential smoothing dynamic prediction method also includes: S106: Use the optimal smoothing index And specify the exponential smoothing method for the electrode drift time series Make predictions and output prediction results ; S107: Obtain the actual response potential of the current pH electrode output , calculate the current ,in, Indicates the zero-point pH value during initial calibration of the pH electrode. It indicates the electrode slope at the measurement temperature of the measured solution. .
