## 2 Sensitivity-Based VPP Control Algorithm
### VPP Control Algorithm  
The VPP control algorithm proposed in this study aims to maintain the stability of the power grid by efficiently managing various VPP resources. The algorithm dynamically adjusts the output of resources over time and employs a sensitivity-based ratio control method to prioritize control actions based on the sensitivity of each resource. The overall flowchart of the algorithm is shown in Figure 4.  
The proposed VPP control algorithm begins with the input of solar irradiance data and EV scheduling data. These inputs are used to perform a power flow analysis, which evaluates the state of the power grid. Once the power flow analysis is completed, the algorithm checks whether the measured voltage magnitude is within the defined Deadband. The Deadband represents the allowable voltage range necessary to maintain grid stability. If the measured voltage magnitude is within the Deadband, no additional control action is required, as the grid is deemed stable under these conditions. If the measured Vpu is within the Deadband, no control is necessary, and the algorithm proceeds to check whether the simulation time has reached the end of the day (e.g., 24 h). If the time is less than 24 h, the algorithm advances to the next time step and repeats the power flow analysis for the subsequent time period. \begin{table}
\begin{tabular}{c c c c} \hline
**Resource** & **DER-1** & **DER-2** & **DER-3** \\ \hline Sensitivity & 0.01 & 0.02 & 0.04 \\ \hline \end{tabular}
\end{table} 
Table 4: Sensitivity ratio example. \begin{table}
\begin{tabular}{c c c} \hline
**Resource** & **Monitoring Bus 1 Group** & **Monitoring Bus 2 Group** \\ \hline DER-1 & - & O \\ DER-2 & O & - \\ DER-3 & - & O \\ \hline \end{tabular}
\end{table} 
Table 2: Grouping results. \begin{table}
\begin{tabular}{c c c c} \hline
**Resource** & **DER-1** & **DER-2** & **DER-3** \\ \hline Sensitivity & 0.01 & 0.02 & 0.04 \\ \hline \end{tabular}
\end{table} 
Table 3: DER sensitivity example. Conversely, if the Vpu is outside the Deadband, control actions are initiated to address the instability. The first step in this process is the selection of monitoring buses, which are used to identify critical areas of the grid requiring intervention. Following the selection of monitoring buses, the algorithm calculates the sensitivity of each resource to the voltage deviations at the monitoring buses. Sensitivity analysis quantifies the impact of each resource's output on the voltage levels, providing a basis for prioritizing control actions. After calculating the sensitivities, resources are grouped based on a grouping threshold, which determines which resources are significantly contributing to the voltage deviations. For each resource within the group, an output ratio is computed based on its sensitivity. Resources with higher sensitivities are assigned greater control responsibilities, ensuring an efficient and targeted response to the grid's instability. This sensitivity-based ratio control is implemented quantitatively to optimize the control actions. The VPP control dynamically prioritizes and adjusts the control of Distributed Energy Resource (DER) groups based on real-time voltage conditions at each monitoring bus to achieve system-wide voltage stabilization. The voltage stability range was defined as 0.908-1.039 [p.u.] based on the Korean Distributed Resource Interconnection Standards. Accordingly, the overvoltage threshold was set to 1.039 [p.u.] and the undervoltage threshold to 0.908 [p.u.]. Let the number of monitoring buses be \(N\), the voltage at each bus be denoted as \(V_{i}(i=1,2,\ldots,N)\), and the overvoltage threshold be represented as \(V_{threshold}\). The active power adjustment of the DER group associated with each bus is denoted as \(\Delta P_{i}\). An overvoltage condition is detected if the voltage at one or more monitoring buses exceeds the overvoltage threshold, as shown in Equation (5).