Skip to main content
. 2019 Jan 15;19(2):329. doi: 10.3390/s19020329
Algorithm 2 Optimal design of cooperative transmission.
Input: transmit power P, transmit rate If, number of relays Ns.
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 Ps1Ps2 reaches the maximum value.

  • 4:

    After obtaining N¯ (the average number of successful relays), get the expression of the average value of Ps2.

  • 5:

    Establish the equation Ps1Ps2=0.

  • 6:

    Solving the derivative of the above equation, we have Ps1P/ξ.

  • 7:

    The optimal power allocation factor is α=Ps1ξ/(2P)0.5.

  • 8:

    The calculation of the optimal value of μ:

  • 9:

    Initialization t=0.01, 0μ1, Ns=2,3,4,5,6.

  • 10:

    forNs=2:1:6do

  • 11:

    for μ=0:t:1 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.