# A Short Note on Physics-Guided GAN to Learn Physical Models without Gradients
## 4 Numerical Study: [PERSON]'s Equations of Motion  
[PERSON]'s equation of motion under gravity is expressed as \(\boldsymbol{x}(t)=\boldsymbol{x}_{0}-\frac{1}{2}gt^{2}+\boldsymbol{v}_{0}t\), where \(\boldsymbol{x}_{0}\in\Re^{2}\), \(\boldsymbol{g}\in\Re^{2}\), \(\boldsymbol{v}_{0}\in\Re^{2}\), and \(t\) denote the coordinates of an initial point, gravitational acceleration, initial velocity vector, and time, respectively. Physical equation \(P\) is formulated as  
\[P(\boldsymbol{x}(t),\theta=\boldsymbol{v}_{0})=\left\|\boldsymbol{x}(t)- \boldsymbol{x}_{0}+\frac{1}{2}gt^{2}-\boldsymbol{v}_{0}t\right\|^{2},\]  
where \(\boldsymbol{v}_{0}=v_{0}(\cos\phi,\sin\phi)^{\top}\). The task is to output a sequence of coordinates  
\[\xi(\theta=\boldsymbol{v}_{0})=\Big{(}\boldsymbol{x}(\delta_{t};\theta)^{\top },\boldsymbol{x}(2\delta_{t};\theta)^{\top},\ldots,\boldsymbol{x}(100\delta_ {t};\theta)^{\top}\Big{)}^{\top},\]  
where the parameter \(\boldsymbol{v}_{0}\) is given. A dataset for pre-training is first prepared as  
\[\mathcal{D}=\{\xi(\theta=\boldsymbol{v}_{0})\mid v_{0}\in\{1,2,\ldots 100\},\ \phi\in\{0,1,\ldots,90\}\}.\]  
The total number of training datapoints was 9000. In the pre-training, the GAN model was trained using dataset \(\mathcal{D}\) for 10,000 epochs. Then, PG-GAN training was carried out. Threshold \(\varepsilon\) is defined as a function of the number of epochs \(e\) as follows:  
\[\varepsilon=\left\{\begin{array}{ll}5,&(\text{if }10,000\leq e<20,000),\\ 2.5,&(\text{if }20,000\leq e<30,000),\\ 1.25,&(\text{if }30,000\leq e<70,000),\\ 0.625,&(\text{if }70,000\leq e<100,000),\end{array}\right.\]  
Figure 3: Architecture of PG-GAN.  
The PG-GAN model was trained, and data \(\xi\) were output.  
After the training was conducted, the coordinates were obtained by using the generators. To compare the accuracy of the models, the residual was calculated for the output coordinates. The residual was calculated by  
\[r=\frac{1}{100}\sum_{k=1}^{k=100}P(\mathbf{x}(k\delta_{t}),\theta=\mathbf{v}_{0}).\]  
An ordinal GAN, physics-informed GAN (PI-GAN), and PG-PI-GAN were also trained and compared. Each model was trained and evaluated three times separately. Figure 4 shows the boxplots of the residuals of each model. Data outside of the 1.5 interquartile range (IQR) from the first and third quartiles was treated as outliers in the boxplot. Table 1 shows the median, first quartile, and interquartile range of the residuals. The physics-informed GAN featured the same GAN architecture, except for the residual \(r\), which was added to the loss function. All network structures were the same in all models. The PG-GAN was characterized by a lower median than the PI-GAN and by the first quartile values. The PG-PI-GAN presented similar median and first quartile values as those of the PG-GAN, but the IQR was lower than that of the PG-GAN. These results show that the PG-GAN effectively reduces the median value, but does not reduce the IQR value. This difference comes from the loss functions of both models. The residual was added in the loss function of the PI-GAN, and hence the residual of all generated data were reduced. By contrast, the PG-GAN considered no residual in the loss function. The undesired data indicated larger residuals. Note that the amount of residuals of undesired data does not affect the loss function. Hence, the residuals of the undesired