## 4 Simulation Verification
### Verification  
We put the parameters in Table 1 into Equations (18) and (31) to illustrate the bode diagram of the inverter output impedance. In the simulation, a small harmonic voltage of 100-5000 Hz is added to the grid voltage, the inverter output current is measured, and the output impedance of the inverter is obtained after the calculation of the measured data, as shown in Figure 10.  
As shown in Figure 10, the analytic calculation results (Equations (18) and (31)) and the results from the simulation match very well. The accuracy of the linearized analytical model in the frequency domain has been verified.  
The real part of the inverter output admittance Re[Y(j\(\omega\))] is illustrated in Figure 11.  
Figure 11: The real part of the inverter output admittance; blue for the dq-based control method and red for the PR-based control method.  
Figure 10: The Bode diagram of the inverter output impedance. (**a**) Impedance amplitude (**b**) Impedance phase angle; the solid line for theoretical calculation; * for simulation result; red for dq-based control and blue for PR-based control.  
As shown in Figure 11, both the dq-based control method (blue line) and PR-based control method (red line) enter the range with the negative real part of the output admittance near about 1700 Hz. This means that both control methods will be not stable if the resonance point of the grid is above 1700 Hz (Critical resonant frequency).  
Verification will be performed in the simulation. In the simulation, the grid impedance consists of a CL circuit. The filter inductance of the inverter L, the grid capacitance Cg and the grid inductance Lg together form an LCL resonant circuit. Lg is given as 49.5 uH, corresponding to a 400 m cable length. The total grid capacitance, taking into account all the LV-cables in the analyzed system, will be estimated so that a specified resonance frequency is achieved (Equation (33)).  
\[\mathrm{C_{g}}=\frac{\mathrm{L+L_{g}}}{4\mathrm{LL_{g}(\pi f_{r})^{2}}} \tag{33}\]  
The resonant frequencies are set to 1530 Hz and 1730 Hz, respectively. To demonstrate the instability effect, the time domain simulation is started without capacitance and after 0.3 s, the capacitance is connected, forming an LCL circuit. The simulation results are shown in Figure 12.  
As shown in Figure 12a,c, the inverter-grid system with the dq-based control method oscillates slightly after 0.3 s since the Re[Y\({}_{\mathrm{inv}}\)(i\(\omega\))] of the inverter with the dq-based control method is near 0 in a large frequency range (1000 Hz\(\sim\)5000 Hz), as shown in Figure 11.  
As shown in Figure 12b, when f\({}_{r}\) = 1530 Hz is less than the critical resonant frequency (1700 Hz), the inverter-grid system with the PR-based control method is stable after 0.3 s. As shown in Figure 12f, when f\({}_{r}\) = 1730 is larger than the critical resonant frequency (1700 Hz), the system is unstable after 0.3 s.  
By comparing Figure 12c,d with the same system resonant frequency, the dq-based control method is critically stable and the PR-based control method is resonance instable. Since the dq-based control method (Figure 11a, blue line) is always above the PR-based control method (Figure 11a, red line) after entering the range with the negative real part of the output admittance, this means that the dq-based control method has a larger stability margin than the PR-based control method.  
Figure 12: The simulation waveform result of (**a**) dq-based control method with a 1530 Hz resonant frequency; (**b**) PR-based control method with a 1530 Hz resonant frequency; (**c**) dq-based control method with a 1730 Hz resonant frequency; (**d**) PR-based control method with a 1730 Hz resonant frequency.