 user signal space. Their SINR is expressed as (2.19) The optimal power allocation factor >u(n,2) is yet to be solved. Based on the optimization problem proposed in Section 2.3, we form a new problem that aims to maximize the sum capacity in each beam. (2.20) subject to < du(n,2) (2.21) (2.22) The problem defined above is convex with respect to Nu(n,2) and its Karush-Kuhn-Tucker (KKT) conditions are given as follows. (2.23) dru(n,2) (2.24) (2.25) (2.26) Equation (2.23) is the stationarity condition and M is KKT multiplier, (2.24) is the primal feasibility, (2.25) is dual feasibility, and (2.26) is the complementary slackness. Solving for (2.23), we can get (2.27) H1H2P(H-ID2) 2 5G Wireless Networks with Underlaid D2D Communications where, P = Pn/o is the transmit SNR, H2 = |hu(n,2)12, = |hu(n,1)Wnl2 is the channel gain for users 2 and 1, I1 is the interference-to-noise ratio of users and 2, respectively. I the inter-beam interference-to-noise ratio. Clearly, Otherwise, Nu(n,2) 0 cannot satisfy (2.21). Therefore, we can solve (2.26) for the optimal Nu(n,2)' (2.28) Nu(n,1) 1 Nu(n,2) (2.29) 2.4.2.2 Second ZF Precoding In the second ZF precoding, the inter-beam interference remains for both first and second users. Their respective SINR are as follows. (2.30) (1-22)PH' (2.31) Similarly, 22 is the power allocation factor for the user with stronger channel. H' = |hu(n,1)WZF212 H'2 = |hu(n,2)WZF212 are the channel gains for users 1 and 2, respec- = has the same format as IDI but with different precoding vector, the same to I'D2. We form a similar optimization problem as in (2.20) and detailed derivations are omitted here. The respective optimal power allocation factor for the second and first users is (2.32) (2.33) 2.5 Numerical Results In this section, we present the performance results from simulation. The coverage area of MBS is circular with a radius of 500 m. The number of transmit antennas is N = 3. The total numbers of CUs and DUs are M = [8, 16, 32, 60, 90] and P = 2, respectively. M varies in order to study the 