#### Abstract

The aim of this work is to present a model for heat transfer, desorbed refrigerant, and pressure of an intermittent solar cooling system’s thermochemical reactor based on backpropagation neural networks and mathematical symmetry groups. In order to achieve this, a reactor was designed and built based on the reaction of BaCl_{2}-NH_{3}. Experimental data from this reactor were collected, where barium chloride was used as a solid absorbent and ammonia as a refrigerant. The neural network was trained using the Levenberg–Marquardt algorithm. The correlation coefficient between experimental data and data simulated by the neural network was *r* = 0.9957. In the neural network’s sensitivity analysis, it was found that the inputs, reactor’s heating temperature and sorption time, influence neural network’s learning by 35% and 20%, respectively. It was also found that, by applying permutations to experimental data and using multibase mathematical symmetry groups, the neural network training algorithm converges faster.

#### 1. Introduction

It is estimated that 15% of the electrical energy in the world is used for cooling [1]. One way to decrease this percentage is to use energy from alternative sources such as geothermal or solar energy, among others [2]. In [3], sorption cooling is proposed (adsorption) which uses low-intensity sources such as solar energy. Sorption cooling systems use thermal energy and apply thermodynamic equilibrium: liquid-vapor and solid-vapor. The best known liquid-vapor works are mentioned in [4, 5]. The solid-vapor system is divided into physical sorption and chemisorption. The main physical sorption works are mentioned in [6, 7].

The solids frequently used are metal salts, in particular, alkaline metals and alkaline earth metal halides, which, in anhydrous state, can absorb large amounts of ammonia or other refrigerants. The salts that are most used as sorbents are calcium chloride (CaCl_{2}) [8–10], strontium chloride (SrCl_{2}) [11], and barium chloride (BaCl_{2}) [12, 13]. In [14], 36 solid-gas reactions are collected, mainly chlorides reacting with ammonia. On the contrary, composite materials are a mixture between the aforementioned salts and inert solids such as expanded graphite [15], vermiculite [16, 17], carbon Sibunit, and Al_{2}O_{3} [17]. Composite materials have also been used as solid sorbents as they increase thermal conductivity and prevent agglomeration and swelling. The disadvantage of these composite materials is the low solid-gas ratio and the reactor’s increased volume due to the addition of new materials, compared to the use of pure salts. On the contrary, the predominant refrigerant in solid-gas systems is ammonia due to its vaporization properties, high availability, and minimal environmental impact.

A thermodynamic solid-gas sorption cycle is composed primarily of four elements: an evaporator, an absorber/generator, a condenser, and an expansion device. This cycle works intermittently; when the absorber/generator generates, it cannot absorb and vice versa. The reactor is the device where the phenomena of heat transfer occur by mass and kinetic reactions. In [18], the phenomena of heat and mass transfer are modeled, as well as the kinetic reaction by means of differential equation systems, in order to have a better knowledge in solid-gas reactors.

Mathematical models for studying solid-gas reactors are classified as local, global, and analytical. Local models deal with the phenomena of heat and mass transfer and are numerically solved. Global models deal with thermal conductivity, specific heat, and permeability averages. Analytical models consider reaction times and geometrical configurations [19]. There are also approaches where phenomena within the reactor have been analyzed at different scales [20] and different materials are used as sorbents [21]. It is also reported that the kinetic reaction in thermochemical reactors is complicated and has not been precisely modeled yet [6].

As it has been mentioned before, very complete studies on the phenomena of heat and mass transfer in solid-gas systems in numerical and analytical modalities with different salts have been carried out. There are also reports on intermittent cooling systems that use artificial neural networks (ANNs) to determine the performance in thermochemical reactors during the solid-gas sorption process [22, 23] and show that they are a promising technique in this area [24]. In this work, artificial neural networks and mathematical symmetry groups were used to model a thermochemical reactor of a solid-gas cooling system, where the solid is barium chloride (BaCl_{2}) and the refrigerant is ammonia (NH_{3}).

A thermochemical reactor working with the BaCl_{2}-NH_{3} pair was designed and built. Experimental data were collected from this reactor in order to obtain a mathematical prediction based on neural networks that model such a reactor. This provides an artificial intelligence tool that contributes to the design of reactors used in solid-gas sorption cooling.

The rest of this work is organized as follows: Section 2 describes the experimental setup and the influence of the heating fluid on the thermochemical reactor. Section 3 shows the modeling of the thermochemical reactor using neural networks and mathematical symmetry groups. Section 4 shows the obtained results. Section 5 shows the most relevant variables in ANN learning. Then, Section 6 shows the results of the uncertainty analysis followed by the main conclusions and a list of references.

#### 2. System’s Description and Experiments

Figure 1 shows the intermittent solid-gas sorption refrigeration cycle used in this work; this is composed as follows: the thermochemical reactor that acts as a generator/absorber, the condenser, the refrigerant storage tank, an expansion valve, and the evaporator. The system was built in stainless steel [12].

In addition, the following subsystems were built: (1) water supply to heat/cool the thermochemical reactor and to remove heat from the condenser. Both temperatures are controlled by this subsystem consisting of a thermal bath (heat), a vapor compression cooler (cool), and a water pumping system (remove heat); (2) ammonia supply to the thermodynamic cycle; and (3) a data acquisition system.

Figure 2 depicts an intermittent cooling system. The system works in two stages: (a) generation-condensation and (b) evaporation-sorption. In the former, the *V*_{A} and *V*_{C} ball valves are closed, and the *V*_{B} ball valve is open. Subsequently, the generator/absorber containing the BaCl_{2}-NH_{3} pair is heated (*Q*_{G}) to a temperature where the refrigerant (NH_{3}) is desorbed. The refrigerant in the vapor state passes to the condenser where heat (*Q*_{C}) is extracted, becomes a liquid, and is stored in the condensate tank.

In the latter, *V*_{B} closes, and *V*_{A} and *V*_{C} open. Subsequently, the expansion valve opens and regulates the refrigerant to enter the evaporator where it absorbs heat from the medium to be cooled (*Q*_{E}). The refrigerant then returns to the generator/absorber where heat (*Q*_{A}) is removed during the absorption process.

Three J-type thermocouples with different radii were installed in the generator/absorber, taking the reactor centre as reference: *r*1 = 0 cm, *r*2 = 2 cm, and *r*3 = 4 cm. This was done in order to obtain the temperatures Tr1, Tr2, and Tr3 at the respective radii, when heat (*Q*_{G}) is added to the reactor by heating water at various temperatures (Thf). Thermocouples were calibrated with high-precision Ametek brand electronic equipment built by Jofra Instruments model D55SE and had a temperature range of 0 to 150°C. A Cole-Parmer pressure sensor with an operating range of 0 to 20.68 bar (g) and 4 to 20 mA output was also installed to measure the generated pressure (Pg). To measure the volume of condensed or desorbed ammonia (Vd), an external glass meter of 38.1 mm (1½ ”) diameter was installed, coupled to their respective valves as can be seen in Figure 1 (3). To measure the amount of desorbed ammonia (accumulated volume), readings were taken every 5 minutes from the start of the condensation until the desorption process was completed.

##### 2.1. Influence of the Heating Fluid on the Reactor

The desorption process was carried out in order to determine the behavior of the temperature distribution within the reactor and quantify the volume of the desorbed refrigerant. To perform the desorption, the reactor was heated with water at different Thf temperatures (70°C, 80°C, and 95° C) and at a condensation temperature of 23°C. The variables recorded were temperatures Tr1, Tr2, and Tr3, generated pressure Pg, and the volume of desorbed ammonia in its liquid state (Vd).

Temperature distributions within the reactor (Tr1, Tr2, and Tr3) were obtained; however, only the result of Tr2 is shown (Figure 3(a)) as an illustrative case of the influence of Thf on the reactor’s radial temperatures. A linear behavior can be observed in Figure 3, that is, the higher the temperature of Thf, the higher the temperature of Tr2, and the same happens with the variable Vg (Figure 3(b)). The pressure Pg (Figure 3(c)) does not show an increasing behavior; this is because the pressure during the desorption process (phase change) must behave as an isobaric process.

**(a)**

**(b)**

**(c)**

#### 3. Neural Network Proposal for Modeling the Thermochemical Reactor

An artificial neural network (ANN) is a set of interconnected nodes, trying to mimic the functioning of the human brain. An ANN is a function . Each of the nodes has an input function and an output function. Once the ANN is designed and trained, then given an input dataset, the ANN can predict the values of the output variables. ANNs are used especially to model the behavior of nonlinear systems [24]. To train the ANN, the Levenberg–Marquardt algorithm [25, 26] was used because of its convergence speed and precision.

Figures 4 and 5 show the network structure and its input and output variables, which was implemented in MATLAB. Table 1 shows the definition of the neural network’s input and output variables. The ANN’s precision was determined by using the root-mean-square error (RMSE).

For the ANN training, 2 databases were used. The first database has 7637 experimental data and was generated with the Thf fluid at 70°C. The second database has 8956 experimental data and was generated with the Thf fluid at 95°C. The neural network was trained with these two merged databases. For a better network training, the databases were merged obtaining a single database of 16,593 records, and an alternating group was applied to this database [27, 28]. Then, tuples or permutations of the base 2 multibase mathematical symmetry group (obtained from the multibase symmetry group) were applied to the resulting database. The multibase mathematical symmetry groups are obtained as follows [29].

Let *G* be a finite group of order *N*. Rename the elements of *G* by the set . Let be a number that will indicate a numerical base (for example, base 10 and base 2). Then, can be represented as , where is a cyclic group of order and .

On the contrary, each number in the set can be represented aswhere *y*.

Each element in is given by (vector form of the number), where .

Let be the operation of group and the operation of the cyclic group . If , thenwhere the cyclical group operation is represented as

The inverse of the element is defined as

With the previous group operations, the matrix is formed, where is the number of columns or records in the database used to train the ANN, and each row of this matrix represents a permutation of this database. The matrix is defined as follows:

On the contrary, to determine the optimal ANN architecture, a set of various network configurations was tested, each one with different numbers of hidden layers and different numbers of neurons in each layer. It was found that the simplest and most accurate network model was 9-9-5 (nine neurons in the hidden layer and 5 neurons in the output layer) as shown in Figure 6. The transfer functions used in the network training were tansig function (hidden layer) and pureline function (output layer).

According to Figure 6, it was concluded that the best ANN model was achieved with 09 neurons on the hidden layer. However, the performance in the training set is good with more than 09 neurons, but the performance of the test set is significantly worse, which could indicate an overfit. Therefore, in order to improve the results, the number of neurons in the hidden layer has been reduced to 09 neurons [30]. Consequently, the optimal network configuration was approximately 09-09-05. This model presents smaller values of RMSE (0.4%) and higher *R*^{2} (99.97%).

Once the ANN architecture was defined, each output of the neural network is calculated by the following equation:[/lcmath]

Explicitly, each output of the neural network is calculated by the following equations (7)–(11):where N = total neurons of the hidden layer, M = total input, LW_{ij} = weights of the output layer from neuron *j* of the hidden layer to the output, *IW*_{jk} = weights of the input layer from input *k* to neuron *j* of the hidden layer, In_{k} = *k*-th input, *b*1_{j} = bias of the hidden layer of the *j*-th neuron, *b*2_{i} = bias of the output layer at the *i*-th output, and *I* = *i*-th output.

#### 4. Results and Discussion

After training the neural network, the results were obtained as follows (see Table 2). The ANN was trained with 75% of data, and the other 25% of data were used for validation and testing (see Section 3).

In order to verify learning of the network, a database with 7,420 experimental data was used. These data were the heating time (*t*) from 0 to 10.31 h, the heating temperature (Thf) from 24.7°C to an average maximum temperature of 81.2°C, and the reactor geometry values which were constant, as well as the amounts of NH_{3} and BaCl_{2} (see Table 1).

By training the network with the appended database and verifying its learning, a correlation coefficient of *r* = 0.9671 was obtained (see Section 3). Applying an alternating group to the ANN training database and checking its learning with this new database, a correlation coefficient of *r* = 0.9920 was obtained. Finally, applying an alternating group and then applying elements from the multibase mathematical symmetry group to the ANN training database and verifying their learning with the new database, a correlation coefficient of *r* = 0.9957 was obtained. For a fair comparison, in all ANN trainings with different permutations (alternating group and multibase mathematical symmetry group) from the training database, the network weights were initialized with a random seed of 1230.

Figure 7(a) shows that the behavior of simulated temperature Tr3 during the addition of heat to BaCl_{2}-NH_{3} (sensible heat), against the experimental data, coincides with a correlation coefficient of *r* = 0.9996. During the phase change or desorption, the difference of the simulated data against the experimental data becomes minimal.

**(a)**

**(b)**

**(c)**

**(d)**

**(e)**

In the Tr2 case (Figure 7(b)), it is observed that the simulated and experimental Tr2 temperatures are consistent and have a correlation coefficient of *r* = 0.9924. It should be noted that, during desorption, there are some minimal differences between simulated and experimental values; however, from the experimental point of view, this is acceptable. The evolution of the Tr1 simulated temperature (Figure 7(c)) coincides with a correlation coefficient of *r* = 0.9953 which is acceptable from a practical point of view.

The simulated values of the refrigerant volume versus the experimental ones coincide with a correlation coefficient of *r* = 0.99 (Figure 7(d)). It should be noted that the experimental data were visually recorded every five minutes. However, it has an approximate value to the recorded final volume at the experimental desorption.

The simulated pressure inside the reactor (Figure 7(e)) is consistent with the sensible heating process, as it occurred with temperatures at different radii, and it has a correlation coefficient of *r* = 0.9503. During desorption, the pressure must have a constant behavior; however, in the experimental stage, there is a gradual increase. In the case of simulated pressure, the same increase occurs, with a maximum difference of 1 bar; it must be taken into account that the pressure values in Figure 3(c) do not show an ascending or descending pattern when increasing Thf.

#### 5. Sensitivity Analysis

In order to determine the impact of each input variable on the outputs estimated by the neural network, a sensitivity analysis was developed using a genetic programming algorithm executed in Eureqa [31]. The sensitivity analysis showed that the most used characteristic is the heating fluid’s temperature (35%) followed by the desorption time (20%), that is, these variables are the most important in the ANN’s learning process.

The sensitivity analysis for each of the input variables was also performed by generalizing the equations of Dimopoulos et al. [32] for outputs, which is given as follows:where is the sensitivity of the *q*-th output of the neural network, for , *N* is the total input data to the neural network, and is the total number of outputs of the network.where is the total input parameters to the neural network.where *ni* is the number of neurons of the hidden layer, , is the *q*-th activation function of the output layer, is the -th activation function of the hidden layer, are the weights of the output layer, are the weights of the hidden layer, is the weight from the entrance to the hidden layer, from the *i*-th network entrance to the *e*-th neuron of the hidden layer, is the weight that goes from the hidden layer to the output layer, from the *i*-th neuron of the hidden layer to the *q*-th neuron of the output layer, and and are those derived from the activation functions of the neurons of the output layer and the hidden layer, respectively.

In equation (14), the domains of the activation functions are defined as follows:where is the *p*-th input to train or simulate the network.where is the domain of the activation function of the *q*-th neuron of the output layer.

Equations (12)–(16) were implemented in MATLAB yielding Table 3, as in Eureqa; it is concluded that the most important variables for the learning process of the neural network are Thf and *t*.

#### 6. Uncertainty Analysis

In order to verify the accuracy improvement of the ANN, the uncertainties of the temperature sensors, pressure sensor, and desorption were analyzed. Some methodologies and standards for obtaining uncertainties are mentioned in [33–35]. All the uncertainties calculated for the sensors used in this research were based on evaluation of measurements described in [35], and a probability and a coverage factor *k* = 3 were proposed. The expanded uncertainty of the J-type class 2 temperature sensor of Ametek brand [36] is *U* = 2.9°C. The expanded uncertainty of the pressure sensor of Cole-Parmer brand [37] is *U* = 0.18 bar. On the contrary, the desorption of the refrigerant was recorded manually, so the fuzzy set type 2 technique [34] and the central limit theorem were used to obtain the expanded uncertainty, obtaining *U* = 4.47 ml. Using these uncertainties, the correlation coefficient of *r* = 0.9957 was obtained between the experimental data (those never used for the network training) and the data simulated by the neural network.

#### 7. Conclusions

The proposed artificial neural network allowed modeling the behavior of a BaCl_{2}-NH_{3} reactor globally with a precision of 0.9957 without using complex systems of differential equations. However, it is still necessary to improve the learning precision and the architecture of this neural network to model the behavior of these reactors. For example, it is necessary to improve the output of the neural network that simulates pressure, which has a correlation coefficient of *r* = 0.9503.

Applying an alternating group of mathematical symmetry to the input data of the neural network allowed obtaining better precision in the learning process than only appending the 70°C and 95°C databases. However, when applying the permutations of the multibase mathematical symmetry groups to the input data of the neural network, a better precision (*r* = 0.9957) was obtained in the mentioned learning process than applying the alternating symmetry group .

By applying the permutations of the mathematical symmetry group to the neural network input database, the training algorithm (Levenberg– Marquardt) converges faster and with greater precision compared to the appended database. However, given the high computational complexity of the permutations generated for the mathematical symmetry group, not all permutations were applied to the input data of the neural network.

As shown by the sensitivity analysis, the most important variables for the neural network training are heating fluid temperature (Thf) and desorption time (*t*). The analysis of the uncertainties of experimental measurements allowed obtaining a higher learning precision of the neural network (*r* = 0.9957).

#### Data Availability

The experimental data used to support the findings of this study are available from the corresponding author upon request.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

#### Acknowledgments

Special thanks are due to the Institute of Renewable Energies (IER) for their valuable help in the development of this work and to the Secretary of Public Education (SEP) for granting the National Conventional Scholarship for doctoral studies PROMEP/103.5/09/4363.