# Optimizing Physics-Informed Neural Network in Dynamic System Simulation and Learning of Parameters
## 5 Computational Simulations of Dynamical Systems
### Biomass Transfer  
Biomass transfer involves the movement of organic material from one organism to another within an ecosystem. This concept is key to understanding the flow of energy within an ecosystem, as energy is transferred from producers (like plants) to primary consumers (like herbivores) and then on to secondary and tertiary consumers (like carnivores and omnivores). Imagine a forest in Europe populated by one or two species of trees. We pick out some of the eldest among them, those on the brink of their life cycle and anticipated to wither in the coming years. We then observe their journey from living, thriving trees to becoming lifeless entities. Over time, these deceased trees decompose and topple due to natural seasonal changes and biological influences. Ultimately, these fallen trees transform into nutrient-rich humus, completing their life cycle [30]. Differential equations are often used to model biomass transfer as they can describe the rate of change of a quantity (in this case, biomass) over time. Let us consider the dynamical system model of a biomass transfer  
\[ \begin{split}\frac{du_{1}(t)}{dt}&=-a(t)u_{1}(t)+b( t)u_{2}(t)\\ \frac{du_{2}(t)}{dt}&=-b(t)u_{2}(t)+c(t)u_{3}(t)\\ \frac{du_{3}(t)}{dt}&=-c(t)u_{3}(t).\end{split}  \tag{18}\]  
where variable \(u_{1}(t)\), \(u_{2}(t)\) and \(u_{3}(t)\) is defined by  
\[ \begin{split} u_{1}(t)&:\text{ biomass decayed into humus per time}\\ u_{2}(t)&:\text{ biomass of dead trees per time}\\ u_{2}(t)&:\text{ biomass of living trees}\\ t&:\text{time in decades}\end{split} \]  
and the variable \(a,b\) and \(c\) are the parameters required to be estimated. Given that \(a=1\), \(b=3\), \(c=5\) and the initial conditions of \(u(t=0)=[0,0,1]\), then the observed data [12] are given in Table 10. \begin{table}
\begin{tabular}{c c c c} \hline \hline \(t\) & \(u1\) & \(u2\) & \(u3\) \\ \hline
0.0 & 0.000000 & 0.000000 & 1.000000 \\
0.1 & 0.055747 & 0.335719 & 0.606531 \\
0.2 & 0.166850 & 0.452330 & 0.367879 \\
0.3 & 0.282767 & 0.458599 & 0.223130 \\
0.4 & 0.381125 & 0.414647 & 0.135335 \\
0.5 & 0.454416 & 0.352613 & 0.080285 \\
0.6 & 0.502502 & 0.288780 & 0.049787 \\
0.7 & 0.528506 & 0.230648 & 0.030197 \\
0.8 & 0.536641 & 0.181006 & 0.018316 \\
0.9 & 0.531127 & 0.140241 & 0.011109 \\
1.0 & 0.515706 & 0.107623 & 0.006738 \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Observed values of \(u_{1},u_{2}\) and \(u_{3}\) at different time points. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Epochs** & **Loss** & **Error u** & **Error v** \\ \hline
50,000 & 2.7514 \(\times\)\(10^{-2}\) & 7.9001 \(\times\)\(10^{-4}\) & 5.5722 \(\times\)\(10^{-4}\) \\
40,000 & 1.9048 \(\times\)\(10^{-1}\) & 1.5938 \(\times\)\(10^{-3}\) & 3.3815 \(\times\)\(10^{-3}\) \\
30,000 & 1.5272 \(\times\)\(10^{-1}\) & 2.8571 \(\times\)\(10^{-3}\) & 5.4818 \(\times\)\(10^{-3}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 9: Analysis of the Brusselator model using different epochs. The analytical solution of (18) is given as follows:  
\[ \begin{split} u_{1}(t)&=\frac{15}{8}\bigg{(}e^{-5t}-2e^ {-3t}+e^{-t}\bigg{)}\\ u_{2}(t)&=\frac{5}{2}\bigg{(}-e^{-5t}+e^{-3t}\bigg{)} \\ u_{3}(t)&=e^{-5t}.\end{split}  \tag{19}\]  
The PINN approach to solve and identify the parameters of the biomass transfer model is made by finding the best network parameters, \(\omega\), representing the biases and weights network that minimizes the loss function. Following a similar procedure in the previous application, we offer PINN with four networks to do this. The first network outputs are \(u_{1 NN}(t_{n};\omega)\), \(u_{2 NN}(t_{n};\omega)\) and \(u_{3 NN}(t_{n};\omega)\), which admits \(t\) as the input data. The second, third and fourth networks learn the parameters \(a(t_{n};\Phi)\), \(b(t_{n};\Phi)\) and \(c(t_{n};\Phi)\) from the data. We define the residual loss \(\zeta_{r}(\omega;\kappa_{r})\) and training loss \(\zeta_{t}(\omega;\kappa_{t})\) as follows:  
\[\zeta_{r}(\omega;\kappa_{r})=\frac{1}{\kappa_{r}}\sum_{i=1}^{3}\sum_{n=1}^{ \kappa_{r}}|r_{i}(t_{n})|^{2}. \tag{20}\]  
where  
\[