Modeling Simulation and Fault Analysis of Aircraft Air Conditioning System Based on Grasshopper Algorithm Improved Support Vector Machine

: To effectively analyze the working state of the air circulation system when the aircraft flies at high altitude, it is necessary to simulate and analyze on the ground. A simulated annealing-grasshopper algorithm is proposed to optimize the support vector machine ( SAGOA-SVM ). The overall simulation model of the aircraft air circulation system is established, and the fault injection analysis is carried out. The support vector machine is introduced to classify the system results. The grasshopper algorithm simulated annealing and position offset are used to optimize the support vector machine, and the optimal parameter values are obtained. The results show that the simulation system can effectively simulate the temperature changes of the aircraft under various operating conditions. The optimized support vector machine can effectively distinguish the fault types of the aircraft component outlet, and the system convergence speed is accelerated to avoid the problem of falling into the local optimal value.

A good air circulation system can not only create a comfortable air environment for the crew, but also meet the environmental temperature requirements of the flight equipment, which is of great significance to the flight safety of the aircraft.Researchers at home and abroad began to carry out dynamic simulation of aircraft system from the 1970s and 1980s.The scholars of Boeing used simulation software to simulate the gas inside the aircraft, and used experimental data to verify the simulation results, which played a great guiding role in cabin airflow control.Chinese scholars have also carried out a lot of simulation experiments on the aircraft environmental control system after 1980s.
In recent years, the development of support vector machine ( SVM ) has made rapid progress, and the related research results have been applied to many fields such as medicine, electricity and communication.
Yang [1] established a simulation system based on the mathematical model of aircraft air entraining system components, and realized fault simulation and fault mechanism analysis.Shi [2] et al.carried out co-simulation the air circulation system of aircraft, reproduced the failure of the air circulation system during flight, and analyzed the changes in the performance of the air circulation system components.Chao [3] established a more comprehensive MATLAB model and AMESim model for the air circulation system of aircraft, especially for the air flow in the cabin, and conducted an effective fault analysis for the air entraining system of aircraft.Sun [4] et al. studied the faults of aircraft air-entraining structure, and proposed a Bayesian fault prediction method for predictive maintenance using the data of aircraft condition monitoring system. The results show that this method can effectively monitor the aircraft faults.Geng [5] Based on TRNSYS software, the air supply system of aircraft is simulated, which provides theoretical support for ground detection and maintenance of aircraft air circulation system.Cao [6] et al. applied the SVM classification method to the detection and screening of primary liver cancer, and the results showed that this method could provide help for the early screening of cancer. Zhao [7] et al. combined long-short-term memory neural network ( LSTM ) and SVM to predict the displacement of tunnel rock, and the results showed that this method had good prediction effect on rock movement.Gong [8] combined grasshopper optimization algorithm ( GOA ) and SVM to predict the electric load. The results show that the combined algorithm can effectively accelerate the convergence and improve the convergence accuracy.Qi [9] fused LSTM and SVM for short-term power forecasting. The results show that the combined method can provide some reference for short-term power use of steel enterprises.Velásquez [10] et al. used SVM algorithm to study the transformer model in power system, effectively preventing local leakage and other security issues. Ahmed [11] et al. established a traffic sign detection and recognition model based on SVM to help the autonomous driving system effectively identify traffic signs.Ma [12] et al. studied a robust dual-parameterized interval SVM, which has good generalization function for SVM and can solve the binary classification problem of uncertain data.Lameski [13] et al. studied the parameter tuning of grid search SVM and its influence on the reduction of model overfitting. The results show that the performance of SVM after parameter optimization is optimized and the data can be fitted more effectively.Do [14] et al studied the parallel learning algorithm of local SVM algorithm for classification of big data sets. The results show that the parallel learning algorithm can effectively improve the classification efficiency of big data.Saremi [15] et al.
research shows that GOA can effectively optimize SVM algorithm and improve optimization efficiency.Wang [16] et al based on generalized refined composite multi-scale sample entropy and optimized SVM rolling bearing fault diagnosis research shows that the optimized SVM can improve the accuracy of bearing fault diagnosis.Gu [17] et al. studied the unified classification of bacterial colonies in different agar media based on hyperspectral imaging and machine learning. The results showed that the prediction accuracy of GOA was significantly better than that of other swarm intelligence algorithms.Sayed [18] et al. showed that the optimal foraging algorithm has a good improvement on SVM parameters.Wu [19] et al used the distance between clusters in the feature space to select the kernel parameters of SVM. The results show that the performance of SVM after kernel function optimization has been effectively improved.The results of Qin [20] et al. on parameter optimization of SVM show that the SVM after parameter optimization of classification can effectively accelerate the convergence.Zhou [21] et al. applied SVM to the inversion of organic matter content in soil spectrum, which provided theoretical support for subsequent hyperspectral remote sensing inversion. Zhang [22] applied GOA to SVM for electricity consumption prediction, and the results showed that the optimized SVM had significantly improved the accuracy of electricity consumption prediction.Wang [23] Shengsheng applied the improved SVM algorithm to electric vehicle charging station scheduling, the results show that the improved SVM can be more rapid and reasonable for power station scheduling.Cui [24] et al. studied the application of GOA in water analysis, providing reference for the comprehensive implementation of the most stringent water resources management system in Yunnan Province.In order to identify abnormal traffic, Lv [25] used GOA to improve SVM. The results show that the improved SVM algorithm has high classification accuracy and good classification performance.
The research results on aircraft air circulation system have achieved good results, which have high reference value. However, at present, there are few mathematical modeling and fault simulation of aircraft air circulation components in China and abroad. The simulation method of aircraft air circulation components is too, and there is not enough simulation data to compare with flight data for reference.Due to the limitation of SVM, there are few examples using SVM in the field of aircraft air circulation system fault analysis.
Taking a certain type of aircraft as an example, this paper uses the simulation software AMESim to model and analyze the main components of aircraft air circulation system, and proposes a fault diagnosis method of aircraft air circulation system based on improved SVM.Firstly, GOA is used to optimize the initial parameters of SVM, improve the convergence of traditional SVM algorithm and improve the optimization efficiency of SVM algorithm. Then, the data of the experimental group are imported into the system for training, and the position random offset mechanism and simulated annealing algorithm are used to optimize the system, so as to reduce the time required for optimization and avoid the system falling into local optimal value. Finally, the global optimal parameters are output, and the optimal parameter training system is used to input the test group into the system and test the training results.

System modeling
To solve the influence of unfavorable atmospheric parameters on the human body at high altitude, the airtight cockpit controlled by the air circulation system of the aircraft has become a necessary condition for the aircraft to fly at high altitude. It can solve the problems of pressurization, ventilation and temperature control at the same time, and meet the physiological needs of the human body.

Heat exchanger simulation model
In this paper, the efficiency-heat transfer unit method ( NTU ) is used for the simulation of heat exchanger, which needs to calculate the heat capacity ratio and efficiency of gas respectively. The key to build the model is the heat exchanger pressure loss, hot and cold side flow, heat exchange efficiency and inlet temperature data.
The structure, parameters and connection between the heat flowmeter and the semi-heat exchanger are shown in Figure 1. The heat flow meter in Figure 1 is connected to the two components of the semi heat exchanger in a certain order, and other complete components are added. The modeling connection and parameter data of the heat exchanger system are shown in Figure  2.Where, red k is the input end of the system, such as the temperature and pressure of air are input to one end of the heat exchanger, and then the gas enters the heat exchanger for heat exchange. The blue component is the output of the system, which can view the temperature, pressure and other data.

Turbine Compressor Simulation Model
Because the turbine and compressor are coaxial operation, so in the modeling process, the two modeling together, using both gas supply regulation. The main parameters in the modeling process are flow rate, pressure and temperature. Structures and parameters of compressors and turbines as shown in Figure 3. According to the modeling requirements, in addition to the basic data of turbine compressor operation, other turbine parameters should be provided, such as mass flow correction value, adiabatic efficiency, etc. According to the turbine characteristic curve, it is necessary to adjust the port torque, compressor speed and other parameters. Connect turbine and compressor assemblies and add input and output to form turbinecompressor assemblies. The turbinecompressor system modeling connection and parameter data are shown in Figure 4.  In the establishment of the simulation model of the air circulation machine, in addition to the heat exchanger module and the turbine compressor module, the water removal structure model is added. As shown in Figure  5, a water removal device is inserted between each two connected components. Because the air introduced by the aircraft is wet air, so if not dewatered, gradually accumulated, the humidity of the system will be too large, resulting in system error.  Figure 6. Figure 6 refers to the model of aircraft air circulation system established in reference , but the key calculation parameters such as internal temperature and pressure, gas mixing index and wall thermal conductivity in the heat exchanger are collected from the latest data of the airline.

Simulation results
The set system data are input into the system to measure the outlet temperature and pressure of each component of the aircraft air circulation system, as shown in Table 1.

Dynamic Analysis of Component Output Results
According to the simulation results, the data change process in AMESim software is adjusted. The outlet temperature and pressure of the primary ( secondary ) heat exchanger, turbine and compressor are shown in Figure 7. It can be seen from the diagram that the temperature of aircraft air circulation system components is constantly changing before 5 s, and the system is not stable. Since the gas at the inlet of the primary heat exchanger is the external high-temperature air, the temperature is high when it is unstable at the beginning, and the temperature begins to decline and tends to be stable after the cold fluid starts heat exchange. The initial air entering the compressor end comes from the unstable air in the primary heat exchanger. The temperature is too high. After compression by the compressor, the air temperature rises again, so the temperature reaches 1 000 K at the beginning. When the outlet temperature of the primary heat exchanger tends to be stable, the temperature delivered to the compressor drops, and the outlet gas temperature of the compressor drops sharply to 400 K. The temperature change curves of the secondary heat exchanger, turbine, condenser and other components are similar to those of the primary heat exchanger and compressor. After the buffer of the primary heat exchanger and compressor, the temperature change is relatively flat. Because primary heat exchanger, compressor and secondary heat exchanger are connected to the turbine, the outlet temperature of primary heat exchanger directly affects the compressor, the outlet temperature of compressor affects the secondary heat exchanger, and the outlet temperature of secondary heat exchanger affects the turbine, that is, the outlet temperature of the previous component is the inlet temperature of the next component ( the dewatering device does not affect the temperature ). Different faults may occur when the aircraft is flying, which affects the output of the system [4][5] . Therefore, it is necessary to conduct fault injection simulation research on the system.
It is assumed that the flow control and shut-off valve ( FCV ) of the system fails when the time is 20 s, which is manifested by the sudden increase of the inlet flow of the system. The outlet temperature of each component is shown in Fig. 8.  Fig. 8, except for the primary heat exchanger and compressor, the temperature changes of other components are relatively not obvious, and it is difficult to find the problem. In addition, during the flight of the aircraft, the failure phenomenon observed by the pilot is finally manifested in the outlet of the air refrigeration component ( before entering the mixing cabin ), namely the outlet temperature of the turbine.
The outlet temperature of the turbine is shown in Fig. 9 when the flow control and the shutter are shut down. It can be seen from the diagram that the outlet temperature of the turbine is about a dozen K higher than the steady state under normal conditions, which indicates that the refrigeration system fails. Heat exchanger leakage is another common fault of aircraft air circulation system. Because the heat exchanger wall is easy to damage, it is easy to leak, that is, the hot end of the input air due to pipeline defects and partial outflow. When the system is set at 25 s, the heat exchanger hot end inlet leakage occurs, and the leakage rates are 10 %, 20 %, 30 %, 40 % and 50 %, respectively. The temperature when the primary heat exchanger leaks is shown in Fig. 10. It can be seen from the figure that when the time is 25 s, the leakage fault occurs in the system, and the outlet temperature of the heat exchanger begins to decrease from the original stable 337 K. After about 4 s, when the time is 29 s, the system tends to be stable, the outlet temperature is about 326 K, and there is no significant change afterwards.
When a leakage fault occurs in the heat exchanger, the introduced hot air leakage and loss will occur at the hot end inlet of the heat exchanger. According to the law of energy conservation, the energy of the cold end air does not change, and the flow of the hot end air decreases due to leakage, so the overall energy decreases. Under the condition of losing the same energy, the hot end temperature is lower than that without leakage. From the perspective of thermodynamic formula, when the heat exchanger leakage fault occurs, the heat exchanger hot end inlet flow changes, part of the hot air flow to the outside due to the leakage of the body, resulting in heat exchanger hot end inlet flow loss, thereby reducing the mass flow of gas per second. Under the premise of no change in other conditions, the decrease of hot end flow makes the wall temperature decrease, which eventually leads to the decrease of hot end outlet temperature of heat exchanger.  Figure 10 shows that when the leakage rate increases, the decrease of hot end outlet temperature is aggravated. When the leakage rate is increasing, the hot end inlet flow is less and less, and the outlet temperature is reduced accordingly.

Failure analysis
Due to the complex and changeable external environment in flight, the temperature, pressure and humidity of the external air, as well as the wear and tear of the corresponding components of the aircraft itself, fuel supply and air flow are complex, so it is very important to effectively identify whether the air circulation system of the aircraft is faulty and the fault type. SVM has excellent performance in solving many problems, especially in classification [6][7] and pattern recognition. The ultimate goal of SVM algorithm is to find an ideal and classified hyperplane in the target area, so as to classify different types of data [8][9] ,so that the classification distance between the two types of sample data after separation reaches the maximum.
Using multiple sets of fault data of an aircraft, the number of samples collected is 572. The sample data mainly include aircraft air-entraining flow, hot-end air-entraining temperature, cold-end air-entraining temperature, hot-end air-entraining pressure, specific heat capacity of external air pressure, specific heat capacity of wall material, heat exchange efficiency of heat exchanger, air density, and outlet temperature of cooling air. The data are divided into three categories : no fault, FCV switch fault and heat exchanger leakage.
In order to train the required system correctly, ensure the scientificity, rationality and correctness of the system output, and ensure the effectiveness of the training results, in the process of data collection and processing, remove some data that is difficult to identify or confuse the system. The 554 preprocessed samples were divided into two groups, 300 randomly selected as the training data set, and the remaining 254 as the test data set. Data classification in different datasets is shown in Table 2. Note : FCV is flow control and shut-off valve.
Confusion matrix method was used to obtain the following performance evaluation data indicators : Sensitivity (Se), Specificity (Sp), Youden index (Yi), Accuracy (Acc), Receiver operating characteristic curve (ROC), Area Under Curve(AUC), and Kappa. Binary classification problem problem [6] Confusion matrix is shown in table 3.

Parameter optimization SVM model
There are many methods to optimize the SVM model [12][13][14][15][16] ,but the main optimization methods are concentrated on optimizing the penalty coefficient C and the kernel function parameter σ.These two parameters have a very important influence on SVM, and are critical to the determination of classification accuracy and system edge accuracy [17][18][19][20] .

Optimization method
Differential evolution ( DE ) algorithm can optimize the model. DE algorithm performs well in solving some nonlinear parameter problems, and is more comprehensive in the improvement of many scholars. In addition to the DE algorithm to optimize the SVM parameter method, the more common algorithms are particle swarm optimization and genetic algorithm. The particle swarm optimization algorithm is an algorithm proposed for artificial life and bird predation behavior. Compared with the traditional method, this method converges and operates faster, but the disadvantage is that the parameter preset accuracy is high and the calculation is difficult. The source of genetic algorithm is the evolution and development of nature. Scholars bring the survival of the fittest and the survival of the fittest into genetic materials. Different genetic materials survive through inheritance, crossover and mutation, so as to ensure that the final output is ideal.

GOA Optimizes SVM
Compared with the traditional improved SVM algorithm, Saremi et al. [15] proposed a new improved algorithm,GOA,based on the behavior of grasshoppers in nature. GOA simulates the behavior of grasshoppers in nature to move to a certain area during predation and consume the food in that area, and then move the next time. Compared with optimization algorithms such as DE algorithm and genetic algorithm, GOA has higher search efficiency and faster convergence speed. Moreover,GOA 's own special adaptive mechanism can well balance the global and local search processes,and has better optimization accuracy [23] .
Since all behaviors of grasshoppers during predation are carried out under natural conditions rather than human control, the position update of GOA mimics the position change of grasshoppers during predation. Considering the location of the grasshopper itself [25] , the amount of food around it, the location of other grasshoppers, etc. the next position change is where Xi is the next position vector of the i grasshopper; ω c is the internal adjustment parameter when the inertia weight is ω in the process of grasshopper searching.It can effectively adjust the coordination of individual searching for food and group searching for food to achieve effective exploration;ε and η are two effective boundaries of grasshopper 's exploration range;s is the attraction function between grasshoppers; r is the distance between two grasshoppers;xi is the current position vector of the i grasshopper ; xj is the current position vector of the j grasshopper;Td is the best fitness of grasshopper in the d-dimensional space at present;cn is the adjustment mechanism parameter, which is to reduce the decreasing coefficient of different relative regions where cmax is the maximum parameter value, t is the current iteration number,cmin is the minimum parameter value,and L is the maximum iteration number. s(r) can be regarded as the interaction part between two grasshoppers, which changes with the change of attraction u between two grasshoppers and attraction effective region parameter τ, When the distance between different grasshoppers changes significantly, the relative force function changes [24] . When the relative distance between two grasshoppers is 2, there is no attraction or repulsion between the two grasshoppers. The area in this case is called the comfort zone. When the function value of s(r) is greater than 0, two grasshoppers are attractive because of their relatively far distance, and the area between them is called the attraction range. When the function value of s(r) is less than 0, the distance between the two grasshoppers is relatively small, and there is repulsion between the two. At this time, the area between the two is called the exclusion area.
After GOA calculation, different behaviors such as attraction or exclusion among grasshoppers are simulated. With the change of parameters, grasshoppers adjust the distance with their peers, consume food, and find the next goal through continuous predation. Finally, GOA achieves the purpose of successfully retrieving the global optimal value [25] .

Simulated annealing algorithm optimizes GOA
When GOA searches for the optimal value of the region, it adjusts the comfort distance parameters between the grasshoppers by adjusting the parameters of the system to achieve the purpose of changing the comfort area, exclusion area and attraction area, so that the grasshopper advances to the best collective optimal value and finally approaches the optimal value infinitely.
In the GOA calculation process, the grasshopper population is randomly initialized, and the current position and fitness of each grasshopper individual are calculated. The minimum fitness is taken as the target value, so that all the populations are close to the value.Then, during the iterative calculation, GOA updates and calculates the individual ' s current fitness at any time. If the fitness of the individual ' s current position is better than the set value, the current value is set to fitness. In the actual calculation process, the individual may often appear the problem that the current position of multiple generations is the optimal value and the optimal value of the population cannot be updated effectively. Just as grasshoppers may search in the same direction for a long distance when they prey, this will make the GOA search process insufficient due to the randomness of the initial search direction, and eventually lead to the error of local optimal value.
In order to avoid the situation that the GOA cannot be effectively updated due to multiple generations of positions, make GOA retrieve the target area more fully and effectively, and improve the accuracy of the search algorithm, so as to avoid the GOA falling into local optimal value, this paper proposes two methods to improve the system, namely, the position random migration mechanism and the SA algorithm, so as to help the system out of the dilemma. The principle of position random offset mechanism is as follows : if the fitness of the current individual position is better than the previous fitness, the current fitness is replaced by the previous fitness ; conversely, if less than the previous fitness, the individual is not blindly looking for the next position, but the use of offset position mechanism, the next position random direction offset. Random offset [25] is (8) where p is the random offset ; Li is the minimum value of the i grasshopper search area ; Hi is the maximum value of the i grasshopper search region;R is a random number;Xi+1 is the position vector optimized by Xi. SA algorithm is an effective method to help the network successfully jump out of the local optimal value.The traditional calculation method replaces the relatively poor fitness with the relatively optimal fitness, and SA can not only accept the optimal solution, but also accept the differential solution under certain conditions. In this way, the individual target value shows high randomness, which will effectively search in the target area and enhance the possibility of GOA jumping out of the local optimal value.
When the original GOA approaches the target value, although it has been moving in the direction of the optimal value, it may be a problem of direction, resulting in multiple iterations. The optimal value cannot be effectively updated, and the search performance is degraded. So GOA is likely to fall into the trap of local optimum. Simulated annealing grasshopper optimization support vector machine ( SAGOA-SVM ) algorithm in the search for the optimal solution, the system will continue to shift, the algorithm continues to converge, the direction will point to the real overall optimal value as soon as possible.
The calculation steps of SAGOA-SVM algorithm are as follows.
1)Parameter initialization. The parameters in GOA such as the number of grasshoppers, region range, number of iterations, and iteration dimension are initialized, and the penalty coefficient C and kernel function parameter σ are also initialized.
2) Import aircraft air circulation system port temperature data, divide all data into training group and test group 3)Update the adjustment parameter cn according to equation (6). 4)Calculate the distance between grasshoppers and update the current location. 5) If the fitness of the new location is better than the current target value, update the current target value. 6) Calculate the position offset according to Equation (8), and record the new grasshopper position to get the new Td. If the new position after migration is better than the previous position, the current target value is updated as the offset Td. Otherwise, the annealing algorithm is used to calculate whether to accept the new lower Td. 7)Annealing operation. 8)Determine whether the maximum number of iterations is satisfied. If not, go to step 3). 9)Output global optimal parameters C and σ and save optimal parameters C and σ. 10)Using the optimized C and σ to train SVM, the algorithm ends.
Through the calculation of SAGOA -SVM algorithm, the ROC comparison before and after the optimization of the three classification system is obtained, as shown in Figure 13. It can be seen from the figure that compared with the unoptimized algorithm, the SAGOA-SVM algorithm has obvious improvement effect. After optimization, the modeling and prediction accuracy of the system is obviously improved, the accuracy and reliability of the system are improved, and the system is effectively improved.  Comparison of receiver operating characteristic curve ( ROC ) before and after optimization of three classification system Logistic regression (LR), decision tree (DT), random forest (RF), gradient boosting decision tree (GBDT), SVM and SAGOA-SVM algorithms were used to establish models and predict respectively, and the accuracy of different algorithms was compared.
In order to ensure the accuracy of the test, all the data were divided into two groups : the training group and the prediction group. After training, the accuracy of the prediction group of the six optimization methods was tested respectively. After recording, all the data were re-disordered and then grouped, repeated 10 times. The accuracy of the six improved algorithms is shown in Fig. 14. It can be seen from the figure that after 10 repeated experiments, although the accuracy of each algorithm is different, the accuracy of SAGOA-SVM algorithm is significantly higher than that of other algorithms, and the results are relatively stable.  Figure.14 Accuracy of 6 improved algorithms The training accuracy of different algorithms is shown in Table 5. It can be seen from the table that the accuracy of SAGOA-SVM algorithm is superior to other algorithms in any aspect. The AUC obtained by the six improved algorithms is shown in Figure 15. It can be seen from the graph that the AUC height of SAGOA-SVM algorithm is not lower than that of other algorithms in both modeling and prediction process, indicating that SAGOA-SVM algorithm has better modeling effect, and the performance of the model is further improved after using SAGOA-SVM algorithm to improve the parameter selection method. In this paper, the air circulation system of aircraft is modeled and simulated by using AMESim software. Based on the SVM model, a large number of miscellaneous data of the air circulation system of aircraft are analyzed, and the three-layer structure is introduced to establish the model. It is proposed that GOA is introduced into the modeling and simulation of air circulation components of aircraft, and the SAGOA-SVM model is constructed by introducing the position random offset mechanism and SA algorithm. The main conclusions are as follows : 1)The AMESim model can effectively simulate the gas flow mode of the aircraft air circulation system, and simulate the change of the system outlet temperature when the aircraft air circulation system fails.
2)SVM model based on flight data can effectively achieve the aircraft air circulation system components outlet temperature prediction and fault classification 3)The parameters of the SAGOA-SVM model are significantly improved compared with those of the traditional SVM, and the convergence speed and search efficiency are also significantly improved. Moreover, compared with other traditional intelligent algorithms, the SAGOA-SVM model also has certain accuracy advantages.

Compliance with Ethical Standards:
Funding: This study was funded by Shenyang University of Chemical Technology (201601198)

Conflict of Interest:
Author WU Huiyong declares that he has no conflict of interest.;Author JIN Shuchun declares that he has no conflict of interest.Author JIN Zhu declares that he has no conflict of interest.

Ethical approval:
This article does not contain any studies with human participants performed by any of the authors.
Informed consent: Informed consent was obtained from all individual participants included in the study.