# Jointly Optimize the Residual Energy of Multiple Mobile Devices in the MEC-WPT System
## 6 Simulation Results  
In this section, we conduct simulation experiments to verify the advantages of the proposed joint optimization scheme, which aims at residual energy maximization of multi MDs in multi-time slots, and jointly optimizes the amount of task-offloading, energy harvesting time, task-offloading time and CPU frequency. All simulation programs are written in the Python programming language and use the PyOpt, which is a Python-based software package for solving optimization problems with nonlinear constraints. The numerical results are compared with the following two benchmark schemes to evaluate the joint optimization scheme for maximizing residual energy under multi-MD s and multi-slots. The scheme jointly optimizes the task-offloading size, energy harvesting time, task-offloading time and the CPU frequency, which is abbreviated as MMM. 1. Local computation only: Each user completes its computation task only through local computations, and the entire time slice is used to harvest energy for each user, referred to as LOC. 2. Only computation offload: Each user completes his computing task only by completely offloading the computing task to the AP, and the energy harvested by the user is used to support computing offload, referred to as OFF. 3. Fixed energy harvesting time: The energy harvesting time of each user is fixed [28], and the task-offloading size and task-offloading time are optimized, referred to as FEH. 4. Fixed task offloading size: The size of each user's task-offloading is fixed [28], which can optimize energy harvesting time and offloading time, referred to as FTO. In the simulation, we first used to set the general parameters of the simulation. The system parameters are setting as follows (unless otherwise stated): The number of the MDs \(M=3\), the number of time slots \(N=3\), the period required for 1-bit calculation is subject to uniform distribution \(C_{j}\in[600,800]\) cycles/bit, \(\kappa_{j}=10^{-28},\ \ \forall j\in\mathbf{M}\)[13], the maximum CPU frequency \(f_{j}  
From Figure 3, we can observe that when the AP transmission power varies from 200 W to 290 W, the MMM and FTO curves always have relatively large residual energy. However, the MMM curve shows better stability because the proposed joint optimization scheme considers the task-offloading size, while FTO fixes the task-offloading size and only optimizes the task-offloading time and energy harvesting time. In contrast, OFF offloads all tasks to the AP, which means that the size of task offload is fixed, and optimize the only task-offloading time and energy harvesting time, which requires reducing energy harvesting time and increasing task-offloading time. Similarly, although LOC does not require task offload size and task offload time, it only needs to use time slots for harvesting. We all know that MDs do not have strong computing power. Of course, the residual energy is more than FEH only. The FEH solution fixes the energy harvesting time, which does not take so long for task-offloading. Therefore, the energy harvesting time is shortened, the energy consumption increased further the smallest residual energy. In addition, we found that MMM and FTO intersect among the five curves, OFF is closer to MMM, and the LOC and FEH curves are a straight line. The second simulation shows the relationship between the residual energy (J) and the task size (KB). The tasks we declared earlier are randomly selected. For the sake of the intuitiveness of the task size changes, we directly give a fixed task size change. There are multiple MDs in a time block, assuming that each MD has the same task size. By changing the size of the task, we observed the changes in the residual energy when the five methods were executed separately.