# Joint Beam-Forming Optimization for Active-RIS-Assisted Internet-of-Things Networks with SWIPT
## 3 Proposed Algorithm
### Optimizing \(P\),\(\Theta\) Given \(w_{k},\rho_{k},t_{k}\)
Therefore, we can add additional optimization variables to this so that the optimal solution obtained can have better performance. Therefore, it is decided to optimize the SINR and harvest energy boundaries while satisfying the constraint of having a unique rank. To obtain the optimal solution, two new relaxation variables \(\tau_{k}\) and \(\Delta_{k}\) are introduced as \"SINR residuals\" and \"energy harvesting residuals\", respectively, and with the introduction of the additional new variables (P6) can be rewritten as follows:  
\[(\mathrm{P7}):\underset{\mathrm{T},\tau_{k},\Delta_{k}}{\text{ minimize }}f_{4}=\frac{1}{2\mu}\Big{(}\left\|\mathrm{T}\right\|_{*}-\widetilde{\Psi}( \mathrm{T})\Big{)}-\sum_{k=1}^{K}(\alpha\tau_{k}+\beta\Delta_{k}), \tag{45}\]  
\[\text{s.t. }\frac{\mathrm{Tr}(\mathrm{S}_{k,\mathrm{T}})+\left|a_{k,k}\right|^ {2}}{\gamma_{k}+\tau_{k}}-\sum_{ \begin{subarray}{c}j=1\\ j\
eq k\end{subarray} }^{K}\mathrm{Tr}\Big{(}\mathrm{S}_{k,j}\mathrm{T}\Big{)}- \sigma_{v}^{2}\mathrm{Tr}\Big{(}\widetilde{Z}_{k}\mathrm{T}\Big{)}\geqslant \widetilde{\sigma}_{k}, \tag{46}\]  
\[\sum_{j=1}^{K}\mathrm{Tr}\Big{(}\mathrm{S}_{k,j}\mathrm{T}\Big{)}+\left|a_{k,j }\right|^{2}+\sigma_{v}^{2}\mathrm{Tr}\Big{(}\widetilde{Z}_{k}\mathrm{T}\Big{)} \geqslant\frac{t_{k}^{2}}{1-\rho_{k}}, \tag{47}\]  
\[\mathrm{T}\succeq 0, \tag{48}\]  
\[\tau_{k},\Delta_{k}\geqslant 0,\forall k, \tag{49}\]  
The flowchart of the overall algorithm proposed in this paper is shown in Figure 2.  
Figure 2: Flowchart of the overall algorithm (As shown in Algorithms 1–3). **Remark 1** (Complexity Analysis). : _The overall complexity of the proposed BCD algorithm (Algorithm 3) arises from two components: Algorithm 1 for solving subproblem 1 and Algorithm 2 for solving subproblem 2. In each iteration of the BCD algorithm (Algorithm 3), we independently address problems (23) and (45). To illustrate the complexity related to Algorithm 1, which addresses the convex problem (23), its algorithmic complexity can be expressed as_  
\[\mathcal{O}_{1}=I_{1}\cdot\mathcal{O}\bigg{(}\sqrt{KM}\Big{(}K^{3}M^{2}+K^{2} M^{3}\Big{)}\log\frac{1}{e_{1}}\bigg{)},\]  
_where \(e_{1}\) represents the given solution accuracy, \(I_{1}\) denotes the number of iterations before convergence, \(K\) is the total number of users, and \(M\) is the number of antennae. The algorithmic complexity for solving the SDP problem (45) with Algorithm 2 can be expressed as_  
\[\mathcal{O}_{2}=I_{2}\cdot\mathcal{O}\bigg{(}\Big{(}(3K+1)\Big{(}N^{3.5}+3 KN^{ 2.5}\Big{)}\Big{)}\log\frac{1}{e_{2}}\bigg{)},\]  
_where \(e_{2}\) represents the given solution accuracy, \(I_{2}\) denotes the number of iterations before convergence, \(K\) is the total number of users, and \(N\) is the dimension of the semidefinite cone. In summary, the overall complexity of the BCD algorithm (Algorithm 3) is given by_  
\[\mathcal{O}_{3}=I_{3}(\mathcal{O}_{1}+\mathcal{O}_{2}),\]  
_where \(I_{3}\) represents the total number of iterations executed by Algorithm 3._  
```
(1) while\(i\leq L_{\text{max}}\) do (2) Calculation of \(\widehat{\mathbf{v}}(\mathrm{T})\) according to (8) (3) Solve \(\mathrm{P}(\mathrm{7})\), output \(\{\mathrm{T}^{*}\}\), update \(\left\{\mathrm{T}^{(i+1)}\right\}=\{\mathrm{T}^{*}\}\) (4) Let \(i=i+1\) (5) end while (6) Output \(\{\mathrm{T}^{*}\}\)
```  
**Algorithm 2** Set the maximum number of iterations \(L_{\text{max}}\), \(i=0\), fix \(\mathrm{T}\), initialize \(\mathrm{w}_{k},\rho_{k}\).