Fuzzy and Matlab/Simulink Modelling of the Air Compression Refrigeration Cycle

The coefficient of performance (COP) for a gas refrigeration cycle was estimated using Matlab/Simulink and fuzzy logic. A Matlab/Simulink model of the gas refrigeration cycle was developed, and the output was compared to theoretical data. Additionally, fuzzy logic was used to estimate the COP for arbitrary low-and high-pressure levels. Simulation results were used to develop a multi-input-multi-output (MIMO) fuzzy Takagi-Sugeno-Kang (TSK)-based model. Both the Matlab/Simulink and the MIMO fuzzy model were found to be very well correlated with theoretical results, with an error of less than 2 %. These results demonstrate the effectiveness of using fuzzy logic to analyse gas refrigeration cycles and suggest that this approach can be extended to analyse other thermodynamic cycles.


Highlights
• The coefficient of performance (COP) for a gas refrigeration cycle was assessed using a modern intelligent tool, specifically fuzzy logic.• To verify the results obtained by fuzzy logic, a simulation study was conducted over a wide range of low and high pressures in the cycle.• The fuzzy logic approach was found to produce results very similar to the simulated COP, with a root mean square error of less than 2 %. • Fuzzy logic was found to be a fast approach for estimating the COP with limited knowledge of gas refrigeration cycles.

INTRODUCTION
Thermodynamics has a wide range of applications, including refrigeration, which involves the transfer of heat from a lower temperature region to a higher temperature one [1] and [2].The air compression refrigeration cycle is a well-known example of this process, utilizing air as a working fluid instead of chlorofluorocarbon (CFC).This type of refrigeration is commonly used in airplane air conditioning systems, where pressurized air from the engine compressors is utilized.In recent years, researchers have shown more interest in this type of refrigeration due to its environmental advantages, as it has a positive impact on the ozoneosphere.Additionally, the working fluid for this refrigeration cycle is readily available at no cost, making it economically attractive.However, due to the low efficiencies of the compressor and expander [3] and [4], the coefficient of performance (COP) of this refrigeration cycle is relatively low.
The closed-air refrigeration cycle is typically comprised of four components: the air cooler, refrigerator, compressor, expander, and motor.Fig. 1 displays the four components of the refrigeration cycle, where the refrigerator holds air at a low pressure and the air cooler holds air at a high pressure.
Many studies, such as [5] and [6], have investigated the simulation and thermodynamic analysis of this cycle.Gigiel et al. [7] compared the air cycle and the CFC conventional freezing cycle.Further research regarding the optimization of the air refrigeration cycle using finite time thermodynamics and entropy generation minimization has been discussed in [8] and [9].Refrigeration system designers aim to maximize efficiency while minimizing energy consumption and production costs.Several variables have an effective role in determining which combination of properties can be used to increase the coefficient of performance (COP) of the system.Kizilkan [10] conducted a performance analysis of a variablespeed refrigeration system using artificial neural networks.The objective of the study and the learning procedure was to identify the optimal set of weights that would produce the correct output for any input.The output of the network was compared to a desired response to generate an error, and the performance of the network was evaluated in terms of the desired signal and the convergence criterion.Fuzzy logic and artificial neural networks (ANNs) have been widely used in the literature to model complex mechanical systems [11] and [12].Sahin [13], for example, used ANNs and adaptive neuro-fuzzy (ANFIS) to analyse the performance of a single-stage vapour compression refrigeration system with an internal heat exchanger using refrigerants R134a, R404a, and R407c.A comprehensive review of the applications of artificial neural networks for refrigeration cycles was presented in [14].
This research work proposes an alternative method for estimating the coefficient of performance (COP) using fuzzy logic as a tool, eliminating the need for analytical modelling of the refrigeration cycle.The researchers developed two models to estimate the COP of gas refrigeration cycles: the first model utilized a Matlab/Simulink model and direct mathematical relations and models, while the second model employed fuzzy logic.Both models utilized the low and high pressures of the cycle as inputs and the COP as an output.These results can be applied to modelling and simulating other refrigeration cycles, specifically, and thermodynamic cycles, generally.

METHODS
In this section, the gas refrigeration cycle model development using Matlab/Simulink is described.Matlab/Simulink has been extensively used by researchers for modelling and simulating mechanical systems.Milecki and Rybarczyk [15], for instance, employed Matlab/Simulink to simulate the behaviour of an electrohydraulic proportional valve.The development process starts with the calibration of the thermodynamic properties of air, as described below: where h is the enthalpy (kJ/kg), P r is the relative pressure, and T is the temperature in Kelvin.
To obtain the enthalpy fitted model, a power function in the form of (h = a x b + c) is suggested.By utilizing the curve-fitting toolbox (CFT) in Matlab, the following results are obtained: h(P r ) = 333.70× P r 0.2539 -65.14, ( 3) To evaluate the accuracy of this model, the root mean square error (RMSE) is utilized, which is less than 1 % for the enthalpy for both Eqs. ( 3) and (4).Figs.2a and b depict the original data, obtained from the thermodynamics tables, and the fitted data generated through this model.
In addition to the enthalpy data, the relative pressure as a function of temperature and temperature as a function of relative pressure are also required.These relationships are generated using the curve fitting toolbox, and the resulting equations are as follows: ., To assess the performance of the developed model, the root mean square error (RMSE) is used as an evaluation metric.The RMSE is determined to be less than 1.5 % for both Eqs. ( 5) and (6), indicating good agreement between the fitted data and the original data obtained from the thermodynamics tables.This is further supported by Figs.2c and d, which show the fitted data closely overlapping with the original data.
Using the fitted functions described earlier, the researchers developed a complete Simulink model of the gas refrigeration cycle.This model takes the low and high pressures of the cycle as input and produces the COP as output.A block diagram of the Simulink model is depicted in Fig. 3.
In the compressor subsystem, it is assumed that the air enters the compressor with a temperature of 285 K and a pressure of one atmospheric pressure.Using Eqs. ( 4) and ( 5), the enthalpy and relative pressure can be calculated.The thermodynamic properties of the air at the exit can be determined by applying the conservation of mass and energy principles.
The exit enthalpy and temperature can be determined using the computed value of the P r from Eqs. ( 3) and ( 6).
In the Turbine subsystem, the air enters the turbine with the third state, which is the exit of the condenser and exits the turbine with the fourth state.The enthalpy and relative pressure of the third state obtained from the condenser subsystem are used to calculate the enthalpy and relative pressure of the fourth state, using Eqs.( 4) and ( 5), respectively.Using the relative pressure, the enthalpy and temperature can be determined using Eqs.( 3) and (6).
In the evaporator model, the absorbed energy in the condenser (q L ) can be calculated as the difference between the enthalpies of the first and fourth states, which is given by the following equation:

EXPERIMENTAL
The components of a fuzzy expert system include fuzzification, a knowledge base, a fuzzy inference engine, and defuzzification.A summary of how these components operate is provided below: 1. Fuzzification: To perform fuzzification in a fuzzy expert system, input values are transformed into fuzzy values according to a specific membership function.In this case, the proposed method uses a Gaussian function for input membership.2. Knowledge Base: In the knowledge base component of a fuzzy expert system, rules are created based on the expertise and experience of the system's designer.Typically, each rule is given equal weight, though some rules may be given more weight based on expert judgement.This component establishes the connections and regulations between input and output values.The proposed method for this system uses nine rules that encompass all possible combinations of the input membership functions.3. Fuzzy inference engine: The fuzzy inference engine component of a fuzzy expert system utilizes expert knowledge-based rules to make inferences from the available information.One popular method of inference is Takagi-Sugeno-Kang (TSK) inference.In TSK inference, the existing rules are combined using the Max-Min operation.4. Defuzzification: Defuzzification is the process of converting fuzzy information into a specific value.One common technique for defuzzification is the weighted average method, which is simple and widely used.The method of defuzzification that uses weighted averages is also known as the Sugeno defuzzification method.It is suitable for fuzzy sets with symmetrical output membership functions and produces results that are similar to the centroid of area (COA) method.
The proposed method involves the development of a fuzzy logic model that is based on the input-output data of the COP obtained from the mathematical models and relations of the gas refrigeration cycle.The data set that is generated is then used to structure the fuzzy model, including the input and output membership functions, as well as the if-then rules.We attempted to optimize the membership functions used for the input variables by trying two and four functions.However, the accuracy of the two-function approach was only about 95 %, while the fourfunction approach was very close to the three-function approach, with an error of about 1 %.Therefore, we decided to adopt the three-function approach, as it provided a better correlation compared to the two-function approach and faster computation time compared to the four-function approach.
The refrigeration cycle includes four sub-systems: the evaporator, compressor, turbine, and condenser.However, the proposed fuzzy model only considers the input variables, which are the low and high pressures, and the output variable, which is the COP.For the low and high pressures, three membership functions are assumed, using Gaussian functions as follows: where L i and H i are the i th membership function of low and high pressures, respectively, A i , B i , C i and D i are the design parameters of i th input membership functions.Fig. 4 shows the input and output membership functions.
For the if-then rules, Table 1 lists the if-then rules together with the output membership functions.
Where COP were calculated as follows: The authors previously presented a method to estimate the coefficients a, b, and c of the TSK model using the available experimental or simulation data.This was achieved by generating an optimized TSK model through the application of a nonlinear least square method, as described in reference [16].

NUMERICAL EXAMPLES RESULTS
After performing simulations using the Matlab/ Simulink model with various input pressures, a dataset was generated with the COP as the output.The range of low pressures considered was from 100 kPa to 200 kPa, while the range of high pressures was from 1.0 MPa to 3.0 MPa.The MATLAB code used the COP data generated from the Simulink model and applied the least square method to estimate the optimal values of the membership function coefficients.
The accuracy of the results is demonstrated by the RMSE value of 0.01953, which means that the expected COP error based on the model is less than 2 % on each occasion.Table 2 provides all the If-Then rules and output membership functions (OMF).Increasing the order of the OMF could be a potential area for future work, but it may require high-speed computers.
Fig. 5a depicts the relationship between the input variables of low and high pressures and the output variable of COP, as predicted by the developed model.The accuracy of the model is evident from the plot, with the error being negligible.Furthermore, Fig. 5b displays the residuals of the developed surface with a maximum error of less than 0.02, indicating the accuracy of the model's predictions.

COMPARISONS BETWEEN SIMULINK AND FUZZY MODELING RESULTS
Although the proposed approach does not inherently require a dynamic model, the Matlab/Simulink is employed to facilitate the utilization of the developed model for future research endeavours, e.g., implementing control strategies for refrigeration cycles and to make the developed model easily accessible to other researchers, enabling them to further investigate and contribute to the field of refrigeration systems.Table 3 presents a comparison between the methods used by Matlab/Simulink and Fuzzy logic modelling to estimate the COP of refrigeration cycles.The model is built using the raw data available from the gas refrigeration cycle.
To estimate the COP, complete mathematical models and equations for all sub-domains of a refrigeration system are necessary.
The detailed interaction between sub-systems of a refrigeration system is not necessary for fuzzy modelling.Instead of requiring expertise, a data set can be used to develop the Fuzzy model of the COP.Classical mathematical programming models rely on well-defined coefficients for all refrigeration cycle components.However, in some cases, model parameters can only be roughly estimated.Additionally, to obtain the COP, all tables must be used.
After developing the fuzzy model of the gas refrigeration cycle, a tuning process is typically carried out to optimize it.Once optimized, the fuzzy model can estimate the COP independently without the need for tables or physical components.With its graphical user interface (GUI) environment, Matlab/Simulink provides an easier way to simulate gas refrigeration cycles, as well as other engineering systems.
To use fuzzy logic in refrigeration systems, an expert in the field is needed to provide an initial guess of the input/output membership functions and to construct the If-Then rules.

CONCLUSIONS
In this research, the COP of gas refrigeration cycles was estimated using both Matlab/Simulink and fuzzy logic approaches.Matlab/Simulink used mathematical equations and relations to estimate the COP, while fuzzy logic used available data sets for the same purpose.The performance of the fuzzy logic approach was evaluated across a wide range of low and high pressures in the cycle.The results showed that fuzzy logic provided a quick way to estimate the COP with less knowledge of gas refrigeration cycles.The fuzzy logic found to be comparable in accuracy to Matlab/ Simulink and mathematical modelling with a RMSE of less than 2 %, highlighting the effectiveness of fuzzy logic as a tool to model refrigeration cycles, in particular, and thermodynamics cycles in general.

Fig. 1 .
Fig. 1.Air refrigeration cycle (dashed and solid lines stand for high and low pressures, respectively)

Fig. 2 .
Displays a comparison between the simulated data obtained from the developed models and the data obtained from thermodynamics tables; a) the enthalpy as a function of relative pressure, b) the enthalpy as a function of temperature, c) the relative pressure as a function of temperature, and d) the temperature as a function of relative pressure

Fig. 4 .
The input membership functions before tuning of a) low pressure, and b) high pressure Fuzzy and Matlab/Simulink Modelling of the Air Compression Refrigeration Cycle

Fig. 5 .
The input membership functions after tuning of a) low pressure; and b) high pressure

Fig. 6 .
a) the normalized COP as a function of the normalized input pressures, and b) the residual between the calculated COP and the predicted COP using fuzzy logic

Table 1 .
The if-then rules and output membership functions

Table 2 .
The if-then rules and output membership functions

Table 3 .
A simple comparison of the Matlab/Simulink and Fuzzy logic modelling