A method for correcting sequential sampling composition data of gas-gas diffusion experiments at a uniform time
Patent Information
- Application Number
- CN202611121614.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-27
- Publication Date
- 2026-10-27
AI Technical Summary
[0008]本发明的目的在于针对PVT筒气-气扩散实验中因顺序取样导致的不同位置样品实际取样时刻不一致,从而使测得组成剖面不能真实表征同一扩散时刻分布状态的问题,提出了一种用于气-气扩散实验顺序取样组成数据的统一时刻校正方法,该方法首先定义等效取样时刻并进行对数比变换,在此基础上,结合了局部加权时间对齐与空间平滑重构两个关键步骤,构成了气-气扩散实验顺序取样组成数据的统一时刻校正方法,用于修正气-气扩散实验中因顺序取样引起的组成数据时间错位问题
[0096]本发明提出了一种用于气-气扩散实验顺序取样组成数据的统一时刻校正方法,该方法基于取样时间窗记录与等效时刻计算,通过组分归一化与对数比转换,采用局部加权时间对齐与空间平滑处理,系统性地校正因顺序取样引起的时间不同步问题。与现有技术相比,本发明能够提高顺序取样数据在统一时刻下的可比性,降低因采样时差引起的组成偏差,并为扩散系数计算、扩散模拟拟合及扩散机理分析提供更一致的数据基础,具有重要的理论意义与工程应用价值。
Smart Images

Figure CN122986249A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of experimental data processing technology for oil and gas development, and specifically relates to a unified time correction method for sequential sampling composition data in PVT cylinder gas-gas diffusion experiments, and more particularly to a data correction method for composition measurement deviations caused by inconsistent actual sampling times at different sampling locations. Background Technology
[0002] In oil and gas development research, gas-to-gas diffusion experiments are an important experimental means to characterize the diffusion and mass transfer laws of multi-component gases under reservoir conditions, obtain effective diffusion coefficients, and understand the component transfer mechanism. The experimental results directly affect the analysis of diffusion mechanism, the calculation of diffusion coefficients, and the evaluation of gas injection development schemes, and are therefore of great significance.
[0003] In existing PVT (Polymer Transmission Tunnel) gas-to-gas diffusion experiments, two gases with different compositions are typically injected into the PVT. After a set diffusion time is reached, rapid sequential sampling is performed at multiple locations along the height of the PVT. The samples are then collected using a gas collection bag and analyzed by gas chromatography to obtain the gas composition at each location. However, because sampling at different locations is usually not synchronized, there is an objective time difference between the actual sampling times of samples from different locations. During this sampling process, gas-to-gas diffusion continues. The composition data at locations that nominally correspond to the same diffusion time actually correspond to different real sampling times, leading to a systematic time misalignment of the composition data at different locations. This reduces the comparability between samples from different locations, causes distortion of the diffusion profile composition, and further affects the accuracy of diffusion coefficient calculation, model fitting, and mechanism interpretation.
[0004] Existing research on gas-to-gas diffusion experiments in PVT cylinders mainly focuses on diffusion coefficient determination, diffusion mechanism analysis, pressure / concentration fitting, and evaluation of factors affecting porous media. However, it does not directly address the problem of inconsistent compositional data at the same nominal diffusion time due to sequential sampling from multiple locations along the height of the PVT cylinder. Chromatographic analysis has retention time drift correction methods. Zushi et al. used an interpolation alignment method to correct for component retention time drift errors caused by instrument fluctuations in two-dimensional gas chromatography-high resolution time-of-flight mass spectrometry (GLC-HTMS). This unified the chromatographic time reference for different injection batches, avoided component mismatch, and improved the accuracy of multi-component analysis (Zushi, Yasuyuki, Gros, et al. Pixel-by-pixel correction of retention time shifts in chromatograms from comprehensive two-dimensional gas chromatography coupled to high resolution time-of-flight mass spectrometry.[J]. Journal of chromatography. A,2017,Vol.1508: 121-129.). Skov et al. also studied retention time drift handling during two-dimensional gas chromatography. However, these methods address instrument analysis time axis drift and peak matching, not spatial sampling timing errors in diffusion experiments (Skov, Thomas, Hoggard, et al. Handling within run retention time shifts in two-dimensional chromatography data using shift correction and modeling[J]. Journal of Chromatography A, 2009, Vol.1216(18): 4020-4029.). GB / T45133-2025 and ISO 12963:2017 mainly employ four calibration methods centered on single-point / two-point linear regression, along with nonlinear uncertainty assessment and system stability verification. These methods correct for gas chromatograph response bias, baseline drift, zero-value error, and minor nonlinear errors, and establish a quantitative conversion relationship between instrument electrical signals and gas component molar percentages. Such standards can support the reliability of single-sample composition measurements, but cannot solve the problem of experimental timing deviations when samples from multiple locations are not at the same actual diffusion time.
[0005] Therefore, there is an urgent need for a data correction method that can uniformly align sequentially sampled data from different locations to the same time base, in order to eliminate sampling time sequence differences and achieve spatiotemporal synchronous reconstruction of diffusion profile composition.
[0006] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this application, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0007] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or describe the scope of protection of these embodiments, but rather as a prelude to the detailed description that follows.
[0008] The purpose of this invention is to address the problem in PVT cylinder gas-to-gas diffusion experiments where the actual sampling times of samples at different locations are inconsistent due to sequential sampling, resulting in the measured composition profiles failing to accurately represent the distribution state at the same diffusion time. This invention proposes a unified time correction method for sequentially sampled composition data in gas-to-gas diffusion experiments. This method first defines an equivalent sampling time and performs a logarithmic ratio transformation. Based on this, it combines two key steps—local weighted time alignment and spatial smooth reconstruction—to form a unified time correction method for sequentially sampled composition data in gas-to-gas diffusion experiments, used to correct the time misalignment problem of composition data caused by sequential sampling in gas-to-gas diffusion experiments.
[0009] To achieve the above technical objectives, the present invention adopts the following technical solution, including the following steps:
[0010] Step S1: During the gas-to-gas diffusion experiment, with the height direction of the PVT cylinder as the Z-axis, a total of m experiments were conducted, and the relevant experimental parameters of temperature and pressure were recorded.
[0011] Step S2: Define the arithmetic mean of the start and end times of sampling at the j-th position in the n-th experiment as the equivalent time t for this sample. n,j,eq This is used to characterize the actual sampling time corresponding to the sample at that location:
[0012] Step S3: Select the component with a high mole percentage, small fluctuation and greater than zero in all samples as the reference component, denoted as r. For any non-reference component i≠r, construct the logarithmic ratio variable relative to the reference component.
[0013] Step S4: During time alignment, leave-one-out cross-validation is used to determine the optimal bandwidth h. * Establish a log-ratio training set for non-reference components. :
[0014] Step S5: To determine the predicted value for the test sample Based on the time-aligned weighting function and candidate bandwidth h l Establish the target residual equation to determine the parameters of the local linear regression equation. and :
[0015] Step S6: Based on the predicted values of all test samples Leave-one-out cross-validation to select the optimal bandwidth The optimal time-aligned weight function is obtained:
[0016] Step S7: Based on the time-aligned weighting function of the optimal bandwidth, apply the fixed component logarithmic ratio variable u i,n,j Time alignment with a fixed position j:
[0017] Step S8: At the unified target time t * Next, spatial smoothing is performed on the time-aligned logarithmic ratio vector;
[0018] Step S9: For each position j, calculate the corrected normalized molar percentage of the non-reference component i. and reference component r normalized molar percentage .
[0019] As a further description of the above technical solution, the specific process of step S1 includes:
[0020] Step S1.1: Record the PVT cylinder temperature, pressure, and diffusion time as t. n Where n = 1, 2, 3, ..., m; t n As the nominal diffusion time, each experiment samples k locations;
[0021] Step S1.2: For the j-th position in the n-th experiment, where j = 1, 2, 3, ..., k; record the sampling start time as t. n,j,s The sampling end time is t. n,j,e ;
[0022] Step S1.3: Record the mole percentage of component i at position j in gas chromatography, where i = 1, 2, ..., Nc. .
[0023] As a further description of the above technical solution, the arithmetic mean in step S2 is:
[0024] (1)
[0025] In the formula: t n,j,eq For equivalent time; tn,j,s The sampling start time, t n,j,e This is the time when the sampling ends.
[0026] As a further description of the above technical solution, step S3 specifically includes:
[0027] Step S3.1: Determine the molar percentage of the component at each location. Does it fall within the range of 0 to 100%?
[0028] Step S3.2: Calculate the total molar percentage of all components at each location. :
[0029] (2)
[0030] Step S3.3: When Then take the normalized mole percentage. ;
[0031] Step S3.4: Conversely, that is... Then, the molar percentages of each component at that position are normalized to obtain the normalized molar percentages as follows:
[0032] (3)
[0033] Step S3.5: After normalization, select the component with a high mole percentage, small fluctuation, and greater than zero in all samples as the reference component, and record its mole percentage as . For any non-reference component i ≠ r, construct its logarithmic ratio variable relative to the reference component:
[0034] (4)
[0035] In the formula: u i,n,j This represents the logarithmic ratio of non-reference component i to the reference component; The mole percentage of component i after normalization; The molar percentage of reference component r after normalization.
[0036] As a further description of the above technical solution, step S4 specifically includes:
[0037] Step S4.1: For any fixed non-reference component i and fixed position j, collect the logarithmic ratio variable and corresponding equivalent time for that component in all m experiments, forming a sample set U. i,j :
[0038] (5)
[0039] Step S4.2: For the sample set U i,j The p-th sample Remove the sample from the sample set U i,j Removed from the sample and used as a test sample;
[0040] Step S4.3: The remaining m-1 samples constitute the training set, denoted as... :
[0041] (6)
[0042] In the formula: Given non-reference component i and fixed position j, collect the logarithmic ratio variable of this component and the corresponding equivalent time in all m experiments to form a sample set; For sample set The p samples are the test samples; For sample set Remove the p-th sample from the training set.
[0043] As a further description of the above technical solution, step S5 specifically includes:
[0044] Step S5.1: Let the target alignment time be t. * The t * The nominal diffusion time t of the nth experiment can be taken as n It can also be pre-specified as a reference time according to the purpose of the calibration;
[0045] Step S5.2: For the nth experiment, at the jth position, at the equivalent sampling time t n,j,eq At this point, to characterize the sample's relevance to the target time t * The time proximity is determined by constructing time alignment weights using a Gaussian function:
[0046] (7)
[0047] Step S5.3: Determine the optimal bandwidth h during time alignment. * Pre-defined candidate bandwidth set :
[0048] (8)
[0049] Step S5.4: For each candidate bandwidth h l ,in The time alignment effect was evaluated using leave-one-out cross-validation.
[0050] Step S5.5: The established target residual equation is used to solve for the local linear regression parameters using the least weighted residual square method. and :
[0051] (9)
[0052] in: ;
[0053] In the formula: The equivalent sampling time corresponding to the test sample; The predicted value for the test sample; and The intercept and slope parameters are for the local linear regression with the equivalent sampling time of the test sample as the target time. To test sample conditions and candidate bandwidth h l The sample weights are as follows.
[0054] As a further description of the above technical solution, step S6 specifically includes:
[0055] Step S6.1: Establish a local linear regression equation, and use the equation obtained from equation (9) to obtain the result. , Substitute the values into the local linear regression equation to obtain the predicted values for the test samples. :
[0056] (10)
[0057] Step S6.2: For the sample set U i,j Perform the above steps on all m samples, sum the squared errors of all test samples, and obtain the candidate bandwidth h. l The error function of leave-one-out cross-validation:
[0058] (11)
[0059] Step S6.3: Set the candidate bandwidth Repeat steps S51-S55, S61, and S62 for all bandwidths, calculate the cross-validation error function, and take the value that makes... The minimum bandwidth is the optimal bandwidth h. * ;
[0060] Step S6.4: Determine the optimal bandwidth h * Then, the optimal time alignment weight function is obtained:
[0061] (12)
[0062] In the formula: The optimal time-aligned weight function; For optimal bandwidth, h hours; t * Alignment time with the target.
[0063] As a further description of the above technical solution, step S7 specifically includes:
[0064] Step S7.1: For a fixed component i and a fixed position j, at the target time t * Establish a local linear regression model:
[0065] (13)
[0066] in: and For diffusion time t n The intercept and slope parameters of the local linear regression at the target time;
[0067] Step S7.2: Based on the optimal bandwidth h * Optimal time alignment weight function a in equation (13) i,j and b i,j The result is obtained by using the least weighted sum of squared residuals:
[0068] (14)
[0069] Step S7.3: Obtain a from equation (14) i,j That is, the target alignment time t. * Logarithm ratio after time alignment:
[0070] (15)
[0071] In the formula: Let a be the logarithmic ratio of position j and component i after time alignment; i,j This is the intercept parameter in the local linear regression model.
[0072] As a further description of the above technical solution, step S8 specifically includes:
[0073] Step S8.1: After time alignment of the fixed non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is:
[0074] (16)
[0075] Step S8.2: Assume that after spatial smoothing of the non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is:
[0076] (17)
[0077] Step S8.3: Solve for the spatially smoothed column vector by minimizing the solution:
[0078] (18)
[0079] Step S8.4: Equation (18) is further solved as follows:
[0080] (19)
[0081] in: , For smoothing coefficients;
[0082] Step S8.5: For equation (19) Taking the partial derivatives and setting them to zero, we obtain the system of positive definite linear equations:
[0083] (20)
[0084] Step S8.6: Similarly, the smoothing parameter λ can be determined by using leave-one-out cross-validation.
[0085] Step S8.7: The column vector after spatial smoothing of the logarithmic ratios at each position is:
[0086] (twenty one)
[0087] In the formula: Align the target with t * Below, I is a column vector composed of the logarithmic ratios of the k sampling positions after time alignment of the non-reference component i; λ is a k×k identity matrix; λ is a smoothing parameter; and D is a second-order difference matrix. To align t to the target * Below, after spatial smoothing of the non-reference component i, the column vector is composed of the logarithmic ratios of the k sampling locations.
[0088] As a further description of the above technical solution, step S9 specifically includes:
[0089] Step S9.1: For each position j, the normalized molar percentage of the corrected non-reference component i:
[0090] (twenty two)
[0091] In the formula: This is the corrected normalized molar percentage of non-reference component i; Let j be the logarithm ratio of component i after spatial smoothing.
[0092] Step S9.2: For each position j, the normalized molar percentage of the corrected reference component r is:
[0093] (twenty three)
[0094] In the formula: The normalized molar percentage of the reference component r after correction.
[0095] Compared with the prior art, the present invention has the following beneficial effects:
[0096] This invention proposes a unified time correction method for sequential sampling composition data in gas-to-gas diffusion experiments. Based on sampling time window recording and equivalent time calculation, this method systematically corrects the time asynchrony problem caused by sequential sampling through component normalization and logarithmic ratio transformation, employing local weighted time alignment and spatial smoothing. Compared with existing technologies, this invention improves the comparability of sequential sampling data at a unified time, reduces compositional deviations caused by sampling time differences, and provides a more consistent data foundation for diffusion coefficient calculation, diffusion simulation fitting, and diffusion mechanism analysis, possessing significant theoretical and engineering application value.
[0097] The above general description and the description below are exemplary and illustrative only and are not intended to limit this application. Attached Figure Description
[0098] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0099] One or more embodiments are illustrated by way of example with reference to the accompanying drawings. These illustrations and drawings do not constitute a limitation on the embodiments. Elements having the same reference numerals in the drawings are shown as similar elements. The drawings are not to be scaled. And wherein:
[0100] Figure 1 A flowchart of a unified time correction method for sequential sampling composition data in gas-to-gas diffusion experiments;
[0101] Figure 2 This is a comparison chart of the molar percentages of each component before and after correction at the first sampling location 1.
[0102] Figure 3 A comparison chart of CH4 molar percentages before and after correction at each sampling location during the first sampling;
[0103] Figure 4 This is a comparison chart of the percentage of CH4 moles before and after correction at position 1 in four experiments. Detailed Implementation
[0104] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0105] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0106] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0107] In the description of the embodiments of the present invention, it should be noted that if terms such as "upper," "lower," "horizontal," or "inner" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of the invention is in use, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention. Furthermore, terms such as "first" and "second" are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0108] Furthermore, the use of the term "horizontal" does not imply that the component must be absolutely horizontal, but rather that it can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal than "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0109] In the description of the embodiments of the present invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention according to the specific circumstances.
[0110] This invention proposes a unified time correction method for sequential sampling composition data in gas-to-gas diffusion experiments. The method first defines the equivalent sampling time and performs a logarithmic ratio transformation. Based on this, it combines two key steps: local weighted time alignment and spatial smooth reconstruction, thus forming a unified time correction method for sequential sampling composition data in gas-to-gas diffusion experiments. This method is used to correct the time misalignment problem of composition data caused by sequential sampling in gas-to-gas diffusion experiments.
[0111] To achieve the above technical objectives, the present invention adopts the following technical solution, including the following steps:
[0112] Step S1: During the gas-to-gas diffusion experiment, with the height of the PVT cylinder as the Z-axis, a total of m experiments were conducted, and the relevant experimental parameters such as temperature and pressure were recorded; the specific process includes:
[0113] Step S1.1: Record the PVT cylinder temperature, pressure, and diffusion time as t. n Where n = 1, 2, 3, ..., m; t n As the nominal diffusion time, each experiment samples k locations;
[0114] Step S1.2: For the j-th position in the n-th experiment, where j = 1, 2, 3, ..., k; record the sampling start time as t. n,j,s The sampling end time is t. n,j,e ;
[0115] Step S1.3: Record the mole percentage of component i at position j in gas chromatography, where i = 1, 2, ..., Nc. .
[0116] Step S2: Define the arithmetic mean of the start and end times of sampling at the j-th position in the n-th experiment as the equivalent time t for this sample. n,j,eq This is used to characterize the actual sampling time corresponding to the sample at that location:
[0117] (1)
[0118] In the formula: t n,j,eq For equivalent time; t n,j,s The sampling start time, t n,j,e This is the time when the sampling ends.
[0119] Step S3: Select the component with a high mole percentage, small fluctuation, and greater than zero in all samples as the reference component, denoted as r. For any non-reference component i≠r, construct the logarithmic ratio variable relative to the reference component; the specific process includes:
[0120] Step S3.1: Determine the molar percentage of the component at each location. Does it fall within the range of 0 to 100%?
[0121] Step S3.2: Calculate the total molar percentage of all components at each location. :
[0122] (2)
[0123] Step S3.3: When Then take the normalized mole percentage. ;
[0124] Step S3.4: Conversely, that is... Then, the molar percentages of each component at that position are normalized to obtain the normalized molar percentages as follows:
[0125] (3)
[0126] Step S3.5: After normalization, select the component with a high mole percentage, small fluctuation, and greater than zero in all samples as the reference component, and record its mole percentage as . For any non-reference component i ≠ r, construct its logarithmic ratio variable relative to the reference component:
[0127] (4)
[0128] In the formula: u i,n,j This represents the logarithmic ratio of non-reference component i to the reference component; The mole percentage of component i after normalization; The molar percentage of reference component r after normalization.
[0129] Step S4: During time alignment, leave-one-out cross-validation is used to determine the optimal bandwidth h. * Establish a log-ratio training set for non-reference components. The specific process includes:
[0130] Step S4.1: For any fixed non-reference component i and fixed position j, collect the logarithmic ratio variable and corresponding equivalent time for that component in all m experiments, forming a sample set U. i,j :
[0131] (5)
[0132] Step S4.2: For the sample set U i,j The p-th sample Remove the sample from the sample set U i,j Removed from the sample and used as a test sample;
[0133] Step S4.3: The remaining m-1 samples constitute the training set, denoted as... :
[0134] (6)
[0135] In the formula: Given non-reference component i and fixed position j, collect the logarithmic ratio variable of this component and the corresponding equivalent time in all m experiments to form a sample set; For sample set The p samples are the test samples; For sample set Remove the p-th sample from the training set.
[0136] Step S5: To determine the predicted value for the test sample Based on the time-aligned weighting function and candidate bandwidth h l Establish the target residual equation to determine the parameters of the local linear regression equation. and The specific process includes:
[0137] Step S5.1: Let the target alignment time be t. * The t * The nominal diffusion time t of the nth experiment can be taken as n It can also be pre-specified as a reference time according to the purpose of the calibration;
[0138] Step S5.2: For the nth experiment, at the jth position, at the equivalent sampling time t n,j,eq At this point, to characterize the sample's relevance to the target time t * The time proximity is determined by constructing time alignment weights using a Gaussian function:
[0139] (7)
[0140] Step S5.3: Determine the optimal bandwidth h during time alignment. * Pre-defined candidate bandwidth set :
[0141] (8)
[0142] Step S5.4: For each candidate bandwidth h l ,in The time alignment effect was evaluated using leave-one-out cross-validation.
[0143] Step S5.5: The established target residual equation is used to solve for the local linear regression parameters using the least weighted residual square method. and :
[0144] (9)
[0145] in: ;
[0146] In the formula: The equivalent sampling time corresponding to the test sample; The predicted value for the test sample; and The intercept and slope parameters are for the local linear regression with the equivalent sampling time of the test sample as the target time. To test sample conditions and candidate bandwidth h l The sample weights are as follows.
[0147] Step S6: Based on the predicted values of all test samples Leave-one-out cross-validation to select the optimal bandwidth The optimal time-aligned weight function is obtained through the following process:
[0148] Step S6.1: Establish a local linear regression equation, and use the equation obtained from equation (9) to obtain the result. , Substitute the values into the local linear regression equation to obtain the predicted values for the test samples. :
[0149] (10)
[0150] Step S6.2: For the sample set U i,j Perform the above steps on all m samples, sum the squared errors of all test samples, and obtain the candidate bandwidth h. l The error function of leave-one-out cross-validation:
[0151] (11)
[0152] Step S6.3: Set the candidate bandwidth Repeat steps S51-S55, S61, and S62 for all bandwidths, calculate the cross-validation error function, and take the value that makes... The minimum bandwidth is the optimal bandwidth h. * ;
[0153] Step S6.4: Determine the optimal bandwidth h * Then, the optimal time alignment weight function is obtained:
[0154] (12)
[0155] In the formula: The optimal time-aligned weight function; For optimal bandwidth, h hours; t * Alignment time with the target.
[0156] Step S7: Based on the time-aligned weighting function of the optimal bandwidth, apply the fixed component logarithmic ratio variable u i,n,j Time alignment with a fixed position j: The specific process includes:
[0157] Step S7.1: For a fixed component i and a fixed position j, at the target time t * Establish a local linear regression model:
[0158] (13)
[0159] in: and For diffusion time t n The intercept and slope parameters of the local linear regression at the target time;
[0160] Step S7.2: Based on the optimal bandwidth h * Optimal time alignment weight function a in equation (13) i,j and b i,j The result is obtained by using the least weighted sum of squared residuals:
[0161] (14)
[0162] Step S7.3: Obtain a from equation (14) i,j That is, the target alignment time t. * Logarithm ratio after time alignment:
[0163] (15)
[0164] In the formula: Let a be the logarithmic ratio of position j and component i after time alignment; i,j This is the intercept parameter in the local linear regression model.
[0165] Step S8: At the unified target time t * Next, spatial smoothing is performed on the time-aligned logarithmic ratio vector; the specific process includes:
[0166] Step S8.1: After time alignment of the fixed non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is:
[0167] (16)
[0168] Step S8.2: Assume that after spatial smoothing of the non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is:
[0169] (17)
[0170] Step S8.3: Solve for the spatially smoothed column vector by minimizing the solution:
[0171] (18)
[0172] Step S8.4: Equation (18) is further solved as follows:
[0173] (19)
[0174] in: , For smoothing coefficients;
[0175] Step S8.5: For equation (19) Taking the partial derivatives and setting them to zero, we obtain the system of positive definite linear equations:
[0176] (20)
[0177] Step S8.6: Similarly, the smoothing parameter λ can be determined by using leave-one-out cross-validation.
[0178] Step S8.7: The column vector after spatial smoothing of the logarithmic ratios at each position is:
[0179] (twenty one)
[0180] In the formula: Align the target with t * Below, I is a column vector composed of the logarithmic ratios of the k sampling positions after time alignment of the non-reference component i; λ is a k×k identity matrix; λ is a smoothing parameter; and D is a second-order difference matrix. To align t to the target * Below, after spatial smoothing of the non-reference component i, the column vector is composed of the logarithmic ratios of the k sampling locations.
[0181] Step S9: For each position j, calculate the corrected normalized molar percentage of the non-reference component i. and reference component r normalized molar percentage The specific process includes:
[0182] Step S9.1: For each position j, the normalized molar percentage of the corrected non-reference component i:
[0183] (twenty two)
[0184] In the formula: This is the corrected normalized molar percentage of non-reference component i; Let j be the logarithm ratio of component i after spatial smoothing.
[0185] Step S9.2: For each position j, the normalized molar percentage of the corrected reference component r is:
[0186] (twenty three)
[0187] In the formula: The normalized molar percentage of the reference component r after correction.
[0188] The present invention will be further described in detail below with reference to specific embodiments:
[0189] A unified time correction method for sequential sampling composition data in gas-to-gas diffusion experiments, the calculation process is as follows: Figure 1 As shown, the steps are as follows:
[0190] Step S1: Taking the gas-to-gas diffusion experiment of natural gas as an example, with the height direction of the PVT cylinder as the Z-axis, a total of 4 experiments were conducted, and the relevant experimental parameters were recorded.
[0191] Step S1.1: Record the following at this time: PVT cylinder temperature 81℃, pressure 10MPa, and diffusion time t. n (n=1,2,3,4), where the diffusion times for sampling are 1h, 2h, 4h, and 8h, respectively;
[0192] Step S1.2: Samples were taken at 5 locations for each experiment, namely 0m, 0.0075m, 0.015m, 0.0225m, and 0.03m. Before the experiment, two different initial compositions of gas were injected into the upper and lower parts of the PVT cylinder, respectively. The initial compositions are shown in Table 1.
[0193] Table 1. Composition at the initial moment of the gas-to-gas diffusion experiment (molar percentage)
[0194]
[0195] Step S1.3: Record the sampling start time t 1,j,s Sampling end time t 1,j,e and determination of mole percentage at each location (N groups) c =4), data are shown in Table 2. Subsequent calculations will be based on the first experiment (diffusion time 1h) as an example.
[0196] Table 2 shows the start and end times of sampling at each location, as well as the mole percentage at each location.
[0197]
[0198] Step S2: Taking the first sampling location as an example, the arithmetic mean of the sampling start time and sampling end time is defined as the equivalent time t of the sample. 1,1,eq This is used to characterize the actual sampling time corresponding to the sample at that location:
[0199] (1)
[0200] Step S3.1: Mole percentage of each component All fall within the range of 0 to 100%;
[0201] Step S3.2: Total mole percentage S 1,1 :
[0202] (2)
[0203] Step S3.3: Because Therefore, take ;
[0204] Step S3.5: Select CH4 as the reference component, denoted as r, which has a high mole percentage, small fluctuation, and is greater than zero in all samples. For any non-reference component i≠r, construct its logarithmic ratio variable relative to the reference component, such as the logarithmic ratio of CO2:
[0205] (4)
[0206] Similarly, N2 and C2~7 are calculated. + The logarithmic ratios are -0.9326 and -2.5792, respectively.
[0207] Similarly, in the first sampling, CO2, N2, and C2~7 were present at other locations. + The values obtained by logarithmic ratio conversion with the CH4 reference component are shown in Table 3.
[0208] Table 3. Logarithmic ratio transformation values of other locations of each non-reference component in the first sampling.
[0209]
[0210] Step S4.1: For the non-reference component CO2 and position 1, collect the logarithmic ratio variable and corresponding equivalent time for this component in all four experiments to form the sample set U. 2,1 :
[0211] (5)
[0212] Step S4.2: For set U 2,1 The first sample in set U (1.0167h, -2.5070) will be removed from the set U. 2,1 Removed from the sample and used as a test sample;
[0213] Step S4.3: The remaining 3 samples form the training set, denoted as... :
[0214] (6)
[0215] Step S5.1: For the first experiment, at position 1, let the target alignment time be t. * =1h;
[0216] Step S5.2: At the equivalent sampling time t 1,1,eq At =1.0167h, to characterize the sample's relevance to the target time t * The time proximity is determined by constructing time alignment weights using a Gaussian function:
[0217] (7)
[0218] Step S5.3: Determine the optimal bandwidth h during time alignment. * Pre-defined candidate bandwidth set :
[0219] (8)
[0220] Step S5.4: For candidate bandwidth h l ,in The time alignment effect is evaluated using leave-one-out cross-validation. Taking a bandwidth of h9 = 1.7h as an example;
[0221] Step S5.5: Establish the target residual equation and use the least weighted residual square method to determine the local linear regression parameters. and :
[0222] (9)
[0223] in:
[0224] Step S6.1: Establish the local linear regression equation, and use the local linear regression parameters obtained from equation (9) =-1.8213 and Substituting 0.1381 into the local linear regression equation, we obtain the predicted value for the test sample. =-1.8213;
[0225] (10)
[0226] Step S6.2: For the sample set U 2,1 Perform the above steps on all four samples, sum the squared errors of all test samples, and obtain the sum of squared errors of leave-one-out cross-validation for the candidate bandwidth:
[0227] (11)
[0228] Step S6.3: Set the candidate bandwidth Repeat steps S51~S55, S61, and S62 for all bandwidths to calculate the sum of squared errors for all bandwidths. Finally, take a bandwidth of 1.7h as the optimal bandwidth h. * ;
[0229] Step S6.4: Therefore, the optimal time-aligned weight function is obtained:
[0230] (12)
[0231] Step S7.1: For component CO2 and position 1, based on the optimal bandwidth h * =1.7h and at the target time t * Establish a local linear regression model at =1h:
[0232] (13)
[0233] Step S7.2: Based on the optimal bandwidth h * The optimal time alignment weight function is 1.7h. a in equation (13) 2,1 and b 2,1 It can be obtained through the least weighted sum of squared residuals:
[0234] (14)
[0235] Step S7.3: Obtain a from equation (14) 2,1 =-2.437095, which is the logarithm ratio after time alignment at the target time:
[0236] (15)
[0237] Step S8.1: After aligning the time of the fixed non-reference component CO2, determine the target alignment time t for the five sampling locations. * The logarithmic ratio vector of =1h is:
[0238] (16)
[0239] Step S8.2: Assume that after spatial smoothing of the non-reference component CO2, the column vector composed of the logarithmic ratios of the five sampling locations is:
[0240] (17)
[0241] Step S8.3: Minimize the solution space-smoothed column vector:
[0242] (18)
[0243] Step S8.4: Equation (18) is further solved as follows:
[0244] (19)
[0245] in: .
[0246] Step S8.5: Equation (19) for Taking the partial derivatives and setting them to zero, we obtain the positive definite linear equation system:
[0247] (20)
[0248] in: .
[0249] Step S8.6: Similarly, the leave-one-out cross-validation method based on spatial location can be used to determine that the smoothing parameter is λ=1;
[0250] Step S8.7: In summary, the column vector after spatial smoothing of the logarithmic ratios at each position is:
[0251] (twenty one)
[0252] Step S9.1: Taking position 1 of the first experiment as an example, based on the smooth logarithm ratio of all i≠r The molar percentage of CO2 after uniform time correction is:
[0253] (twenty two)
[0254] Step S9.2: The molar percentage of the reference component CH4 after uniform time correction is:
[0255] (twenty three)
[0256] Calculate the components N2 and C2~7 after uniform time correction in sequence. + The molar percentages were 32.135% and 3.591%, respectively.
[0257] Similarly, the molar percentages of all components before and after correction are shown in Table 4;
[0258] Table 4 Mole percentages of all components before and after correction
[0259]
[0260] The above description is not intended to limit the scope of the invention. While the invention has been illustrated through the above embodiments, it is not intended to limit the invention. Any person skilled in the art can make certain changes, modifications, or equivalent substitutions based on the disclosed technical content without departing from the scope of the invention. Any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the invention, without departing from the scope of the invention, shall still fall within the scope of the invention.
Claims
1. A method for uniform time correction of sequential sampling composition data in gas-to-gas diffusion experiments, characterized in that: Step S1: During the gas-to-gas diffusion experiment, with the height direction of the PVT cylinder as the Z-axis, a total of m experiments were conducted, and the relevant experimental parameters of temperature and pressure were recorded. Step S2: Define the arithmetic mean of the start and end times of sampling at the j-th position in the n-th experiment as the equivalent time t for this sample. n,j,eq This is used to characterize the actual sampling time corresponding to the sample at that location: Step S3: Select the component with a high mole percentage, small fluctuation and greater than zero in all samples as the reference component, denoted as r. For any non-reference component i≠r, construct the logarithmic ratio variable relative to the reference component. Step S4: During time alignment, leave-one-out cross-validation is used to determine the optimal bandwidth h. * Establish a log-ratio training set for non-reference components. : Step S5: Determine the predicted value for the test sample. Based on the time-aligned weighting function and candidate bandwidth h l Establish the target residual equation to determine the parameters of the local linear regression equation. and : Step S6: Based on the predicted values of all test samples Leave-one-out cross-validation to select the optimal bandwidth The optimal time-aligned weight function is obtained: Step S7: Based on the time-aligned weighting function of the optimal bandwidth, apply the fixed component logarithmic ratio variable u i,n,j Time alignment with a fixed position j: Step S8: At the unified target time t * Next, spatial smoothing is performed on the time-aligned logarithmic ratio vector; Step S9: For each position j, calculate the corrected normalized molar percentage of the non-reference component i. and reference component r normalized molar percentage .
2. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S1 includes: Step S1.1: Record the PVT cylinder temperature, pressure, and diffusion time as t. n Where n = 1, 2, 3, ..., m; t n As the nominal diffusion time, each experiment samples k locations; Step S1.2: For the j-th position in the n-th experiment, where j = 1, 2, 3, ..., k; record the sampling start time as t. n,j,s The sampling ends at time t. n,j,e ; Step S1.3: Record the mole percentage of component i at position j in gas chromatography, where i = 1, 2, ..., Nc. .
3. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The arithmetic mean in step S2 is: (1) In the formula: t n,j,eq For equivalent time; t n,j,s The sampling start time, t n,j,e This is the time when the sampling ends.
4. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S3 includes: Step S3.1: Determine the molar percentage of the component at each location. Does it fall within the range of 0 to 100%? Step S3.2: Calculate the total molar percentage of all components at each location. : (2) Step S3.3: When Then take the normalized mole percentage. ; Step S3.4: Conversely, that is... Then, the molar percentages of each component at that position are normalized to obtain the normalized molar percentages as follows: (3) Step S3.5: After normalization, select the component with a high mole percentage, small fluctuation, and greater than zero in all samples as the reference component, and record its mole percentage as . For any non-reference component i ≠ r, construct its logarithmic ratio variable relative to the reference component: (4) In the formula: u i,n,j This represents the logarithmic ratio of non-reference component i to the reference component; The mole percentage of component i after normalization; The molar percentage of reference component r after normalization.
5. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S4 includes: Step S4.1: For any fixed non-reference component i and fixed position j, collect the logarithmic ratio variable and corresponding equivalent time for that component in all m experiments, forming a sample set U. i,j : (5) Step S4.2: For the sample set U i,j The p-th sample Remove the sample from the sample set U i,j Removed from the sample and used as a test sample; Step S4.3: The remaining m-1 samples constitute the training set, denoted as... : (6) In the formula: Given non-reference component i and fixed position j, collect the logarithmic ratio variable of this component and the corresponding equivalent time in all m experiments to form a sample set; For sample set The p samples are the test samples; For sample set Remove the p-th sample from the training set.
6. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S5 includes: Step S5.1: Let the target alignment time be t. * The t * The nominal diffusion time t of the nth experiment can be taken as n It can also be pre-specified as a reference time according to the purpose of the calibration; Step S5.2: For the nth experiment, at the jth position, at the equivalent sampling time t n,j,eq At this point, to characterize the sample's relevance to the target time t * The time proximity is determined by constructing time alignment weights using a Gaussian function: (7) Step S5.3: Determine the optimal bandwidth h during time alignment. * Pre-defined candidate bandwidth set : (8) Step S5.4: For each candidate bandwidth h l ,in The time alignment effect was evaluated using leave-one-out cross-validation. Step S5.5: The established target residual equation is used to solve for the local linear regression parameters using the least weighted residual square method. and : (9) in: ; In the formula: The equivalent sampling time corresponding to the test sample; The predicted value for the test sample; and The intercept and slope parameters are for the local linear regression with the equivalent sampling time of the test sample as the target time. To test sample conditions and candidate bandwidth h l The sample weights are as follows.
7. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S6 includes: Step S6.1: Establish a local linear regression equation, and use the equation obtained from equation (9) to obtain the result. , Substitute the values into the local linear regression equation to obtain the predicted values for the test samples. : (10) Step S6.2: For the sample set U i,j Perform the above steps on all m samples, sum the squared errors of all test samples, and obtain the candidate bandwidth h. l The error function for leave-one-out cross-validation: (11) Step S6.3: Set the candidate bandwidth Repeat steps S51-S55, S61, and S62 for all bandwidths, calculate the cross-validation error function, and take the value that makes... The minimum bandwidth is the optimal bandwidth h. * ; Step S6.4: Determine the optimal bandwidth h * Then, the optimal time alignment weight function is obtained: (12) In the formula: The optimal time-aligned weight function; For optimal bandwidth, h hours; t * Alignment time with the target.
8. The method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S7 includes: Step S7.1: For a fixed component i and a fixed position j, at the target time t * Establish a local linear regression model: (13) in: and For diffusion time t n The intercept and slope parameters of the local linear regression at the target time; Step S7.2: Based on the optimal bandwidth h * Optimal time alignment weight function a in equation (13) i,j and b i,j The result is obtained by using the least weighted sum of squared residuals: (14) Step S7.3: Obtain a from equation (14) i,j That is, the target alignment time t. * Logarithm ratio after time alignment: (15) In the formula: Let a be the logarithmic ratio of position j and component i after time alignment; i,j This is the intercept parameter in the local linear regression model.
9. A method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S8 includes: Step S8.1: After time alignment of the fixed non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is: (16) Step S8.2: Assume that after spatial smoothing of the non-reference component i, the column vector composed of the logarithmic ratios of the k sampling locations is: (17) Step S8.3: Solve for the spatially smoothed column vector by minimizing the solution: (18) Step S8.4: Equation (18) is further solved as follows: (19) in: , For smoothing coefficients; Step S8.5: For equation (19) Taking the partial derivatives and setting them to zero, we obtain the system of positive definite linear equations: (20) Step S8.6: Similarly, the smoothing parameter λ can be determined by using leave-one-out cross-validation. Step S8.7: The column vector after spatial smoothing of the logarithmic ratios at each position is: (21) In the formula: Align the target with t * Below, I is a column vector composed of the logarithmic ratios of the k sampling positions after time alignment of the non-reference component i; λ is a k×k identity matrix; λ is a smoothing parameter; and D is a second-order difference matrix. To align t to the target * Below, after spatial smoothing of the non-reference component i, the column vector is composed of the logarithmic ratios of the k sampling locations.
10. A method for unified time correction of sequential sampling composition data in gas-to-gas diffusion experiments according to claim 1, characterized in that: The specific process of step S9 includes: Step S9.1: For each position j, the normalized molar percentage of the corrected non-reference component i: (22) In the formula: This is the corrected normalized molar percentage of non-reference component i; Let j be the logarithm ratio of component i after spatial smoothing. Step S9.2: For each position j, the normalized molar percentage of the corrected reference component r is: (23) In the formula: The normalized molar percentage of the reference component r after correction.