## 1 Introduction  
It is important for an aircraft pilot to fly at a comfortable temperature and for the avionics in the cockpit to dissipate heat and operate smoothly. Therefore, in the cockpit environment control system (ECS), the temperature and air flow control are important technologies and issues. The system for temperature and air flow control is called the environmental control system. In recent years, the design of an ECS mostly involves mixing the hot air flow from the engine and the cold air flow cooled by the air conditioning package (i.e., the heat exchanger) to produce an appropriate air flow rate and temperature and transmit it into the cabin. The most critical technological issue for generating an appropriate air flow rate and temperature is to control the cold and hot air flows and mix them to reach the desired value. It is a complex multiple-input multiple-output (MIMO) problem [1]. In closed loop control systems, the proportional-integral-derivative (PID) controller design has been widely used in the industry [2]. Its advantages include good stability, easy adjustment, and high reliability. The history of PID control can be traced back to the governor design in the 1890s [3, 4]. Subsequently, it was gradually developed for ship automatic operating systems, advanced aircraft flight controllers, and related engine controllers. Currently, PID control is widely used in electronic systems for positioning of magnetic disk read-write heads [5], spacecraft attitude control [6], and power systems [7]. Obviously, we also apply PID control as the design principle of the controller in this study. PID control is defined as the sum of the following three terms: the error term multiplied by the proportional gain parameter \(K_{p}\), the error integral term multiplied by the integral gain parameter \(K_{i}\), and the error derivative term multiplied by the derivative gain parameter \(K_{d}\). How to obtain the optimal \(K_{p}\), \(K_{i}\), and \(K_{d}\) for PID control is an important issue to be discussed and explored [8; 9; 10]. However, in most studies, only a local optimal solution is reached or these studies might be constrained by time-varying, nonlinear, and MIMO systems rather than by a single-input single-output (SISO) system, which can be easily manipulated [11; 12]. Therefore, this study aims to improve the traditional methods and use optimal heuristic algorithms to compare and analyze, and then simulate and evaluate, the ECS of an aircraft cockpit to improve the air flow and temperature control. There is still room for improvement in PID control; thus, we attempt to optimize the PID controller with particle swarm optimization (PSO) or simplified swarm optimization (SSO) algorithms. The PSO algorithm is a metaheuristic algorithm [13]. It is a model that simulates the flight status of a flock of birds in search of food [14]. According to the adaptability of a flock of birds to the environment, an individual bird can drive the group to move toward the best position with the most adequate food. PSO is often used to solve optimization problems because it requires few or even no assumptions [15; 16]. It can also provide multiple possible solutions. This study will use PSO to find the three gain parameters \(K_{p}\), \(K_{i}\), and \(K_{d}\) of the PID controller because of its good optimization effect and simple operations. SSO was proposed by [PERSON] in 2008 [17]. It is an improved algorithm to resolve the shortcomings of PSO, which only reaches a local optimal solution instead of the global optimal solution. The general concept and purpose of SSO are the same as those of PSO, but SSO uses more random variables to change the optimization method and optimize the results. SSO allows the optimization result to be not only limited to the local optimum, but also to achieve a global optimum. Thus, this study utilizes SSO to find the gain parameters of the PID controller and compares it with the optimization result of PSO.