## Appendix A MATLAB-CVX Source Code
disp(['Runcount: ', num2 str(repeat)]); disp(['Systemparameters: ','K=',num2 str(K),' F=',num2 str(F),' N=',num2 str(N), 'S_max-',num2 str(S_max),' Si_r=',num2 str(S1_r),'Sd_r=',num2 str(sd_r), 'tr_r='-',num2 str(tr_r),' r_r=',num2 str(r_r),'B_min=',num2 str(B_min),'B_max-', num2 str(B_max),' rho-',num2 str(rho),' w1=',num2 str(w1),'w2=',num2 str(w2)]); disp(['Optimizedmeanlifespan: ', num2 str(sum(td)/sum(td>0))]); disp(['Greedymeanlifespan: ', num2 str(sum(td_greedy)/sum(td_greedy>0))]); disp(['Optimizedlifespanstandarddeviation: ', num2 str(sqrt(var(td)))]); disp(['Greedylifespanstandarddeviation: ', num2 str(sqrt(var(td_greedy)))]); disp(['Optimizedmeanlifespanimprovement: ', num2 str(100*(sum(td,td_no)/sum(td>0)-1)),' %']); disp(['Greedymeanlifespanimprovement: ', num2 str(100*(sum(td_greedy./td_no)/sum(td>0)-1)),' %']);

end

## References

* (1) [PERSON]; [PERSON] An Energy Efficient Cross-Layer Network Operation Model for IEEE 802.15.4-Based Mobile Wireless Sensor Networks. _IEEE Sens. J._**2015**, _15_, 684-692. * (2) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Mobile Wireless Sensor Network: Architecture and Enabling Technologies for Ubiquitous Computing. In Proceedings of the 21 st International Conference on Advanced Information Networking and Applications Workshops (AINAW '07), Niagara Falls, ON, Canada, 21-23 May 2007; Volume 2, pp. 113-120. * (3) [PERSON]; [PERSON]. Cognitive radio: Making software radios more personal. _IEEE Pers. Commun. Mag._**1999**, \(6\), 13-18. * (4) [PERSON]; [PERSON]; [PERSON] A novel clustering-based spectrum sensing in cognitive radio wireless sensor networks. In Proceedings of the 3 rd IEEE International Conference on Cloud Computing and Intelligence Systems (CCIS), Shenzhen, China, 27-29 November 2014; pp. 695-699. * (5) [PERSON]; [PERSON]; [PERSON]; [PERSON] Power control and localization of wireless body area networks using semidefinite programming. In Proceedings of the 2 nd International Symposium on Future Information and Communication Technologies for Ubiquitous HealthCare (Ubi-HealthTech), Beijing, China, 28-30 May 2015; pp. 1-5. * (6) [PERSON]; [PERSON]; [PERSON]; [PERSON] Low-Power Far-Field Wireless Powering for Wireless Sensors. _Proc. IEEE_**2013**, _101_, 1397-1409. * (7) [PERSON] Wireless power transmission: State-of-the-arts in technologies and potential applications (invited paper). In Proceedings of the 2011 Asia-Pacific Microwave Conference Proceedings (APMC), Melbourne, Australia, 5-8 December 2011; pp. 86-89. * (8) [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] Experimental studies of using wireless energy transmission for powering embedded sensor nodes. _J. Sound Vib._**2010**, _329_, 2421-2433. * (9) [PERSON]; [PERSON] Maximizing the Lifetime of Wireless Sensor Networks with Mobile Sink in Delay-Tolerant Applications. _IEEE Trans. Mob. Comput._**2010**, \(9\), 308-318. * (10) [PERSON]; [PERSON] Efficient algorithm for prolonging network lifetime of wireless sensor networks. _Tsinghua Sci. Technol._**2011**, _16_, 561-568. * (11) [PERSON]; [PERSON] Joint Sink Mobility and Routing to Maximize the Lifetime of Wireless Sensor Networks: The Case of Constrained Mobility. _IEEE/ACM Trans. Netw._**2010**, _18_, 871-884. * (12) [PERSON]; [PERSON]; [PERSON] WSN Lifetime Optimization through Controlled Sink Mobility and Packet Bufferization. In Proceedings of the 5 th Global Information Infrastructure Symposium, Trento, Italy, 28-31 October 2013. * (13) [PERSON]; [PERSON]. How Long is the Lifetime of a Wireless Sensor Network? In Proceedings of the 2009 International Conference on Advanced Information Networking and Applications, Bradford, UK, 26-29 May 2009; pp. 763-770. * [PERSON] et al. (2013) [PERSON]; [PERSON]; [PERSON] Clustering algorithms for maximizing the lifetime of wireless sensor networks with energy-harvesting sensors. _Comput. Netw._**2013**, _57_, 2689-2704. * [PERSON] et al. (2007) [PERSON]; [PERSON]; [PERSON]; [PERSON] Maximizing System Lifetime in Wireless Sensor Networks. _Eur. J. Oper.