Skip to main content
. 2023 Apr 11;23(8):3884. doi: 10.3390/s23083884
Algorithm 2 Power allocation algorithm based on water injection method
1. Set the water level for the initial water injection, and let θ=1KPmax+k=1K1Hk;
2. The channel state values of each channel are arranged in ascending order from smallest to largest, and the power values are also arranged in ascending order at this time.
3. Use Equation (41) to calculate the power allocated to each channel.
4. If the power assigned to a channel is less than 0, then set its value to 0 and eliminate it in the next iteration; if the power assigned to a user is greater than pmax+pmaxu, then set its value to pmax+pmaxu and return to step 2 to finally obtain the transmit power of all channels.
5. The allocated power of users in each channel is calculated by Equations (42) and (43), and if the allocated power is greater than its maximum value, the maximum value is taken to finally complete the power allocation.