# A Power-Optimized Cooperative MAC Protocol for Lifetime Extension in Wireless Sensor Networks
## 4 Lifetime-Extended Transmission Power Optimization Algorithm
### Constraint Conditions of Channel Gain and Residual Energy of Cooperative Nodes  
A cooperative node can take part in the cooperative transmission and then achieve the objective of improving the system capacity and extending the network lifetime only when its residual energy and channel gain between itself and the sender/recipient satisfy certain conditions.  
Firstly, in order to extend network lifetime, the cooperative node should have enough residual energy to participate in the cooperative transmission and forward the data packets. That is to say, the residual energy of the cooperative node before the cooperative transmission should be more than that of the sender after transmitting the data packets directly, i.e.,  
\[E_{\mathrm{S}}-P_{\mathrm{D}}T<E_{\mathrm{R_{i}}},\ i\in[1,N] \tag{9}\]  
where \(P_{\mathrm{D}}\) is the transmission power of the sender in direct transmission, which can be deduced from the Shannon theorem as follows:  
\[R\leq\mathrm{log}_{2}\left(1+\frac{P_{\mathrm{D}}\parallel h_{\mathrm{SD}} \parallel^{2}}{N_{0}}\right). \tag{10}\]  
Then we get:  
\[P_{\mathrm{D}}\geq\frac{N_{0}\left(2^{R}-1\right)}{\parallel h_{\mathrm{SD}} \parallel^{2}}. \tag{11}\]Secondly, the cooperative node transforms the packet transmission between the sender and its recipient from one-hop to two-hop. In order to improve the system capacity, the channel gain of the cooperative node between itself and the corresponding sender/recipient should be higher than that of the direct link between the sender and its recipient, i.e.,  
\[\parallel h_{\text{SR}_{\parallel}}\parallel^{2}>\parallel h_{\text{SD}} \parallel^{2}, \tag{12}\]  
\[\parallel h_{\text{R}_{\text{i}}\text{D}}\parallel^{2}>\parallel h_{\text{SD}} \parallel^{2}. \tag{13}\]  
Moreover, the energy consumption of the cooperative transmission should be constrained. In the cooperative transmission, the energy consumption of the sender should be less than that in the direct transmission, i.e.,  
\[P_{\text{S}}\times\frac{L}{2 RB}<P_{\text{D}}\times\frac{L}{RB}, \tag{14}\]  
where \(L\) is the length of data packets, and \(B\) is the bandwidth of the channel.  
If a cooperative node \(\text{R}_{\text{i}}\) participates in the cooperative transmission, according to Equation (3), in order to guarantee its correct packet decoding, the transmission power of the sender should satisfy the following condition:  
\[P_{\text{S}}\geq\frac{N_{0}\left(2^{2R}-1\right)}{\parallel h_{\text{SR}_{ \parallel}}\parallel^{2}}. \tag{15}\]  
Substituting Equations (11) and (15) into Equation (14), we have:  
\[\frac{\parallel h_{\text{SD}}\parallel^{2}}{\parallel h_{\text{SR}_{ \parallel}}\parallel^{2}}<\frac{2(2^{R}-1)}{2^{2R}-1}=\frac{2}{2^{R}+1}. \tag{16}\]  
Compared to Equation (12), Equation (15) is a strict constraint. Furthermore, the channel gains of all potential cooperative nodes' links should satisfy Equations (12), (13) and (16).  
Equations (9), (12), (13) and (16) restrict the residual energy and the channel gains of all cooperative nodes' links. Equations (3)-(8) give the feasible region of the transmission powers of the sender and its multiple cooperative nodes. The optimal values of \(P_{\text{S}}\) and \(P_{\text{R}_{\text{i}}}\) can be calculated in the feasible region to maximize \(e\), and thus extend the network lifetime.