Disclosure of Invention
The invention provides a method for predicting the load of a water chilling unit by using open-source water chilling unit data, which aims at the technical problem of low precision of the load prediction of the water chilling unit and is driven by fusing data and a model, and comprises the following steps: after the CVs-ELM model part and the CVA state space model part are respectively completed, a fusion driving load prediction result is output according to an average absolute percentage error strategy of each prediction result, and then the fusion driving load prediction result is compared with real data, so that the prediction accuracy in an acceptable range is obtained.
The invention provides a method for predicting the load of a water chilling unit driven by fusion of data and a model, which comprises the steps of dividing the data into a CVs-ELM model part, dividing the data into past data and future data, constructing a past and future combined matrix, calculating a cross covariance matrix, carrying out singular value decomposition on a Hankel matrix to obtain a conversion matrix, extracting multivariable data into a small number of standard variables CVs, reserving the integrity of the data, training an extreme learning machine ELM, constructing a CVs-ELM model, carrying out singular value decomposition on the Hankel matrix, further utilizing standard variable analysis CVA based on a subspace identification method to divide the standard variable space into a main space and a residual space, defining a linear combination of past observation vectors according to the residual space, obtaining a model coefficient matrix through least square recursion, obtaining a CVA state space model, and carrying out fusion driving prediction part, feeding input data into the CVs-ELM model and the CVA state space model, and carrying out a selection strategy of an average percentage error on respective prediction result to complete the fusion driving prediction. According to the invention, the standard variable analysis and the extreme learning machine are fused to complete load prediction, so that the fusion driving prediction of multiple variables and multiple models is realized, and the accuracy of load prediction is improved, which is an effective excavation and supplement of a load prediction method. In addition, the invention has wide application prospect in the aspect of energy resource management, and is expected to provide powerful support for sustainable development of the energy industry.
In order to achieve the aim of the invention, the technical scheme adopted by the invention is that the method for predicting the data and model fusion driving load comprises the following steps:
Step S1, dividing the acquired data in a period of time into past data y p(r) and future data y f(r), determining a past observation length p and a future observation length f, and setting initial values of an order n of a predictive system model.
Step S2, constructing a past and future combination matrix Y p、Yf, and calculating a covariance matrix Sigma pp、∑ff of past and future observations and a cross covariance matrix Sigma fp between the past and future observations.
And S3, constructing a Hankel matrix, carrying out singular value decomposition on the Hankel matrix, and obtaining a canonical variable Z r and a conversion matrix J based on past measured values.
And S4, projecting the conversion matrix J to the original data u to obtain the input data u' with reduced dimensions.
And S5, dividing the data x' into training data p 1、t1 and test data p 2、t2, carrying out normalization processing, creating and training an extreme learning machine model, setting the number of input layers and hidden layers N, L, and randomly initializing the connection weight IW and hidden layer bias B 1 between the input layers and the hidden layers.
And S6, calculating an output value tempH of the hidden layer, obtaining a mapping value h of the hidden layer to the sample characteristic by using a mapping function, and then calculating a connection weight LW of the hidden layer and the output layer.
And S7, repeating the step S6 for the trained model, and calculating tempH 1 and h 1 to obtain a predicted result Y ELM of the CVs-ELM model.
Step S8, the canonical variable space is further divided into a main space and a residual space by the step S3, the canonical variable Z r is obtained and expanded into an expansion vector, and then the linear combination of the past observation vectors is defined according to the residual space, so that a state vector x r、xr-1 is obtained, and the system state is determined.
And S9, a model coefficient matrix A, B, C, D is estimated through linear least square recursion, a model is built, and a prediction result Y CVA of the CVA state space model is obtained.
Step S10, for the two model prediction results, adopting a mean absolute percentage error (Mean Absolute Percentage Error, MAPE for short) selection strategy, and selecting that the error between each sample is small, so as to obtain a fusion driving load prediction result Y Parallel.
And S11, comparing the three types of prediction results with real data, and comparing the predicted performance indexes, namely average absolute Error (Mean Absolute Error, abbreviated as MAE), average relative Error (MEAN RELATIVE Error, abbreviated as MRE) and root mean square Error (Root Mean Square Error, abbreviated as RMSE), so as to obtain a conclusion.
Further, in step S1, the collected data is divided into past data y p(r) and future data y f(r), where r is expressed as a class of ordinal numbers, and p and f refer to the lengths of past and future observations, respectively.
Further, in step S2, r=p+1, p+2,..p+n is set, and a past and future combination matrix Y p、Yf is constructed, as follows.
Yp=[yp(p+1) yp(p+2) … yp(p+N)] (3)
Yf=[yf(p+1) yf(p+2) … yf(p-N)] (4)
Wherein Y p∈R、Yf e R, setting l observation variables, the last element of Y p(p+1) is Y (1),yf(p+N) and the last element is Y (l), i.e. the largest column number of Hankel matrix is n=l-p-f+1. Covariance matrices of past and future observations and cross-covariance matrices therebetween are calculated as follows.
Further, in step S3, the CVA attempts to find the best linear combination between y p(r) and y f(r) to maximize the correlation between past and future observations, which can be achieved by singular value decomposition of the Hankel matrix, as follows.
Based on past measurements, the canonical variable Z r and the transformation matrix J are derived as follows.
Further, in step S4, the transformation matrix J is projected onto the original data u to obtain the reduced-dimension input data u'.
u'=uJ (11)
Further, in step S5, the data u' is divided into training data p 1、t1 and test data p 2、t2, and normalized. The formula is as follows, where the input data p= [ P 1 p2 ], the output data t= [ T 1 t2 ].
[p1,minp,maxp,t1,mint,maxt]=premnmx(P,T) (12)
An extreme learning machine is created, the number of input layers and hidden layers is set S, L, and the connection weight IW and the hidden layer bias B 1 between the input layers and the hidden layers are initialized randomly, and the formula is as follows.
IW=2*rand(L,S)-1 (13)
B1=rand(L,1) (14)
Further, in step S6, an output value tempH of the hidden layer is calculated, a mapping value h of the hidden layer to the sample feature is obtained by using the mapping function, and then a connection weight L W of the hidden layer and the output layer is calculated, where the formula is as follows.
tempH=IW*p1+B1 (15)
LW=pinv(h′)*t1 (17)
Further, in step S7, the trained model is repeated in step S6, and tempH 1 and h 1 are calculated to obtain the predicted result Y ELM of the CVs-ELM model.
tempH1=IW*P+B1 (18)
YELM=h1′*LW (20)
Further, in step S8, the past measurement values are converted into a canonical variable space according to the conversion matrix J in step S3, which is divided into a main space and a residual space, the first Q main singular values determine the main space x r, and the remaining singular values determine the residual space r r, so that the canonical variable Z r is further expanded into an expansion vector, as follows, where V x contains the first Q columns of V,
A linear combination of past observation vectors is defined according to the residual space, so that a state vector x r、xr-1 is obtained, and the system state is determined. The formula is as follows, where 0 e R, the matrix is all zero elements,Is the past observation vector at r sampling time in the recursive modeling process.
Further, in step S9, the model coefficient matrix A, B, C, D is recursively estimated by linear least squares. The formula is as follows, wherein Xr=x(r:r+n)、Xr-1=x(r-1:r+n-1)、Yr=y(r:r+n)、Yr-1=y(r-1:r+n-1)、Ur=u(r:r+n),ur is the raw data.
xr+1Axr+Bur (28)
And constructing a state space model to obtain a predicted result Y CVA of the CVA state space model.
YCVA=Cxr+Dur (29)
Further, in step S10, an average absolute percentage error MAPE selection strategy is adopted for the two model predictions, whereinIs the predicted result, and y i is the true value. The formula is as follows.
And calculating MAPE 1 of the CVs-ELM model and MAPE 2 of the CVA state space model, and selecting a small MAPE value between each sample between the two models by using a condition conditional statement to obtain a fusion driving load prediction result Y Parallel.
Further, in step S11, the three types of prediction results are compared with the real data, and the predicted performance index MAE, MRE, RMSE is compared to obtain a conclusion. The formula is as follows.
In the above method, steps S1 to S7 are steps of building a CVs-ELM model, steps S8 to S9 are steps of building a CVA state space model, and steps S10 to S11 are steps of fusion driving prediction and concluding.
Compared with the prior art, the invention has the beneficial effects that:
1. The load prediction method provided by the invention originally introduces the idea of fusion driving prediction, and provides the water chilling unit load prediction method driven by fusion of data and a model, which obviously improves the accuracy of load prediction, realizes effective management of energy and injects new energy into the energy utilization field.
2. The invention skillfully fuses the standard variable analysis and the extreme learning machine, replaces the traditional method, creatively builds the CVs-ELM model, and can realize the effective and rapid extraction of the multi-variable complex information, thereby greatly improving the efficiency and the accuracy of information processing and providing a new way for the research and the application of the related fields.
3. According to the invention, based on the reduction of data dimension by standard variable analysis, a CVA state space model is further built, and the average absolute percentage error MAPE is used as a key selection strategy to complete fusion driving load prediction. Meanwhile, the method effectively ensures the accuracy of load prediction, provides powerful support for the research direction of load prediction, and shows great potential in practical application.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. Of course, the specific embodiments described herein are for purposes of illustration only and are not intended to limit the invention.
Example 1
The american society of heating, cooling and air conditioning engineers (ASHRAE) was established in new york in 1894 in united states, and in 2019 ASHRAE held a field of energy prediction competition that provided open source real data about water chiller units, as shown in table 1. Based on this, the method for predicting the load of the water chilling unit driven by fusion of data and a model provided by the embodiment is as follows:
TABLE 1
The number of input variables of the real data of the water chilling unit is 8, the number of output data is only 1, and the number of samples is 13615. The embodiment visually expresses the effectiveness of the load prediction method of the fusion driving water chiller, and takes part of sample data as model training test data.
The specific steps of this embodiment are as follows:
Step 1, firstly dividing the sample data u into past data y p(r) and future data y f(r), setting an observation value length p and future observation value lengths f, wherein the values of p=1, f=1, setting an initial value of an order n of a predictive system model, wherein the n=1, r represents a class of ordinal numbers, the first data y (r-1) of the embodiment is the data u (1), and the like.
Setting r=p+1, p+2, & gt, p+N, constructing a past and future combination matrix Y p、Yf,Yp∈R、Yf E R, setting l observation variables, namely that the last element of Y p(p+1) is Y (1),yf(p+N), the last element is Y (l), and the maximum column number N=l-p-f+1 of the Hankel matrix, wherein N=8;
Yp=[yp(p+1) yp(p+2) … yp(p+N)],Yf=[yf(p+1) yf(p+2) … yf(p+N)];
and 3, calculating covariance matrixes of past and future observation values and a cross covariance matrix between the covariance matrixes, and then carrying out singular value decomposition on the Hankel matrix.
Step 4, obtaining a standard variable Z r and a conversion matrix J according to the step 3, and further projecting the conversion matrix J to sample data u to obtain dimension-reduced data u';
u′=uJ;
And 5, dividing the data u' into training data P 1、t1 and test data P 2、t2, and carrying out normalization processing on input data p= [ P 1 p2 ] and output data T= [ T 1 t2 ].
[p1,minp,maxp,t1,mint,maxt=premnmx(P,T);
And 6, creating an extreme learning machine ELM, setting the number of input layers S and hidden layers L, wherein S is the number 5,L of main space dimensions and is set to be 100 in the embodiment, and randomly initializing the connection weight IW and the hidden layer bias B 1 between the input layers and the hidden layers.
IW=2*rand(L,S)-1,B1=rand(L,1);
And 7, training by using training data p 1、t1, calculating an output value tempH of the hidden layer, obtaining a mapping value h of the hidden layer to the sample characteristics by using a mapping function, and calculating a connection weight LW of the hidden layer and the output layer.
tempH=IW*p1+B1,LW=pinv(h′)*t1;
And 8, after testing by using the test data, building a CVs-ELM model, and feeding the input data P into the model to obtain a predicted result Y ELM of the CVs-ELM model.
Step 9, according to the transformation matrix J in step 3, transforming the past measured values into a canonical variable space, dividing the canonical variable space into a main space and a residual space, determining the main space x r by the first Q main singular values, and determining the residual space r r by the residual singular values, so that the canonical variable Z r is further expanded into an expansion vector, wherein V x comprises the front Q column of V.
Step 10, defining the linear combination of past observation vectors according to residual space to obtain a state vector x r、xr-1, determining the system state, 0E R, the matrix is all zero elements,Is the past observation vector at r sampling time in the recursive modeling process.
And 11, constructing a state space model after a model coefficient matrix A, B, C, D is estimated through linear least square recursion, and feeding sample data u into the model to obtain a prediction result Y CVA of the CVA state space model.
Xr=x(r:r+n)、Xr-1=x(r-1:r+n-1)、Yr=y(r:r+n)、Yr-1=y(r-1:r+n-1)、Ur=u(r:r+n);
xr+1=Axr+Bur,YCVA=Cxr+Dur;
And 12, for the two model prediction results, adopting an average absolute percentage error MAPE selection strategy, and selecting that the MAPE value between each sample between the two models is small to obtain a fusion driving load prediction result Y Parallel.
In this embodiment, simulation is performed according to the above steps, so as to obtain the load prediction accuracy of the chiller with multiple models within the receiving range, as shown in table 2.
TABLE 2 prediction accuracy with errors within 5 kWh
To more intuitively compare the three load prediction effects, the three prediction effects were compared using three indexes of Mean Absolute Error (MAE), mean Relative Error (MRE), root Mean Square Error (RMSE), as shown in table 3.
Table 3 comparison of predicted results
| Evaluation index |
MAE/kWh |
MRE/% |
RMSE/kWh |
| CVs-ELM model |
6.661 |
5.13% |
3.584 |
| CVA state space model |
2.777 |
2.08% |
0.479 |
| Fusion driving of the present invention |
1.963 |
1.48% |
0.348 |
As can be seen from the above tables 2 and 3, the fusion driving proposed in this embodiment is significantly superior to the prediction results of the CVs-ELM model part and the CVA state space model part. The load prediction accuracy of the water chilling unit is greatly improved, and breakthroughs are brought to the field of energy management. The innovative data and model fusion driving method adopted by the embodiment not only organically combines the data and the model, creates a new way for reducing the dimension, effectively digs the potential value of multiple variables, but also further builds a state space model part to carry out load prediction, and remarkably improves the accuracy of the prediction. The outstanding performance of this approach allows fusion driven predictions to achieve good results. In summary, the method for predicting the load of the water chiller driven by fusion of data and the model in the embodiment shows high adaptability and value in the aspect of energy resource prediction.
The foregoing description of the preferred embodiments of the invention is not intended to limit the invention to the precise form disclosed, and any such modifications, equivalents, and alternatives falling within the spirit and scope of the invention are intended to be included within the scope of the invention.