## 2 Materials and Methods
### Virtual Inertia Optimization Allocation Model
#### 2.2.1 Frequency Stability Constraints  
The minimum inertia requirement of the distribution system is mainly reflected in the system frequency change rate and the lowest point of the system frequency [23]. To ensure that multiple regions remain autonomous and frequency stable after being disconnected from the grid, the regional inertia demand should meet the following constraints after an active disturbance occurs. According to the equivalent rotor motion equation of the power system, the expression of the system frequency change rate RoCoF can be obtained as follows:  
\[\left\{ \begin{array}{l}\frac{d\Delta f}{dt}=\frac{\Delta P_{m}-\Delta P_{l}- \Delta f}{2H}\\ \frac{d\Delta f}{dt}\Big{|}_{t=0}=\frac{\Delta P_{m}-\Delta P_{l}}{2H}\end{array} \right. \tag{4}\]  
where \(t=0\) represents the moment when the frequency disturbance occurs, \(\Delta P_{m}\) is the increment of the system's equivalent mechanical power, \(\Delta P_{L}\) is the increment of the system's equivalent electromagnetic power, \(D\) is the system's virtual damping coefficient, \(\Delta f\) is the change in system frequency, and \(H\) is the system's inertia. The maximum rate of change in the system frequency \(RoCoF_{max}\) appears immediately after the disturbance occurs. At this  
Figure 2: Evaluation process of RBFNN. time, the virtual damping coefficient and the equivalent mechanical power increment can be ignored. From Equation (4), \(RoCoF_{max}\) can be equivalently expressed as follows:  
\[RoCoF_{max}=\frac{-\Delta P_{L}f_{0}}{2 HS_{b}} \tag{5}\]  
where \(S_{b}\) represents the rated capacity of the system, and \(f_{0}\) represents the rated frequency of the system. From Equation (5), the critical inertia expression under the constraint of \(RoCoF_{max}\) can be obtained as follows:  
\[H_{RoCoF}=\frac{-\Delta P_{max}f_{0}}{2 RoCoF_{max}S_{b}} \tag{6}\]  
When the frequency is disturbed and changes, the virtual governor will increase the equivalent mechanical power input to reduce the system power deviation, thereby further suppressing the frequency drop. Generally, it is approximately considered that when the equivalent mechanical power input and the equivalent electromagnetic power output are equal, the system frequency reaches the minimum value \(f_{nadir}\). To avoid triggering the low-frequency load shedding stability action of the device, the lowest point of the frequency is also a key indicator for measuring the system frequency stability, and it needs to meet the following:  
\[f_{min}\leq f_{nadir} \tag{7}\]  
where \(f_{min}\) represents the lower limit of frequency. A linear model can be used to solve for the lowest frequency point of the system, that is,  
\[f_{nadir}=f_{N}-\frac{p_{1}+p_{2}}{q_{1}+q_{2}+q_{3}} \tag{8}\]  
\[\left\{ \begin{array}{l}p_{1}=2t_{db}f_{N}R_{sys}\Delta P_{\max}\\ p_{2}=f_{N}\Delta P_{\max}^{2}\\ q_{1}=4H_{sys}R_{sys}\\ q_{2}=Dt_{db}f_{N}R_{sys}\\ q_{3}=Df_{N}\\ \end{array} \right. \tag{9}\]  
To reduce the complexity of the equation, this equation uses \(p_{1}\), \(p_{2}\), \(p_{3}\), \(q_{1}\) and \(q_{2}\) to represent the product of each parameter. By substituting Equations (8) and (9) into the frequency constraint condition (7), the minimum inertia can be obtained as follows:  
\[H_{nadir}=-\frac{p_{1}^{\prime}+p_{2}^{\prime}+p_{3}^{\prime}+p_{4}^{\prime}} {q_{1}^{\prime}+q_{2}^{\prime}} \tag{10}\]  
\[\left\{ \begin{array}{l}p_{1}^{\prime}=2f_{N}t_{db}R_{sys}\Delta P_{max}\\ p_{2}^{\prime}=f_{N}\Delta P_{max}^{2}\\ p_{3}^{\prime}=f_{N}Dt_{db}R_{sys}(f_{min}-f_{N})\\ p_{4}^{\prime}=f_{N}D\Delta P_{max}(f_{min}-f_{N})\\ q_{1}^{\prime}=4R_{sys}f_{min}\\ q_{2}^{\prime}=-4R_{sys}f_{N}\\ \end{array} \right. \tag{11}\]  
As in the previous text, Equation (11) reduces the complexity of Equation (10).