# Lyapunov-Guided Energy Scheduling and Computation Offloading for Solar-Powered WSN
## 6 Results and Discussion  
### Simulation Setup  
In this section, we evaluate the system performance via numerical simulations based on the Monte Carlo method. All nodes are randomly distributed in the sensing area for 100 times and the corresponding maximum long-term energy efficiency is calculated, which are probabilistically distributed by interval, and the number with the highest EE value from the highest probability interval is selected as the optimal network EE, and the corresponding offloading calculation decision and resource scheduling scheme is the best. We consider a coverage area of 100 m \(\times\) 100 m for a solar-powered MEC system, which includes a solar-powered access point with MEC server (HAP) and [4; 8; 12; 16; 20] sensor nodes with random distribution. The HAP was equipped with a 1 m \(\times\) 1 m solar panel with 10 kJ energy storage batteries, where energy harvesting efficiency is 20%. Solar energy arrivals follow the hidden Markov model [31] with three states, which represent different weather states and satisfy different Gaussian distributions, such as sunny (94.6, 0.31), cloudy (76.0, 1.55), rainy (45.6, 1.48). The maximum transmit power is set to 5 W. All nodes recharge themselves with energy efficiency 0.51. The computational efficiency parameter is set to 109, the local CPU frequency of each node is set to [0.2 GHz, 2 GHz], and the CPU frequency of the MEC server is set to 4 GHz. The channel gain follows the Rayleigh fading model, where the path loss factor is 3 Hz. The system bandwidth is set to [200-600 kHz] and noise spectral density is set as -174 dB/Hz. We initialize the energy and data queue length to 0, i.e., \(E_{S}(0)=0\), \(Q_{k}(0)=0\), \(E_{k}(0)=0\).  
To verify the performance of the proposed Lyapunov-based joint online optimization algorithm for partial task offloading decisions and resource allocation (_\"Proposed\"_), we consider four representative methods as the benchmarks in terms of queue stability, system energy efficiency, and related parameters, all of which use the same energy availability constraints as _\"Proposed\"_. \(f_{s}^{t*}\) is computed similarly to _\"Proposed\"_ by using Equation (29), while determining \(P_{S}^{\mathbb{R}*}\) and \(\tau_{k}^{t*}\) via following strategies:  
* _\"All local\"_ represent sensor perform all computational tasks locally based on the whole harvested solar energy. In this case, the optimal energy broadcast power is obtained by solving (12) with \(\tau_{0}=T\),\(\tau_{k}^{t*}=0\).
* _\"All MEC\"_ represent sensor offloads all tasks to HAP for edge processing. In this case, the optimal transmit power \(P_{S}^{\mathbb{T}*}\) is obtained by solving (12) with \(f_{k}^{t}=0\).
* _\"Fixed broadcast power\"_ is referenced from the literature [22], which has a similar energy harvesting and offloading mechanism as this paper, where sensing nodes perform local computing or remote offloading for maximizing the long-term energy efficiency based on the harvested RF energy. The difference is that the HAP has a constant and stable energy provision and the energy broadcast power is constant and takes a maximum value \(P_{S}^{\max}\).
* _\"Fixed energy allocation\"_: indicates that the node uses the collected energy proportionally for local computing and remote offloading. For simplicity, we set the scaling factor is 0.5.