# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### Biomass Transfer
\begin{split} r_{1}(t_{n})&=\frac{du_{1 NN}(t_{n}; \omega)}{dt}-\bigg{(}-a(t_{n};\Phi)u_{1 NN}(t_{n};\omega)+b(t_{n};\Phi)u_{2 NN}( t_{n};\omega)\bigg{)}\\ r_{2}(t_{n})&=\frac{du_{2 NN}(t_{n};\omega)}{dt}- \bigg{(}-b(t_{n};\Phi)u_{2 NN}(t_{n};\omega)+c(t_{n};\Phi)u_{3 NN}(t_{n};\omega) \bigg{)}\\ r_{3}(t_{n})&=\frac{du_{3 NN}(t_{n};\omega)}{dt}- \bigg{(}-c(t_{n};\Phi)u_{3 NN}(t_{n};\omega)\bigg{)}\end{split}  \tag{21}\]  
and  
\[ \begin{split}\zeta_{t}(\omega;\kappa_{t})=\frac{1}{\kappa_{t}} \bigg{(}\sum_{n=1}^{\kappa_{t}}|u_{1 NN}(t_{n};\omega)-u_{1}(t_{n})|^{2}+\sum_{ n=1}^{\kappa_{t}}|u_{2 NN}(t_{n};\omega)-u_{2}(t_{n})|^{2}\\ +\sum_{n=1}^{\kappa_{t}}|u_{3 NN}(t_{n};\omega)-u_{3}(t_{n})|^{2} \bigg{)}.\end{split}  \tag{22}\]  
The neural network obtains the optimal values for the model parameters. The \(u_{1}(t_{n})\), \(u_{2}(t_{n})\) and \(u_{3}(t_{n})\) represent the loss function's training data. The training process minimizes the residual loss, which measures the discrepancy between the model predictions and the actual differential equations, and the training loss, which measures the discrepancy between the model predictions and the observed data. Finally, the biomass transfer model's time-varying parameters were obtained using PINN with one layer of 10 neurons, 71,800 epochs, the tanh activation function, and a learning rate of \(10^{-3}\). The PINN Algorithm 3 for learning the optimal parameters of the biomass transfer model (18) is shown below. The time-varying parameters \(a(t)\), \(b(t)\), and \(c(t)\) are obtained using the above two scenarios. The corresponding Equation (19) system was solved at \(t^{*}=0.26\), \(0.65\), and \(0.59\) for parameters \(a,b\), and \(c\), and Figure 12 shows the obtained exact solution and the predicted output of the biomass transfer model. The 3D surface plot of the actual output of species \(u_{1},u_{2}\) and \(u_{3}\) and the predicted output of species \(u_{1},u_{2}\) and \(u_{3}\) is shown in Figure 13. Figure 14 shows the learned time-varying parameter values of the biomass transfer model for different inputs of \(a(t),b(t)\), and \(c(t)\). The \(a\), \(b\), and \(c\) curves look like quadratic functions. The plot of the absolute error between the target and the predictions is shown in Figure 15. Table 11 shows the parameters and error metrics obtained through the approaches described in Scenarios 1 and 2. We observe that Scenario 1 proved more accurate than Scenario 2. The results demonstrate that the PINN approach yields accurate parameter estimates and predictions for the biomass transfer model. The obtained parameters are close to their true values, and the error metrics indicate high accuracy and performance. In addition, the results obtained from the physics-informed neural networks approach are compared with the values and results reported in the literature using deep neural networks [12]. This comparative study was conducted with a configuration of 71,800 epochs and one hidden layer containing 10 neurons. The results are shown in Table 12. The PINN approach outperforms the DNN approach in terms of accuracy and computational efficiency, as evidenced by comparing results and CPU times in Table 12. Furthermore, Table 13 presents a comparative analysis between physics-informed neural networks and deep neural networks, illustrating the differences in their performance across shallow and deep layers. The CPU time of PINN for one, two, and three layers with 40 neurons are 9, 9, and 6 s, while for DNN is 20, 19, and 16 s [12]. The data presented in Table 13 demonstrates that the PINN approach outperforms the DNN approach in terms of accuracy and computational efficiency, as evidenced by comparing results and CPU times, especially in both shallow and deep-layer processing capabilities. Specifically, for a network with one layer of 40 neurons, the PINN model was 55% more efficient than the DNN model. Similarly, for two layers of 40 neurons each, the efficiency improvement was 52.63%, and for three layers, it increased to 62.5%.