## 3 Beam Layout and Frequency Allocation Optimization Method Based on User Distribution
### Number of Actual Accessible Users for a Satellite  
The distribution of users in different beams is different, and so is the number of users. To improve spectrum utilization, the frequency resource allocation between beams and within and outside the same beam needs to be dynamically adjusted according to the actual distribution of users.  
The number of users that can actually be accessed depends on the user channel. During the uplink process, the channel gain \(h_{i}^{m}\) for a single user is  
\[h_{i}^{m}=G_{t}\cdot G_{r}\cdot PL \tag{4}\]  
\[PL=\left(\frac{c}{4\pi d_{i}f_{c}}\right)^{2} \tag{5}\]  
where \(G_{t}\) and \(G_{r}\) represent the signal transmission gain and reception gain, respectively; \(PL\) is the loss of the signal path from the user terminal to the satellite; \(d_{i}\) is the distance between the user terminal and the satellite signal; \(f_{c}\) is the carrier frequency of the signal.  
The received signal power \(P_{i}^{m}\) of a single user on the satellite is  
\[P_{i}^{m}=P_{0}^{m}\cdot h_{i}^{m}=P_{0}^{m}\cdot G_{t}\cdot G_{r}\cdot PL \tag{6}\]  
To measure the channel conflict that may be caused by frequency multiplexing in the MHSTFC-UD model, the conflict factor \(\alpha\) is defined.  
The reasons that may cause channel interference are the frequency resources allocated to adjacent beams overlap under the same time slot and code sequence, and the code sequence repeats within the same beam under the same time slot and frequency.  
\[\alpha_{i}=\frac{B_{i}\cap B_{j}}{B_{i}}+\frac{\cap Code_{m}}{\sum\limits_{m= 1}^{U_{i}}Code_{m}}-\frac{B_{i}\cap B_{j}}{B_{i}}\cdot\frac{\cap Code_{m}}{ \sum\limits_{m=1}^{U_{i}}Code_{m}} \tag{7}\]  
\[B_{i}=B_{s}^{i}+B_{c}^{i} \tag{8}\]\(B_{s}^{i}\) and \(B_{c}^{i}\) represent the bandwidth allocated to the edge area and the center area within the same beam, respectively; \(Code_{i}\) represents different code patterns.  
The user distribution position under the satellite beam is different, and the path loss caused by the near and far effect is also different. To avoid excessive signal power of some terminals and interference to other signals during demodulation, the power of users in the beam cell is controlled so that the signal strength reaching the receiving end is equal. Then, the SINR of the beam cell is  
\[SINR_{i}=\frac{\sum\limits_{m=1}^{U_{i}}P_{i}^{m}}{N_{0}B_{i}+\sum\limits_{m= 1}^{U_{i}}\alpha_{i}P_{i}^{m}} \tag{9}\]  
Therefore, the throughput \(C_{i}\) of the \(i\)th beam in a unit time slot is  
\[C_{i}=C_{s}^{i}+C_{c}^{i}=B_{i}\text{log}_{2}(1+SINR_{i}) \tag{10}\]  
To further increase the user capacity, TDMA and CDMA are used. For CDMA, it is  
\[N_{t}=\frac{(M-1)P_{i}^{m}}{B_{w}}+N_{0} \tag{11}\]  
\[E_{b}=\frac{P_{i}^{m}}{V_{code}} \tag{12}\]  
Furthermore, the signal-to-noise ratio \(\frac{E_{b}}{N_{t}}\) is  
\[\frac{E_{b}}{N_{t}}=\bigg{(}\frac{B_{w}}{V_{code}}\bigg{)}\cdot\frac{P_{i}^{m} }{N_{0}B_{w}+(M-1)P_{i}^{m}} \tag{13}\]  
That is, the number of users can grow, as follows:  
\[M=\frac{B_{w}}{R}\cdot\frac{N_{t}}{E_{b}}-\frac{N_{0}B_{w}}{P_{i}^{m}}+1 \tag{14}\]  
For TDMA, according to the satellite transit time \(T\) and the time required for a single message \(\frac{L}{V_{t}}\), the number of time slots that can be divided \(N_{slot}\) can be obtained as follows:  
\[N_{slot}=\frac{TV_{t}}{L} \tag{15}\]  
Therefore, when the throughput required by a single user is \(C_{0}=B_{m}\text{log}_{2}(1+SINR_{m})\), the total number of users \(N_{user}\) that can be accessed to a single satellite is  
\[C_{i}=M\cdot N_{slot}\cdot B_{i}\text{log}_{2}(1+SINR_{i}) \tag{16}\]  
\[N_{user}=\sum\limits_{i=1}^{K}C_{i}/C_{0} \tag{17}\]