|
Algorithm 2 Optimal design of cooperative transmission. |
Input: transmit power P, transmit rate , number of relays . Output: power allocation factor , relay location factor .
-
1:
According to Equation (33), we can observe that and are two parts that do not affect each other. Then, we can obtain the optimal values of and separately.
-
2:
The calculation of the optimal value of :
-
3:
According to Equation (34), is optimal when reaches the maximum value.
-
4:
After obtaining (the average number of successful relays), get the expression of the average value of .
-
5:
Establish the equation .
-
6:
Solving the derivative of the above equation, we have .
-
7:
The optimal power allocation factor is .
-
8:
The calculation of the optimal value of :
-
9:
Initialization , , .
-
10:
fordo
-
11:
for
do
-
12:
Calculate according to Equation (41).
-
13:
end for
-
14:
Search for the value of when is the minimum, and this is optimal.
-
15:
end for
-
16:
The calculation is completed.
|