Air conditioning predictive control for rail transit vehicles based on load prediction

. This paper proposes a predictive control method for rail vehicle air-conditioning systems. Due to heat transfer and diffusion, the air-conditioning system is a long-time-delay system. However, most air-conditioning systems use feedback control, which has problems such as long transition time, system shock, and mismatch between air cooling capacity and load, resulting in the waste of energy. Combined with feedforward and feedback control, a predictive control method with dynamic correction is proposed to solve this problem. Based on the load prediction, the real-time indoor temperature feedback link is added to send the cold air into the room in advance, which makes the room temperature stable, and the energy-saving effect significant. In the study, variance analysis of environmental factors is performed to improve the accuracy of the load prediction system, and the mean relative error (MRE) of the prediction reached 0.0112. By comparing the simulation results of predictive control and feedback control, it is proved that the predictive control with correction has a smoother room temperature curve. The energy-saving rate is about 25.2%.


Introduction
The air conditioning system is one of the main energyconsuming systems on rail transit vehicles. According to the analysis of energy consumption statistics of operating lines, the air-conditioning system energy consumption accounts for about 30% of the vehicle energy consumption. Energy conservation of air-conditioning systems has been valued in various buildings. Many studies have proposed some energy-saving methods, such as fuzzy control or neural network control [1], adaptive con1trol [2], heat storage, robust control, etc. However, the airconditioning system is a time-delay system with a long lag time. The lagging response of room temperature to regulation and heat source interference has a great influence on room temperature control effect and system energy-saving [3,4]. Due to heat transfer and gas diffusion, when a command is inputted to the system at the current moment, the indoor temperature and humidity cannot reach the expected control target until ∆t time. It means that after the control command was issued, the load demand or operating condition may change before the controlled variable respond. Therefore, the system often runs under unmatched loads, resulting in a waste of energy and poor stability of indoor control. Airconditioning systems mostly use feedback control. The system has a strong anti-interference ability and high control accuracy, but also has problems such as long transition time and system shock. Most traditional airconditioning energy-saving measures have this problem. The control strategy is studied to eliminate the effect of indoor temperature delay on the control during the operation and adjustment of the air conditioning system [5]. Rail transit vehicles have short operating lines, frequent passenger boarding, and rapid environmental changes [6], so the system lag will seriously affect the energy-saving control of air-conditioning systems. For this problem, predictive control can be a suitable solution. However, there are two problems to be solved for the prediction control. One is the prediction system accuracy, and the other is the adjustment method of the control system.
There have been many studies on load prediction. Load prediction methods mainly include building energy consumption simulation, multiple regression analysis, time series, grey theory, artificial neural network, etc. [7]. Reference [8] established a regression model of commercial building energy consumption based on the outdoor temperature and compared the predicted results with actual energy consumption. Reference [9] used onevariable linear regression to obtain the function of the building envelope load and the temperature difference between indoor and outdoor, and finally calculated the building cold load. Reference [10] used historical load data to establish a model for predicting the next day airconditioning load, and the prediction results were in good agreement with the measured results. Reference [11] used short-term indoor and outdoor temperature differences, heating energy consumption, and indoor load test data to establish a neural network model to predict long-term heating energy consumption. Reference [12] compared the prediction results of the neural network with the prediction results of the physical model and proved the accuracy of the neural network.
In terms of predictive control of air conditioning systems, to solve the lag, scholars have proposed methods including Smith estimation pre-compensation [13], model predictive control [14,15], Elman neural network multi-step [16], etc. Reference [15] proved that model predictive control could help reduce peak energy consumption and significantly reduce the operating costs of buildings. Literature [16] proposed a method for indoor temperature predictive control based on the multistep predictive model of Elman neural network for the predictive control of indoor temperature time-delay in VAV air-conditioning systems. Literature [17] proposed a robust model predictive control strategy, which can improve the supply air conditioning control of the air handling unit by directly dealing with related uncertainties and constraints.
In summary, there are many studies on load prediction at present, but few on load prediction for rail transit vehicles air-conditioning. Due to their characteristics, vehicle air conditioning is different from building air conditioning systems. Predictive control is mostly in the research stage, which is inconclusive and lacks in-depth research on control methods. But the predictive control method could greatly improve the comfort and stability of the indoor environment and energy saving.
This paper studies predictive control and proposes a control method based on load prediction. Firstly, the load characteristics of rail vehicles air-conditioning are analyzed, and the significance ranking of each environmental impact factor is obtained by using variance analysis, which determines the input of the load prediction model. Then establish an artificial neural network model and train it with a large amount of data until the errors meet the requirements after verification to ensure that the prediction results of the neural network are accurate and reliable. Next, determine the theoretical method of predictive control and establish an airconditioning system simulation model to verify its reliability. Finally, obtain the results of predictive control and energy-saving rate.
The structure of this paper is as follows: Section 2 discusses the research methods, including theoretical analysis and simulation model building of load prediction system and air-conditioning predictive control system. Section 3 is the training and verification of the load prediction system, using multiple evaluation criteria to determine the accuracy of the prediction system. Section 4 is the simulation calculation results and analysis of the predictive control system. Section 5 is the conclusion.

Methodologies
The predictive control method is divided into two steps, the first is prediction, and the second is control. Only by accurately predicting the amount of cooling the airconditioning system needs to supply next, can it be effectively controlled. The research method is divided into two parts, which will be detailed in the following.

Load prediction
Artificial neural network (ANN) uses network topology to imitate the human brain system. It has the characteristics of memory, autonomous learning, and optimized computing, and has been widely used in various fields. The BP neural network has a multi-layer structure, including an input layer, several hidden layers, and an output layer. The neurons in different layers are fully connected, which is very suitable for complex nonlinear objects, such as the prediction of air conditioning loads. Here we use the BP neural network for load prediction.

Load characteristics and model inputs.
There is a big difference between the air conditioning of subway vehicles and the building, because of its operating environment. Therefore, in the load prediction, it is necessary to consider its characteristics and analyze the influence of different environmental factors on the air conditioner, and take these into the prediction model.
The air conditioning load of a subway vehicle includes envelope structure heat transfer, passenger heat dissipation, electromechanical equipment heat dissipation, fresh air load, heat dissipation from the door opening, and solar radiation heat from the ground line.
The air-conditioning load shows obvious peak-to-valley differences with passenger flow and train running intervals. In terms of passenger flow, the passenger density in the carriages during peak and non-peak hours vary greatly every day, and the passenger flow on different days such as weekdays, weekends, and legal holidays also changes hugely. The number of passengers has the biggest effect on the cooling load because it determines the heat dissipation and the fresh air volume. Subway vehicles operate underground most of the time and are less affected by solar radiation, but ground lines should also be considered. As vehicles travel in the tunnel for a long time, the heat transfer of the envelope structure has a smaller effect on the load than the building envelope structure. When the train is stationary and running, the heat transfer coefficient K changes, which increases with the train running speed. Besides, the heat dissipation of the equipment in the car is lighting equipment, fans, and electrical equipment, which are fixed values and small.
The orthogonal test method is adopted. Set six influence factors and an error column: climate, body material structure, vehicle speed, passenger flow, lighting and equipment power, fresh air volume index. The first four factors are each at four levels, and the last two factors are each at two levels without interference. Subsequently, variance analysis was used for the calculation load, and the results are shown in Table 1. Remove insignificant variables based on variance analysis. Because the predictive control is in the vehicle operation phase and the body material structure is fixed, the determined input factors of the neural network should include outdoor temperature, outdoor humidity, solar radiation, number of passengers, fresh air volume, and equipment. Also, due to the heat storage of the envelope structure, the air conditioning load has a time delay to the change of the outdoor environment, so it is necessary to consider the previous environmental parameters. In building air-conditioning systems, this delay time is long and usually takes two or three hours. Because the thermal inertia of the cabin material is smaller than that of the building envelope, the delay time of the load is also short. Based on multiple model trials and verifications, the input lead time was set to one hour, t-1. Therefore, there are nine input nodes, and the output node is the air-conditioning load Q.

Neural network prediction model.
The neural network has a variety of learning algorithms. The TRAINLM algorithm is selected here, which has fast convergence speed and high accuracy. Although this algorithm occupies a large amount of memory, the vehicle air-conditioning load prediction is not a big network, so it is the most applicable algorithm.
In the training of neural networks, the hidden layer neurons number is important. Too few neurons will lead to poor fault tolerance of the network, fail to learn well, and ultimately affect the load prediction effect. Conversely, it will cause too long training time and decrease network association ability, called overfitting. The selection of the nodes number in the hidden layer currently has no strict calculation method, which can only be determined by experiments according to the training purpose and requirements. According to Kolmogorov's theorem, if the number of input layer nodes is m, the number of hidden layer nodes should be 2m+1. The number of nodes can be gradually increased or decreased based on 2m+1 during training. After several trial calculations, the model was determined to be a three-layer neural network structure with 18 hidden layer nodes.
The structure of the neural network is shown in Figure 1. Take the learning rate as Net.train Param.lr = 0.1.

Predictive control system
Based on load prediction, predictive control of the airconditioning system is performed.

Predictive control.
After predicting the airconditioning load in the room at time t 0+1 , the required cooling capacity in the room at time t 0+1 is calculated according to the environmental status of the room and sent in advance at the current time. Such a predictive control method helps adjust the air conditioning in advance when the indoor cooling load changes.
For example, when a heat source is predicted to enter the room at time t 0+1 , the temperature will gradually decrease at time t 0 . When the heat source enters, the room temperature will not exceed the design range due to the heat transfer delay. At the same time, the temperature decreases at t 0 means that the inverter compressor starts to speed up slowly at t 0 . When the room temperature reaches its peak, the cold air has been fully sent to the room. The air conditioner does not need to run at high speed suddenly, which makes the compressor operation curve more smooth. According to [18], compressor efficiency varies with speed. The highest efficiency is usually in the middle position, and the efficiency will be greatly reduced at full speed, which is consistent with our air conditioning simulation results. The main energy consumption component of the unit air-conditioning system for rail transit vehicles is the compressor. The compressor start-stop and speed greatly influence airconditioning energy consumption. Therefore, when using predictive control, the more stable operation will improve the efficiency of the air-conditioning system, with a good energy-saving effect.
Rail transit vehicle air-conditioners are all fixed air volume units and only the supply air temperature changes. The humidity requirements in the vehicle are not high. When the temperature meets the design requirements, and the air-conditioning unit supplies air at the dew point, the humidity can fully meet the requirements. After the load prediction, we calculate the supply air temperature.
The calculation formula of the sensible heat load is as follows: Where, Q is the sensible heat load, kW ; C p is the specific heat capacity, J/(kg·K) ; ρ is the air density, kg/m³; G is the supply air volume, kg/h; T o is the design temperature, °C; T s is the supply air temperature, °C.
The supply air temperature calculated based on the load is as follows: However, there is a problem with this calculation method. If there is an error in the load prediction or an error in the adjustment of the air-conditioning system, there is no link to return this error to the predictive control system, and the error will gradually accumulate and become larger. Therefore, we need to return the room temperature controlled to the predictive control system. After the correction calculation, we can get the actual supply air temperature.
Calculated as follows: Where, T N is the indoor temperature, °C ; V is the room volume, m³; ∆t is the lead time of predictive control, s.

Predictive control simulation model.
When the load prediction is realized, a complete simulation model of the air-conditioning system and the control system is built to compare and analyze the control effect and calculate the system energy-saving efficiency.
Amesim provides basic engineering components for physical modeling without refining mathematical models. It can be used for simulation of the air-conditioning system, and can also perform PID feedback control. Build an air conditioning system model in Amesim. The load prediction and predictive control system are realized in Simulink by using co-simulation.
Rail transit vehicle air-conditioners are mostly overhead unit air conditioners. Its compressors, condensers, throttling devices, evaporators, fans, and electrical devices are installed in a box to form a complete air-conditioning unit. In the simulation, the load is entered into the chamber module using the data module. Fresh air and return air are mixed and sent to the evaporator for processing and then to the chamber. Due to the variability of the control, it is set here as a variable-frequency unit. But in fact, a large part of airconditioning for rail transit vehicles still uses fixedfrequency units, and they are even less energy efficient.
The transmission interface module of Amesim and Simulink is compiled by VC ++ to realize the dynamic transmission of data. After the data is transmitted to the S-Function in Simulink, it is first normalized to meet the input requirements of the neural network. Then the trained neural network is called, and the predicted load Q is output. Based on the predicted load value, a series of calculations are performed by adding the indoor temperature. Finally, the target value of the supply air temperature is obtained and transmitted to Amesim.
There are ten groups of data transmitted by Amesim to Simulink. The first nine sets of environmental state data are used to input the trained neural network for load prediction, and the temperature at the current time t 0 in the room is used to correct the predicted load according to the indoor state. Simulink has two sets of data transmitted to Amesim. The air supply temperature at t 0 is the target of the predictive control system, and the predicted indoor load is regarded as error observation. Table 2 shows the data transmitted between Amesim and Simulink. Target supply temperature at time t 0 Outdoor dry bulb temperature one hour before t 0+1 Outdoor relative humidity at time t 0+1 Outdoor relative humidity one hour before t 0+1 Solar radiation at time t 0+1 Air-conditioning load at t 0+1 Solar radiation one hour before t 0+1

Number of personnel at time t 0+1
Fresh air volume at time t 0+1 Room temperature at time t 0 The predicted lead time ∆t mentioned above is: According to research, the lag of the air conditioning system is mainly due to the adjustment of the air conditioning system and the diffusion of the supply air in the room, which is about 5-6 minutes. In the simulation, since the carriage is set as a fixed-size chamber, the time of heat diffusion is not considered, so the advance time of predictive control in the simulation only needs to include the adjustment time of the air conditioning system. In this simulation, ∆t is about the 60s. However, in practical applications, the lead time ∆t of the predictive control system should be 5-6 minutes.

Data preprocessing for load prediction
Neural network training requires a lot of historical data.
Obtaining actual data is difficult, but energy simulation software can make up for this demand. A model was built using Trnsys according to the parameters of the subway car type B. By setting the size of the room, the material of the envelope structure, the thickness of the car wall, etc., the model is adapted to the actual situation of the subway vehicle. The number of personnel is set according to the number of subway capacity and the actual survey. Make the size change so that the predicted value is interpolated rather than extrapolated. Climate uses data from Beijing. The output data interval of the model operation is set to 0.2h, from May 1 to September 30, covering the entire air-conditioning season. Since the subway operates only during the day, nighttime temperature data will cause the neural network to fail to recognize it. Delete the data with zero loads at night, and only predict the running time from 6:20 to 23:00 during the day.

Load prediction training and verification
Use Matlab for programming and call the processed data for training. The final training data is about 51,000 sets, and 1000 sets of data are set as verification data. The number of iteration steps is 10,000.
After the network training is completed, the model needs to be tested and verified to determine whether the obtained model is accurate. Call the network and the verified data to take the predicted data. Compare with the actual data, calculate the error, and judge whether the deviation is within the allowable range. The accuracy of the load prediction model can be evaluated by the mean relative error (MRE), mean square error (MSE), and the Pearson correlation coefficient. Figure 2(a) shows the comparison between the predicted value and the actual value of these 1000 sets of data. The abscissa represents the number of data input, which reflects the specific time point. The time interval between the two adjacent data is 0.2h. The ordinate is the cooling load of the air conditioner. The solid line is the actual value, and the dotted line is the prediction result. Figure 2(b) shows the predicted relative error.
It can be seen that the prediction results are consistent with the actual data. The relative errors are within 10%, and 95% of the data are within 5%. Through statistical calculations, the mean relative error is 0.0112, the mean square error is 0.00034, and the Pearson correlation coefficient reaches 0.995. As shown in Table 3. It means that this neural network is accurate in predicting the cooling load of the air conditioner, which is enough to meet the prediction accuracy requirements.    The linear regression graph of training data and test data is shown in Figure 3. Their R values are both around 0.998.

Figure 3(a).
Linear regression of training data. Figure 3(a). Linear regression of test data.
Besides, one day's data was randomly selected for a detailed analysis of prediction results. Figure 4 is an enlarged curve of one-day prediction data. As in Figure 2, the solid line in Figure 4(a) is the actual data curve, the dashed line is the data curve of the predicted value, and Figure 4(b) is the predicted relative error curve.
It can be seen from the figure that the curves of the actual data and the predicted data mostly coincide. The data with large errors are highlighted in red on the graph.
The time with the largest error is the beginning of the morning peak period. At this time, the load change at each point is extremely large, so the prediction deviation is easy to occur. The other places with errors also are time with a big change, which conforms to the general law. But on the whole, this neural network has high prediction accuracy. Its average relative error is only 1-3%, enough to serve as the basis for predictive control.    Predictive control

Predictive control without correction
Using the co-simulation model, uncorrected predictive control is calculated first. The indoor temperature is controlled based on the predicted load of the neural network only. The method is as follows: the internal and external environmental parameters at time t 0+1 are input to a load prediction model, and the prediction model outputs the indoor instantaneous cooling load at time t 0+1 . The cold load value is input to the predictive controller, and after calculation, the supply air temperature at time t 0 in advance is obtained. At the same time, the controller gives the fresh air volume at time t 0 from the passenger flow data. At time t 0 , the deviation between the instantaneous supply air temperature and the supply air temperature output from the predictive controller is used to calculate the deviation value, which is controlled in advance by the PID controller. The flowchart is shown in Figure 5. The indoor temperature is calculated using equation (2): Here we use the meteorological environment data of the Beijing, and randomly select the summer July 21 for calculation. The simulation time is from 6:20 to 23:00, and a point is taken every 5s.
With the same environment and system parameters, simulation calculations are performed for uncorrected predictive control and feedback control, respectively.  The comparison between the actual cooling load and the predicted cooling load is shown in Figure 6. The solid black line is the actual load value, and the dashed red line is the predicted load value, with a mean relative error of 2.22%. In Figure 7, the predicted supply air temperature output by the controller is a solid black curve, and the actual supply air temperature adjusted by PID in the air-conditioning model is a red dotted curve. It can be seen from the figure that the supply air temperature meets the requirements of the predictive controller.
The air condition in the cabin of the two control methods is shown in Figure 8. The black solid line is the temperature of the feedback control, and the red dashed line is the temperature of the uncorrected predictive control. The other two dashed lines are humidity curves.
The indoor design temperature is 26°C, the control range is ±1°C, and the design humidity is 55-60%. According to the control results, it can be found that the indoor conditions have met the design requirements most of the time. But at the morning peak, the room temperature for uncorrected predictive control was slightly out of range. The main reason here is a large number of passengers enter the compartment at the same time, so the indoor temperature rises rapidly. The uncorrected predictive control system only controls based on the predicted load and does not make adjustments to the indoor real-time changes. A slight error will lead to insufficient cooling capacity in the morning peak. However, in the uncorrected predictive control, the indoor temperature at most of the day is more stable, and the fluctuation range is smaller than in the feedback control.  Figure 9. Energy consumption of two control methods. Figure 9 shows the energy consumption of the two control methods. According to calculations, the energysaving rate of uncorrected predictive control is about 26.5%.
It can be known from the simulation results that the uncorrected predictive control can achieve a good energy-saving effect, but the control effect on room temperature is insufficient. It cannot be adjusted well when the load changes greatly. It is easy to provide insufficient cooling capacity when the load suddenly changes, making the room temperature beyond the design range, which is also a disadvantage of feedforward control. The load prediction system has a larger error than the middle value when the load is maximum or minimum, which is difficult to avoid due to the nature of machine learning. Therefore, we added a real-time feedback correction link to solve this problem.

Predictive control with correction
The real-time correction link uses the indoor temperature at the current moment as one of the input data of the controller. When adjusting the air conditioning system, the predictive controller considers the deviation between the current environment and the design requirements, and then corrects the supply air temperature based on the deviation.
The method is as follows: the internal and external environmental parameters at time t 0+1 are input to a load prediction model, and the prediction model outputs the indoor instantaneous cooling load at time t 0+1 . The cold load value at time t 0+1 is input to the predictive controller together with the room temperature at time t 0 . The deviation between the indoor temperature and the design temperature at time t 0 is used to correct the input cooling capacity. After calculation, the supply air temperature at time t 0 in advance is obtained. At the same time, the controller gives the fresh air volume at time t 0 from the passenger flow data. At time t 0 , the deviation between the instantaneous supply air temperature and the supply air temperature output from the predictive controller is used to calculate the deviation value, which is controlled in advance by the PID controller. The flowchart is shown in Figure 10. The indoor temperature is calculated using equation (3): For comparison with the uncorrected predictive control in Section 4.1, the simulation of predictive control used the same environmental parameters and system parameters. Because the amount of interference does not change, the output of the load prediction system also does not change, as shown in Figure 6.
After the simulation, the predicted supply air temperature output by the prediction controller and the actual supply air temperature adjusted by PID in the airconditioning system are shown in Figure 11. It can be seen that the controller requirements are also basically met, and the lowest supply air temperature is lower than the uncorrected predictive control. The air condition in the cabin of the two control methods is shown in Figure  12. The meaning of each curve is the same as the figure in section 4.1.
We found that after adding the real-time calibration link, the indoor temperature and humidity have reached the design requirements. The indoor condition at the morning peak was within the target range, and it soon cooled down to around the design temperature of 26°C. Compared with the feedback control, the results of the predictive control are smoother, with almost no large fluctuations, and no room temperature sudden changes. Due to its predictability, predictive control has greatly improved in control stability.   The energy consumption of predictive control and feedback control is shown in Figure 13, and the energysaving rate of predictive control is about 25.2%.
In order to prove the applicability of the predictive control method, June 19th was selected to perform the simulation calculation again. The comparison between predictive control and feedback control is as follows. Figure 14 shows the indoor conditions for different control methods. Figure 15 shows the energy consumption, and the energy-saving rate is 24.3%. The conclusion is not much different from the previous simulation. Figure 14. Indoor air condition with two control methods. Figure 15. Energy consumption of two control methods.
From the results, compared with the uncorrected predictive control system, the results of predictive control with dynamic correction are significantly better. It solves the shortcomings of poor anti-interference ability and unadjustable cold output. It can adjust quickly as the indoor environment changes. Compared with the feedback control system, the predictive control system with a dynamic correction link has more stable and smooth room temperature control. There are almost no room temperature sudden changes caused by load changes. Besides, the cooling capacity of the air conditioner matches the indoor load, and the compressor is adjusted in advance according to the prediction, so the energy-saving effect is obvious.

Conclusion
This paper proposed a predictive control method for rail transit vehicle air-conditioning systems with dynamic correction. Based on the previous analysis and results, the following conclusions were obtained: (1) The load characteristics of air conditioning for rail transit vehicles were analyzed, and the significance ranking of each environmental factor was obtained using variance analysis: personnel density (F=435.20)> climate (F=19.32)> envelope (F=5.69)> fresh air volume (F=4.66)> lighting and equipment (F=3.95)> speed (nonsignificant).
(2) A load prediction model for rail vehicle airconditioning was established. After training and testing, the mean relative error of the model is 0.0112, and the Pearson correlation coefficient reaches 0.995, which proved that the prediction results of this model are accurate and reliable.
(3) Based on the load prediction, a predictive control method was proposed. The simulation results of predictive control with correction and predictive control without correction and feedback control were compared. The results of the corrected predictive control system shown that the indoor temperature is stable and changes smoothly. There were almost no room temperature sudden changes caused by load changes. The control effect was significantly better than the traditional feedback control. Also, the predictive control had a good energy-saving effect, with an energy-saving rate of 25.2% and 24.3% on different days.