1 Introduction

1.1 Background of Cooperative Networks

Designers of telecommunication systems have always attempted to design systems transmitting information with higher quality i.e. higher speed and higher reliability. Using multiple antennas in the transmitter and/or receiver has been one of the most effective techniques to achieve this target. In multiple antenna systems, higher speed (or equivalently higher capacity) can be achieved by spatial multiplexing and higher reliability (i.e. lower probability of error or lower probability of outage) is achievable by means of space–time coding schemes [1]. Spatial multiplexing in Multiple-Input Multiple-Output (MIMO) wireless communication is a transmission technique that divides the incoming data into multiple parallel sub-streams and transmits each on a different antenna [2] while space–time coding schemes rely on transmitting multiple, redundant copies of data signals on the antennas.

In practice, it may be impractical to have multiple antennas in one device due to size, cost and/or hardware limitations [3]. The idea of cooperative (or relay) networks is the solution to this problem. In the cooperative networks, different nodes of the network, located in different locations, cooperate with each other and provide a system of distributed antennas and as a result the same benefits as the conventional MIMO wireless systems.

A very vast amount of research in the field of relay networks has been conducted so far and various system models have also been proposed in order to provide a special advantage. One Way Relay Networks (OWRNs), as depicted in Fig. 1 are one of the simplest models in which information is flowed in one direction from the source node toward the destination node.

Fig. 1
figure 1

One-way relay network

Two-Way Relay Networks (TWRNs) on the contrary are ones in which two distinct terminals exchange information via a single or multiple relay nodes and therefore a bidirectional data flow happens. A OWRN, as depicted in Fig. 2a simply needs four time-slots to handle information bidirectionally (two time-slots for each direction); while in a network with no relays two time-slots are sufficient (Fig. 2b). Therefore the capacity of a bidirectional relay channel is half of the bidirectional channel with no relays.

Fig. 2
figure 2

Steps of information exchange in a a TWRN with no use of network coding; b direct channel with no relays

Recent TWRN protocols complete the information exchange between two source nodes in two or three transmission phases by employing the network coding schemes, designed for multicast [4]. In the next subsection where these protocols are explained, we will elaborate on how network coding schemes can improve the spectral efficiency of a TWRN.

1.2 Protocols of the Cooperative Networks

Several different protocols have been proposed so far which can be served as the basis of the transmission technique in a TWRN. The two most important of these protocols are called time division broadcast (TDBC) and multiple access broadcast (MABC) which assume three and two time-slots respectively for the transmission of messages [5]. Kim et al. [6] have provided an overview of the different protocols for both the TDBC and the MABC in bidirectional relaying networks along with their corresponding achievable rate region analysis. The TDBC transmission protocol runs in three time-slots (Fig. 3):

Fig. 3
figure 3

Steps of information exchange in a TWRN with TDBC protocol

  1. I.

    Node a transmits its message x a to the relay;

  2. II.

    Node b transmits its message x b to the relay;

  3. III.

    The relay combines x a and x b by means of a network coding scheme and produces x r  = f(x a , x b ) and then broadcasts (BCs) it (for which this phase is called the BC phase). Each of the terminals performs a self-interference cancellation process over the received signal x r and extracts the intended message (b extracts x a and a extracts x b from x r ).

In the MABC transmission protocol on the other hand, messages are exchanged during the two time-slots and therefore it is more spectral efficient than the TDBC, although it is more complex to implement. These two phases are as follows (Fig. 4):

Fig. 4
figure 4

Steps of information exchange in a TWRN with MABC protocol

  1. I.

    Nodes a and b transmit, synchronously, their messages x a and x b to the relay by forming a conventional MAC channel [5] (for which this phase is called the MAC phase). We will give exact details of this phase in part 2.1.

  2. II.

    The second phase is exactly the same as the third phase in the TDBC protocol.

In addition to the above mentioned transmission techniques, different relaying schemes have been proposed in the literature [711]. The two most important are:

  1. I.

    Amplify and Forward (AF): The relay just amplifies the received signal and then retransmits it. Although this scheme needs no computation in the relay, but suffers from the noise amplification in relay.

  2. II.

    Decode and Forward (DF): The relay decodes the received messages from terminals and then re-encodes and transmits them. As a result, the noise is not amplified by using this scheme, although a large amount of computation is required at the relay.

1.3 Improving the Performance of Cooperative Networks

One of the most noticeable topics of research in the field of relay networks is the performance improvement. For performance improvement, one should choose a performance criterion and then devise a method to make that network perform better in terms of that criterion. Among various criterions such as minimizing the error probability, outage probability, power consumption or maximizing the energy efficiency, spectral efficiency, etc. we have concentrated, in this paper, on the outage probability. We will clarify the definition of outage probability in part 2.2.

Along with the appropriate criterion, the method for performance improvement is also important. Resource allocation (for instance power allocation) and relay selection (in multiple relay networks) are two examples. Optimal power allocation (OPA) to the active nodes is an effective method to improve the performance of a relay network. Authors in [4, 1216] have proposed various approaches to determine the optimal power of the nodes in a DF TWRN. The criterion considered in [12, 13, 16] is the achievable sum-rate which is aimed to be maximized. Authors in [14] propose a power optimization scheme in order to minimize the outage probability. In [4, 15], end-to-end BER has been chosen as the performance metric. The power allocation techniques proposed in [12, 13, 15, 16] have been based on the assumption that all the channel coefficients are known prior to determining the power values. In [14] some information such as antenna gains, path loss factor and distance between transmitters and receivers are required to evaluate the power values. It is assumed in [15] that mean channel gains are obtained by channel estimation.

1.4 Main Contributions of This Work

In this paper we propose a novel method for power allocation in a DF TWRN in which neither instantaneous value of the channel coefficients nor the antenna parameters are required. The only assumption we have made about the channels is the Rayleigh flat (not necessarily slow) fading. In other words we have assumed that only statistical Channel State Information (CSI) is available and instantaneous CSI is not required. Authors in [17] have obtained an expression describing the outage probability of a DF TWRN for two special cases: (a) all the nodes transmit with the same power but different rates; (b) all the nodes transmit with the same rate but different power. We have derived, for the first time, a mathematical expression, describing the outage probability of a TWRN in a more general case. In fact we have imposed no restriction on the rates of the nodes. The only constraint we have considered is that the power of the relay is no greater than the power of two end terminals. This expression is then regarded as the cost function and we attempt to minimize it by selecting appropriate values for the power of the nodes.

The remainder of this paper is organized as follows: In Sect. 2 the structure of the network and its performance metric are described. In Sect. 3 the optimization problem is introduced and solved, clarifying the power allocation scheme. Section 4 is devoted to simulation results and numerical analysis. Finally we conclude the paper in Sect. 5.

2 System Model, Notations and the Performance Metric

This section describes the structure of the network and the performance metric used for OPA.

2.1 Network Model

We assume a TWRN consisting of two terminals a and b and one relay. Terminals a and b are supposed to transmit independent messages w a and w b respectively to each other. It is assumed that all the nodes use the same codebook. There is no direct link between a and b and the transmission is proceeded only via the relay. All the nodes are considered as half-duplex single antenna transceivers. The physical channels between the terminals and the relay are reciprocal and described by h a and h b which are zero-mean independent circularly symmetric complex Gaussian random variables with unit variance. The additive noise in receivers is also considered as a zero-mean circularly symmetric complex Gaussian random variable with variance σ 2. Noise processes are independent in different receivers. The channel coefficients are not required to be constant during a transmission phase. Furthermore we have made no assumption of instantaneous channel coefficients being known.

We use R a and R b to denote the data rate of messages w a and w b respectively, i.e., \(w_{a} \in Z_{a} = \left\{ {0, \ldots ,\left\lfloor {2^{{R_{a} }} } \right\rfloor - 1} \right\}\) and \(w_{b} \in Z_{b} = \left\{ {0, \ldots ,\left\lfloor {2^{{R_{b} }} } \right\rfloor - 1} \right\}\) and x a and x b for corresponding transmitted signals of the two terminals. Moreover the transmission power of the three nodes are represented by P a , P b and P r .

The transmission protocol considered here is MABC DF which assumes two phases for information exchange. In the first phase, a and b transmit their messages to the relay by forming a conventional MAC channel [5]. The relay receives the signal

$$y_{r} = h_{a} x_{a} + h_{b} x_{b} + n_{r} ,$$
(1)

and then extracts the messages w a and w b by Maximum Likelihood (ML) decoding [18]

$$\left( {\overline{{w_{a} }} ,\overline{{w_{b} }} } \right) = \arg \min_{{\left( {w_{a} ,w_{b} } \right) \in Z_{a} \times Z_{b} }} \left| {y_{r} - \sqrt {P_{a} } h_{a} x_{a} \left( {w_{a} } \right) - \sqrt {P_{b} } h_{b} x_{b} \left( {w_{b} } \right)} \right|.$$
(2)

In the second phase the relay exploits a network coding scheme to combine messages and transmit to terminals. It reproduces a new signal x r , by bit-wise xor operation as a network coding scheme (x r  = x a  ⊕ x b ) and then broadcasts the corresponding signal. Terminals a and b receive the signal x r and then perform a self-interference cancellation operation (a xors x r with x a to extract the intended signal x b and b xors x r with x b to extract the intended signal x a ). Figure 5 depicts the structure of the network and the steps of information exchange between a and b.

Fig. 5
figure 5

Structure of the TWRN with MABC DF protocol and the steps of information exchange. a Multiple access phase. b Broadcast phase

Our attention in this work is only on the outage probability, not error probability; hence we assume that the relay and terminals are able to decode x a , x b and x r correctly without any error.

Although R a and R b are not confined to be equal, it is assumed that x a and x b are of the same length, since the bitwise xor operation requires the signals from a and b to have the same length [19].

Table 1 is included at the end of this part which summarizes all the notations and symbols that have been used in this work.

Table 1 Notations and symbols of the article

2.2 Performance Metric

We aim at setting the power values P a , P b and P r in order to minimize the outage probability. For any communication network, if the transmission rates of the nodes exceed out of a specific region, named achievable rate region, an outage will occur. The achievable rate region for the network described in Sect. 2.1 is determined by the constraints [5]

$$R_{a} \le \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + P_{a} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }}} \right),\log_{2} \left( {1 + P_{r} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right)} \right\},$$
(3)
$$R_{b} \le \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + P_{b} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right),\log_{2} \left( {1 + P_{r} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }}} \right)} \right\},$$
(4)
$$R_{a} + R_{b} \le \frac{1}{2}\log 2\left( {1 + P_{a} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }},1 + P_{b} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right).$$
(5)

If at least one of the constraints in (3)–(5) are not satisfied, an outage will occur.

3 Problem Formulation and Solution

We intend to find values P a , P b and P r by solving the problem

$$\begin{array}{*{20}c} {\begin{array}{*{20}c} {\hbox{min} imize} & {P_{outage} \left( {P_{a} ,P_{b} ,P_{r} } \right)} \\ \end{array} } \\ {\begin{array}{*{20}c} {s.t.} & {P_{a} + P_{b} + P_{r} = P_{sum} ,P_{r} \le P_{a} ,P_{r} \le P_{b} } \\ \end{array} } \\ \end{array} .$$
(6)

The conditions P r  ≤ P a and P r  ≤ P b have been considered to ensure that the relay is only an assistant node, aiding terminals a and b in their communications and therefore should consume the least amount of power between all the nodes.

3.1 Calculating the Outage Probability

According to Eqs. (3)–(5) we define three probability events A, B and C as

$$A = \left\{ {\left( {P_{a} ,P_{b} ,P_{r} } \right)|R_{a} > \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + P_{a} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }}} \right),\log_{2} \left( {1 + P_{r} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right)} \right\}} \right\},$$
(7)
$$B = \left\{ {\left( {P_{a} ,P_{b} ,P_{r} } \right)|R_{b} > \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + P_{b} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right),\log_{2} \left( {1 + P_{r} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }}} \right)} \right\}} \right\},$$
(8)
$$C = \left\{ {\left( {P_{a} ,P_{b} ,P_{r} } \right)|R_{a} + R_{b} > \frac{1}{2}\log_{2} \left( {1 + P_{a} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }} + P_{b} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}} \right)} \right\}.$$
(9)

As mentioned earlier in Sect. 2.2 the outage probability is

$$P_{outage} = pr\left\{ {A \cup B \cup C} \right\} = pr\left\{ {\left( {A^{{\prime }} \cap B^{{\prime }} \cap C^{{\prime }} } \right)^{{\prime }} } \right\} = 1 - pr\left\{ {A^{{\prime }} \cap B^{{\prime }} \cap C^{{\prime }} } \right\} = 1 - \varGamma ,$$
(10)

where we have employed De Morgan’s law in the second equality. Now we define two new random variables \(X = P_{a} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }}\) and \(Y = P_{b} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }}\) and from these \(U = P_{r} \frac{{\left| {h_{b} } \right|^{2} }}{{\sigma^{2} }} = \frac{{P_{r} }}{{P_{b} }}Y\) and \(V = P_{r} \frac{{\left| {h_{a} } \right|^{2} }}{{\sigma^{2} }} = \frac{{P_{r} }}{{P_{a} }}X\). For the sake of simplicity we make use of substitutions \(\lambda_{1} = \frac{{\sigma^{2} }}{{P_{a} }}\), \(\lambda_{2} = \frac{{\sigma^{2} }}{{P_{b} }}\), \(\lambda_{3} = \frac{{P_{r} }}{{P_{b} }}\) and \(\lambda_{4} = \frac{{P_{r} }}{{P_{a} }}\). X and Y are exponential random variables with parameters λ 1 and λ 2 respectively, because of the Rayleigh channel assumption. Specifically \(f_{X} \left( x \right) = \lambda_{1} e^{{ - \lambda_{1} x}} ,\quad x > 0\) and \(f_{Y} \left( y \right) = \lambda_{2} e^{{ - \lambda_{2} y}} ,\quad y > 0\). It is evident that X and Y are independent random variables; consequently f XY (xy) = f X (x).f Y (y).

As a result of above definitions and assumptions we can write

$$\begin{aligned} \varGamma & = pr\left\{ {R_{a} \le \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + X} \right),\log_{2} \left( {1 + \lambda_{3} Y} \right)} \right\},} \right. \\ \quad R_{b} \le \frac{1}{2}\hbox{min} \left\{ {\log_{2} \left( {1 + Y} \right),\log_{2} \left( {1 + \lambda_{4} X} \right)} \right\}, \\ \left. {\quad R_{a} + R_{b} \le \frac{1}{2}\log_{2} \left( {1 + X + Y} \right)} \right\}. \\ \end{aligned}$$
(11)

Logarithm is a monotonically increasing function. So operators ‘min’ and ‘log’ are able to be exchanged in (11) so that

$$\varGamma = pr\left\{ {R_{1} \le \hbox{min} \left\{ {X,\lambda_{3} Y} \right\},R_{2} \le \hbox{min} \left\{ {Y,\lambda_{4} X} \right\},R_{3} \le X + Y} \right\},$$
(12)

where we have used \(R_{1} = 2^{{2R_{a} }} - 1\), \(R_{2} = 2^{{2R_{b} }} - 1\) and \(R_{3} = 2^{{2\left( {R_{a} + R_{b} } \right)}} - 1\) in (12) for simplicity. By exploiting “Total probability” theorem [20], Eq. (12) can be expanded as

$$\begin{aligned} \varGamma & = pr\left\{ {R_{1} \le X,R_{2} \le Y,R_{3} \le X + Y|X < \lambda_{3} Y,Y < \lambda_{4} X} \right\}.pr\left\{ {X < \lambda_{3} Y,Y < \lambda_{4} X} \right\} + \\ \quad pr\left\{ {R_{1} \le X,R_{2} \le \lambda_{4} X,R_{3} \le X + Y|X < \lambda_{3} Y,\lambda_{4} X < Y} \right\}.pr\left\{ {X < \lambda_{3} Y,\lambda_{4} X < Y} \right\} + \\ \quad pr\left\{ {R_{1} \le \lambda_{3} Y,R_{2} \le Y,R_{3} \le X + Y|\lambda_{3} Y < X,Y < \lambda_{4} X} \right\}.pr\left\{ {\lambda_{3} Y < X,Y < \lambda_{4} X} \right\} + \\ \quad pr\left\{ {R_{1} \le \lambda_{3} Y,R_{2} \le \lambda_{4} X,R_{3} \le X + Y|\lambda_{3} Y < X,\lambda_{4} X < Y} \right\}.pr\left\{ {\lambda_{3} Y < X,\lambda_{4} X < Y} \right\}, \\ \end{aligned}$$
(13)

or equivalently

$$\begin{aligned} \varGamma & = pr\left\{ {R_{1} \le X,R_{2} \le Y,X < \lambda_{3} Y,Y < \lambda_{4} X,R_{3} \le X + Y} \right\} + \\ \quad pr\left\{ {R_{1} \le X,R_{2} \le \lambda_{4} X,X < \lambda_{3} Y,\lambda_{4} X < Y,R_{3} \le X + Y} \right\} + \\ \quad pr\left\{ {R_{1} \le \lambda_{3} Y,R_{2} \le Y,\lambda_{3} Y < X,Y < \lambda_{4} X,R_{3} \le X + Y} \right\} + \\ \quad pr\left\{ {R_{1} \le \lambda_{3} Y,R_{2} \le \lambda_{4} X,\lambda_{3} Y < X,\lambda_{4} X < Y,R_{3} \le X + Y} \right\}. \\ \end{aligned}$$
(14)

Denoting four terms of (14) with Γ 1, Γ 2, Γ 3 and Γ 4 respectively, we attempt to obtain a mathematical solution for them. Specifically

$$\varGamma_{i} = \iint_{{S_{i} }} {f_{X} \left( x \right).f_{Y} \left( y \right)dxdy,\quad i = 1,2,3,4,}$$
(15)

where S i , the probability region for Γ i , must be determined. It should be noted that we have assumed, without the loss of generality that R a  ≥ R b . Clearly this assumption does not deteriorate the generality of the problem because of the symmetric nature of the network. The probability regions for Γ i s have been investigated in detail in the appendix.

Based on the probability regions displayed in the appendix, we can perform the integrations in (15). Calculating (15) over different probability regions and then simplifying the terms obtained is a straightforward but long process. We disregard the details and suffice to state the final result.

For the case P a  ≠ P b (or equivalently λ 3 ≠ λ 4) Γ will be a four-objective function:

  1. 1.

    If \(\left( {\frac{{R_{2} }}{{\lambda_{4} }} \le \frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \, \& \, \frac{{R_{1} }}{{\lambda_{3} }} \le \frac{1}{{1 + \lambda_{3} }}R_{3} \, \& \, R_{1} \le \frac{{R_{2} }}{{\lambda_{4} }}} \right)\left| {\left( {\frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \le \frac{{R_{2} }}{{\lambda_{4} }} \le \frac{1}{{1 + \lambda_{4} }}R_{3} \, \& \, \frac{{R_{1} }}{{\lambda_{3} }} \le R_{3} - \frac{{R_{2} }}{{\lambda_{4} }}} \right)} \right.\) then

$$\varGamma = \frac{{\lambda_{1} }}{{\lambda_{2} - \lambda_{1} }}e^{{ - \lambda_{2} R_{3} }} \left[ {e^{{\left( {\lambda_{2} - \lambda_{1} } \right)\left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} - e^{{\left( {\lambda_{2} - \lambda_{1} } \right)\frac{{R_{2} }}{{\lambda_{4} }}}} } \right] + e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \lambda_{1} \left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} ;$$
(16)
  1. 2.

    If \(\left( {\frac{{R_{2} }}{{\lambda_{4} }} \le \frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \, \& \, \frac{{R_{1} }}{{\lambda_{3} }} \le \frac{1}{{1 + \lambda_{3} }}R_{3} \, \& \, \frac{{R_{2} }}{{\lambda_{4} }} \le R_{1} } \right)\) then

$$\varGamma = \frac{{\lambda_{1} }}{{\lambda_{2} - \lambda_{1} }}e^{{ - \lambda_{2} R_{3} }} \left[ {e^{{\left( {\lambda_{2} - \lambda_{1} } \right)\left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} - e^{{\left( {\lambda_{2} - \lambda_{1} } \right)R_{1} }} } \right] + e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \lambda_{1} \left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} ;$$
(17)
  1. 3.

    If \(\left( {\frac{{R_{2} }}{{\lambda_{4} }} \le \frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \, \& \, \frac{1}{{1 + \lambda_{3} }}R_{3} \le \frac{{R_{1} }}{{\lambda_{3} }}} \right)\left| {\left( {\frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \le \frac{{R_{2} }}{{\lambda_{4} }} \, \& \, \frac{{R_{2} }}{{\lambda_{3} \lambda_{4} }} \le \frac{{R_{1} }}{{\lambda_{3} }}} \right)} \right.\) then

$$\varGamma = e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \lambda_{1} R_{1} }} ;$$
(18)
  1. 4.

    If \(\left( {\frac{{\lambda_{3} }}{{1 + \lambda_{3} }}R_{3} \le \frac{{R_{2} }}{{\lambda_{4} }} \le \frac{1}{{1 + \lambda_{4} }}R_{3} \, \& \, R_{3} - \frac{{R_{2} }}{{\lambda_{4} }} \le \frac{{R_{1} }}{{\lambda_{3} }} \le \frac{{R_{2} }}{{\lambda_{3} \lambda_{4} }}} \right)\left| {\left( {\frac{1}{{1 + \lambda_{4} }}R_{3} \le \frac{{R_{2} }}{{\lambda_{4} }} \, \& \, R_{2} \le \frac{{R_{1} }}{{\lambda_{3} }} \le \frac{{R_{2} }}{{\lambda_{3} \lambda_{4} }}} \right)} \right.\) then

$$\varGamma = e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \frac{{\lambda_{1} }}{{\lambda_{4} }}R_{2} }} .$$
(19)

For the case P a  = P b (or equivalently λ 3 = λ 4) Γ will be a two-objective function:

  1. 1.

    If \(R_{1} \le \frac{{R_{2} }}{{\lambda_{4} }}\) then

$$\varGamma = \lambda_{1} e^{{ - \lambda_{2} R_{3} }} \left[ {\left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right) - \frac{{R_{2} }}{{\lambda_{4} }}} \right] + e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \lambda_{1} \left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} ;$$
(20)
  1. 2.

    If \(\frac{{R_{2} }}{{\lambda_{4} }} \le R_{1}\) then

$$\varGamma = \lambda_{1} e^{{ - \lambda_{2} R_{3} }} \left[ {\left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right) - R_{1} } \right] + e^{{ - \frac{{\lambda_{2} }}{{\lambda_{3} }}R_{1} }} e^{{ - \lambda_{1} \left( {R_{3} - \frac{{R_{1} }}{{\lambda_{3} }}} \right)}} .$$
(21)

As a result we have obtained a mathematical solution for Γ = 1 − P outage as stated in Eqs. (16)–(21). As it is apparent from these equations, Γ is not dependent on the value of channel coefficients (instantaneous CSI), but rather on statistical CSI (\(\lambda_{1} = \frac{{\sigma^{2} }}{{P_{a} }}\), \(\lambda_{2} = \frac{{\sigma^{2} }}{{P_{b} }}\)) and \(\lambda_{3} = \frac{{P_{r} }}{{P_{b} }}\), \(\lambda_{4} = \frac{{P_{r} }}{{P_{a} }}\), R 1 and R 2 that are constant parameters. This is why we have claimed that our approach for power allocation doesn’t require any instantaneous CSI. In other words we have made use of probabilistic features (probability distribution function, mean and variance value) of channel coefficients and derived an equation for outage probability which is only relevant to the channel parameters.

3.2 Minimizing the Outage Probability

The mathematical expression of outage probability is too complex to examine in terms of convexity. On the other hand we are required to find the optimal value (i.e. global minimum) of the problem (6), while common optimization techniques might result in local minimum points. Analyzing the problem in terms of convexity and proposing an optimization technique can form the basis of another separate work in future. For the present article, we have alternatively utilized a simple and effective technique to solve the optimization problem (6) that is also capable of finding the global minimum. Solving problem (6) is equivalent to maximize Γ(λ 1, λ 2, λ 3, λ 4). To solve this problem, we use “grid search” technique to find the optimal power values. In fact, the whole domain of the function Γ is investigated to find the optimal solution. Although this technique might seem inefficient and time-consuming, but in the case of our optimization problem and its constraints, it can be useful. Specifically, as we will clarify the details of this technique, the domain which must be investigated is a two-dimensional region, i.e. an 1 × 1 square in the λ 3 − λ 4 plane and the two other variables, λ 1 and λ 2, can be calculated from λ 3 and λ 4.

Details of the steps of this technique is as follows:

  1. 1.

    Let λ 3 = 1;

  2. 2.

    Let λ 4 = 1;

  3. 3.

    Calculate λ 1 and λ 2:

    1. (a)

      \(P_{r} = \frac{{P_{sum} }}{{1 + \frac{1}{{\lambda_{3} }} + \frac{1}{{\lambda_{4} }}}};\)

    2. (b)

      \(P_{a} = \frac{{P_{r} }}{{\lambda_{4} }}\) and \(P_{b} = \frac{{P_{r} }}{{\lambda_{3} }}\);

    3. (c)

      \(\lambda_{1} = \frac{{\sigma^{2} }}{{P_{a} }}\) and \(\lambda_{2} = \frac{{\sigma^{2} }}{{P_{b} }}\);

  4. 4.

    Calculate Γ(λ 1λ 2λ 3λ 4) by Eqs. (16)–(21);

  5. 5.

    Substitute λ 4 = λ 4 − Δ. if λ 4 > 0 go to step 3;

  6. 6.

    Substitute λ 3 = λ 3 − Δ. If λ 3 > 0 go to step 2;

  7. 7.

    Find the maximum value of Γ and corresponding (P a P b P r ).

In this procedure Δ is a step value for changing λ 3 and λ 4 in order to search through the entire feasible set of the optimization problem. It is necessary to select Δ small enough so that the global maximum point will be found in better precision. The proposed grid search technique is able to find the optimum point fast enough owing to the fact that the variation interval of λ 3 and λ 4 is too short (since λ 3, λ 4 ∊ [0, 1]) and inspection through this limited interval spends little time.

4 Simulation and Numerical Results

In this section we intend to verify Eqs. (16)–(21) by Monte Carlo simulations. Then the proposed scheme for power allocation in a TWRN is examined and numerical results are stated. σ, the variance of the noise, has been set to unity for simulation and analysis of this part. All the figures represent the outage probability P outage versus \(SNR = \frac{{P_{sum} }}{{\sigma^{2} }}\) which is equivalent to P sum (since σ = 1) and specified in dB.

In Figs. 6 and 7, the curves specified by dots, have been plotted by Monte Carlo simulation technique, while in the curves specified by triangles, P outage has been figured out by mathematical Eqs. (16)–(21), derived in part 3.1. As it is indicated by these figures, simulation and analytical curves coincide with each other exactly and therefore simulation curves verify the correctness of mathematical analysis.

Fig. 6
figure 6

Outage probability versus P sum  = P a  + P b  + P r under different sum-rate R a  + R b values and equal power allocation \(P_{a} = P_{b} = P_{r} = \frac{{P_{sum} }}{3}\); by both analytical and simulation schemes

Fig. 7
figure 7

Outage probability versus P sum  = P a  + P b  + P r under different sum-rate R a  + R b values and unequal power allocation \(P_{r} = \frac{3}{4}P_{b} = \frac{1}{2}P_{a}\); by both analytical and simulation schemes

In Fig. 6 the total power has been divided equally between three nodes but in Fig. 7 different power has been considered for the nodes.

In Figs. 8, 9 and 10 we have demonstrated the superiority of our proposed scheme for power allocation (i.e. OPA) over the equal power allocation (EPA) scheme for various values of data rate. In the curves specified by black dots, power of the nodes has been figured out by the OPA scheme; while in the curves specified by white dots, EPA scheme has been utilized. As it is indicated by these figures, for average SNR values, OPA scheme results in about 1 dB gain over EPA; although as SNR → ∞ the advantage of OPA becomes less significant and in fact decreases to about 0.1 dB.

Fig. 8
figure 8

Comparison of OPA and EPA schemes, R a  = 7, R b  = 4 bits/s/Hz

Fig. 9
figure 9

Comparison of OPA and EPA schemes, R a  = 4, R b  = 4 bits/s/Hz

Fig. 10
figure 10

Comparison of OPA and EPA schemes, R a  = 6, R b  = 3 bits/s/Hz

Another important result has been depicted by Fig. 11. This figure indicates that as the sum-rate value (R a  + R b ) falls below about 4 bits/s/Hz, the OPA gives no noticeable gain over EPA scheme. It is so because as the sum-rate decreases, the objective function Γ(λ 1λ 2λ 3λ 4) becomes more smoother and as a result trying to find optimal solution will not result any advantage over EPA.

Fig. 11
figure 11

Comparison of OPA and EPA schemes, R a  = 3, R b  = 1 bits/s/Hz

5 Conclusion

In this paper, the outage probability for a TWRN was obtained in terms of a closed mathematical expression for the first time. Specifically this expression was obtained in the more general case without imposing any constraints on the rate of the nodes. The only limiting constraint is that the relay transmit power is less then transmit power of end terminals. Moreover a new power allocation scheme was proposed based on minimizing the obtained outage probability. The only assumption made about the links between nodes was Rayleigh fading channel without any knowledge about the instantaneous CSI.

We also examined the validity of the mathematical expression for outage probability. Specifically, Monte Carlo simulation technique has been conducted and the correctness of mathematical expressions verified. The curves of the outage probability for simulation and analytical schemes exactly coincide with each other. At last, we investigated the effectiveness of the proposed OPA. Our proposed OPA scheme led to about 1 dB gain in outage probability for average and large sum-rate and average SNR values.