[go: up one dir, main page]

CN112114047B - GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network - Google Patents

GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network Download PDF

Info

Publication number
CN112114047B
CN112114047B CN202010985935.5A CN202010985935A CN112114047B CN 112114047 B CN112114047 B CN 112114047B CN 202010985935 A CN202010985935 A CN 202010985935A CN 112114047 B CN112114047 B CN 112114047B
Authority
CN
China
Prior art keywords
neural network
signal
liquid
gas
parameters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010985935.5A
Other languages
Chinese (zh)
Other versions
CN112114047A (en
Inventor
王鑫
韩一硕
汪太阳
王成
何利民
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China University of Petroleum East China
Original Assignee
China University of Petroleum East China
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China University of Petroleum East China filed Critical China University of Petroleum East China
Priority to CN202010985935.5A priority Critical patent/CN112114047B/en
Publication of CN112114047A publication Critical patent/CN112114047A/en
Application granted granted Critical
Publication of CN112114047B publication Critical patent/CN112114047B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/14Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object using acoustic emission techniques
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/44Processing the detected response signal, e.g. electronic circuits specially adapted therefor
    • G01N29/4481Neural networks
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N29/00Investigating or analysing materials by the use of ultrasonic, sonic or infrasonic waves; Visualisation of the interior of objects by transmitting ultrasonic or sonic waves through the object
    • G01N29/44Processing the detected response signal, e.g. electronic circuits specially adapted therefor
    • G01N29/46Processing the detected response signal, e.g. electronic circuits specially adapted therefor by spectral analysis, e.g. Fourier analysis or wavelet analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/084Backpropagation, e.g. using gradient descent
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2291/00Indexing codes associated with group G01N29/00
    • G01N2291/02Indexing codes associated with the analysed material
    • G01N2291/024Mixtures
    • G01N2291/02425Liquids in gases, e.g. sprays
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N2291/00Indexing codes associated with group G01N29/00
    • G01N2291/02Indexing codes associated with the analysed material
    • G01N2291/024Mixtures
    • G01N2291/02433Gases in liquids, e.g. bubbles, foams

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Biophysics (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • Biochemistry (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Biomedical Technology (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • Computing Systems (AREA)
  • Analytical Chemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Signal Processing (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Spectroscopy & Molecular Physics (AREA)
  • Genetics & Genomics (AREA)
  • Physiology (AREA)
  • Acoustics & Sound (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The method for measuring the flow parameters of the GAs-liquid two-phase flow based on the acoustic emission-GA-BP neural network comprises the steps of setting a threshold according to environmental noise; collecting the sound signal and the pressure difference and the liquid holdup; calculating acoustic signal parameters under each flow condition; analyzing wavelet packets of acoustic signals at each gas-liquid flow rate; determining an initial structure of a BP neural network; determining the population size, the coding length and the fitness in a genetic algorithm; selecting a genetic operator; calculating an optimal weight and a threshold; checking the accuracy of the model; and calculating pressure drop and liquid holdup parameters of the marine oil-gas mixing pipeline system. The invention aims to solve the defects of the BP neural network, adopts a genetic algorithm to optimize the BP neural network, avoids the defects of slow iteration and sinking into a local optimal solution of the BP neural network, has wide application range and has the accuracy rate of more than 95 percent. Besides submarine gathering and transportation, the invention is also suitable for detecting the pressure drop and the liquid holdup flow parameters of the gas-liquid two-phase flow in the industrial fields of power engineering, nuclear energy utilization, chemical industry and the like.

Description

基于声发射-GA-BP神经网络的气液流动参数检测方法Gas-liquid flow parameter detection method based on acoustic emission-GA-BP neural network

技术领域Technical Field

本发明涉及多相流检测领域,特别是气液两相流流动参数检测领域,具体涉及一种基于声发射-GA(遗传算法)-BP神经网络的气液流动参数检测方法,以对海洋油气混输系统倾斜(20-90°)或立管内的气液两相流流动参数管道压降和持液率进行实时在线检测。The present invention relates to the field of multiphase flow detection, in particular to the field of gas-liquid two-phase flow parameter detection, and specifically to a gas-liquid flow parameter detection method based on acoustic emission-GA (genetic algorithm)-BP neural network, so as to perform real-time online detection of pipeline pressure drop and liquid holdup of gas-liquid two-phase flow parameters in an inclined (20-90°) or riser of an offshore oil and gas mixed transportation system.

背景技术Background technique

随着陆地石油资源日益枯竭,人们越来越多地把视线集中到海底油气资源中。海洋油田生产系统中,为了节约输送成本,油气多以混输的方式进行,在工程实际应用中,为了实时监控管内流动状态,需要对管道内多种两相流动参数进行检测。立管集输系统内的两相流动受多种因素影响,流动参数的实时测量具有重要意义,如持液率、压降、两相流速、流型等。其中管道压降和持液率是重要的运行参数。压降反映了管内油气流动的阻力损耗和沿线压力变化,是管道运行的基本参数之一,混输管线压降造成的上游井口回压对油井产量有重要影响,是混输泵配置和运行的重要参数。同时压降也反映了深水油气管道内结蜡、水合物生成等变化情况。持液率反映了管道截面上液体所占的比率,这对管内油气界面分布的了解、对于管道清管周期的确定都有重要意义。因此,压降和持液率是油气混输管道设计和运行中的重要参数。As terrestrial oil resources are increasingly depleted, people are increasingly focusing on submarine oil and gas resources. In the offshore oilfield production system, in order to save transportation costs, oil and gas are mostly transported in a mixed manner. In practical engineering applications, in order to monitor the flow state in the pipeline in real time, it is necessary to detect a variety of two-phase flow parameters in the pipeline. The two-phase flow in the riser gathering and transportation system is affected by many factors, and the real-time measurement of flow parameters is of great significance, such as liquid holdup, pressure drop, two-phase flow velocity, flow type, etc. Among them, pipeline pressure drop and liquid holdup are important operating parameters. Pressure drop reflects the resistance loss and pressure change along the oil and gas flow in the pipeline, and is one of the basic parameters of pipeline operation. The upstream wellhead back pressure caused by the pressure drop of the mixed pipeline has an important impact on the oil well production, and is an important parameter for the configuration and operation of the mixed pump. At the same time, the pressure drop also reflects the changes in wax deposition and hydrate formation in deepwater oil and gas pipelines. Liquid holdup reflects the ratio of liquid to the cross section of the pipeline, which is of great significance for understanding the distribution of the oil and gas interface in the pipeline and determining the pipeline cleaning cycle. Therefore, pressure drop and liquid holdup are important parameters in the design and operation of oil and gas mixed transportation pipelines.

在油气生产现场伽马射线是常用的持液率测量方法,然而由于射线源监管严格繁琐和设备安装不方便,限制了其应用。专利号CN201910250057.X提供了一种持液率检测方法,通过一个与管道容积相近的压力容器分压,可通过特定范围内容器分压前后的分压系数检测出管道持液率,但不具备普遍性和适用性。声发射技术是一种无损检测技术,凭借安装快捷,操作简单等优势已被成功用于材料缺陷、裂纹检测和管道泄漏等领域。将声发射技术应用于两相流动参数识别,可以满足无损、快速在线检测的要求。申请号2020102334040中,给出了基于声发射-BP神经网络两相流流型识别的方法,该专利利用倾斜管下不同气液速的声发射数据,与BP神经网络相结合,建立了倾斜立管的声发射数据和流型的关联模型,实现了流型的在线识别。此专利申请为利用声发射数据来预测流动参数的可行性提供了思路。Gamma rays are a commonly used method for measuring liquid holdup at oil and gas production sites. However, their application is limited by the strict and cumbersome supervision of ray sources and the inconvenience of equipment installation. Patent No. CN201910250057.X provides a method for detecting liquid holdup. Through a pressure vessel partial pressure close to the volume of the pipeline, the liquid holdup of the pipeline can be detected by the pressure coefficient before and after the pressure drop of the container in a specific range, but it does not have universality and applicability. Acoustic emission technology is a non-destructive testing technology. With the advantages of quick installation and simple operation, it has been successfully used in the fields of material defects, crack detection and pipeline leakage. Applying acoustic emission technology to the identification of two-phase flow parameters can meet the requirements of non-destructive and rapid online detection. Application No. 2020102334040 provides a method for identifying flow patterns of two-phase flow based on acoustic emission-BP neural network. The patent uses acoustic emission data of different gas-liquid velocities under inclined pipes, combined with BP neural network, to establish a correlation model between acoustic emission data and flow patterns of inclined risers, and realizes online identification of flow patterns. This patent application provides ideas for the feasibility of using acoustic emission data to predict flow parameters.

BP神经网络最大的特点是能较好地解决非线性问题,但是也有以下缺点:首先BP神经网络收敛速度慢。BP神经网络随机选取初值和阈值,若选取较差会导致神经网络在这一部分的迭代收敛缓慢,运算耗时较长。其次,BP神经网络的学习方法是梯度下降法,但非线性问题通常在函数区间内存在多个极值点,导致神经网络陷入局部最优解,无法实现参数的准确预测。The biggest feature of BP neural network is that it can solve nonlinear problems well, but it also has the following disadvantages: First, BP neural network converges slowly. BP neural network randomly selects initial values and thresholds. If the selection is poor, it will cause the iteration of the neural network in this part to converge slowly and the calculation will take a long time. Secondly, the learning method of BP neural network is gradient descent, but nonlinear problems usually have multiple extreme points in the function interval, which causes the neural network to fall into the local optimal solution and cannot achieve accurate prediction of parameters.

因此亟需一种气液两相流流动参数在线检测方法,该方法不但需要对管道压降和持液率的测量做到行之有效,还应克服现有BP网络的以上问题。Therefore, there is an urgent need for an online detection method for gas-liquid two-phase flow parameters, which not only needs to be effective in measuring pipeline pressure drop and liquid holdup, but also should overcome the above problems of the existing BP network.

发明内容Summary of the invention

本发明的目的是提供基于声发射-GA(遗传算法)-BP神经网络的气液流动参数检测方法,对海洋油气混输系统倾斜(20-90°)或垂直高压管道内的气液两相流动参数压降和持液率进行在线识别。The purpose of the present invention is to provide a gas-liquid flow parameter detection method based on acoustic emission-GA (genetic algorithm)-BP neural network, which can identify the pressure drop and liquid holdup of gas-liquid two-phase flow parameters in an inclined (20-90°) or vertical high-pressure pipeline of a marine oil and gas mixed transportation system online.

本发明通过提取分析不同气液折算速度组合气液流动工况下的声发射信号特征,建立信号特征与流动参数的模型,通过GA-BP神经网络学习不同流动条件下的样本信号特征,达到计算两相流流动参数压降和持液率的目标。The present invention extracts and analyzes the acoustic emission signal characteristics under gas-liquid flow conditions with different gas-liquid converted velocity combinations, establishes a model of signal characteristics and flow parameters, and learns the sample signal characteristics under different flow conditions through a GA-BP neural network to achieve the goal of calculating the pressure drop and liquid holdup of the two-phase flow parameters.

基于声发射-GA-BP神经网络测量气液两相流流动参数的方法,其特征是包括以下步骤:The method for measuring flow parameters of gas-liquid two-phase flow based on acoustic emission-GA-BP neural network is characterized by comprising the following steps:

步骤1、根据环境噪音设定阈值Step 1: Set the threshold according to the ambient noise

在海洋油气混输系统20-90°范围的倾斜管道或垂直高压管道外壁上布置一个声发射传感器(1);An acoustic emission sensor (1) is arranged on the outer wall of an inclined pipeline or a vertical high-pressure pipeline in the range of 20-90 degrees in a marine oil and gas mixed transmission system;

当管道内气速、液速均为零时,进行空管采集,将空管信号中的最大值设定为阈值电压。When the gas velocity and liquid velocity in the pipeline are both zero, empty pipe collection is performed, and the maximum value of the empty pipe signal is set as the threshold voltage.

步骤2、对声信号和压差、持液率进行采集Step 2: Collect acoustic signals, pressure difference, and liquid holdup

当管道的气液两相流动处于不同气液流速组合的工况时,通过声发射传感器(1)采集两相流声信号;在采集声信号的同时,通过压差传感器和双平行电导探针同步记录压差和持液率,用于对后续步骤建立的神经网络模型进行训练和验证。When the gas-liquid two-phase flow in the pipeline is in the working condition of different gas-liquid flow rate combinations, the two-phase flow acoustic signal is collected by an acoustic emission sensor (1); while collecting the acoustic signal, the pressure difference and liquid holdup are synchronously recorded by a pressure difference sensor and a dual parallel conductivity probe, which are used to train and verify the neural network model established in the subsequent steps.

步骤3、计算各流动条件下的声信号参数Step 3: Calculate the acoustic signal parameters under various flow conditions

对采集到的声信号的原始波形数据进行统计分析,计算得到声信号幅值、平均电压电平、均方根值、绝对能量值和振铃计数。The collected original waveform data of the acoustic signal is statistically analyzed to calculate the acoustic signal amplitude, average voltage level, root mean square value, absolute energy value and ringing count.

幅值AMP,单位dB,定义为:Amplitude AMP, in dB, is defined as:

其中,Vmax为两相流声信号中电压数据的最大值,单位V。Wherein, V max is the maximum value of the voltage data in the two-phase flow acoustic signal, in V.

平均电压电平ASL,单位dB,定义为:The average voltage level ASL, in dB, is defined as:

其中,Vmean为两相流声信号中电压数据的平均值,单位V。Wherein, V mean is the average value of the voltage data in the two-phase flow acoustic signal, in V.

均方根值RMS,单位V,定义为:The root mean square value RMS, in V, is defined as:

其中,V为两相流声信号中每个数据点电压信号,单位V;n为声信号数据点的个数。Wherein, V is the voltage signal of each data point in the two-phase flow acoustic signal, in V; n is the number of acoustic signal data points.

绝对能量值ABS,单位J,定义为:Absolute energy value ABS, in J, is defined as:

其中,V为两相流声信号中每个数据点电压信号,单位V;10KΩ为参考电阻;T为采样时间,单位s;Wherein, V is the voltage signal of each data point in the two-phase flow acoustic signal, unit V; 10KΩ is the reference resistor; T is the sampling time, unit s;

振铃计数Counts,表示越过门槛信号的震荡次数,即为超过门槛电压的有效波峰的个数;Ringing count Counts, which indicates the number of oscillations that cross the threshold signal, that is, the number of effective peaks that exceed the threshold voltage;

在分析流动参数与各统计参数相关性时,发现振幅值AMP在很大时间窗内具有很强的随机性,与流动参数基本无关联,故舍去。When analyzing the correlation between flow parameters and various statistical parameters, it was found that the amplitude value AMP has strong randomness in a large time window and has basically no correlation with the flow parameters, so it was discarded.

步骤4、对各气液流速下声信号的小波包进行分析Step 4: Analyze the wavelet packets of the acoustic signal at each gas-liquid flow rate

小波包是由一系列小波包基函数组成,由于不同的小波包基有不同的时频特性,则对于同一个信号,不同的小波包基会得到不同的结果,所以选择合适的小波包基对准确提取信号特征非常重要。Wavelet packets are composed of a series of wavelet packet basis functions. Since different wavelet packet bases have different time-frequency characteristics, different wavelet packet bases will produce different results for the same signal. Therefore, choosing a suitable wavelet packet basis is very important for accurately extracting signal features.

步骤4.1、选择小波包基函数Step 4.1: Select wavelet packet basis function

选取Symlets8小波基函数进行小波包的分解;Select Symlets8 wavelet basis function to decompose wavelet packet;

步骤4.2、对小波包进行分解Step 4.2: Decompose the wavelet packet

若信号的采样频率为fs,根据奈奎斯特采样定理,信号的可测频率范围为[0,fs/2];由于在信号频率的范围内,细节信号和近似信号的分布范围是对称的,当分解尺度为1时,[0,fs/4]和[fs/4,fs/2]为近似信号和细节信号的频率范围,对于采样频率为fs的信号f(n)进行J次小波包分解后,其信号被分解为2J个频率段,各个频率范围的计算公式如下:If the sampling frequency of the signal is fs , according to the Nyquist sampling theorem, the measurable frequency range of the signal is [0, fs /2]; because within the range of the signal frequency, the distribution range of the detail signal and the approximate signal is symmetrical, when the decomposition scale is 1, [0, fs /4] and [ fs /4, fs /2] are the frequency ranges of the approximate signal and the detail signal. After performing J wavelet packet decompositions on the signal f(n) with a sampling frequency of fs , the signal is decomposed into 2J frequency segments. The calculation formulas for each frequency range are as follows:

若设采样频率为fs kHz,信号要求的最低识别频率为fmin,根据式(5),其最大分解尺度J应满足:If the sampling frequency is fs kHz, the minimum recognition frequency required by the signal is fmin . According to equation (5), the maximum decomposition scale J should satisfy:

即:Right now:

分解尺度一般选取J=3~4;小波包分解后得到了各个频段的重构波形信号,求重构波形信号的范数平方作为各节点的小波包能量。The decomposition scale is generally selected as J=3~4; after wavelet packet decomposition, the reconstructed waveform signal of each frequency band is obtained, and the norm square of the reconstructed waveform signal is calculated as the wavelet packet energy of each node.

步骤5、确定BP神经网络初始结构Step 5: Determine the initial structure of the BP neural network

一般设计神经网络优先考虑3层网络;以声信号平均电压电平、均方根值、绝对能量值、振铃计数四种统计参数和2J个频率段处小波包能量即重构波形的范数平方,共计4+2J个特征值,作为BP神经网络输入层的输入量;因此输入层的节点数和输入的统计特征的个数相同,为4+2J个。Generally, when designing a neural network, a three-layer network is given priority. The four statistical parameters of the acoustic signal, namely the average voltage level, root mean square value, absolute energy value, and ringing count, and the energy of the wavelet packet at 2 J frequency bands, i.e., the square norm of the reconstructed waveform, totaling 4+2 J eigenvalues, are used as the input of the BP neural network input layer. Therefore, the number of nodes in the input layer is the same as the number of statistical features of the input, which is 4+2 J.

输出层的节点数1;隐藏层的节点数由计算隐含层元素个数的经验公式确定,常用的经验公式如下:The number of nodes in the output layer is 1; the number of nodes in the hidden layer is determined by the empirical formula for calculating the number of elements in the hidden layer. The commonly used empirical formula is as follows:

h=2*m+1 (8)h=2*m+1 (8)

其中,h为隐含层节点的数目,m为输入层节点数。Among them, h is the number of hidden layer nodes, and m is the number of input layer nodes.

为了便于计算与比较,需要将输入层和输出层神经元进行归一化处理,归一化的公式为:In order to facilitate calculation and comparison, the input layer and output layer neurons need to be normalized. The normalization formula is:

其中,α为归一化处理后的特征值,xi为归一化处理前的特征值,xmax、xmin分别为归一化处理前特征值的最大值和最小值,i是特征值序号,表示第i个特征值,i∈1,……,n;ymax、ymin是归一化后期望的最大值和最小值,一般默认为1和-1。Among them, α is the eigenvalue after normalization, xi is the eigenvalue before normalization, xmax and xmin are the maximum and minimum values of the eigenvalue before normalization, respectively, i is the eigenvalue sequence number, indicating the i-th eigenvalue, i∈1,…,n; ymax and ymin are the expected maximum and minimum values after normalization, which are generally defaulted to 1 and -1.

定义流动参数——管道压降或持液率为输出层,即输出层只有一个神经元。Define the flow parameters - pipeline pressure drop or liquid holdup as the output layer, that is, the output layer has only one neuron.

步骤6、确定遗传算法中种群大小、编码长度和适应度Step 6: Determine the population size, encoding length and fitness in the genetic algorithm

遗传算法是从随机选择的初始解开始,通过基于上一代群体中的个体的选择、交叉、变异操作选代以产生新的解。The genetic algorithm starts with a randomly selected initial solution and generates a new solution through selection, crossover, and mutation operations based on individuals in the previous generation population.

设置种群大小:遗传算法着眼种群,即多个给定初始解的集合,每个初始解被称为个体,也就是染色体。迭代运算时,种群大小不变,种群中的染色体在问题解空间内不断发生改变,因此,种群大小会影响迭代速率,在实际问题解决的过程中应按照实际情况具体分析确定最初种群的规模和位置,一般在20~100之间。Set the population size: Genetic algorithms focus on the population, which is a set of multiple given initial solutions. Each initial solution is called an individual, or chromosome. During iterative operations, the population size remains unchanged, and the chromosomes in the population are constantly changing in the problem solution space. Therefore, the population size will affect the iteration rate. In the process of solving actual problems, the size and position of the initial population should be determined according to the actual situation, generally between 20 and 100.

编码是将数据转换成染色体,即遗传空间内固定形式与长度的基因串结构数据。本发明设计使用二进制编码,即用二进制字符集{0,1}中的0和1代表问题的候选解。Encoding is to convert data into chromosomes, that is, genetic string structure data of fixed form and length in genetic space. The present invention is designed to use binary encoding, that is, 0 and 1 in the binary character set {0,1} are used to represent candidate solutions to the problem.

编码位数往往根据实际问题给出,一般在5~20之间。The number of coding bits is often given based on actual problems, usually between 5 and 20.

遗传算法中个体的适应度值是由适应度函数判断的,适应度说明了染色体的优劣性,因此适应度函数对问题计算出可比较的非负结果,再由后续选择算子进行比较。The fitness value of an individual in a genetic algorithm is determined by a fitness function, which describes the quality of the chromosome. Therefore, the fitness function calculates comparable non-negative results for the problem, which are then compared by subsequent selection operators.

本方法应用的适应度函数为排序函数,通过将后续步骤中训练得到的权值和阈值与上一代权值和阈值之间的误差进行比较,按照误差从小到大排序,进行下一步骤的计算。The fitness function used in this method is a ranking function. By comparing the errors between the weights and thresholds obtained by training in the subsequent steps and the weights and thresholds of the previous generation, the errors are sorted from small to large, and the calculation of the next step is performed.

步骤7、遗传算子的选择Step 7: Selection of genetic operators

包括选择算子的选择、交叉算子的选择和变异算子的选择。It includes the selection of selection operator, crossover operator and mutation operator.

本方法使用随机遍历抽样法,每个个体被选择的几率相等,为个体总数的倒数。This method uses random traversal sampling, and the probability of each individual being selected is equal, which is the inverse of the total number of individuals.

交叉算子是遗传算法中最重要的组成部分,是操作的核心,交叉可以使初始种群中优良的染色体得到保存,通过双方的染色体交换,产生新的种群,增加了种群的复杂性和多样性。常用的交叉算子包括单点交叉算子和两点交叉算子,本方法使用单点交叉算子:The crossover operator is the most important component of the genetic algorithm and the core of the operation. Crossover can preserve the excellent chromosomes in the initial population and generate a new population by exchanging chromosomes between the two parties, which increases the complexity and diversity of the population. Commonly used crossover operators include single-point crossover operators and two-point crossover operators. This method uses a single-point crossover operator:

设两个父串分别为x=[x1,x2,L,xn]和y=[y1,y2,L,yn],叉点为k,那么生成的子代为:Suppose the two parent strings are x = [x 1 , x 2 , L, x n ] and y = [y 1 , y 2 , L, y n ], and the fork point is k, then the generated offspring is:

x'=[x1,x2,L,xk,yk+1,yk+2,L,yn] (14)x'=[x1,x2,L, xk ,yk + 1 ,yk + 2 ,L, yn ] (14)

y'=[y1,y2,L,yk,xk+1,xk+2,L,xn] (15)y'=[y 1 ,y 2 ,L,y k ,x k+1 ,x k+2 ,L,x n ] (15)

单点交叉中,染色体的断点只有一个,若父串的长度为n,则单点交叉有(n-1)种不同交叉结果。In a single-point crossover, there is only one breakpoint on the chromosome. If the length of the parent string is n, then the single-point crossover has (n-1) different crossover results.

交叉概率一般取值在0.4~0.9之间。The crossover probability is generally between 0.4 and 0.9.

本方法的变异算子是随机选择的某个染色体有一定的概率去改变数据,通常作为一个产生新物种的辅助手段,具有局部搜索能力,进一步扩展了种群的多样性;The mutation operator of this method is a random selection of a chromosome with a certain probability to change the data, usually as an auxiliary means to generate new species, with local search capabilities, further expanding the diversity of the population;

变异概率的取值范围一般在0.001~0.1之间。The mutation probability generally ranges from 0.001 to 0.1.

步骤8、计算最优权值和阈值Step 8: Calculate the optimal weights and thresholds

在选定的管道倾斜角度下,选取不少于150组不同表观气体速度和表观液体速度组合流动工况的测量声发射信号,然后利用步骤3和步骤4计算每个工况声发射信号的4+2J个特征参数,选取全部工况的60%作为训练样本,40%作为测试样本;选择与训练样本对应的压降或持液率作为训练样本结果,选择与测试样本对应的压降或持液率作为测试样本结果;将训练样本、测试样本、训练样本结果、测试样本结果参数归一化。At the selected pipeline inclination angle, select no less than 150 groups of measured acoustic emission signals of different flow conditions with different superficial gas velocity and superficial liquid velocity combinations, and then use steps 3 and 4 to calculate 4+2 J characteristic parameters of the acoustic emission signal of each condition, select 60% of all conditions as training samples, and 40% as test samples; select the pressure drop or liquid holdup corresponding to the training samples as the training sample results, and select the pressure drop or liquid holdup corresponding to the test samples as the test sample results; normalize the training samples, test samples, training sample results, and test sample result parameters.

将归一化后的训练样本、训练样本结果、测试样本、测试样本结果带入步骤5的BP神经网络进行训练,得到初始权值和阈值;Bring the normalized training samples, training sample results, test samples, and test sample results into the BP neural network of step 5 for training to obtain initial weights and thresholds;

然后进行遗传算法优化计算,根据步骤6中设置的种群大小、编码形式和适应度函数对权值和阈值进行适应度计算,利用步骤7设置的遗传算子进行迭代;Then, the genetic algorithm optimization calculation is performed, and the fitness calculation of the weight and threshold is performed according to the population size, encoding form and fitness function set in step 6, and the genetic operator set in step 7 is used for iteration;

经过遗传算子的迭代后,得到下一代种群;通过步骤6设置的适应度函数对种群进行评价,当迭代次数达到预先给定数值时迭代停止,此时得到最优权值和阈值;After the iteration of the genetic operator, the next generation population is obtained; the population is evaluated by the fitness function set in step 6, and the iteration stops when the number of iterations reaches a predetermined value, at which time the optimal weight and threshold are obtained;

迭代次数的选择范围是200次以下;当达到设定的迭代次数时,得到的最优个体为BP神经网络的最优权值和阈值。The selection range of the number of iterations is less than 200 times; when the set number of iterations is reached, the optimal individual obtained is the optimal weight and threshold of the BP neural network.

步骤9、模型准确性检验Step 9: Model Accuracy Test

将得到的最优权值和阈值重新赋给神经网络,将测试样本代入BP神经网络,比较计算输出结果与真实结果,如果计算误差在5%以下,模型建立成功,若不满足计算误差,重复进行步骤6和步骤7,直到计算误差满足设计要求;此时的BP神经网络即为经过遗传算法优化过的最优BP神经网络。The optimal weights and thresholds are reassigned to the neural network, and the test samples are substituted into the BP neural network. The calculated output results are compared with the actual results. If the calculated error is below 5%, the model is successfully established. If the calculated error does not meet the requirements, steps 6 and 7 are repeated until the calculated error meets the design requirements. The BP neural network at this time is the optimal BP neural network optimized by the genetic algorithm.

步骤10、海洋油气混输管道系统的压降和持液率参数计算Step 10: Calculation of pressure drop and liquid holdup parameters for offshore oil and gas mixed pipeline system

然后利用步骤1中布置在管道外壁上的声发射传感器(1)采集声发射信号,以步骤3的方式计算声信号参数,以步骤4的方式计算声信号的小波包能量,并将所得参数和小波包能量输入到经上述步骤训练后得到的最优模型中,即可得到海洋油气混输管道系统的压降和持液率参数。Then, the acoustic emission sensor (1) arranged on the outer wall of the pipeline in step 1 is used to collect the acoustic emission signal, the acoustic signal parameters are calculated in the manner of step 3, the wavelet packet energy of the acoustic signal is calculated in the manner of step 4, and the obtained parameters and wavelet packet energy are input into the optimal model obtained after training in the above steps, so that the pressure drop and liquid holdup parameters of the marine oil and gas mixed transmission pipeline system can be obtained.

所述步骤4中,选取J=3作为小波包分解尺度。In the step 4, J=3 is selected as the wavelet packet decomposition scale.

所述步骤5中,输入层、隐藏层和输出层之间使用线性传递函数,训练函数采用trainlm函数,即L-M反向传播算法,训练次数设为1000,训练目标设为10-5,学习速率设置为0.1。In step 5, a linear transfer function is used between the input layer, the hidden layer and the output layer, the training function adopts the trainlm function, that is, the LM back propagation algorithm, the number of training times is set to 1000, the training target is set to 10 -5 , and the learning rate is set to 0.1.

所述步骤6中,以10作为最优二进制编码位数。In step 6, 10 is used as the optimal binary coding bit number.

所述步骤6中,以0.7作为最优交叉概率选。In step 6, 0.7 is selected as the optimal crossover probability.

所述步骤7中,以0.01作为最优变异概率。In step 7, 0.01 is used as the optimal mutation probability.

所述步骤8中,最大迭代次数即最大遗传代数为50。In step 8, the maximum number of iterations, i.e., the maximum genetic generation, is 50.

发明优点Advantages of the invention

为解决BP神经网络的不足,采用遗传算法(Genetic Algorithm,GA)优化BP神经网络,该预测模型是在保持BP预测模型结构不变基础上进行权重和阈值的优化。遗传算法是一种自适应启发式全局搜索算法,它模仿生物的遗传和进化,基于达尔文物竞天择、适者生存的进化原理,着眼整体开展并行搜索,最终得到问题最优解。该方法面向整体并行搜索和依概率为导向的找寻过程,避免了BP神经网络迭代缓慢和陷入局部最优解的缺陷。In order to solve the shortcomings of BP neural network, the genetic algorithm (GA) is used to optimize the BP neural network. The prediction model optimizes the weights and thresholds on the basis of keeping the structure of the BP prediction model unchanged. The genetic algorithm is an adaptive heuristic global search algorithm. It imitates the inheritance and evolution of organisms. Based on Darwin's evolutionary principle of natural selection and survival of the fittest, it focuses on overall parallel search and finally obtains the optimal solution to the problem. This method is oriented to overall parallel search and probability-oriented search process, avoiding the defects of slow iteration of BP neural network and falling into the local optimal solution.

声发射技术是一种被动的无损检测技术,传感器只需贴合在管外壁即可,操作简单,适应环境能力强,可以在不破坏管道的情况下检测两相流信号,碳钢金属材质的油气管道有利于声信号的传播。本发明是基于声发射测量的气液两相流流动参数计算方法,提供了一种实时、快速、在线的方法,对于高压厚壁油气管道的运行状况检测、深水油气流动安全保障监控具有重要价值。本发明能够识别倾斜和垂直管道气液两相流压降和持液率流动参数,适用流速范围宽,准确率高达95%以上。除了海底集输,本发明同样适用于动力工程、核能利用、化工等工业领域的气液两相流压降和持液率流动参数的检测。Acoustic emission technology is a passive non-destructive testing technology. The sensor only needs to be attached to the outer wall of the pipe. It is simple to operate and has strong adaptability to the environment. It can detect two-phase flow signals without damaging the pipeline. Carbon steel metal oil and gas pipelines are conducive to the propagation of acoustic signals. The present invention is a method for calculating the flow parameters of gas-liquid two-phase flow based on acoustic emission measurement. It provides a real-time, fast, and online method, which is of great value for the operation status detection of high-pressure thick-walled oil and gas pipelines and the safety monitoring of deep-water oil and gas flow. The present invention can identify the pressure drop and liquid holdup flow parameters of gas-liquid two-phase flow in inclined and vertical pipelines, with a wide range of applicable flow rates and an accuracy rate of more than 95%. In addition to submarine gathering and transportation, the present invention is also suitable for the detection of gas-liquid two-phase flow pressure drop and liquid holdup flow parameters in industrial fields such as power engineering, nuclear energy utilization, and chemical industry.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为基于声发射技术的两相流流动参数识别流程图。Figure 1 is a flow chart of two-phase flow parameter identification based on acoustic emission technology.

图2为两相混输管道声发射信号采集示意图。Figure 2 is a schematic diagram of acoustic emission signal acquisition in a two-phase mixed pipeline.

其中,1-声发射传感器,2-信号放大器,3-信号采集箱,4-计算机。Among them, 1-acoustic emission sensor, 2-signal amplifier, 3-signal acquisition box, 4-computer.

图3为三尺度小波包分解树图。Figure 3 is a three-scale wavelet packet decomposition tree diagram.

图4为倾斜角度45°下表观水速5m/s,表观气速1.6m/s下的原始信号小波包分解重构图。Figure 4 is a wavelet packet decomposition and reconstruction diagram of the original signal at an apparent water velocity of 5 m/s and an apparent air velocity of 1.6 m/s at an inclination angle of 45°.

图5为GA-BP神经网络训练流程图。Figure 5 is a flow chart of GA-BP neural network training.

表1为小波包分解各节点的频率范围。Table 1 shows the frequency range of each node in wavelet packet decomposition.

表2为BP神经网络和GA-BP神经网络预测管道持液率的误差对比。Table 2 shows the error comparison of BP neural network and GA-BP neural network in predicting pipeline liquid holdup.

表3为BP神经网络和GA-BP神经网络预测管道压降的误差对比。Table 3 shows the error comparison of pipeline pressure drop prediction by BP neural network and GA-BP neural network.

表4为基于声发射-GA-BP神经网络识别倾斜45度管道持液率实施举例。Table 4 is an example of the implementation of identifying the liquid holdup of a 45-degree inclined pipeline based on acoustic emission-GA-BP neural network.

表5为基于声发射-GA-BP神经网络识别倾斜45度管道压降实施举例。Table 5 is an example of the implementation of identifying the pressure drop of a 45-degree inclined pipeline based on acoustic emission-GA-BP neural network.

具体实施方式Detailed ways

以下结合附图1对本发明方法作进一步的详细描述:The method of the present invention is further described in detail below in conjunction with FIG1:

基于声发射-GA-BP神经网络测量气液两相流流动参数的方法,计算过程见图1,步骤包括:The method for measuring the flow parameters of gas-liquid two-phase flow based on acoustic emission-GA-BP neural network, the calculation process is shown in Figure 1, and the steps include:

步骤1、根据环境噪音设定阈值Step 1: Set the threshold according to the ambient noise

在海洋油气混输系统20-90°范围的倾斜管道或垂直高压管道外壁上布置一个声发射传感器1,声发射传感器1通常设在流动充分发展段。An acoustic emission sensor 1 is arranged on the outer wall of an inclined pipeline or a vertical high-pressure pipeline in the range of 20-90 degrees in a marine oil and gas mixed transportation system. The acoustic emission sensor 1 is usually arranged in a fully developed flow section.

当管道内气速、液速均为零时,进行空管采集,将空管信号中的最大值设定为阈值电压。When the gas velocity and liquid velocity in the pipeline are both zero, empty pipe collection is performed, and the maximum value of the empty pipe signal is set as the threshold voltage.

步骤2、对声信号和压差、持液率进行采集Step 2: Collect acoustic signals, pressure difference, and liquid holdup

当管道的气液两相流动处于不同气液流速组合的工况时,通过声发射传感器1采集两相流声信号;在采集声信号的同时,通过压差传感器和双平行电导探针(或伽马射线相含率仪)同步记录压差和持液率,用于对后续步骤建立的神经网络模型进行训练和验证。When the gas-liquid two-phase flow in the pipeline is in the working condition of different gas-liquid flow rate combinations, the two-phase flow acoustic signal is collected by the acoustic emission sensor 1; while collecting the acoustic signal, the pressure difference and liquid holdup are synchronously recorded by the pressure difference sensor and the dual parallel conductivity probe (or gamma ray phase content meter) for training and verification of the neural network model established in the subsequent steps.

若现场不具备测试条件,可在实验基地使用相同尺寸、倾角、相同运行条件和相同介质的大型多相流实验环道进行声发射信号、压降和持液率参数的检测。If the test conditions are not available on site, a large multiphase flow test loop with the same size, inclination, operating conditions and medium can be used at the experimental base to test the acoustic emission signal, pressure drop and liquid holdup parameters.

步骤3、计算各流动条件下的声信号参数Step 3: Calculate the acoustic signal parameters under various flow conditions

对采集到的声信号的原始波形数据进行统计分析,计算得到声信号幅值、平均电压电平、均方根值、绝对能量值和振铃计数。The collected original waveform data of the acoustic signal is statistically analyzed to calculate the acoustic signal amplitude, average voltage level, root mean square value, absolute energy value and ringing count.

幅值AMP,单位dB,定义为:Amplitude AMP, in dB, is defined as:

其中,Vmax为两相流声信号中电压数据的最大值,单位V。Wherein, V max is the maximum value of the voltage data in the two-phase flow acoustic signal, in V.

平均电压电平ASL,单位dB,定义为:The average voltage level ASL, in dB, is defined as:

其中,Vmean为两相流声信号中电压数据的平均值,单位V。Wherein, V mean is the average value of the voltage data in the two-phase flow acoustic signal, in V.

均方根值RMS,单位V,定义为:The root mean square value RMS, in V, is defined as:

其中,V为两相流声信号中每个数据点电压信号,单位V;n为声信号数据点的个数。Wherein, V is the voltage signal of each data point in the two-phase flow acoustic signal, unit is V; n is the number of acoustic signal data points.

绝对能量值ABS,单位J,定义为:Absolute energy value ABS, in J, is defined as:

其中,V为两相流声信号中每个数据点电压信号,单位V;10KΩ为参考电阻;T为采样时间,单位s。Wherein, V is the voltage signal of each data point in the two-phase flow acoustic signal, unit is V; 10KΩ is the reference resistor; T is the sampling time, unit is s.

振铃计数Counts,表示越过门槛信号的震荡次数,即为超过门槛电压的有效波峰的个数。The ringing count Counts indicates the number of oscillations that cross the threshold signal, that is, the number of effective peaks that exceed the threshold voltage.

在分析流动参数与各统计参数相关性时,发现振幅值AMP在很大时间窗内具有很强的随机性,与流动参数基本无关联,故舍去。When analyzing the correlation between flow parameters and various statistical parameters, it was found that the amplitude value AMP has strong randomness in a large time window and has basically no correlation with the flow parameters, so it was discarded.

步骤4、对各气液流速下声信号的小波包进行分析Step 4: Analyze the wavelet packets of the acoustic signal at each gas-liquid flow rate

小波包是由一系列小波包基函数组成,由于不同的小波包基有不同的时频特性,则对于同一个信号,不同的小波包基会得到不同的结果,所以选择合适的小波包基对准确提取信号特征非常重要。Wavelet packets are composed of a series of wavelet packet basis functions. Since different wavelet packet bases have different time-frequency characteristics, different wavelet packet bases will produce different results for the same signal. Therefore, choosing a suitable wavelet packet basis is very important for accurately extracting signal features.

步骤4.1、选择小波包基函数Step 4.1: Select wavelet packet basis function

声发射信号实际应用处理中一般选取Symlets8或者coif4小波,本发明实施例以选取Symlets8小波基函数进行小波包的分解。In actual application and processing of acoustic emission signals, Symlets8 or coif4 wavelets are generally selected. In the embodiment of the present invention, Symlets8 wavelet basis functions are selected to decompose wavelet packets.

步骤4.2、对小波包进行分解Step 4.2: Decompose the wavelet packet

若信号的采样频率为fs,根据奈奎斯特采样定理,信号的可测频率范围为[0,fs/2];由于在信号频率的范围内,细节信号和近似信号的分布范围是对称的,当分解尺度为1时,[0,fs/4]和[fs/4,fs/2]为近似信号和细节信号的频率范围,对于采样频率为fs的信号f(n)进行J次小波包分解后,其信号被分解为2J个频率段,各个频率范围的计算公式如下:If the sampling frequency of the signal is fs , according to the Nyquist sampling theorem, the measurable frequency range of the signal is [0, fs /2]; because within the range of the signal frequency, the distribution range of the detail signal and the approximate signal is symmetrical, when the decomposition scale is 1, [0, fs /4] and [ fs /4, fs /2] are the frequency ranges of the approximate signal and the detail signal. After performing J wavelet packet decompositions on the signal f(n) with a sampling frequency of fs , the signal is decomposed into 2J frequency segments. The calculation formulas for each frequency range are as follows:

若设采样频率为fs kHz,信号要求的最低识别频率为fmin,根据式(5),其最大分解尺度J应满足:If the sampling frequency is fs kHz, the minimum recognition frequency required by the signal is fmin . According to equation (5), the maximum decomposition scale J should satisfy:

即:Right now:

本申请实例中的信号采样率fs为2000kHz,故完整声信号的范围为0-1000kHz。根据实际应用经验,分解尺度一般选取J=3~4即能满足要求。对声信号进行3尺度小波包分解,分解树结构如图3所示。从中可以看出第三层得到了23=8个频率段,每个频率段的频率区间为1000/8=125kHz,各区间对应频率段如表1所示。The signal sampling rate fs in the example of this application is 2000kHz, so the range of the complete sound signal is 0-1000kHz. According to practical application experience, the decomposition scale is generally selected as J=3~4 to meet the requirements. The sound signal is decomposed by 3-scale wavelet packet, and the decomposition tree structure is shown in Figure 3. It can be seen that the third layer obtains 2 3 = 8 frequency segments, and the frequency interval of each frequency segment is 1000/8=125kHz. The corresponding frequency segments of each interval are shown in Table 1.

小波包分解后得到了各个频段的重构波形信号(图4所示为本发明研究的倾斜角度45°、表观水速5m/s、表观气速1.6m/s时,原始信号小波包分解重构图),求重构波形信号的范数平方作为各节点的小波包能量。After wavelet packet decomposition, the reconstructed waveform signals of each frequency band are obtained (Figure 4 shows the wavelet packet decomposition and reconstruction diagram of the original signal when the inclination angle is 45°, the apparent water velocity is 5m/s, and the apparent air velocity is 1.6m/s studied in the present invention), and the norm square of the reconstructed waveform signal is calculated as the wavelet packet energy of each node.

步骤5、确定BP神经网络初始结构Step 5: Determine the initial structure of the BP neural network

一般设计神经网络应优先考虑3层网络(即有1个隐层),增加隐藏层数可以降低网络误差,提高精度,但也使网络复杂化,从而增加了网络的训练时间和出现“过拟合”的倾向。Generally, when designing a neural network, three-layer networks (i.e., one hidden layer) should be given priority. Increasing the number of hidden layers can reduce network errors and improve accuracy, but it also complicates the network, thereby increasing the training time of the network and the tendency to "overfit".

本发明设计使用的神经网络为3层网络。The neural network designed and used in the present invention is a 3-layer network.

以声信号平均电压电平、均方根值、绝对能量值、振铃计数四种统计参数和2J个频率段处小波包能量(重构波形的范数平方)等共计4+2J个特征值,作为BP神经网络输入层的输入量,当J为3时,此数为8;因此输入层的节点数和输入的统计特征的个数相同,为4+2J个。The four statistical parameters of the acoustic signal, namely the average voltage level, root mean square value, absolute energy value, and ringing count, and the wavelet packet energy (square norm of the reconstructed waveform) at 2 J frequency bands, totaling 4+2 J eigenvalues, are used as the input of the BP neural network input layer. When J is 3, this number is 8; therefore, the number of nodes in the input layer is the same as the number of input statistical features, which is 4+2 J.

输出层的节点数1;隐藏层的节点数由计算隐含层元素个数的经验公式确定,常用的经验公式如下:The number of nodes in the output layer is 1; the number of nodes in the hidden layer is determined by the empirical formula for calculating the number of elements in the hidden layer. The commonly used empirical formula is as follows:

h=2*m+1 (8)h=2*m+1 (8)

其中,h为隐含层节点的数目,m为输入层节点数;根据经验公式,当J=3时,计算得到隐含层节点数应为25;Among them, h is the number of hidden layer nodes, m is the number of input layer nodes; according to the empirical formula, when J=3, the number of hidden layer nodes is calculated to be 25;

为了便于计算与比较,需要将输入层和输出层神经元进行归一化处理,归一化的公式为:In order to facilitate calculation and comparison, the input layer and output layer neurons need to be normalized. The normalization formula is:

其中,α为归一化处理后的特征值,xi为归一化处理前的特征值,xmax、xmin分别为归一化处理前特征值的最大值和最小值,i是特征值序号,表示第i个特征值,i∈1,……,n;ymax、ymin是归一化后期望的最大值和最小值,一般默认为1和-1。Among them, α is the eigenvalue after normalization, xi is the eigenvalue before normalization, xmax and xmin are the maximum and minimum values of the eigenvalue before normalization, respectively, i is the eigenvalue sequence number, indicating the i-th eigenvalue, i∈1,…,n; ymax and ymin are the expected maximum and minimum values after normalization, which are generally defaulted to 1 and -1.

定义流动参数——管道压降或持液率为输出层,即输出层只有一个神经元。Define the flow parameters - pipeline pressure drop or liquid holdup as the output layer, that is, the output layer has only one neuron.

考虑到持液率和压降的特点,输入层、隐藏层和输出层之间使用线性传递函数,该传递函数具有可以在任意数值范围内缩放的优势,方便与样本值比较。训练函数采用trainlm函数,即L-M反向传播算法。经过多次试验,训练次数设为1000,训练目标设为10-5,学习速率设置为0.1。Considering the characteristics of liquid holdup and pressure drop, a linear transfer function is used between the input layer, hidden layer and output layer. This transfer function has the advantage of being able to be scaled within any numerical range, which is convenient for comparison with sample values. The training function uses the trainlm function, i.e., the LM back propagation algorithm. After many experiments, the number of trainings was set to 1000, the training target was set to 10 -5 , and the learning rate was set to 0.1.

本实例以管道压降或持液率为目标,表2、表3为基于声发射-GA-BP神经网络识别流动参数实施举例。This example targets pipeline pressure drop or liquid holdup. Tables 2 and 3 are examples of the implementation of flow parameter identification based on acoustic emission-GA-BP neural network.

步骤6、确定遗传算法中种群大小、编码长度和适应度Step 6: Determine the population size, encoding length and fitness in the genetic algorithm

遗传算法是从随机选择的初始解开始,通过基于上一代群体中的个体(即染色体)的选择、交叉、变异操作选代以产生新的解。The genetic algorithm starts with a randomly selected initial solution and generates a new solution through selection, crossover, and mutation operations based on the individuals (i.e., chromosomes) in the previous generation population.

设置种群大小:遗传算法着眼种群,即多个给定初始解的集合,每个初始解被称为个体,也就是染色体。迭代运算时,种群大小不变,种群中的染色体在问题解空间内不断发生改变,因此,种群大小会影响迭代速率,在实际问题解决的过程中应按照实际情况具体分析确定最初种群的规模和位置,一般在20~100之间。根据经验和重复试验,本发明实施例(J=3,即3尺度小波包分解时)的最优种群大小为40。Set the population size: The genetic algorithm focuses on the population, that is, a set of multiple given initial solutions, each of which is called an individual, or chromosome. During iterative operations, the population size remains unchanged, and the chromosomes in the population are constantly changing in the problem solution space. Therefore, the population size will affect the iteration rate. In the process of solving actual problems, the size and position of the initial population should be determined according to the actual situation. It is generally between 20 and 100. According to experience and repeated tests, the optimal population size of the embodiment of the present invention (J=3, i.e., 3-scale wavelet packet decomposition) is 40.

编码是将数据转换成染色体,即遗传空间内固定形式与长度的基因串结构数据。本发明设计使用二进制编码,即用二进制字符集{0,1}中的0和1代表问题的候选解。Encoding is to convert data into chromosomes, that is, genetic string structure data of fixed form and length in genetic space. The present invention is designed to use binary encoding, that is, 0 and 1 in the binary character set {0,1} are used to represent candidate solutions to the problem.

编码位数往往根据实际问题给出,一般在5~20之间。本实例应用的是12-25-1的三层神经网络,因此共有12×25×1=325个权值,25+1=26个阈值。经过多次试验,本实例最优二进制编码位数为10,因此每个个体的编码长度为:(325+26)×10=3510。The number of coding bits is often given according to the actual problem, usually between 5 and 20. This example uses a 12-25-1 three-layer neural network, so there are 12×25×1=325 weights and 25+1=26 thresholds. After many experiments, the optimal number of binary coding bits in this example is 10, so the coding length of each individual is: (325+26)×10=3510.

遗传算法中个体的适应度值是由适应度函数判断的,适应度说明了染色体的优劣性,因此适应度函数对问题计算出可比较的非负结果,再由后续选择算子进行比较。适应度函数采用以下几种方法:The fitness value of an individual in a genetic algorithm is determined by a fitness function. The fitness describes the quality of the chromosome. Therefore, the fitness function calculates comparable non-negative results for the problem, which are then compared by subsequent selection operators. The fitness function uses the following methods:

1.适应度函数由目标函数直接转化1. The fitness function is directly transformed from the objective function

求最大值:g(x)=f(x) (10)Find the maximum value: g(x) = f(x) (10)

求最小值:g(x)=-f(x) (11)Find the minimum value: g(x) = -f(x) (11)

2.倒数法2. Countdown method

求最大值: Find the maximum value:

求最小值: Find the minimum value:

式中,c为目标函数的界限保守估计值。Where c is a conservative estimate of the bounds of the objective function.

本方法的实例应用的适应度函数为排序函数,通过将后续步骤中训练得到的权值和阈值与上一代权值和阈值之间的误差进行比较,按照误差从小到大排序,进行下一步骤的计算。The fitness function used in the example application of this method is a ranking function. By comparing the errors between the weights and thresholds obtained by training in the subsequent steps and the weights and thresholds of the previous generation, the errors are sorted from small to large, and the calculation of the next step is performed.

步骤7、遗传算子的选择Step 7: Selection of genetic operators

包括选择算子的选择、交叉算子的选择和变异算子的选择。It includes the selection of selection operator, crossover operator and mutation operator.

选择算子是为了从当前群体中选择出优良染色体,让这些染色体繁殖出下一代群体。染色体通过适应度函数计算出的适应度越高,保留在下一代乃至多个子代的机会越高。The selection operator is to select excellent chromosomes from the current population and let these chromosomes reproduce the next generation population. The higher the fitness of the chromosome calculated by the fitness function, the higher the chance of being retained in the next generation or even multiple generations.

选择算子的常用算法包括轮盘赌选择法、基于排名的选择法、随机遍历抽样法和锦标赛选择法。本方法使用随机遍历抽样法,每个个体被选择的几率相等,为个体总数的倒数;Common algorithms for selecting operators include roulette wheel selection, ranking-based selection, random traversal sampling, and tournament selection. This method uses random traversal sampling, where each individual has an equal chance of being selected, which is the inverse of the total number of individuals;

本方法使用单点交叉算子:This method uses a single-point crossover operator:

设两个父串分别为x=[x1,x2,L,xn]和y=[y1,y2,L,yn],叉点为k,那么生成的子代为:Suppose the two parent strings are x = [x 1 , x 2 , L, x n ] and y = [y 1 , y 2 , L, y n ], and the cross point is k, then the generated offspring is:

x'=[x1,x2,L,xk,yk+1,yk+2,L,yn] (14)x'=[x1,x2,L, xk ,yk + 1 ,yk + 2 ,L, yn ] (14)

y'=[y1,y2,L,yk,xk+1,xk+2,L,xn] (15)y'=[y 1 ,y 2 ,L,y k ,x k+1 ,x k+2 ,L,x n ] (15)

单点交叉中,染色体的断点只有一个,若父串的长度为n,则单点交叉有(n-1)种不同交叉结果;In a single-point crossover, there is only one breakpoint on the chromosome. If the length of the parent string is n, then the single-point crossover has (n-1) different crossover results;

交叉概率一般取值在0.4~0.9之间,经多次计算,本发明实施例的最优交叉概率选为0.7。The crossover probability generally takes a value between 0.4 and 0.9. After multiple calculations, the optimal crossover probability in the embodiment of the present invention is selected as 0.7.

本方法中,变异算子是指随机选择的某个染色体有一定的概率去改变数据,通常作为一个产生新物种的辅助手段,具有局部搜索能力,进一步扩展了种群的多样性。变异算子通过确定种群中染色体的范围,确定基因位置,通过给定的变异概率对该位置的基因进行变异操作。In this method, the mutation operator refers to a randomly selected chromosome with a certain probability to change the data. It is usually used as an auxiliary means to generate new species. It has local search capabilities and further expands the diversity of the population. The mutation operator determines the range of chromosomes in the population, determines the gene position, and mutates the gene at that position with a given mutation probability.

变异概率的取值范围一般在0.001~0.1之间,若大于0.5,遗传算法退化为随机搜索。经多次计算,本发明实施例的最优变异概率为0.01。对于本发明应用的二进制编码,变异就是指随机把某一位的0或者1进行对调,例如:The value range of mutation probability is generally between 0.001 and 0.1. If it is greater than 0.5, the genetic algorithm degenerates into a random search. After multiple calculations, the optimal mutation probability of the embodiment of the present invention is 0.01. For the binary code used in the present invention, mutation refers to randomly swapping a certain bit of 0 or 1, for example:

如上所示,第1位和第6位产生了变异;As shown above, mutations occurred at positions 1 and 6;

步骤8、计算最优权值和阈值Step 8: Calculate the optimal weights and thresholds

在选定的管道倾斜角度下,选取不少于150组不同表观气体速度和表观液体速度组合流动工况的测量声发射信号,然后利用步骤3和步骤4计算每个工况声发射信号的4+2J个特征参数,选取全部工况的60%作为训练样本,40%作为测试样本;选择与训练样本对应的压降或持液率作为训练样本结果,选择与测试样本对应的压降或持液率作为测试样本结果;将训练样本、测试样本、训练样本结果(压降或持液率)、测试样本结果(压降或持液率)参数归一化;At the selected pipeline inclination angle, select no less than 150 groups of measured acoustic emission signals of different flow conditions with different superficial gas velocity and superficial liquid velocity combinations, then use steps 3 and 4 to calculate 4+2 J characteristic parameters of the acoustic emission signals of each condition, select 60% of all conditions as training samples, and 40% as test samples; select the pressure drop or liquid holdup corresponding to the training samples as the training sample results, and select the pressure drop or liquid holdup corresponding to the test samples as the test sample results; normalize the parameters of the training samples, test samples, training sample results (pressure drop or liquid holdup), and test sample results (pressure drop or liquid holdup);

将归一化后的训练样本、训练样本结果、测试样本、测试样本结果带入步骤5的BP神经网络进行训练,得到初始权值和阈值;Bring the normalized training samples, training sample results, test samples, and test sample results into the BP neural network of step 5 for training to obtain initial weights and thresholds;

然后进行遗传算法优化计算,根据步骤6中设置的种群大小、编码形式和适应度函数对权值和阈值进行适应度计算,利用步骤7设置的遗传算子进行迭代;Then, the genetic algorithm optimization calculation is performed, and the fitness calculation of the weight and threshold is performed according to the population size, encoding form and fitness function set in step 6, and the genetic operator set in step 7 is used for iteration;

经过遗传算子的迭代后,得到下一代种群;通过步骤6设置的适应度函数对种群进行评价,当迭代次数达到预先给定数值时迭代停止,此时得到最优权值和阈值;After the iteration of the genetic operator, the next generation population is obtained; the population is evaluated by the fitness function set in step 6, and the iteration stops when the number of iterations reaches a predetermined value, at which time the optimal weight and threshold are obtained;

迭代次数的选择范围是200次以下;当达到设定的迭代次数时,得到的最优个体为BP神经网络的最优权值和阈值。经多次计算验证,综合考虑迭代时间,本实例给定的最大迭代次数即最大遗传代数为50,The range of the number of iterations is less than 200; when the set number of iterations is reached, the optimal individual is the optimal weight and threshold of the BP neural network. After multiple calculations and verifications, considering the iteration time, the maximum number of iterations given in this example, that is, the maximum genetic generation, is 50.

步骤9、模型准确性检验Step 9: Model Accuracy Test

将得到的最优权值和阈值重新赋给神经网络,将测试样本代入BP神经网络,比较计算输出结果与真实结果,如果计算误差在5%以下,模型建立成功,若不满足计算误差,重复进行步骤6和步骤7,直到计算误差满足设计要求;此时的BP神经网络即为经过遗传算法优化过的最优BP神经网络。The optimal weights and thresholds are reassigned to the neural network, and the test samples are substituted into the BP neural network. The calculated output results are compared with the actual results. If the calculated error is below 5%, the model is successfully established. If the calculated error does not meet the requirements, steps 6 and 7 are repeated until the calculated error meets the design requirements. The BP neural network at this time is the optimal BP neural network optimized by the genetic algorithm.

步骤10、海洋油气混输管道系统的压降和持液率参数计算Step 10: Calculation of pressure drop and liquid holdup parameters for offshore oil and gas mixed pipeline system

然后利用步骤1中布置在管道外壁上的声发射传感器(1)采集声发射信号,以步骤3的方式计算声信号参数,以步骤4的方式计算声信号的小波包能量,并将所得参数和小波包能量输入到经上述步骤训练后得到的最优模型中,即可得到海洋油气混输管道系统的压降和持液率参数。Then, the acoustic emission sensor (1) arranged on the outer wall of the pipeline in step 1 is used to collect the acoustic emission signal, the acoustic signal parameters are calculated in the manner of step 3, the wavelet packet energy of the acoustic signal is calculated in the manner of step 4, and the obtained parameters and wavelet packet energy are input into the optimal model obtained after training in the above steps, so that the pressure drop and liquid holdup parameters of the marine oil and gas mixed transmission pipeline system can be obtained.

实施例Example

当J=3时,本发明的方法如下:如图1基于声发射技术的两相流流动参数识别流程图。When J=3, the method of the present invention is as follows: as shown in FIG1 , a flow chart of two-phase flow parameter identification based on acoustic emission technology.

通过在管内流动充分发展段安装声发射传感器采集声发射信号。当管道内表观气速、表观液速均为零时,进行空管采集,将空管信号中的最大值设定为阈值电压。Acoustic emission sensors are installed in the fully developed section of the flow in the pipe to collect acoustic emission signals. When the apparent gas velocity and apparent liquid velocity in the pipe are both zero, empty pipe collection is performed, and the maximum value of the empty pipe signal is set as the threshold voltage.

当管道的气液两相流动处于不同流动状态时,通过声发射传感器采集两相流声信号。在采集声发射信号的同时,通过压差传感器和双平行电导探针测得压降和持液率。When the gas-liquid two-phase flow in the pipeline is in different flow states, the two-phase flow acoustic signal is collected by the acoustic emission sensor. While collecting the acoustic emission signal, the pressure drop and liquid holdup are measured by the pressure difference sensor and the dual parallel conductivity probes.

对上一步骤采集到的声发射信号根据公式1~4和阈值电压计算平均电压电平、均方根值、绝对能量值和振铃计数。The average voltage level, root mean square value, absolute energy value and ring count of the acoustic emission signal collected in the previous step are calculated according to formulas 1 to 4 and the threshold voltage.

对声发射信号进行小波包分析,得到不同流动状态在各个频段的分布。本申请实例中的信号采样率为2000kHz,故完整声信号的范围为0-1000kHz。根据实际应用经验,分解尺度一般选取J=3~4即能满足要求。对声信号进行了3尺度小波包分解,小波基函数为Symlets8,分解树结构如图3所示。从中可以看出第三层得到了23=8个频率段,每个频率段的频率区间为1000/8=125kHz,各区间对应频率段如表1所示。图4为环状流原始信号经过小波包分解得到的各节点信号重构图。通过求重构波形信号的范数平方,提取得到各节点的小波包参数。The acoustic emission signal is subjected to wavelet packet analysis to obtain the distribution of different flow states in each frequency band. The signal sampling rate in the example of this application is 2000kHz, so the range of the complete acoustic signal is 0-1000kHz. According to practical application experience, the decomposition scale is generally selected as J=3~4 to meet the requirements. The acoustic signal was decomposed into 3-scale wavelet packets, the wavelet basis function is Symlets8, and the decomposition tree structure is shown in Figure 3. It can be seen that the third layer obtains 2 3 = 8 frequency bands, and the frequency interval of each frequency band is 1000/8 = 125kHz. The corresponding frequency bands of each interval are shown in Table 1. Figure 4 is a reconstruction diagram of the signal of each node obtained by wavelet packet decomposition of the original signal of the annular flow. By calculating the norm square of the reconstructed waveform signal, the wavelet packet parameters of each node are extracted.

BP神经网络的输入层为12个特征值,即声信号平均电压电平、均方根值、绝对能量值、振铃计数和8个节点处重构波形信号的范数平方。BP神经网络的输出层为流动参数,本实例中为压降或持液率。根据方程8,计算得到隐含层节点数应为25。The input layer of the BP neural network is 12 eigenvalues, namely, the average voltage level, RMS value, absolute energy value, ring count and the norm square of the reconstructed waveform signal at 8 nodes. The output layer of the BP neural network is the flow parameter, which is the pressure drop or liquid holdup in this example. According to Equation 8, the number of hidden layer nodes is calculated to be 25.

GA-BP神经网络训练步骤如图5所示。在同一倾角下选择200组不同表观气速和表观液速下实验工况的声发射信号,计算提取特征参数,选择120作为训练样本,80组作为测试样本。与训练样本对应的压降或持液率作为训练样本结果,与测试样本对应的压降或持液率作为测试样本结果。将训练样本、训练样本结果、测试样本、测试样本结果按照公式9归一化处理后输入步骤5建立的BP神经网络得到初始权值和阈值。按照步骤7和步骤8对最初权值和阈值进行遗传算法优化,具体设定为种群大小40;二进制编码;最大遗传代数50代;交叉为单点交叉算子,概率0.7;变异概率0.01,选择算子的方法为随机遍历抽样法。当后代满足适应度函数条件或迭代次数达到预先给定数值,停止遗传算法计算,输出得到最优权值和阈值。The training steps of the GA-BP neural network are shown in Figure 5. 200 groups of acoustic emission signals of experimental conditions with different superficial gas velocities and superficial liquid velocities were selected at the same inclination angle, and the characteristic parameters were calculated and extracted. 120 groups were selected as training samples and 80 groups were selected as test samples. The pressure drop or liquid holdup corresponding to the training samples was used as the training sample results, and the pressure drop or liquid holdup corresponding to the test samples was used as the test sample results. The training samples, training sample results, test samples, and test sample results were normalized according to formula 9 and input into the BP neural network established in step 5 to obtain the initial weights and thresholds. The initial weights and thresholds were optimized by genetic algorithm according to steps 7 and 8, and the specific settings were as follows: population size 40; binary coding; maximum genetic generation 50 generations; crossover was a single-point crossover operator with a probability of 0.7; mutation probability 0.01, and the method of selecting operators was random traversal sampling. When the offspring meets the fitness function conditions or the number of iterations reaches a predetermined value, the genetic algorithm calculation is stopped, and the optimal weights and thresholds are output.

将得到的最优权值和阈值赋给步骤5建立的BP神经网络,按照步骤9进行模型准确性检验,若满足误差要求,模型建立成功,不满足误差要求,重复进行步骤7和步骤8,直到附有最优权值和阈值的BP神经网络满足误差要求。将待识别的声发射信号特征参数输入具有最优权值和阈值的BP神经网络模型,即可识别压降或持液率流动参数。The obtained optimal weights and thresholds are assigned to the BP neural network established in step 5, and the model accuracy is tested according to step 9. If the error requirements are met, the model is successfully established. If the error requirements are not met, steps 7 and 8 are repeated until the BP neural network with the optimal weights and thresholds meets the error requirements. The characteristic parameters of the acoustic emission signal to be identified are input into the BP neural network model with the optimal weights and thresholds to identify the pressure drop or liquid holdup flow parameters.

为了对比BP神经网络和GA-BP神经网络的差异性,本发明列举了相同管道运行条件下,BP神经网络和GA-BP神经网络的误差对比,如表2、表3所示。每个倾角下各有100组工况数据对模型进行验证。对比可见本文改进后模型预测效果显著提高。In order to compare the differences between the BP neural network and the GA-BP neural network, the present invention lists the error comparison of the BP neural network and the GA-BP neural network under the same pipeline operating conditions, as shown in Table 2 and Table 3. 100 sets of operating data at each inclination angle are used to verify the model. The comparison shows that the prediction effect of the improved model is significantly improved.

本发明以倾斜角度为45度管道的压降和持液率为例,在模型完成训练学习后,进行了100组工况的神经网络识别验证,如表4、表5所示(篇幅限制,仅列出前20组)。在本次实例中,100组压降和持液率的平均误差分别为4.87%和3.91%,可见满足工业应用。The present invention takes the pressure drop and liquid holdup of a pipeline with an inclination angle of 45 degrees as an example. After the model completes training and learning, a neural network recognition verification of 100 groups of working conditions is performed, as shown in Table 4 and Table 5 (due to space limitations, only the first 20 groups are listed). In this example, the average errors of the 100 groups of pressure drop and liquid holdup are 4.87% and 3.91% respectively, which can be seen to meet industrial applications.

表1小波包分解各节点的频率范围Table 1 Frequency range of each node in wavelet packet decomposition

节点node (3,0)(3,0) (3,1)(3,1) (3,2)(3,2) (3,3)(3,3) 频率段/kHzFrequency band/kHz 0-1250-125 125-250125-250 250-375250-375 375-500375-500 节点node (3,4)(3,4) (3,5)(3,5) (3,6)(3,6) (3,7)(3,7) 频率段/kHzFrequency band/kHz 500-625500-625 625-750625-750 750-875750-875 875-1000875-1000

表2BP神经网络和GA-BP神经网络预测管道持液率误差对比Table 2 Comparison of the error of pipeline liquid holdup predicted by BP neural network and GA-BP neural network

表3BP神经网络和GA-BP神经网络预测管道压降误差对比Table 3 Comparison of pipeline pressure drop prediction errors between BP neural network and GA-BP neural network

Claims (7)

1. The method for measuring the flow parameters of the GAs-liquid two-phase flow based on the acoustic emission-GA-BP neural network is characterized by comprising the following steps of:
step 1, setting a threshold according to environmental noise
An acoustic emission sensor (1) is arranged on the outer wall of an inclined pipeline or a vertical high-pressure pipeline within the range of 20-90 degrees of the marine oil-gas mixing and conveying system;
When the gas speed and the liquid speed in the pipeline are zero, carrying out empty pipe acquisition, and setting the maximum value in an empty pipe signal as a threshold voltage;
Step 2, collecting the acoustic signals, the pressure difference and the liquid holdup
When the gas-liquid two-phase flow of the pipeline is in the working condition of different gas-liquid flow rate combinations, acquiring two-phase flow acoustic signals through an acoustic emission sensor (1); synchronously recording pressure difference and liquid holdup through a pressure difference sensor and a double parallel conductivity probe while collecting acoustic signals, and training and verifying a neural network model established in the subsequent step;
step 3, calculating acoustic signal parameters under each flow condition
Carrying out statistical analysis on the acquired original waveform data of the acoustic signal, and calculating to obtain the amplitude value, the average voltage level, the root mean square value, the absolute energy value and the ringing count of the acoustic signal;
Amplitude AMP, in dB, is defined as:
wherein V max is the maximum value of voltage data in the two-phase flow acoustic signal, and the unit is V;
Average voltage level ASL, in dB, is defined as:
wherein V mean is the average value of voltage data in the two-phase flow acoustic signal, and the unit is V;
root mean square RMS, unit V, defined as:
V is the voltage signal of each data point in the two-phase flow acoustic signal, and the unit is V; n is the number of acoustic signal data points;
Absolute energy value ABS, unit J, defined as:
v is the voltage signal of each data point in the two-phase flow acoustic signal, and the unit is V;10KΩ as a reference resistance; t is sampling time, unit s;
Ringing count Counts, which indicates the number of oscillations of the signal crossing the threshold, i.e., the number of effective peaks exceeding the threshold voltage;
When the correlation between the flow parameters and each statistical parameter is analyzed, the amplitude value AMP is found to have strong randomness in a large time window and is basically uncorrelated with the flow parameters, so that the amplitude value AMP is omitted;
step 4, analyzing wavelet packet of acoustic signal under each gas-liquid flow rate
The wavelet packet is composed of a series of wavelet packet basis functions, and as different wavelet packet bases have different time-frequency characteristics, different wavelet packet bases can obtain different results for the same signal, so that the selection of a proper wavelet packet base is very important to accurately extract the signal characteristics;
step 4.1, selecting wavelet packet basis function
Selecting Symlets8 wavelet basis function to decompose wavelet packet;
step 4.2, decomposing the wavelet packet
If the sampling frequency of the signal is f s, according to the Nyquist sampling theorem, the measurable frequency range of the signal is [0, f s/2 ]; since the distribution ranges of the detail signal and the approximate signal are symmetrical in the range of the signal frequency, when the decomposition scale is 1, [0, f s/4 ] and [ f s/4,fs/2 ] are the frequency ranges of the approximate signal and the detail signal, after the signal f (n) with the sampling frequency f s is subjected to J times of wavelet packet decomposition, the signal is decomposed into 2 J frequency segments, and the calculation formulas of the frequency ranges are as follows:
If the sampling frequency is f s kHz, the minimum identification frequency required by the signal is f min, and according to the formula (5), the maximum decomposition scale J should satisfy:
Namely:
the decomposition scale is selected from J=3 to 4; after the wavelet packet is decomposed, a reconstructed waveform signal of each frequency band is obtained, and the norm square of the reconstructed waveform signal is calculated to be used as the wavelet packet energy of each node;
step 5, determining the initial structure of the BP neural network
Designing a 3-layer neural network; the average voltage level, root mean square value, absolute energy value and ringing count of acoustic signals and the wavelet packet energy at2 J frequency segments, namely the norm square of the reconstruction waveform, are taken as the input quantity of the BP neural network input layer, wherein the total number of the characteristic values is 4+2 J; therefore, the number of nodes of the input layer is the same as the number of the input statistical features, and is 4+2 J;
The node number 1 of the output layer; the number of nodes of the hidden layer is determined by an empirical formula for calculating the number of hidden layer elements, and the conventional empirical formula is as follows:
h=2*m+1 (8)
Wherein h is the number of hidden layer nodes, and m is the number of input layer nodes;
In order to facilitate calculation and comparison, the input layer neurons and the output layer neurons need to be normalized, and the normalized formula is as follows:
wherein, alpha is the characteristic value after normalization processing, x i is the characteristic value before normalization processing, x max、xmin is the maximum value and the minimum value of the characteristic value before normalization processing, i is the characteristic value serial number, and i is the i-th characteristic value, i is epsilon 1, … … and n; y max、ymin is the maximum and minimum values expected after normalization, defaulting to 1 and-1;
Defining flow parameters-pipeline pressure drop or liquid holdup as an output layer, namely, the output layer has only one neuron;
Step 6, determining the population size, the coding length and the adaptability in the genetic algorithm
The genetic algorithm starts from an initial solution of random selection, and generates a new solution by selecting generations based on the selection, crossover and mutation operations of individuals in the previous generation population;
setting the population size: genetic algorithms look at populations, i.e., a collection of a plurality of given initial solutions, each of which is called an individual, i.e., a chromosome, with a population size between 20 and 100;
The coding is to convert the data into chromosome, namely, the genetic string structure data with fixed form and length in genetic space, and binary coding is used, namely, 0 and 1 in a binary character set {0,1} are used for representing candidate solutions of the problem;
the number of coding bits is between 5 and 20;
the fitness value of the individual in the genetic algorithm is judged by a fitness function, the fitness is used for illustrating the merits of the chromosome, so that the fitness function calculates a comparable non-negative result for the problem and then the non-negative result is compared by a subsequent selection operator;
The applied fitness function is a sorting function, and the weight and the threshold value obtained by training in the subsequent step are compared with the error between the weight and the threshold value of the previous generation, and the calculation of the next step is carried out according to the sorting from small error to large error;
step 7, selecting genetic operators
The method comprises the steps of selecting a selection operator, selecting a crossover operator and selecting a mutation operator;
Using a random traversal sampling method, wherein the probability of each individual being selected is equal and is the reciprocal of the total number of the individuals;
The crossover operator is the most important component in the genetic algorithm and is the core of operation, and common crossover operators comprise a single-point crossover operator and a two-point crossover operator, and the single-point crossover operator is used:
let two parent strings be x= [ x 1,x2,L,xn ] and y= [ y 1,y2,L,yn ], respectively, and the fork point be k, then the generated child is:
x'=[x1,x2,L,xk,yk+1,yk+2,L,yn] (14)
y'=[y1,y2,L,yk,xk+1,xk+2,L,xn] (15)
In the single-point crossing, the number of breakpoints of the chromosome is only one, and if the length of a father string is n, the single-point crossing has (n-1) different crossing results;
the value of the cross probability is between 0.4 and 0.9,
The mutation operator is a random selected chromosome with a certain probability to change data, and is usually used as an auxiliary means for generating new species, has local searching capability, and further expands the diversity of the population;
The value range of the variation probability is between 0.001 and 0.1;
Step 8, calculating the optimal weight and threshold value
Under the selected inclination angle of the pipeline, selecting at least 150 groups of measurement acoustic emission signals of different apparent gas speeds and apparent liquid speed combined flow working conditions, calculating 4+2 J characteristic parameters of the acoustic emission signals of each working condition by utilizing the step 3 and the step 4, and selecting 60% of all working conditions as training samples and 40% as test samples; selecting the pressure drop or the liquid holdup corresponding to the training sample as a training sample result, and selecting the pressure drop or the liquid holdup corresponding to the test sample as a test sample result; normalizing the training sample, the test sample, the training sample result and the test sample result parameters;
carrying out training on the normalized training samples, training sample results, test samples and test sample results in the BP neural network in the step 5 to obtain initial weights and thresholds;
then, genetic algorithm optimization calculation is carried out, fitness calculation is carried out on the weight and the threshold value according to the population size, the coding form and the fitness function set in the step 6, and iteration is carried out by utilizing the genetic operator set in the step 7;
After iteration of genetic operators, obtaining a next generation population; evaluating the population by the fitness function set in the step 6, and stopping iteration when the iteration times reach a preset value, so as to obtain an optimal weight and a threshold;
The selection range of the iteration times is below 200 times; when the set iteration times are reached, the obtained optimal individuals are the optimal weight and the threshold of the BP neural network;
step 9, model accuracy inspection
Re-assigning the obtained optimal weight and threshold value to the neural network, substituting the test sample into the BP neural network, comparing the calculated output result with the real result, if the calculated error is less than 5%, successfully establishing the model, and if the calculated error is not satisfied, repeating the steps 6 and 7 until the calculated error satisfies the design requirement; the BP neural network is the optimal BP neural network optimized by the genetic algorithm;
Step 10, calculating pressure drop and liquid holdup parameters of marine oil-gas mixed transportation pipeline system
And then, acquiring acoustic emission signals by using the acoustic emission sensors (1) arranged on the outer wall of the pipeline in the step 1, calculating acoustic signal parameters in a step 3 mode, calculating wavelet packet energy of the acoustic signals in a step 4 mode, and inputting the obtained parameters and the wavelet packet energy into an optimal model obtained after training in the steps, so that pressure drop and liquid holdup parameters of the marine oil-gas mixed transportation pipeline system can be obtained.
2. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network according to claim 1, wherein in step 4, j=3 is selected as the wavelet packet decomposition scale.
3. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network according to claim 1, wherein in step 5, a linear transfer function is used among the input layer, the hidden layer and the output layer, a trainlm function is used as a training function, i.e. an L-M back propagation algorithm, the training frequency is set to 1000, the training target is set to 10 -5, and the learning rate is set to 0.1.
4. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network according to claim 2, wherein in step 6, 10 is taken as the optimal binary coding bit number.
5. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network as set forth in claim 4, wherein in said step 6, 0.7 is selected as the optimal crossover probability.
6. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network as recited in claim 5, wherein in said step 7, 0.01 is used as the optimal variation probability.
7. The method for measuring flow parameters of GAs-liquid two-phase flow based on acoustic emission-GA-BP neural network of claim 6, wherein in said step 8, the maximum number of iterations, i.e., the maximum number of genetic algebra, is 50.
CN202010985935.5A 2020-09-18 2020-09-18 GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network Active CN112114047B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010985935.5A CN112114047B (en) 2020-09-18 2020-09-18 GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010985935.5A CN112114047B (en) 2020-09-18 2020-09-18 GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network

Publications (2)

Publication Number Publication Date
CN112114047A CN112114047A (en) 2020-12-22
CN112114047B true CN112114047B (en) 2024-07-05

Family

ID=73801318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010985935.5A Active CN112114047B (en) 2020-09-18 2020-09-18 GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network

Country Status (1)

Country Link
CN (1) CN112114047B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113159139B (en) * 2021-04-01 2022-08-09 哈尔滨工业大学 Damage state diagnosis method based on improved acoustic emission density clustering
CN113836797A (en) * 2021-09-01 2021-12-24 西安石油大学 Prediction method for moisture pipe liquid holdup based on GA-BP neural network
CN116588692B (en) * 2023-07-19 2023-09-26 湖南捷工医疗科技有限公司 Pneumatic logistics transportation multi-transmission bottle continuous receiving system and method

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103543210A (en) * 2013-11-14 2014-01-29 南京航空航天大学 Pressurized pneumatic transmission flow type detection device and method based on acoustic emission technology
CN107392250A (en) * 2017-07-25 2017-11-24 中国石油大学(华东) A kind of Method for Discriminating Gas-liquid Two Phase Flow

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5600073A (en) * 1994-11-02 1997-02-04 Foster-Miller, Inc. Method and system for analyzing a two phase flow
US5741980A (en) * 1994-11-02 1998-04-21 Foster-Miller, Inc. Flow analysis system and method
EP2198121A1 (en) * 2007-08-31 2010-06-23 Saudi Arabian Oil Company Artificial neural network models for determining relative permeability of hydrocarbon reservoirs
CN108090658A (en) * 2017-12-06 2018-05-29 河北工业大学 Arc fault diagnostic method based on time domain charactreristic parameter fusion
CN107991384B (en) * 2017-12-21 2023-10-13 浙江启尔机电技术有限公司 Device and method for detecting flow pattern of gas-liquid two-phase flow in microtubule
CN109839332B (en) * 2018-12-17 2021-04-13 天津大学 A pressure drop prediction method for horizontal oil-water two-phase flow based on dynamic contact angle

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103543210A (en) * 2013-11-14 2014-01-29 南京航空航天大学 Pressurized pneumatic transmission flow type detection device and method based on acoustic emission technology
CN107392250A (en) * 2017-07-25 2017-11-24 中国石油大学(华东) A kind of Method for Discriminating Gas-liquid Two Phase Flow

Also Published As

Publication number Publication date
CN112114047A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
CN112114047B (en) GAs-liquid flow parameter detection method based on acoustic emission-GA-BP neural network
JP6872077B2 (en) Water pipe leak detection method
CN111664365B (en) Oil and gas pipeline leakage detection method based on improved VMD and 1DCNN
Liu et al. A leak detection method for oil pipeline based on Markov feature and two-stage decision scheme
CN111881723B (en) Automatic identification method and system for lightning ground flashback waveform and electronic equipment
CN110675036B (en) Plateau river ecological health evaluation method based on random forest optimization microbial index
Zhang et al. Deep convolutional neural network probability imaging for plate structural health monitoring using guided waves
CN102809718A (en) Ultra-high-frequency partial discharge signal identification method for gas insulated switchgear (GIS)
CN111896616B (en) Gas-liquid two-phase flow pattern identification method based on acoustic emission-BP neural network
CN110879254A (en) An Acoustic Emission Signal Detection Method for Rail Cracks Based on Improved Least Square Generative Adversarial Network
CN109886433A (en) A method for intelligently identifying defects in urban gas pipelines
CN112308124B (en) An intelligent anti-stealing method for electricity consumption information collection system
Xu et al. Rail defect detection method based on recurrent neural network
CN114487129B (en) Flexible material damage identification method based on acoustic emission technology
Yang et al. Teacher–student uncertainty autoencoder for the process-relevant and quality-relevant fault detection in the industrial process
CN117540277B (en) A lost circulation warning method based on WGAN-GP-TabNet algorithm
Ikeda et al. Hammering acoustic analysis using machine learning techniques for piping inspection
CN113239618A (en) Gas pipeline detection and identification method based on acoustic signal characteristic analysis
CN113361383A (en) Porcelain insulator damage neural network identification method based on genetic algorithm characteristic parameter optimization
CN112446168A (en) Effluent BOD concentration soft measurement method based on MIC and RBFNN
Saleem et al. Real-Time Pipeline Leak Detection: A Hybrid Deep Learning Approach Using Acoustic Emission Signals.
CN116773654A (en) Intelligent pipeline defect detection device and detection method based on circumferential guided waves
CN116955902A (en) Multi-sampling rate soft measurement method based on weighted quality-driven autoencoder
CN115099261A (en) CFRP grinding and polishing processing surface roughness prediction method and system based on acoustic emission signals
Haotian et al. Intelligent Detection of Partial Discharge Based on Deep Integration Modeling with Multi-BP Neural Networks

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant