Construction of the mathematical model of a catalytic reaction by means of a perceptron with one hidden layer

Mathematical models for the homogeneous catalytic reaction between alcohols and dimethyl carbonate were developed using the least-squares method, a perceptron with one hidden layer, and the law of mass action. The structure of a trainable neural network is presented. The relative deviation error between the calculated and experimental values is minimum when the perceptron model with one hidden layer is used.


Introduction
Artificial neural networks consist of formal neurons and connections between them. Figure 1 illustrates a formal neuron [1].

Figure 1. Formal neuron structure.
A perceptron is one of the neural network models. A neural network consists of an input layer (n inputs), a hidden layer (m formal neurons), and an output layer (k outputs). A Neural network is trained at the instant of an error as a result of changing the neuron input weights. A backpropagation neural network is a tool to search for regular trends, to make predictions, and to perform qualitative analysis. Backpropagation neural networks got their name because of the employed learning algorithm in which the error propagates from the output layer towards the input layer, i.e., in the direction opposite to the signal propagation direction in the case of normal network functioning. A backpropagation neural network is composed of several neuron layers, with each neuron of layer i being connected to each neuron of layer i+1, i.e., this is a fully connected neural network [2][3][4][5].
The key advantages of the backpropagation neural network are as follows: solving problems with unknown regular trends; stability to input data noise; adjustment to changes; the potential super-high speed of action; and failure tolerance for hardware implementations of a neural network [6,7].
The key drawbacks are as follows: long-time computing, complications in the understanding of the operation.
In this study, we employed neural networks to describe the experimental data obtained for the reaction of dimethyl carbonate (DMC) with alcohols catalyzed by metal complexes [8][9][10]. The reaction complies with green chemistry principles. DMC proved to be necessary as an efficient substitute for the existing toxic reagents, in particular, phosgene and metal halides. In the presence of metal complexes such as octacarbonyldicobalt (Со 2 (СО) 8 ) and hexacarbonyltungsten (W(СО) 6 ) as catalysts [1], this reaction can be triggered at temperatures of 150-200°С.
starting conditions: x . Where t is a time, min; ν ij are stoichiometric coefficients; J is a number of steps; x i is a concentration of a reactant, mol/l; I is a number of compounds; w j is a rate of jth step, 1/min; k j is a rate constant of steps (reduced), 1/min; E j is an activation energy of reactions, kcal/mol; T is a temperature, K; k j 0 are pre-exponential factors, 1/min.

Mathematical description of the kinetic equations for the reaction of dimethyl carbonate with alcohols
The scheme of chemical transformations and rate equations for the steps of the reaction of dimethyl carbonate with alcohols are summarized in Table 1. Table 1. Chemical reaction steps and kinetic equations for the reaction of dimethyl carbonate with alcohols in the presence of Co 2 (CO) 8 .
The relative deviation error of the experimental data from the values calculated by model (1) is about 10%. In addition to the kinetic curves derived from the developed model (1), we attempted to describe the curves by the least-squares method and using a trainable neural network.

Least-squares approximation
The least-squares investigation of the experimental data for ROCO 2 Me [19] has shown that the points are described best by function (3).
x 5 (t)=0.32*arctgt(t) + 0.33 (3) Figure 3 shows the experimental data (points) and theoretical values (curves) calculated by model (3) for the target reaction product ROCO 2 Me. The error of approximation was about 14%. The approximation error exceeded the error obtained using the law of mass action. Thus, we abandoned the use of the least-squares method.  Figure 4 shows the block diagram of the algorithm that implements a trainable neural network in the Python program. The specified data are entered via the keyboard or as a file prepared in advance. This is followed by tuning to the number of neurons in the hidden layer, activation functions, and neuron input weights. The number of neurons in the hidden layer may vary depending on the input data and the accuracy of the description. The activation function uses the hyperbolic tangent, as hidden layer neurons implement a ternary separable function. The neuron input weights are specified randomly or specified in advance. As a result of the variation of these weights, the perceptron is trained. During operation and self-learning, the neural network will change the weights. Next, the number of epochs is defined for a more accurate selection of the neuron input weights (in this case, 1000). Then the data are entered into the tuned neural network. This stage includes data approximation and perceptron selflearning via the change in synapse coefficients and plotting a curve. Then the mathematical model is determined for the resulting curve using the previously obtained neural network data.

Data approximation with the trained neural network
The input data were processed with a perceptron [20]. One neural network hidden layer is sufficient to solve this task. The points at temperatures from 20°C to 200°C were fed into the input layer. This layer approximates the data and sends the data to the second layer. The second layer selects the coefficients such that the description using them satisfies the specified values. Owing to the second layer, synapse weights are learned (at the second layer entrance). We analyzed three chemical experiments: 1) T = 180°C; catalyst amount: 3 mmol. The developed model has the form (4). x=th(x / 46.25) * 0.94 (4) Figure 5 shows the experimental data (points) and theoretical values (curves) calculated by model (4)  x=th(x / 62.73) * 0.798 (5) Figure 6 shows the experimental data (points) and theoretical values (curves) calculated by model (5) for the target reaction product ROCO 2 Me.   The approximation error ξ is defined in terms of variance. The std() function of the NumPy Python library was utilized. The variance was determined for a random sampling of elements L from the overall distribution. The actual unbiased variance was assessed using the parameter ddof (data degrees of freedom) (7).
For models (3)-(5), the approximation error was 5-7%. In the future, we plan to reduce the error in neural network training down to 1%.

Conclusion
Mathematical models for the homogeneous catalytic reaction between alcohols and dimethyl carbonate were developed using the least-squares method, a perceptron with one hidden layer, and the law of mass action. The structure of a trainable neural network is presented. The relative deviation error between the calculated and experimental values is minimum when the perceptron model with one hidden layer is used.
With an increasing amount of data, the mathematical model will describe the experiment with an increasing approximation error. The trainable neural network will learn taking account of various experimental data. It is planned that subsequently, the neural network would describe large arrays of input data. The computational accuracy would increase. This neural network will be used to develop models of homogeneous and heterogeneous catalytic reactions.