A Comparative Study between Reduced-Order and Switching Models of Grid-Following Inverter Interfacing Renewable Energy Sources

. This paper presents a performance comparison between switching and reduced-order models of grid-following inverters. Di ﬀ erent models have been developed to study the inverter ’ s operation using MATLAB and PSIM simulation tools. These models o ﬀ er a tradeo ﬀ between accuracy and computational burden. The switching model fully represents the discontinuities in the inverter due to switching, but such a model demands high computational resources. The inverter representation is simpli ﬁ ed using reduced-order models, which is common in the literature. However, the ﬁ delity of these simpli ﬁ ed models might not be adequate for some applications. Therefore, it is essential to investigate the performance of such models closely to ensure their suitability depending on the purpose of the analysis. Hence, a comparative study between switching and reduced-order models is presented here by simulating di ﬀ erent scenarios and operation conditions. The results have validated the e ﬃ cacy of the reduced-order model in representing the grid-following inverter ’ s operation in both steady state and response to a step change resulting from active or reactive power variation. Unlike the switching model, the ﬁ ndings illustrate that the reduced-order modeling fails to represent harmonics and losses. After simulating di ﬀ erent scenarios, this work highlights the main di ﬀ erences between the switching and reduced-order models to facilitate the choice of the proper modeling method for researchers.


Introduction
The increase in global energy demand, accompanied by increased environmental awareness, has led to a rise in renewable energy penetration.Many of these newly explored renewable sources come as distributed generation (DG) that generates power as a DC source and hence requires an interface to the power grid.Grid-connected inverters facilitate energy conversion from the DC source to the grid side.A microgrid can be formed by clustering multiple DG units, loads, and energy storage systems.These small-scale grids can operate in a grid-connected mode where reliable grid access is available or in autonomous mode where grid accessibility is limited [1].
With critical grid requirements and the renewable source's intermittent and stochastic behavior, DG systems should have high controllability and operability levels to better integrate into the grid while maintaining network functionality and stability.Grid-connected inverters play different roles depending on the microgrid operational mode.Grid-following inverters are controlled to deliver active or reactive power to the grid.However, in the autonomous microgrid, the inverter is operated in a grid-forming mode to set the grid voltage and frequency accurately [2].Different models have been developed to study the inverter's operation and assess grid stability.These models should adequately describe the inverter behavior during the studied phenomena.In a practical case, neglecting the dynamics of the phase-locked loop (PLL) and the DG's DC bus voltage led to a misrepresentation of PV generation, which misled the operator to disconnect PV generation and eventually led to a blackout [3].
Switching models, although computationally heavy, represent the inverter accurately.Models for the semiconductor power devices used in the power stage can include devices' characteristics such as on-state resistance and parasitic capacitances.These devices' gate control is performed via a specific pulse-width modulation (PWM) scheme.Switching models established using commercial simulation tools such as PSIM, EMTP, and MATLAB/ Simscape provide insight into the inverter's dynamics and its interaction with the grid [4].These models allow for various studies, including (i) efficiency assessment and power loss calculations [5], (ii) evaluation of deadtime effect on inverter performance [6][7][8], (iii) investigating harmonic content for facilitating filter design [9] or verifying harmonic compensation techniques [10], (iv) examination of DC bus utilization [11], and (v) investigation into the impact of PWM scheme on inverter operation [12].The advantage of such switching models is to represent faithfully the inverter behavior in real practice.However, some studies considering the system level of grid-connected inverters do not require detailed modeling of the power converter.
To avoid the complexity arising from the discontinuity inherent in the switching model, averaging techniques are employed [13][14][15].The averaging yields reduced-order models that preserve the inverter dynamics while requiring fewer computational resources.Both frequency domain [16,17] and time domain analyses [18,19] are facilitated by reduced-order models.In these models, the switching poles of the inverters are replaced by controllable ideal voltage sources.Such reduced-order models were used to investigate microgrid stability neglecting the line dynamics [20].Those dynamics are neglected, assuming a timescale separation between the network dynamics and inverter inner controller [21].The work in [22,23] has pointed out the importance of network dynamics in microgrid stability assessment.The impact of network impedance on the credibility of stability studies made using reduced-order models is presented in [24].Techniques to improve reduced-order model accuracy, such as singular perturbation [23,25] and dynamic phasor-based modeling [26][27][28][29], are employed for microgrid simulations.
Reduced-order models simplify the inverter representation to decrease simulation time and complexity, risking some crucial aspects being disregarded.On the other hand, a highly detailed switching model may be unnecessary for the specific study's objectives.Depending on the study's nature, it might be feasible to achieve the desired outcomes without exploring additional insights into the inverter's operation.
A comparison between reduced-order models is presented in [30].The work focuses on the stability assessment of microgrids at different R/X regimes.In [31], an efficient reduced-order model of the inverter that allows for inner current loop simplification is developed.After investigating several models, the work concluded that no single reducedorder model suits all scenarios.A model order reduction algorithm is developed in [32].The proposed reducedorder model uses a state space method in an attempt to improve the model's accuracy compared to the existing models.
Based on the above, a literature gap exists in the performance comparison between the switching and reducedorder modeling of the well-known grid-following inverter.Therefore, there is a need for a comparative study between the reduced-order and switching models of the gridfollowing inverter under steady-state and dynamic conditions.By comparing the inverter operation and dynamics while connected to a microgrid, researchers can select the most appropriate inverter representation for various studies.This will enable proper model selection by finding a balance between accuracy and computational efficiency.
This study is aimed at establishing a thorough comparative study between the reduced-order model and the switching model of grid-following inverters.Firstly, the steady-state operation is investigated, and the main differences are highlighted.Various operation modes where real and reactive power is being injected into the grid are studied to highlight the dynamic performances.The harmonic content of the grid current and its total harmonic distortion are also compared.Furthermore, the inverter's dynamics are also studied in the presence of grid disturbance.A case where the grid's frequency witnesses a change is presented.This work also addresses the accuracy of the models under varying line impedance ratios (R/X).Finally, the main findings are discussed and critical comparisons between the models are made.
This paper is arranged as follows: Section 2 presents the grid-following inverter models.Section 3 describes the system structure and the implemented controller.The main results of the simulated scenarios are displayed in Section 4. Section 5 discusses the main findings, and Section 6 provides the paper's conclusions.

Grid-Following Inverter Model
2.1.Reduced-Order Model of Grid-Following Inverter.In the reduced-order model, all the discontinuities in voltage and current waveforms are eliminated by averaging.This allows for neglecting the inverter's internal states while preserving the terminal states, i.e., voltage, current, and frequency.The inverter is modeled by a controllable voltage source with a frequency that matches the grid frequency.Figure 1 shows the structure of the described model.The voltage at the point of common coupling (PCC), which represents the inverter's terminal voltage in phasor form, is expressed as v PCC = V PCC ∠0 °considering it a reference node while the voltage at the grid side v grid = V grid ∠ϑ °.The per-phase complex power delivered by the inverter to the grid can be expressed as where R g and L g are the network resistance and inductance, respectively, as shown in Figure 1.Using (1), expressions for 2 International Journal of Energy Research active and reactive power can be established in terms of the inverter's voltage and current.
Here, the grid-following inverter is represented by an ideal controlled voltage source to operate in grid-connected mode.The active and reactive control is implemented in the dq synchronous reference frame, where the voltage and current are measured and converted to DC values to facilitate controlling them using a PI controller.Power and current control loops are used to deliver a control signal for the grid-following inverter.This is achieved by adjusting the inverter terminal current based on a reference set point for active and reactive power.Then, the controller adjusts the voltage sources inside the model by controlling values (v ma , v mb , and v mc ).

Switching Model of Grid-Following
Inverter.An accurate representation of the inverter's states is possible by representing the switching state of the inverter's switches.However, creating such a model required full knowledge of the inverter topology and switching scheme.Figure 2 shows a three-phase, two-level grid-following inverter with a DC source representing the distributed generation unit.In order to create balanced three-phase voltages at the terminals of the inverter, proper gate control signals for switches (Q 1 …Q 6 ) are required.These signals are generated by a pulse-width modulation (PWM) circuit where control signals (v ma , v mb , and v mc ) are modulated with a high-frequency carrier.Various PWM schemes like sine-PWM and space vector PWM can be used; however, this work implements a simple sine-PWM scheme, as demonstrated in Figure 2.

The System Description
A current control strategy for grid-following is utilized [33].Converting the voltage and current waveforms to a synchronous dq0-frame enables the use of a simple PI controller to eliminate any steady-state error.All time-dependent variables (v abc , i abc ) are converted to dq0-frame (V dq0 , I dq0 ) by combining Clarke's and Park's transformation to obtain [34] X dq0 = T θ x abc , 3 where the transformation matrix T θ is expressed by The reference phase angle θ is deduced from the line voltages at the point of common coupling (PCC) using a phase-locked loop (PLL).Figure 3 depicts the dq-frame rotating at a synchronous speed ω and its relationship to the abc-frame coordinate system.
To control active and reactive power, the measured oscillatory currents (i abc ) are converted to a rotating dq-frame using T θ .A low-pass filter is used in the case of the switching model to eliminate high-order harmonics, as the control target is to adjust the fundamental value only.
Using phasor notation for voltage v t and current i t , the instantaneous active and reactive power can be expressed as Considering the grid voltages to be a balanced threephase system, the zero term in dq0-frame is dropped.Assuming a zero phase shift between the qdand abc -frame coordinate θ o = 0 (shown in Figure 3), the voltage and current phasors are given by Figure 1: Reduced-order model for a grid-following inverter.

International Journal of Energy Research
The instantaneous active and reactive power in ( 5) and ( 6) can be rewritten in terms of dq-frame variables as The controller objective here is to provide a certain combination of active and reactive power at the PCC.For reference active power (P ref ) and reactive power (Q ref ) values and known grid voltage v t , it is viable to formulate the dq-frame reference current values (I q , I q ) in terms of reference power quantities using ( 5)-( 9) as follows: Expressing the voltage and current in dq-frame as in ((7a) and (7b)), one can generate the required reference current values: The complete structure of the grid-following inverter, including the current controller, is shown in Figure 4.A block diagram of the reference current generation expressed by ((11a) and (11b)) is also depicted.Using the proposed control strategy, active and reactive power control is possible using a simple PI controller.This is achieved by comparing the measured and transformed grid currents in the dq-frame with the generated values from the current reference generator.The PI controller generates voltage controller signals (v ma , v mb , and v mc ) while ensuring zero steady-state error in active and reactive power.These control signals are given to the pule-width modulation (PWM) circuit to generate the gate signals for switches in the case of the switching model.On the other hand, the reduced-order model directly uses signals (v ma , v mb , and v mc ) to control the voltage sources, as shown earlier in Figure 1.

Simulation Results
To draw a comparison between the reduced-order and switching models, the two models are evaluated at various operational conditions, including steady state and transient.A lumped impedance between the inverter output and PCC  4 International Journal of Energy Research is assumed.The impedance value and other inverter and network parameters used in the two cases are listed in Table 1.Different case scenarios are investigated to highlight the main differences between the reduced-order and switching models.The reduced-order model is implemented in MATLAB/Simulink, while the switching model is simulated in PSIM [35].It is worth noting that the simulated period is significantly shorter in the switching model case due to the high computation resources needed.

Steady-State and Dynamic
Performance.This section presents a steady-state operation of the reduced-order and switching models during two scenarios.The first scenario involves introducing a reactive power step change while maintaining a constant output active power.In contrast, the second case demonstrates the model's performance during a step change in active power while maintaining a fixed reactive power level.The inverter power is injected directly into the grid during the simulations, and no load is used.A secondary controller not included in this study initiates the active and reactive power reference change and ensures it is within the inverter's rated power.

4.1.1.
Step Change in Reactive Power.In this case, the inverter delivers a contact active power of 10 kW and 2 kVAR of reactive power before an increase in the reactive power to 5 kVAR is introduced at t = 0 115 s. Figure 5  In contrast to the switching model result, the line current in the simulated reduced-order model is pure sinusoidal.Figure 7 shows the same step in reactive power at t = 1 s.No apparent disturbance at the instant of step change appears on the current waveform.The measured active and    6

Current reference generator
International Journal of Energy Research reactive power resulting from the two models at the PCC is compared in Figure 8.It is worth noting that the reducedorder model exhibits a higher overshoot in active power when a change in reactive power is introduced.

4.1.2.
Step Change in Active Power.In this case, the inverter delivers a contact reactive power of 2 kVAR and 10 kW of active power before increasing the active power to 20 kW.The current and voltage at PCC using the switching model are shown in Figure 9.The step change here is introduced at t = 0 115 s.
The current and voltage waveform appear without any distortion when simulating the same scenario using the reduced-order model, as Figure 10 depicts.This is due to using an ideal voltage source instead of the switching model of the inverter.Note here that the change is introduced at t = 1 s.
The measured active and reactive power at the PCC is depicted in Figure 11.In both models, the measured output real and reactive power matches the target.However, the dynamic is slightly different.It is worth noting that reactive power measured by the switching model experiences minimal

Harmonic Content.
The current injected into the grid by the inverter contains a distortion current in addition to the fundamental component.The degree of this distortion is measured by the total harmonic distortion (THD) index, which is the percentage of distortion current to the fundamental component.The THD varies with the inverter's real power output and operation point [36].The current waveform resulting from the reduced-order model contains no distortion and thus has zero THD value.This results from using voltage sources to represent the inverter terminal voltages.
Contrary to the reduced-order model, the switching model provides a detailed overview of the harmonic components generated by the inverter.Furthermore, the switching model can estimate THD value at different power levels.Figure 12 compares the inverter's current generated by the two models when 10 kW of real power is delivered to the grid.The higher frequency order harmonics can be seen in the switching model results.The frequency spectrum in Figure 13 reveals the harmonic content of the current.Besides the fundamental component at the grid frequency (i.e., 50 Hz), harmonics at the switching frequency and its multiple appear.
The THD varies with output power and can be improved by increasing the filter size or improving the current  8 International Journal of Energy Research controller [37,38].To further test the switching model's ability to capture the harmonic content correctly, the THD of the output current is measured at different output power percentages.The percentage THD results are shown in Figure 14, along with the 5% limit that is considered for many engineering standards of grid-connected inverters.
The simulations show a similar trend of measurements reported in the literature.

Grid Disturbances and Line Impedance
Effect.This section presents the main performance differences between the reduced-order and switching model in the case of grid disturbance.Here, two cases are investigated: grid frequency change and line impedance effect.A momentary drop in the grid frequency from 50 to 48 Hz is considered here.Figure 15 shows the grid current and voltage as the frequency changes produced by the switching model.The figure also depicts the measured output power.The reference power is kept constant during the period of disturbance.Similar simulation results using the reduced-order model are presented in Figure 16, where the voltage is not displayed for clarity.
Examining Figures 15 and 16 reveals the difference between the two models in estimating the grid current dynamics.The reduced-order model predicts an unrealistically high current level, while the current in the switching model is within the rated current of the switches.Neverthe-less, the two models can still track the power reference correctly during the period of frequency change.This is expected because the derived current controller is valid for any frequency.
A step in real power from 10 to 20 kW is introduced while using different line R/X ratios to highlight the impact of line impedance.Three distinct cases are reported here, namely, R ≪ X, R ≈ X, and R ≫ X. Figure 17 depicts the grid current produced by the switching model when the step in active power is introduced at t = 0 115 s.The marginal increase in the current as the ratio R/X decreases is due to the rise of the voltage at PCC.Similar results of those produced by the reduced-order model are depicted in Figure 18; note here that the step in real power occurs at t = 1 s.A similar trend in the current waveform is observed when comparing the detailed and reduced-order models in the first cycle following the step change.However, for the reduced-order model case, the current values for the different R/X cases match after that, indicating a higher error if the voltage rise phenomenon is to be studied in highly resistive networks using this model.

Discussion
Selecting the most effective modeling method for a gridfollowing inverter depends on the application and the associated phenomena of interest.Switching models encompass every inverter element and require detailed knowledge about the devices' characteristics, converter topology, and modulation scheme.If properly established, switching models can accurately reproduce exact inverter behavior.This precise presentation allows for a detailed analysis of the inverter operation.Studies such as efficiency optimization, dead-time effect, and assessing controller performance are examples where switching models excel.Despite offering accurate results, switching models require high computational resources and a longer time to converge, making them more suitable for small systems.With the improvement in real-time digital simulation techniques [39], switching models might be considered for larger systems.
The reduced-order model uses an averaging technique to reduce the model complexity and eliminate its discontinuities.These models are simple to implement and require fewer computational resources than the switching model.The reduced-order model of the grid-following inverter   9 International Journal of Energy Research represents the inverter behavior with reasonable accuracy under large but slow disturbances such as reference power step change and grid disturbances.These models fail to account for harmonic and power losses generated by the inverter's switching since the inverter is represented by an ideal voltage source that delivers a pure sinusoidal signal.While the switching model reacts faster to grid disturbances and provides higher accuracy, it requires higher computational resources.On the other hand, the analytical and computational advantages of reduced-order models are favorable, particularly when studying large-scale networks.Although this model may scarify some accuracy, it can still be used if computational efficiency is a priority.An example illustrating this tradeoff is presented in [40].
Further attempts to improve the reduced-order models for better inverter/grid interaction continue [41,42].For example, the stability and control of interconnected microgrids using a reduced-order model are presented in [43].Table 2 compares the types of modeling for grid-following inverters and lists the most suitable studies that can be performed using each model.The simulation's elapsed time to complete one 50 Hz cycle (i.e., 20 ms) listed in the table reflects the high computational resource the switching model needs.This time is expected to be longer for a realworld microgrid as the model should include more components.The precise harmonic representation in the switching model allows for harmonic-related studies such as filter design.Additionally, the switching model can evaluate the   10 International Journal of Energy Research impact of these harmonics on the control loop dynamics.Furthermore, the switching model can study the PWM schemes' effect on the inverter operation since a detailed PWM circuitry is implemented in the model.In comparison, the reduced-order model contains no PWM circuitry.

Conclusions
This paper presented a comparison between switching and reduced-order models of grid-following inverters.Key performance differences between the two models are compared by simulating a grid-following inverter in a microgrid  system.Despite the accuracy of the switching model, it requires full detailed knowledge of the inverter's parameters and demands high computational resources.On the other hand, the reduced-order model is simple to implement and adequate for testing grid-following inverter operation in steady-state or under slow disturbances.The reduced-order model fails to capture harmonics or switching transients due to the averaging that eliminates discontinuities.Moreover, the model accuracy degraded as the line R/X increases.So, the results of the reduced-order model for highly resistive networks should be treated carefully.On the contrary, the results show that the switching model can be used regardless of the network.Furthermore, THD and harmonic analyses reveal an accurate representation of harmonics generated by the inverter.This makes the switching model suitable for harmonic studies, including filter design, and yields accurate power loss calculations that are useful for efficiency optimization.Switching models are also suitable for studying control loop dynamics and testing PWM schemes as they give access to control signals and represent PWM circuitry.
As a continuation of this study, future work may include (i) incorporating a secondary controller stage during the comparison, (ii) expanding the comparison aspects to incorporate fault tolerance and model robustness, (iii) investigating microgrids with the presence of grid-forming inverters and energy storage systems, and (iv) performing a similar comparative study for grid-forming inverters.

Figure 2 :
Figure 2: Detailed switching model for a grid-following inverter.
shows the grid current and voltage for the switching model.The top part of the figures shows phase (a) current and the filtered current before abc-dq transformation.The phase angle between the voltage and fundamental component of the line current is measured before and after the step change to verify the controller performance meeting the new reactive power reference.The regions A and B of Figure 5 are magnified in Figure 6 for closer examination.The measured phase shift in region A is δt = 622 μs which corresponds to a power factor angle of 11 2 °.The phase shift in region B is δt = 1 475 ms which corresponds to a power factor angle of 26 55 °.Based on reference value P ref and Q ref values, the power factor angle should be 11 309 °and 26 56 °, in regions A and B, respectively.

Figure 4 :
Figure 4: Grid-following inverter structure with current controller.

Figure 5 :Figure 6 :Figure 7 :
Figure 5: Output current and voltage of inverter delivering 10 kW of active power and a step in reactive power is introduced at t = 0 115 s.

Figure 8 :Figure 9 :
Figure 8: Measured output real and reactive power at a step change in reactive power introduced: switching model (a) and reduced-order model (b).

Figure 10 :
Figure 10: Current and voltage at the PCC for reduced-order model at t = 1 s.

Figure 11 :
Figure 11: Measured output real and reactive power at a step change in real power introduced: switching model (a) and reduced-order model (b).

Figure 13 :
Figure 13: Frequency spectrum of the output current generated by the switching model.

Figure 14 :
Figure 14: Percentage THD versus output power of the inverter.

Figure 12 :
Figure12: Simulated inverter's current using reduced-order and switching models.

Figure 15 :
Figure 15: Switching model simulation results for frequency disturbance (t = 0 2 0 305s): grid current and voltage (a) and measure and reference power (b).

Figure 16 :
Figure 16: Reduced-order model simulation results for frequency disturbance: grid current (a) and measure and reference power (b).

Figure 17 :Figure 18 :
Figure 17: Simulated grid current using switching model at different line ratios R/X.

Table 1 :
Parameters used for network and inverter simulation.

Table 2 :
Comparison between switching and reduced-order model.Model typeLevel of details Linearity Simulation time step Simulation time1Most suitable studies