# Resource Allocation in Unmanned Aerial Vehicle (UAV)-Assisted Wireless-Powered Internet of Things
## 4 Optimal Solutions for Energy Transfer
** By taking the derivative of \(V^{H}(t,x)\) with respect to \(t\) and \(x\), we obtain  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]0  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]1  
Substituting (25) and (26) into (13), \(A_{H}(t)\) is satisfied:  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]2  
Then, we obtain  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]3  
Similarly, we can obtain  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]4  
Based on (28) and (29), the optimal allocated resource in (17) and (18), which denotes the UAV's strategies for wireless energy transfer, can be re-written as follows:  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]5  
\[\pi_{L}^{*}(t)=V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}-2\gamma_{th}\sum \limits_{i=1}^{N_{L}}\frac{\delta_{L,i}(t)}{I_{L,i}(t)}+\sum\limits_{j=1,j \
eq i}^{N_{L}}\frac{l_{L,j}^{2}(t)}{\delta_{L,j}^{2}(t)}\cdot\frac{g_{L,i}^{ 2}(t)}{l_{L,i}^{2}(t)}\Bigl{[}V_{x}^{L}(t,x)e^{rt}-\varepsilon_{L}^{L}\Bigr{]}. \tag{16}\]6  
Meanwhile, we can obtain the optimal unit price for the wireless power transfer as follows:  
\[ \begin{array}{l}\pi^{*}_{H}(t)=\left(\frac{\mu_{H}}{r-\delta}+s_{H}\right) \!e^{(r-\delta)(t-T)}-\frac{\mu_{H}}{r-\delta}-\varepsilon^{H}_{H}-2\gamma_{ th}\sum\limits_{i=1}^{N_{H}}\frac{s_{H_{i}}(t)}{I_{H_{i}}(t)}\\ +\sum\limits_{j=1,j\
eq i}^{N_{H}}\frac{I^{2}_{H_{i}}(t)}{\delta^{2}_{H_{i}}(t )}\cdot\frac{s^{2}_{H_{i}}(t)}{I^{2}_{H_{i}}(t)}\!\left[\left(\frac{\mu_{H}}{r -\delta}+s_{H}\right)\!e^{(r-\delta)(t-T)}-\frac{\mu_{H}}{r-\delta}-\varepsilon ^{H}_{H}\right]\end{array}  \tag{32}\]  
\[ \begin{array}{l}\pi^{*}_{L}(t)=\left(\frac{\mu_{L}}{r-\delta}+s_{L}\right) \!e^{(r-\delta)(t-T)}-\frac{\mu_{L}}{r-\delta}-\varepsilon^{L}_{L}-2\gamma_{ th}\sum\limits_{i=1}^{N_{L}}\frac{s_{L_{i}}(t)}{I_{L_{i}}(t)}\\ +\sum\limits_{j=1,j\
eq i}^{N_{L}}\frac{I^{2}_{H_{i}}(t)}{\delta^{2}_{L_{i}}(t )}\cdot\frac{s^{2}_{L_{i}}(t)}{I^{2}_{L_{i}}(t)}\!\left[\left(\frac{\mu_{L}}{r -\delta}+s_{L}\right)\!e^{(r-\delta)(t-T)}-\frac{\mu_{L}}{r-\delta}-\varepsilon ^{L}_{L}\right]\end{array}  \tag{33}\]  
Based on the process used to obtain the optimal solutions for the energy transfer, we find that the time complexity of the algorithm will be \(O\!\left(n^{2}\right)\). In the proposed game model, the optimal solutions for energy transfer should be solved for the wireless nodes in each group, which should also be calculated for each time point in a finite time horizon.