## 3 System Design
### Problem Formulation  
In this subsection, we propose a power allocation optimization design to maximize the energy efficiency under the above-mentioned illumination and communication constraints for the multi-color LED-based VLC system. Thus, the main problem can be formulated as follows:  
\[\begin{split}&\text{{Obj.}}\quad\min_{\mathbf{\Gamma},\mathbf{\Delta}} \ \ \mathbf{1}^{T}\bar{\mathbf{\Psi}}\\ & s.t.\ \ \mathbf{c}=\mathbf{\mathrm{G}}\bar{\mathbf{\mathrm{F}}},\\ &\quad\mathbf{\mathrm{K}}\mathbf{\mathrm{c}}+\mathbf{\mathrm{L}}\leq\mathbf{0}, \\ &\quad\mathbf{\mathrm{f}}_{2}^{T}\bar{\mathbf{\mathrm{P}}}\geq\frac{\xi}{K_ {m}},\\ &\quad\mathbf{\Delta}\leq\min(\bar{\mathbf{\mathrm{P}}}-\mathbf{\mathrm{P}}^{ min},\mathbf{\mathrm{P}}^{max}-\bar{\mathbf{\mathrm{P}}}),\\ &\quad\mathbf{\Delta}\geq\beta\mathbf{\Gamma}.\end{split} \tag{28}\]  
The optimization problem (28) is determined by three elements, the average transmitted optical power distribution of the multi-color LED \(\bar{\mathbf{\mathrm{P}}}\), the power amplitude of the modulated optical signal \(\mathbf{\Delta}\), and the coordinate in the chromaticity diagram \(\mathbf{\mathrm{c}}\). It can be observed that the objective function is the minimum value subject to several linear matrix inequalities, so the optimization problem (28) is convex at each iteration, which can be solved by the interior point algorithm. In this paper, we adopt the CVX toolbox in MATLAB to solve the convex optimization problem [21]. Therefore, the proposed scheme can be summarized as Algorithm 1.  
In Algorithm 1, we first create the the initial \(\mathbf{\mathrm{P}}^{(0)}\) and \(\mathbf{\Delta}^{(0)}\) randomly satisfying all the constraints, and we set the decision threshold \(\delta\). After an amount of iterations, we can get the minimum transmission power \(\bar{\mathbf{\mathrm{P}}}_{min}^{(i)}\) in the \(i^{\text{th}}\) loop satisfying the total transmission power \(|W^{(j+1)}-W^{(j)}|\leq\delta\). Since the values of initial \(\bar{\mathbf{\mathrm{P}}}^{(0)}\) and \(\mathbf{\Delta}^{(0)}\) are randomly chosen, we would repeat the whole iteration procedure for \(n_{loop}\) times to achieve the accurate solution of \(\bar{\mathbf{\mathrm{P}}}\).  
Now, we analyze the complexity of our proposed method in Algorithm 1. The convex optimization would be solved by the CVX toolbox, which has the complexity cost of \(\mathcal{O}(T(N^{2}+2N))\), where \(T\) denotes the inner iteration number of the interior point method [21].  
```
Input: loop times \(n_{loop}\), decision threshold \(\delta\) Output: minimum transmission power \(\bar{\mathbf{P}}\) \(i:=1\),\(j:=1\) While\(i\leq n_{loop}\) (1) Create the initial \(\bar{\mathbf{P}}^{(0)}\), \(\boldsymbol{\Delta}^{(0)}\) satisfying the constraints (2).  Let \(W^{(0)}=\mathbf{1}^{T}\bar{\mathbf{P}}^{(0)}\). Set the iteration number \(n=1\). (2) Solve the convex problem Obj. \(\min_{\bar{\mathbf{P}}_{i}\boldsymbol{\Delta}}\mathbf{1}^{T}\bar{\mathbf{P}}\) s.t. \(\mathbf{c}=\mathbf{GF}\bar{\mathbf{P}}\) Kc \(+\) L \(\leq\) 0 \(\mathbf{f}_{2}^{T}\bar{\mathbf{P}}\geq\frac{\bar{\mathbf{c}}}{K_{m}}\) \(\boldsymbol{\Delta}\leq\min(\bar{\mathbf{P}}-\mathbf{P}^{min},\mathbf{P}^{max} -\bar{\mathbf{P}})\) \(\boldsymbol{\Delta}\geq\beta\Gamma\) (3) Update the value: \(j:=j+1\) Until \(|W^{(j+1)}-W^{(j)}|\leq\delta\) \(W^{(i)}_{min}=W^{(j+1)}\), \(\bar{\mathbf{P}}^{(i)}_{min}=\mathbf{P}^{(j+1)}\)  Update the value: \(i:=i+1\) End \(i_{opt}=\arg\min(W^{(1)}_{min},W^{(2)}_{min}\cdots,W^{(n_{loop})}_{min})\), \(\bar{\mathbf{P}}^{(i_{opt})}=\bar{\mathbf{P}}^{(i_{opt})}_{min}\)
```  
**Algorithm 1**Energy-efficient optimization design.