# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### First-Order Irreversible Chain Reactions
Specifically, we focused on network architectures consisting of one, two, and three hidden layers, implemented using physics-informed neural networks. Subsequently, we compared the results obtained with deep neural networks. The respective outcomes of these analyses are succinctly presented in Table 5. The results indicate that the PINN with one hidden layer achieves good accuracy, and increasing the number of layers does not significantly improve performance. Interestingly, the three hidden layer PINN model showed a lower computation time (9 s) than the two layer model (13 s). There are various reasons for this unexpected outcome. Firstly, the increased depth (three layers) might enable more efficient learning and quicker convergence to a solution, thereby reducing the required epochs for training. Although the table shows more epochs for the two-layer configuration than the three-layer one, the actual computation time (CPU time) is less for the latter. This suggests that each epoch in the three-layer configuration is computationally less expensive. Moreover, the three-layer network might better capture the complexities of the modeled dynamical system, leading to more efficient computation per epoch. This is indirectly supported by parameter estimation accuracy (\(k_{1}\) and \(k_{2}\)), which are very close to their ideal values in the three-layer setup, indicating a high-quality learning process. Therefore, the reduction in computation time for the three-layer networks compared to the two-layer ones can be attributed to more efficient learning per epoch, potentially due to better repre \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Error Metrics** & \(\mathbf{u_{1}(PINN)}\) & \(\mathbf{u_{1}(DNN)}\) & \(\mathbf{u_{2}(PINN)}\) & \(\mathbf{u_{2}(DNN)}\) \\ \hline \(MAE\) & 2.7979 \(\times\) 10\({}^{-7}\) & 2.1615 \(\times\) 10\({}^{-6}\) & 3.0801 \(\times\) 10\({}^{-6}\) & 2.3330 \(\times\) 10\({}^{-5}\) \\ \(MSE\) & 1.3095 \(\times\) 10\({}^{-13}\) & 7.0444 \(\times\) 10\({}^{-12}\) & 1.1916 \(\times\) 10\({}^{-11}\) & 5.6775 \(\times\) 10\({}^{-10}\) \\ \(RMSE\) & 3.6187 \(\times\) 10\({}^{-7}\) & 2.6541 \(\times\) 10\({}^{-6}\) & 3.4519 \(\times\) 10\({}^{-6}\) & 2.3827 \(\times\) 10\({}^{-5}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of obtained error results using PINN vs. DNN. This table presents a detailed analysis of the error metrics for both PINN and DNN models across two variables, \(u_{1}\) and \(u_{2}\). The results highlight the superior accuracy of PINNs, as evidenced by significantly lower error values across all metrics compared to DNNs, underscoring the effectiveness of PINNs in dynamic system modeling. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Layers** & **Neurons** & \(\mathbf{k_{1}(PINN)}\) & \(\mathbf{k_{1}(DNN)}\) & \(\mathbf{k_{2}(PINN)}\) & \(\mathbf{k_{2}(DNN)}\) & **Epochs** & **CPU PINN** & **CPU DNN** \\ \hline
1 & 40 & 4.99815 & 4.9925046 & 1.0002131 & 0.9969400 & 21378 & 10s & 30s \\
2 & 40, 40 & 5.0000534 & 4.9999063 & 1.00021 & 1.0000036 & 24358 & 13s & 33s \\
3 & 40, 40, 40 & 4.999991 & 5.0050346 & 0.9999847 & 1.0018185 & 16021 & 9s & 24s \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of PINN vs. DNN based on shallow vs. deep layers through the approaches described in Scenario 1. This table details the accuracy of parameter estimation (\(k_{1}\) and \(k_{2}\)) and computational performance across various network depths. Notably, it showcases the increasing computational efficiency of PINNs over DNNs, with improvements of 66.67%, 60.61%, and 62.5% for different layer configurations. These findings emphasize the enhanced efficiency and adaptability of PINNs in handling complex dynamical systems, especially in deeper network architectures. sentation and processing of the complex relationships in the data by the deeper network architecture.