# Spectrum and Energy Efficiency of Uplink Massive MIMO System with D2D Underlay
## 5 Numerical and Simulation Results  
In this section, the Monte Carlo simulations are performed over \(10^{5}\) independent trials. We verify the tightness of our analysis and show the optimal number of antennas obtained by our closed-form expression for a given \(P_{\mathrm{c}}\). The large-scale fading (path-loss) at distance \(d\) is set as \(\mathcal{L}(d)=10^{-3.53}d^{-3.76}\)[19]. The distance between the D2D users is set as \(10\) m. Without loss of generality, \(K=15\) CUEs and the D2D link are uniformly placed in a circle of radius 200 m around the BS. The other parameter settings are detailed in Table 1.  
Figure 2 shows the PDF \(f_{\gamma_{ck}}(x)\) obtained by our closed-form approximation and the simulations with \(P_{\mathrm{c}}=500\) mW for different number of antennas. A good match can be observed between our closed-form approximation and the simulations.  
Figure 3 plots the achievable rate and the outage probability of CUEs versus the number of antennas. It reveals that the analytical results agree reasonably well with the simulation results. With the increase of the number of BS antennas, the achievable rate can be significantly improved. In addition, the derived lower bound rate is close to the real value. To evaluate the impact of \(P_{\mathrm{c}}\) on the performance of massive MIMO system, the achievable rate of CUEs is shown in Figure 4. The achievable rate gets larger and approaches the upper bound with the increase of \(P_{\mathrm{c}}\). It can be seen that increasing the transmit power imposes less impacts compared with increasing the number of antennas.  
We have \(P_{\mathrm{c}}^{\mathrm{max}}=1100\) mW by solving \(\mathcal{R}_{d}\left(P_{\mathrm{c}}\right)=r\). Then, the optimal solution of P1 can be obtained by a one-dimensional search w.r.t. \(P_{\mathrm{c}}\) from 0 to 1100 mW. Figure 5. plots the EE for different number of BS antennas and different \(P_{\mathrm{cir}}\) for a given \(P_{\mathrm{c}}=500\) mW. From the plot, we can see that the analytical result is the same as the result obtained by the exhaustive search. As expected, the optimal number of antennas gets smaller with the increase of \(P_{\mathrm{cir}}\).  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Parameter** & **Value** \\ \hline \(\sigma^{2}\) and \(\sigma_{d}^{2}\) & -96 dBm [19] & \(P_{\mathrm{d}}\) & 20 dBm \\ \hline \(P_{0}\) & 40 dBm [20] & \(\gamma_{c}\), \(\gamma_{d}\), and \(\bar{\gamma}_{th}\) & 10 dB \\ \hline \(r\) & 6 bps/Hz & \(N_{th}\) & 33 [20] \\ \hline \hline \end{tabular}
\end{table}
Table 1: Simulation Parameters.  
Figure 2: The probability density function of the signal-to-interference-plus-noise ratio (SINR) of cellular user equipments (CUEs), \(P_{\mathrm{c}}=500\) mW.  
Figure 4: The achievable rate of CUEs vs. the transmit power of CUEs, \(N=150\).  
Figure 5: Energy efficiency for different number of BS antennas and different \(P_{\text{cir}}\), \(P_{\text{c}}=500\) mW.  
Figure 3: The achievable rate and the outage probability of CUEs vs. the number of base station (BS) antennas, \(P_{\text{c}}=500\) mW.  
Figure 6 compares the maximized EE and the optimal number of antennas obtained by our proposed method and the exhaustive search. As expected, our proposed method achieves the same performance as the optimal exhaustive search with higher complexity.