Fractional order water tank liquid level identification method based on PS0-ADAM algorithm
By using the PSO-ADAM algorithm to identify the fractional-order CARMA nonlinear model in the tank level system, the problem of inaccurate modeling of the water tank level system in the prior art is solved, and the identification effect of high precision and rapid convergence is achieved.
Patent Information
- Application Number
- CN202311603757.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-03-18
AI Technical Summary
When modeling a water tank level system in the prior art, it is difficult to fit the actual model well, especially the order and parameter selection of the sampling mechanism modeling are insufficient.
The fractional-order water tank level identification method based on the PSO-ADAM algorithm is adopted to establish a fractional-order CARMA nonlinear model and identify the model parameters using the PSO-ADAM algorithm.
It achieves a faster convergence speed and high convergence accuracy, which can be better suited for modeling and parameter identification of fractional tank level systems.
Smart Images

Figure CN119647232A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of water supply system identification, and in particular to a fractional-order water tank liquid level identification method based on a PSO-ADAM algorithm. Background Art
[0002] With the gradual development of society, high-rise buildings have become the main living and working space for urban residents. The water volume of urban water supply tanks can no longer meet the living water requirements of residents. Secondary pressurized water supply has become the most common water supply method. The secondary pressurized water supply system is mainly composed of water tanks and power distribution facilities. Among them, the water tank is an important part of the secondary pressurized water supply facilities, and its main function is to adjust the difference between the user's water consumption and the water supply within a certain period of time. In order to better analyze and predict the water supply process, it is necessary to establish a corresponding system model for the water tank and identify the parameters of the established model. To this end, researchers have also proposed different identification methods, such as: Newton iteration algorithm, least squares algorithm and particle swarm algorithm.
[0003] The Newton iteration algorithm is an iterative algorithm. Each step requires solving the inverse matrix of the Hessian matrix of the objective function, and the calculation is relatively complicated. The least squares algorithm has the problem of data saturation due to the increase in data volume in the process of tracking time-varying parameters. Although the particle swarm algorithm as a swarm intelligence algorithm can be well applied in different working conditions, the generation of new individuals depends on the organic combination within and between groups, which has certain limitations.
[0004] The literature points out that for water tank level systems, people generally use the first-order or second-order plus pure lag method or the state space method to model the water tank level system based on the CARMA model. The order of the model and the choice of model parameters cannot match the actual model well. The CARMA model is a complete model that describes the characteristics of the system. It can not only describe the input and output relationship of the system, but also describe the color of the noise. While estimating some coefficients, it also estimates the noise characteristic coefficients. Our invention uses the PSO-ADAM algorithm to identify the fractional-order water tank level model in order to solve the problem that the general sampling mechanism modeling of the water tank level cannot match the actual object well.
[0005] How to solve the above technical problems is the subject faced by the present invention. Summary of the invention
[0006] The purpose of the present invention is to provide a fractional-order water tank level identification method based on PSO-ADAM algorithm, which has faster convergence speed and higher convergence accuracy and can be well applied to modeling and parameter identification of fractional-order water tank level system.
[0007] The present invention is achieved by the following measures: The present invention provides a fractional-order water tank level identification method based on the PSO-ADAM algorithm, which specifically includes the following steps:
[0008] Step 1) Establish the input and output mathematical model of the fractional-order water tank level system. Establishing a mathematical model can help us improve the efficiency and accuracy of problem solving. By abstracting the actual problem into a mathematical model, we can accurately describe and analyze it, so as to solve the problem more effectively, and also help us deeply understand the essence of the problem and discover the laws and connections.
[0009] Step 2) Construct the identification process of the PSO-ADAM algorithm. Constructing the identification process of the algorithm allows us to accurately classify new data and quickly process large amounts of data, helping us better understand the model.
[0010] As a further optimization scheme of the fractional-order water tank level identification method based on the PSO-ADAM algorithm provided by the present invention, the specific modeling steps of step 1) are as follows:
[0011] (1-1) Construct the structure of a fractional-order CARMA nonlinear model of a water tank level system.
[0012] (1-2) Based on this model, the CARMA nonlinear model expression of the fractional-order water tank level system is constructed as follows:
[0013]
[0014]
[0015]
[0016] The meaning of each symbol in the above formula is: μ(t) is the model input signal, ε(t) is the model output signal, v(t) is a signal with a mean of 0 and a variance of σ 2 And the white noise satisfies Gaussian distribution, the intermediate variable is an unmeasurable signal, q is the unit delay symbol, A(q), B(q), and C(q) are polynomials in q with the following definitions:
[0017]
[0018]
[0019]
[0020] Among them, the polynomial factor a i , b j and d w is the parameter to be estimated and γ is the fractional order of the polynomial.
[0021] The present invention adopts the Grünwald Letnikov (GL) definition to solve the fractional derivative. The GL definition can be expressed as:
[0022]
[0023] where Δ is the discrete fractional difference operator, Δ γ x(zh) is the γ-order fractional derivative of the function x(zh), let t=zh, where h is the sampling interval and z is the number of samples for calculating the derivative approximation.
[0024] The output of the nonlinear link in the model is in polynomial form and can be expressed as:
[0025]
[0026] in, are the unknown coefficients that need to be identified, while the order γ of the polynomial function is known;
[0027] (1-3) The identification model of the CARMA nonlinear model of the fractional-order water tank level system is obtained:
[0028]
[0029] In the above formula, φ(t) is the information vector of the system, expressed as:
[0030]
[0031] θ is the parameter vector of the system, expressed as:
[0032] Among them, a, b, c, and d are defined as:
[0033]
[0034]
[0035]
[0036]
[0037] Define the criterion function J(θ(t)) as:
[0038]
[0039] Taking the gradient of the criterion function, we get
[0040]
[0041] The further design of the parameter identification method of the fractional-order water tank level system CARMA nonlinear model based on the PSO-ADAM algorithm is that the step 2) is specifically as follows:
[0042] Step 2-1) Initialization, given the number of cycles L;
[0043] Step 2-2) The output of the proportional valve is used as the input data μ(t) of the liquid level tank system model, and the liquid level height value of the water column B is used as the output data ε(t);
[0044] Step 2-3) The ε(t) and nonlinear parts in the information vector The input signal μ(t) and the unmeasured noise v(t) are replaced by their estimated values and According to formula (7)
[0045]
[0046] Step 2-4) V(t) is the first-order moment estimate and S(t) is the second-order moment estimate. The first-order moment estimate after bias correction is calculated according to equations (11) and (10): Bias-corrected second moment estimates
[0047]
[0048]
[0049]
[0050]
[0051] β=w*v+c1*(p i -x i )+c2*(p g -x i ) (12)
[0052] x i =x i-1 +v (13)
[0053] Where β is the exponential weighted average method, the inertia weight w is 0.7, the learning factor (c) and the learning factor (c2) are both 0.4, v is the flight speed, p i 、p g 、x i They represent the optimal position of an individual, the optimal position of a group, and the position of an individual respectively;
[0054] Step 2-5) Calculate according to formula (14)
[0055]
[0056] Where r(t) is the initial learning step size, η = 0.000001; Step 2-6) Calculate the fractional derivative of the intermediate variable according to the GL definition of formula (4)
[0057] Step 2-7) determines whether the maximum number of cycles has been reached. If not, the program jumps to step 2-3). If reached, it goes to step 2-8); outputs the result and completes the identification.
[0058] Compared with the prior art, the present invention has the following beneficial effects:
[0059] (1) The present invention establishes a model for parameter identification of the fractional-order water tank level CARMA nonlinear system, takes the output of the proportional valve as input data, and uses the PSO-ADAM algorithm to identify the model parameters; Figure 4 It can be seen that the algorithm can identify the internal parameters of the model very well.
[0060] (2) Compared with the F-SG algorithm, the PSO-ADAM algorithm updates the variables and noise in each cycle to obtain an estimated information vector, and uses the exponential weighted average method to avoid the identification process from falling into a non-optimal value. When the appropriate inertia weight is selected, the probability of PSO-ADAM finding the optimal position is higher, which improves the convergence speed. The PSO-ADAM algorithm can better identify nonlinear systems, and the identification accuracy is also higher, and the estimation error is smaller; at the same time, it also shows that this identification method has good applicability to the fractional-order water tank level CARMA nonlinear model. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0062] Figure 1 This is an overall flow chart of the fractional-order water tank level CARMA nonlinear system identification method based on the PSO-ADAM algorithm provided by the present invention.
[0063] Figure 2 A schematic diagram of the fractional-order water tank liquid level of the fractional-order water tank liquid level parameter identification method based on the PSO-ADAM algorithm provided by the present invention.
[0064] Figure 3 A schematic diagram of a general model of the fractional-order water tank level parameter identification method of the PSO-ADAM algorithm provided by the present invention.
[0065] Figure 4Schematic diagram of the error between the PSO-ADAM algorithm identification parameters and the true values in the present invention.
[0066] Figure 5 Schematic diagram of the error between the F-SG algorithm identification parameters and the true values in the present invention. DETAILED DESCRIPTION
[0067] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. Of course, the specific embodiments described here are only used to explain the present invention and are not used to limit the present invention.
[0068] Example 1
[0069] See also Figures 1 to 4 The technical solution provided in this embodiment is a fractional-order water tank level identification method based on PSO-ADAM algorithm, and the specific steps are as follows:
[0070] Step 1) Establish the input-output mathematical model of the fractional-order water tank level system.
[0071] Step 2) Construct the identification process of the PSO-ADAM algorithm.
[0072] As a further optimization scheme of the fractional-order water tank level system identification method based on the PSO-ADAM algorithm provided in this embodiment, the specific modeling steps of step 1) are as follows:
[0073] (1-1) Construct the structure of a fractional-order CARMA nonlinear model of a water tank level system.
[0074] (1-2) Based on this model, the CARMA nonlinear model expression of the fractional-order water tank level system is constructed as follows:
[0075]
[0076]
[0077]
[0078] The meaning of the symbols in the above formula is: μ(t) is the model input signal, ε(t) is the model output signal, v(t) is a signal with a mean of 0 and a variance of σ 2 And the white noise satisfies Gaussian distribution, the variable is an unmeasurable signal, q is the unit delay symbol, A(q), B(q), and D(q) are polynomials in q with the following definitions:
[0079]
[0080]
[0081]
[0082] Among them, the polynomial factor a i , b j and d w is the parameter to be estimated and γ is the fractional order of the polynomial.
[0083] The Grünwald Letnikov (GL) definition is used to solve the fractional derivatives. The GL definition is expressed as:
[0084]
[0085] where Δ is the discrete fractional difference operator, Δ γ x(zh) is the γ-order fractional derivative of the function x(zh), let t=zh, where h is the sampling interval and z is the number of samples for calculating the derivative approximation.
[0086] The output of the nonlinear link in the model is in polynomial form, expressed as:
[0087]
[0088] in, are the unknown coefficients that need to be identified, while the order γ of the polynomial function is known;
[0089] (1-3) The identification model of the CARMA nonlinear model of the fractional-order water tank level system is obtained:
[0090]
[0091] In the above formula, φ(t) is the information vector of the system, expressed as:
[0092]
[0093] θ is the parameter vector of the system, expressed as:
[0094] Among them, a, b, c, and d are defined as:
[0095]
[0096]
[0097]
[0098]
[0099] Define the criterion function J(θ(t)) as:
[0100]
[0101] Taking the gradient of the criterion function, we get
[0102]
[0103] Preferably, the model in step 1) is a fractional-order CARMA nonlinear model.
[0104] Preferably, the specific steps of step 2) constructing the identification process of the PSO-ADAM algorithm are as follows:
[0105] Step 2-1) Initialization, given the number of cycles L;
[0106] Step 2-2) The output of the proportional valve is used as the input data μ(t) of the liquid level tank system model, and the liquid level height value of the water column B is used as the output data ε(t);
[0107] Step 2-3) The ε(t) and nonlinear parts in the information vector The input signal μ(t) and the unmeasured noise v(t) are replaced by their estimated values and According to formula (7)
[0108]
[0109] Step 2-4) V(t) is the first-order moment estimate and S(t) is the second-order moment estimate. The first-order moment estimate after bias correction is calculated according to equations (11) and (10): Bias-corrected second moment estimates
[0110]
[0111]
[0112]
[0113]
[0114] β=w*v+c1*(p i -x i )+c2*(p g -x i ) (12)
[0115] x i =x i-1 +v (13)
[0116] Where β is the exponential weighted average method, the inertia weight w is 0.7, the learning factor (c) and the learning factor (c2) are both 0.4, v is the flight speed, p i 、p g 、x i They represent the optimal position of an individual, the optimal position of a group, and the position of an individual respectively;
[0117] Step 2-5) Calculate according to formula (14)
[0118]
[0119] Where r(t) is the initial learning step size, η = 0.000001;
[0120] Step 2-6) Calculate the fractional derivative of the intermediate variable according to the GL definition of formula (4)
[0121] Step 2-7) determines whether the maximum number of cycles has been reached. If not, the program jumps to step 2-3). If reached, it goes to step 2-8); outputs the result and completes the identification.
[0122] The schematic diagram of the fractional-order water tank level system used in this embodiment is as follows: Figure 2 As shown. Among them, μ(t) is the output of the pressure proportional valve of the liquid level tank, and ε(t) is the liquid level height value of the water column B.
[0123] Through the above-mentioned fractional-order CARMA model, the following model can be established in this embodiment:
[0124] A(q)=1+a1q -γ +a2q -2γ =1-0.524q -γ +0.616q -2γ
[0125] B(q)=1+b1q -γ +b2q -2γ =1+1.165q -γ +0.962q -2γ
[0126] D(q)=1+d1q -γ +d2q -2γ =1+0.048q -γ -0.544q -2γ
[0127]
[0128]
[0129] Fractional order γ = 0.7
[0130] Comparing the above model with step 1), we can get
[0131] a1=-0.524, a2=0.616, b1=1.165, b2=0.962,
[0132] c1=0.700, c2=-0.907, d1=0.048, d2=-0.544
[0133] In order to conveniently substitute the parameters to be identified into the PSO-ADAM algorithm, the parameters to be identified are combined into a parameter vector θ, and the parameters to be identified are as follows:
[0134] θ=[a1,a2,b1,b2,c1,c2,d1,d2],
[0135] Initialize according to step 2-1) and give a given number of loops L;
[0136] According to step 2-2), the input and output data of the fractional-order water tank level system model are obtained;
[0137] Calculate the estimated value φ(t) of the information vector according to step 2-3);
[0138] Calculate the bias-corrected first-order moment estimate according to steps 2-4) Bias-corrected second moment estimates
[0139] Update the estimated value of the parameter vector according to steps 2-5)
[0140] Calculate the fractional derivative according to step 2-6)
[0141] Complete the loop according to step 2-7) and step 2-8) and output the result.
[0142] Among them, several issues need to be considered when setting the number of loops L: if the number of loops is too small, the identification result will be unsatisfactory, thus resulting in low identification accuracy. If the number of loops is too large, it will cause a large amount of calculation.
[0143] The parameter identification results of the fractional-order water tank level model parameter identification method based on the PSO-ADAM algorithm of this embodiment are as follows: Figure 4 As shown. It can be seen that the identification accuracy of this method is high, and the estimated value of the parameter to be identified is very close to the true value. At the same time, it also shows that this identification method has good applicability for parameter identification of fractional-order water tank level model.
[0144] Example 2
[0145] See also Figure 5 The technical solution provided in this embodiment is a fractional-order water tank level identification method using a random algorithm with a forgetting factor, and the specific steps are as follows:
[0146] Step 1) Establish the input-output mathematical model of the fractional-order water tank level system.
[0147] Step 2) Construct the identification process of the random algorithm with forgetting factor.
[0148] Preferably, the specific steps of step 2) constructing the identification process of the random algorithm with forgetting factor are as follows:
[0149] Step 2-1) Initialization, given the number of loops L,;
[0150] Step 2-2) The output of the proportional valve is used as the input data μ(t) of the water tank level system model, and the liquid level height value of the water column B is used as the output data ε(t);
[0151] Step 2-3) The ε(t) and nonlinear parts in the information vector The input signal μ(t) and the unmeasured noise v(t) are replaced by their estimated values and According to formula (15),
[0152]
[0153] Step 2-4) Calculate the new information vector e(t) according to formula (16);
[0154]
[0155] Step 2-5) Calculate r(t) according to formula (17);
[0156]
[0157] Step 2-6) Calculate the estimated value of the parameter vector according to formula (18)
[0158]
[0159] Step 2-7) Calculate the fractional derivative of the intermediate variable according to the GL definition of formula (4)
[0160] Step 2-8) determines whether the maximum number of cycles has been reached. If not, the program jumps to step 2-3). If reached, it proceeds to step 2-9);
[0161] Step 2-9) Output the result and complete the identification.
[0162] The schematic diagram of the fractional-order water tank level system used in this embodiment is as follows: Figure 2 As shown. Among them, μ(t) is the output of the pressure proportional valve of the liquid level tank, and ε(t) is the liquid level height value of the water column B.
[0163] Through the above-mentioned fractional-order CARMA model, the following model can be established in this embodiment:
[0164] A(q)=1+a1q -γ +a2q -2γ =1-0.524q -γ +0.616q -2γ
[0165] B(q)=1+b1q -γ +b2q -2γ =1+1.165q -γ +0.962q -2γ
[0166] D(q)=1+d1q -γ +d2q -2γ =1+0.048q -γ -0.544q -2γ
[0167]
[0168]
[0169] Fractional order γ = 0.7
[0170] Comparing the above model with step 1), we can get
[0171] a1=-0.524, a2=0.616, b1=1.165, b2=0.962,
[0172] c1=0.700, c2=-0.907, d1=0.048, d2=-0.544
[0173] In order to conveniently substitute the parameters to be identified into the random algorithm with forgetting factor, the parameters to be identified are combined into a parameter vector, and the parameters to be identified are as follows:
[0174] θ=[a1,a2,b1,b2,c1,c2,d1,d2],
[0175] Initialize according to step 2-1) and give a given number of loops L;
[0176] According to step 2-2), the output of the proportional valve is used as the input data μ(t) of the liquid level tank system model, and the liquid level height value of the water column B is used as the output data ε(t);
[0177] Calculate the estimated value φ(t) of the information vector according to step 2-3);
[0178] Calculate the new information vector e(t) according to step 2-4);
[0179] Calculate r(t) according to step 2-5);
[0180] Update the estimated value of the parameter vector according to step 2-6)
[0181] Calculate the fractional derivative according to step 2-7)
[0182] Complete the loop according to step 2-8) and step 2-9) and output the result.
[0183] Among them, several issues need to be considered when setting the number of loops L: if the number of loops is too small, the identification result will be unsatisfactory, thus resulting in low identification accuracy. If the number of loops is too large, it will cause a large amount of calculation.
[0184] The parameter identification results of the fractional-order water tank level model parameter identification method using the random algorithm with forgetting factor of this embodiment are as follows: Figure 5 As shown. It can be seen that the identification accuracy of this method is smaller than that of the PSO-ADAM algorithm.
[0185] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A fractional-order water tank level identification method based on PSO-ADAM algorithm, characterized in that: The following steps are involved: Step 1) establishing an input-output mathematical model of a fractional-order water tank level system; Step 2) Construct the identification process of the PSO-ADAM algorithm.
2. The fractional-order water tank level identification method based on PSO-ADAM algorithm according to claim 1 is characterized in that: The modeling steps of step 1) are as follows: (1-1) Construct a structure of a fractional-order CARMA nonlinear model of a water tank level system; (1-2)(1-2)Based on this model, the CARMA nonlinear model expression of the fractional-order water tank level system is constructed as follows: Among them, μ(t) is the model input signal, ε(t) is the model output signal, and v(t) is a signal with a mean of 0 and a variance of σ. 2 And the white noise satisfies Gaussian distribution, the intermediate variable is an unmeasurable signal, q is the unit delay symbol, A(q), B(q), and D(q) are polynomials in q with the following definitions: Among them, the polynomial factor a i , b j and d w is the parameter to be estimated, γ is the fractional order of the polynomial; The Grünwald Letnikov definition is used to solve the fractional derivatives. The GL definition is expressed as: where Δ is the discrete fractional difference operator, Δ γ x(zh) is the γ-order fractional derivative of the function x(zh), let t = zh, where h is the sampling interval and z is the number of samples for calculating the derivative approximation; The output of the nonlinear link in the model is in polynomial form, expressed as: in, is the unknown coefficient that needs to be identified, and the order γ of the polynomial function is known; (1-3) the identification model of the CARMA nonlinear model of the fractional-order water tank level system is obtained: In the above formula, φ(t) is the information vector of the system, expressed as: θ is the parameter vector of the system, expressed as: Among them, a, b, c, and d are defined as: Define the criterion function J(θ(t)) as: Taking the gradient of the criterion function, we get 3. The fractional-order water tank level identification method based on PSO-ADAM algorithm according to claim 2 is characterized in that: The model in step 1-1 is a fractional-order CARAM nonlinear model.
4. The fractional-order water tank level identification method based on PSO-ADAM algorithm according to claim 1 is characterized in that: The steps of constructing the identification process of the PSO-ADAM algorithm in step 2) are as follows: Step 2-1) Initialization, given the number of cycles L; Step 2-2) The output of the proportional valve is used as the input data μ(t) of the water tank level system model, and the liquid level height value of the water column B is used as the output data ε(t); Step 2-3) The ε(t) and nonlinear parts in the information vector The input signal μ(t) and the unmeasured noise v(t) are replaced by their estimated values and According to formula (7) Step 2-4) V(t) is the first-order moment estimate and S(t) is the second-order moment estimate. The first-order moment estimate after bias correction is calculated according to equations (11) and (10): Bias-corrected second moment estimates β=w*v+c1*(p i -x i )+c2*(p g -x i ) (12) x i =x i-1 +v (13) Where β is the exponential weighted average method, the inertia weight w is 0.7, the learning factor (c) and the learning factor (c2) are both 0.4, v is the flight speed, p i 、p g 、x i They represent the optimal position of an individual, the optimal position of a group, and the position of an individual respectively; Step 2-5) Calculate according to formula (14) Where r(t) is the initial learning step size, η = 0.000001; Step 2-6) Calculate the fractional derivative of the intermediate variable according to the GL definition of formula (4) Step 2-7) determines whether the maximum number of cycles has been reached. If not, the program jumps to step 2-3). If reached, it proceeds to step 2-8); Step 2-8) Output the result and complete the identification.