Modeling a Thermochemical Reactor of a Solar Refrigerator by BaCl2-NH3 Sorption Using Artificial Neural Networks and Mathematical Symmetry Groups

,e 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 BaCl2-NH3. Experimental data from this reactor were collected, where barium chloride was used as a solid absorbent and ammonia as a refrigerant. ,e neural network was trained using the Levenberg–Marquardt algorithm. ,e 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.


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 lowintensity sources such as solar energy. Sorption cooling systems use thermal energy and apply thermodynamic equilibrium: liquid-vapor and solid-vapor. e best known liquid-vapor works are mentioned in [4,5]. e solid-vapor system is divided into physical sorption and chemisorption.
e main physical sorption works are mentioned in [6,7]. e 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. e salts that are most used as sorbents are calcium chloride (CaCl 2 ) [8][9][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. e 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. is cycle works intermittently; when the absorber/generator generates, it cannot absorb and vice versa. e 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].
ere 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. ere 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.
is provides an artificial intelligence tool that contributes to the design of reactors used in solid-gas sorption cooling. e 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. en, Section 6 shows the results of the uncertainty analysis followed by the main conclusions and a list of references. Figure 1 shows the intermittent solid-gas sorption refrigeration cycle used in this work; this is composed as follows:

System's Description and Experiments
the thermochemical reactor that acts as a generator/absorber, the condenser, the refrigerant storage tank, an expansion valve, and the evaporator. e 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. e 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. e 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 ). e refrigerant then returns to the generator/absorber where heat (Q A ) is removed during the absorption process.
ree J-type thermocouples with different radii were installed in the generator/absorber, taking the reactor centre as reference: r1 � 0 cm, r2 � 2 cm, and r3 � 4 cm.
is 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 ( f ). ermocouples 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 ermochemical refrigerator system: 1, generator/absorber, 2, condenser, 3, ammonia condensate tank, 4, expansion valve, 5, evaporator, 6, auxiliary systems for heat and cold water supply, 7, data acquisition system, and 8, ammonia supply tank [12]. 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.

Influence of the Heating Fluid on the Reactor.
e 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 f temperatures (70°C, 80°C, and 95°C) and at a condensation temperature of 23°C. e 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 f on the reactor's radial temperatures. A linear behavior can be observed in Figure 3, that is, the higher the temperature of f, the higher the temperature of Tr2, and the same happens with the variable Vg ( Figure 3(b)). e 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.

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 f: R n ⟶ R m . 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. e ANN's precision was determined by using the root-mean-square error (RMSE).
For the ANN training, 2 databases were used. e first database has 7637 experimental data and was generated with the f fluid at 70°C. e second database has 8956 experimental data and was generated with the f fluid at 95°C. e 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 A n was applied to this database [27,28]. en, tuples or permutations of the base 2 multibase mathematical symmetry group (obtained from the multibase symmetry group) were applied to the resulting database. e 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 m i be a number that will indicate a numerical base (for example, base 10 and base 2). en, G can be represented as On the contrary, each number in the set I can be represented as Figure 2: Solid-gas sorption refrigeration cycle.
Let ∘ be the operation of group G and ⊕ m i the operation of the cyclic group Z mi . If t , g ∈ G, then where the cyclical group operation is represented as e inverse g − 1 of the element g ∈ G is defined as With the previous group operations, the matrix V NxN is formed, where N 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. e matrix V NxN 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. e 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. erefore, 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.
Once the ANN architecture was defined, each output of the neural network is calculated by the following equation:

Mathematical Problems in Engineering
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, b1 j � bias of the hidden layer of the j-th neuron, b2 i � bias of the output layer at the i-th output, and I � i-th output.

Results and Discussion
After training the neural network, the results were obtained as follows (see Table 2). e 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. ese data were the heating time (t) from 0 to 10.31 h, the heating temperature ( f ) 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.
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. e 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.
e 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. e 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 f.

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]. e 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. e sensitivity analysis for each of the input variables was also performed by generalizing the equations of Dimopoulos et al. [32] for M outputs, which is given as follows: where SSD q is the sensitivity of the q-th output of the neural network, for q � 1, 2, . . . M, N is the total input data to the neural network, and M is the total number of outputs of the network.
where n is the total input parameters to the neural network.
where ni is the number of neurons of the hidden layer, e � 1, 2, · · · , n, f o q is the q-th activation function of the output layer, f h i is the i-th activation function of the hidden layer, W o are the weights of the output layer, W h are the weights of the hidden layer, W h ei 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, W o qi 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 ' 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 x p j is the p-th input to train or simulate the network.
where x o q 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 f and t.

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][34][35]. All the uncertainties calculated for the sensors used in this research were based on evaluation of measurements described in [35], and a probability p � 0.99 and a coverage factor k � 3 were proposed. e expanded uncertainty of the J-type class 2 temperature sensor of Ametek brand [36] is U � 2.9°C. e 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.

Conclusions
e 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 A n 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 Table 3: Result of sensitivity analysis of the input parameters of the neural network (all data are multiplied by 1e + 57).

Output
Input r1  Mathematical Problems in Engineering 9 learning process than applying the alternating symmetry group A n . 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 ( f ) and desorption time (t). e analysis of the uncertainties of experimental measurements allowed obtaining a higher learning precision of the neural network (r � 0.9957).

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

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.