# RIS-Assisted Network Slicing Resource Optimization Algorithm for Coexistence of eMBB and URLLC
## 3 Problem Formulation  
### eMBB Allocation Problem  
The objective of this problem is to jointly optimize RB allocation, power allocation, and RIS phase shift matrix to maximize the total ergodic capacity of eMBB users under constraints such as maximum transmission power and rate ratio. This paper uses Orthogonal Frequency Division Multiplexing (OFDM) as the primary modulation and demodulation technique. The channel gain \(C_{e}\) of eMBB user \(e\) in RB \(b\) is known. Assume that the channel is interfered with by Additive White Gaussian Noise (AWGN), denoted as \(\sigma^{2}=N_{0}B\), where \(N_{0}\) is the noise power spectral density. The corresponding signal-to-noise ratio (SNR) of eMBB user \(e\) in RB \(b\) is expressed as:  
\[h_{eb}=C_{e}/\sigma^{2} \tag{1}\]  
Then the received SNR of eMBB user \(e\) on RB \(b\) is:  
\[\gamma_{eb}=P_{eb}h_{eb} \tag{2}\]  
where \(P_{eb}\) is the downlink transmission power of eMBB user \(e\) in RB \(b\).  
When M-ary quadrature amplitude modulation (M-QAM) is used, and the error probability is measured according to the Symbol Error Ratio (SER), the number of bits per symbol \(G\)[21] can be expressed as:  
\[G=\log_{2}(1+\frac{\gamma_{eb}}{\Gamma}) \tag{3}\]  
where \(\Gamma\) is the signal-to-noise ratio gap, defined as \(\Gamma=\frac{1}{3}\Big{[}Q^{-1}\Big{(}\frac{SER}{4}\Big{)}\Big{]}^{2},Q(x)= \int_{x}^{\infty}\Big{(}e^{-it^{2}/2}/\sqrt{2\pi}\Big{)}du\).  
Thus, the data rate of eMBB user \(e\) on RB \(b\) at a given time slot can be approximated as:  
\[r_{eb}=W\log_{2}(1+\frac{\gamma_{eb}}{\Gamma}) \tag{4}\]  
Figure 2: Multiplexing Model for eMBB-URLLC Traffic.  
Combining Equations (1)-(4), the data rate of eMBB user \(e\) on all assigned RB \(b\) is expressed as follows:  
\[r_{e}=\sum\limits_{b\in B}x_{eb}W\log_{2}(1+\frac{\gamma_{eb}}{ \gamma_{eb}})\] \[=\sum\limits_{b\in B}x_{eb}W\log_{2}\biggl{(}1+\frac{P_{eb}|G_{ RIS,e}\Phi_{e}H_{sNB,RIS}+D_{gNB,e}|^{2}}{\sigma^{2}\Gamma}\biggr{)} \tag{5}\]  
where the binary variable \(x_{eb}=\left\{\begin{array}{ll}1,&\text{if user e is assigned RB in a timeslot}\\ 0,&\text{else}\end{array}\right.\) is the RB allocation indicator for eMBB user \(e\) in a time slot.  
Therefore, the gNB traversal capacity of all eMBB users in a given time slot is issued by the following equation:  
\[C_{gNB}=E\left(\sum\limits_{e=1}^{e}r_{e}\right) \tag{6}\]  
where \(E(\cdot)\) is expected to cover all fading channels.  
In summary, the eMBB resource allocation problem can be formulated as follows:  
\[P1:\max\limits_{\Phi_{e},P,x_{eb}}C_{gNB} \tag{7}\]  
\[s.t.0\leq P_{eb}\leq P_{eb}^{max},\forall e\in E,\forall b\in B \tag{8}\]  
\[x_{eb}=\{0,1\},\forall e\in E,\forall b\in B \tag{9}\]  
\[r_{i}:r_{j}=\varphi_{i}:\varphi_{j},\forall i,j\in\{1,\cdots,E\},i\
eq j \tag{10}\]  
\[|\Phi_{n}|\leq 1,0\leq\theta_{n}\leq 2\pi,\forall n \tag{11}\]  
where \(P_{eb}^{max}\) in constraint (8) is the maximum transmission power of RB-eMBB. Constraint (9) is the eMBB user \(e\) allocation indicator. Constraint (10) is the proportional rate constraint, \(\sum\limits_{e=1}^{E}\varphi_{e}=1\), where \(\varphi_{1}:\varphi_{2}:\cdots:\varphi_{E}\) is the normalized proportionality constant. Constraint (11) constrains the reflection coefficient of the RIS.