Modeling of an Electrical Energy Switching System in Multisource Power Plants: The Case of Grid Connected Photovoltaic and Wind Power Systems

,


Introduction
Renewable energy production is a current area of research in many developed and even developing countries. Indeed, in recent years, in addition to the ever-increasing demand for energy and the depletion of fossil fuel reserves, the scientifc community has focused on the allegedly most worrying threat to the future of the planet: global warming [1]. Tis phenomenon is the consequence of the increase in greenhouse gas emissions linked to human activity. However, the greenhouse gas emissions produced in the global energy sector are estimated at 75% and 85% [2]. In response to this situation, two strategies have been put in place to combat this problem. Te frst strategy is to save energy by implementing consumption reduction programmes and focusing on energy efciency in the industrial and tertiary sectors. Te second strategy is to use the potential of renewable energy sources (RES) [3]. Te rapid development of the renewable energy sector (solar, wind, biomass, etc.) has led researchers to look beyond the threat of climate change to other alternative uses, such as supplying electricity to remote sites (rural areas not connected to the electricity grid) and reducing household electricity consumption in urban areas (areas connected to the electricity grid).
Among these RES, solar photovoltaic energy has great potential as an alternative energy resource to fossil fuels and is one of the most promising due to energy free, clean, inexhaustible, easy conversion process, free-noise, sustainable, and global availability [4][5][6]. However, their dependence on weather conditions leads to their coupling with other renewable or nonrenewable sources to ensure a continuous supply of electricity. Te most common combination in the feld of renewable energy is that of solar photovoltaics and wind power, due to their complementary nature of using the strengths of one source to overcome the weaknesses of the other [7]. Nowadays, it is usual practice to connect RES to the grid. In this case, the electricity produced by the RES is used directly, and the surplus energy is injected into the grid during the day. In bad weather, the grid supports RES when it is unable to provide the electricity required by the load [8]. Te interconnection of the RES to the grid must meet the requirements of the standard in terms of voltage magnitude, frequency, and current harmonics. A synchronization method is used for the control of grid-connected inverter in order to synchronize both sources in such way that the RES is a phase with the grid, and the currents injected into the grid have low total harmonic distortion (THD) [9]. Furthermore, one of the major problems of the harmonic currents injected by the RES is due to the proliferation of nonlinear loads which do not absorb sinusoidal current and which are connected to the network. Tis afects the quality of the energy [10]. Tese harmonics cause serious problems for loads connected to the grid, such as heating problems, unexpected resonances, disturbances in electronic equipment, "logic" faults in digital circuits, degradation of power factor, electromagnetic interference, and motor malfunctions [11][12][13]. Terefore, it is crucial to mitigate the harmonics level on the grid side. Several solutions for harmonic depollution of power systems have been proposed in the literature and can be grouped into traditional and modern solutions. Traditional solutions mainly include shunt passive flters. Modern solutions mainly include series active flters, shunt active flters, and hybrid flters have been proposed [14].
With the technological and scientifc developments in the felds of renewable energies and their interconnection to the grid, the resolution of power quality problems has taken a major step forward. Indeed, in order to optimise the utilisation of the RES, in addition to its function of supplying AC loads, it can perform the function of power quality management [15][16][17]. Te idea is to combine the RES and active power flters. In this topology, RES can also provide power factor (PF) correction, load balancing, harmonic elimination, and reactive power compensation and simultaneously inject the maximum available power of the RES into the grid [14,18]. Te three main functions of this system confguration are power quality, load supply, and low-THD current injection into the grid. Tis paper deals with this approach. In this paper, a new management strategy for a hybrid multisource PV, wind, and grid plant is proposed. Tis proposed management strategy allows the RES to perform the functions of load supply, harmonic elimination, PF correction, reactive energy compensation, and low-THD current injection into the grid.
Te remaining part of this paper is organized as follows: in Section 2, the description of the studied system is done. Ten, the management strategy proposed is described in Section 3. Te performance of the management strategy proposed is illustrated by numerical simulations in MAT-LAB/Simulink software is presented in Section 4. Finally, Section 5 concludes the paper.

System Description and Modelling
Te system proposed in this work is a hybrid multisource PV, wind, and grid plant based on a shunt active power flter. In this confguration, the PV system and wind turbine are connected to the grid through a SAPF. Te grid-connected inverters are controlled to allow the PV system and wind turbine to perform the functions of power quality, load supply, and grid injection of low-THD current. In Figure 1, the functional components are presented. Tis system is composed of a PV system interfaced with the grid via a DC/ AC converter, a wind turbine interfaced with the grid via an AC/DC converter and a DC/AC converter, the nonlinear and linear loads. Te nonlinear loads consist of a rectifed bridge supplying a resistance in series with an inductance. Te reference currents of the grid-connected inverter are provided by the proposed management strategy.

Modelling of PV System.
Te solar cell is the basic unit of a PV panel, and it is the element in charge of transforming the sun rays or photons directly into electric power by a process called the "photovoltaic efect" [8]. Figure 2 shows the equivalent circuit of solar cell, and equation (1) shows the expression of output current of solar cell [5].
We have where I pv is output current of PV cell; I ph is photovoltaic current source; I s is diode saturation current; I rs is diode saturation current at T r ; I scr is short-circuit current of PV module at standard test condition; V pv is output voltage of PV cell; V oc is open-circuit voltage; E g is silicon gap energy of semiconductor; T is cell temperature; T r is reference temperature; G is solar irradiation; G r is reference solar irradiation; q is electron's charge; n is diode ideality; K b is Boltzmann's constant; K i is temperature coefcient of shortcircuit; R s is series resistance; R sh is shunt resistance. For N s cells in series and N p cells in parallel, the characteristic equation of a PV module is delivered as follows [1]:

Modelling of Wind turbine.
Te wind turbine consists of a turbine coupled with a permanent magnet synchronous generator (PMSG) with a transistor rectifed bridge [19]. Te wind turbine model consists of three important blocks, namely the aerodynamic block, the mechanical block, and the electrical block. Figure 3 shows the interaction between the diferent blocks of the wind turbine model [20]. Te turbine transforms the kinetic energy of the wind captured by the blades of the wind turbine into mechanical energy available on its shaft. Te output mechanical power extracted by the wind turbine is given by [21] Tis power is function of air density ρ, of the area covered by the blade S, of wind speed υ, and of the power coefcient C p (λ, β). For a known wind turbine, C p (λ, β) can be determined by measurement, but in some restrictive conditions, it can be approximated as follows [22]: With c 1 − c 6 , the aerodynamic coefcients are given, respectively, by 0.5176; 116; 0.4; 5; 21; and 0.0068 [22].
where λ is the tip speed ratio; β is the blade pitch angle; R is the blade radius; ω T is the mechanical turbine speed Te output of the turbine is the mechanical torque. Te wind turbine torque may be written as follows [21]: Adding equations (4) and (6) into equation (7) we ge: Te wind turbine mechanical subsystem as known as the drive train consists of the rotor shaft, the generator shaft, and a gearbox. Te simplifed model of drive train is shown in Figure 4 [21].

Journal of Renewable Energy
In Figure 4, T A is the wind turbine torque, T s is the shaft torque, T m is the mechanical driving torque, T fric is the torque losses due to friction, T e is the electromagnetic torque, J r is the turbine inertia constant, J g is the generator inertia constant, ω g is the mechanical generator speed, and n is the gearbox transmission report.
Te equation of motion of the drive train shaft is given by Te relationship between the mechanical driving torque and shaft torque is given by [21] T m � T s n .
Te equation of motion of the generator is given by [21] By taking into account the relationship between mechanical generator and turbine speeds given in equation (11) and equations (7)-(9), the mechanical subsystem is represented by the following equation: We have In sum, the model of wind turbine mechanical block is a model with wind turbine torque and electromagnetic torque as inputs, and mechanical generator speed and mechanical turbine speed as outputs.
Te electrical block consists of a permanent magnet synchronous generator, having as input the mechanical generator speed and electromagnetic torque and as output the power. Te electrical model of PMSG in synchronous reference rotating frame is given by [23] where L d, L q are direct and quadratic components of the stator winding inductances; R s is stator winding resistance; p is the number of pole pairs; i d, i q are direct and quadratic components of the stator currents; u d, u q are direct and quadratic components of the stator voltages; ϕ m is the permanent magnetic rotor fux; Te following equation gives the expression of electromagnetic torque [23]:  Rotor Generator   Figure 5 presents the structure of DC/ AC converter used. It is a two-level three-phase inverter with 6 bidirectional power switches in current. Te inverter is connected to the PCC through a coupling flter. Te DC part of the VSI is ensured by the RES connected through a capacitor. Te grid-connected inverter control strategy is designed to allow the PV system to perform its functions of power quality, load supply, and low-THD current injection into the grid [24].

Management Strategy Proposed
Tis section presents the principle of the proposed management strategy and its application with PQ theory.

Principle.
Te proposed management strategy is based on the calculation of the reference currents of the gridconnected inverters. Te idea is to produce a reference current with two components, one, the harmonic component linked to the harmonics contained in the load current, and the other, the fundamental component linked to the fundamental of the load current. Te reference currents are deduced from their harmonic and fundamental components according to the following equation: where i * is the reference current, i * harm is the harmonic component of reference current, i * fund is the fundamental component of reference current, K h is the modulation coefcient of harmonic component, and K f is the modulation coefcient of fundamental component.
Te harmonic component of the reference current is the sum of the harmonic components of the load current. It is extracted from the load current using a harmonic identifcation technique. Tis component is reinjected in phase opposition to the load current at the PCC to eliminate the harmonics generated by the load and thus enables the RES to perform with power quality function. Te modulation coefcient of the harmonic component is set to either 0 or 1, depending on whether the renewable energy source is to provide the power quality function or not.
Te fundamental component of the reference currents is the fundamental component of the load current. Tis component is reinjected in phase to the load current at the PCC to perform with load supply, low-THD current injection into the grid functions, or both function. Te modulation coefcient of the fundamental component can vary from 0 to infnity depending on the weather conditions. Te sum of the two components is used to impose an operating point on the RES. Tis sum represents the reference signal for controlling the grid-connected inverter. A supervisor determines the modulation coefcients of the harmonic and fundamental components of the reference currents. Te supervisor determines the modulation coeffcients so that the both grid-connected inverters are controlled so that one and only one of the renewable sources provide the power quality function. Tis means that if the PV system performs with power quality function, the wind generator can perform with load supply, low-THD current injection into the grid functions, or both function and vice versa.

Implementation with Instantaneous PQ Teory. Te instantaneous PQ theory introduced by Akagi et al. in 1983
is a time-based method, which is used to avoid difculties due to the high number of calculations when implementing frequency-based methods. It transforms the fundamental component of the signal into a DC component and the harmonic components into AC component. Figure 6 shows the implementation with the instantaneous PQ theory of the proposed management strategy. Te (a, b, c) components of the three-phase load current and the three-phase grid voltage are converted to their (α, β) equivalents in the Concordia reference frame according to the following equations: Te instantaneous active and reactive powers are given by Te separation between the DC components linked to the fundamental and the AC components linked to the harmonics, of the powers, is done by means of low-pass flter (LPF). Te AC components p and q are used to calculate the harmonic components of the reference currents according to the following equation: Journal of Renewable Energy 5 Te DC components p and q are used to calculate the fundamental components of the reference currents according to the following equation: Te (a, b, c) components of the harmonic and fundamental components of the reference currents are given by Te reference currents are deduced from their harmonic and fundamental components according to the following equation: where K hi(i�a,b,c) and K fi (i�a,b,c) are the modulated coefcients generated by the supervisor.

Supervisor.
Te role of the supervisor in the proposed management strategy is to set the modulation coefcients of the harmonic and fundamental components of the reference currents. Te modulation coefcients of the harmonic component are set according to the power produced by the PV system and the power produced by the wind turbine. Te renewable energy source producing the most ensures the power quality function. Te modulation coefcients of the fundamental component are set according to the power produced by the PV system, the power produced by the wind turbine, the power required by the load, the THD of the grid current, the THD of the current injected by the PV system, and the THD of the current injected by the wind turbine.

Results and Discussion
Te efectiveness of the proposed control strategy is evaluated in this section by numerical simulations in Matlab/ Simulink software, using the fxed-step time ODE3 (Bogacki-Shampine) solver and the SimPower system toolbox. Te simulation parameters of the grid and the gridconnected inverters are given in Table 1, and those of the wind turbine are given in Table 2, and PV system is given in Table 3.  Figure 6: Block diagram of proposed management strategy with PQ theory. operating scenario, the power produced by the PV system and that produced by the wind turbine are greater than the power required by the load throughout the simulation. During the frst phase, i.e., between 0 s and 0.5 s, the power produced by the PV system is higher than that produced by the wind turbine and during the second phase; i.e., between 0.5 s and 1 s, the power produced by the wind turbine is higher than that produced by the PV system. Te simulation parameters of the nonlinear load are R � 10Ω and L � 2.6 mH. Te temperature and wind speed are fxed at 25°C and 12 m/s, respectively. Te solar irradiation profle is given in Figure 7. Figures 8-11 show the waveforms and THD of the load current, the flter current injected by the PV system, the flter current injected by the wind turbine, and the grid current, respectively. Figure 12 shows the modulation coefcients fxed by the supervisor, and Figure 13 shows the power factor of the grid. As the load is fxed throughout the simulation, its waveform does not change and stays distorted with a THD of 27% (see Figure 8). During the frst phase (0 s to 5 s), the power produced by the PV system is higher than the power produced by the wind turbine and the power required by the load. For the grid-connected inverter to the PV system, the supervisor sets the modulation coefcient of the harmonic component to 1 and that of the fundamental component to 2.3. Tis means that the PV system eliminates the harmonics, supplies the load, and injects into the grid a current. Te flter current injected by the PV system is less distorted than that of the load (see Figure 9(a)) because, in addition to the currents needed to eliminate the harmonics generated by the load, it contains a sinusoidal component to supply the load and another that is injected into the grid. Tis is verifed in Figure9(b) by the THD value which is about around 12%. For the grid-connected inverter to the wind turbine, the supervisor sets the modulation coefcient of the harmonic component to 0 and that of the fundamental component to 1.8. Tis means that the wind turbine supplies the load and injects into the grid a current. Te flter current injected by the wind turbine is sinusoidal with a THD of 0.5%. Te current injected by the two renewable sources into the grid has a THD of less than 1%.

Performance under
During the second phase, the solar irradiation decreases and induces a decrease in the power produced by the PV system, which becomes lower than that produced by the wind turbine but remains higher than the power required by the load. Te components are set to 0 for the harmonic component and 1.8 for the fundamental component. Tis means that in this phase, the harmonics are eliminated by the wind turbine, the load is supplied by the renewable energy sources, and the surplus renewable energy produced is injected into the grid. Indeed, in this phase, the flter current injected by the PV system is sinusoidal with a THD lower than 1%, the flter current injected by the wind turbine is distorted with a THD close to 20%, and the current injected into the grid is sinusoidal with a THD lower than 1%. Te diferent power fows in the two phases of this scenario can also be seen in Figure 13 where the PF changes from a positive value before the RES connection to a negative value close to −1. Te value of −1 means that during the whole scenario, a current with low THD in phase opposition with the voltage is injected into the grid.

Performances under Operating Scenario 2.
In this section, the performance of the proposed management strategy is verifed under the conditions of operating scenario 2. In this scenario, the power produced by the PV system and that produced by the wind turbine are lower than the power     Figure 14.  Figure 19 shows the modulation coefcients fxed by the supervisor. As the load is fxed throughout the  simulation, its waveform does not change and stays distorted with a THD of 20% (see Figure 15). During the frst phase, the power required by the load is higher than the power produced by the PV system and the power produced by the wind turbine, but it is still lower than the sum of the power produced by the renewable energy sources. As the power produced by the PV system is higher than the power produced by the wind turbine, the modulation coefcients of the reference currents of the grid-connected inverter to the PV system are set to 1 for the harmonic component and 0.8 for the fundamental component. For the grid-connected inverter to the wind turbine, these components are set to 0 for the harmonic component and 0.4 for the fundamental component. Tis means that in this phase, the harmonics are eliminated by the PV system, the load is supplied by renewable energy sources, and the surplus renewable energy produced is injected into the grid. Indeed, in this phase, the flter current injected by the wind turbine is sinusoidal with a THD lower than 1% (see Figure 17), the flter current injected by the PV system is distorted with a THD close to 25%, and the current injected into the grid is sinusoidal with a THD lower than 1%.

Journal of Renewable Energy
During the second phase, the power required by the load is higher than the power produced by the PV system, the power produced by the wind turbine, and the sum of the power produced by renewable energy sources. As the power produced by the wind turbine is higher than the power produced by the PV system, the modulation coefcients of the reference currents of the grid-connected inverter to the wind turbine are set to 1 for the harmonic component and 0.4 for the fundamental component. For the grid-connected inverter to the PV system, these components are set to 0 for the harmonic component and 0.3 for the fundamental component. Tis means that in this phase, the harmonics are eliminated by the wind turbine, the load is partially supplied by renewable energy sources, and the power defcit is  provided by the grid. Indeed, in this phase, the flter current injected by the PV system is sinusoidal with a THD lower than 1%, the flter current injected by the wind turbine is distorted with a THD close to 50%, and the current drawn by the load from the grid is made sinusoidal by the action of the flter current injected by wind turbine. Te THD of the grid current is always less than 1%. Te diferent power fows in the two phases of this scenario can also be seen in Figure 20, where the PF changes from a negative value close to −1 to a positive value close to 1. Tis means that during the frst phase, a current with a low THD and in phase opposition with the voltage is injected into the grid. During the second phase, the grid supplies the power defcit required by the load. Due to the power quality function of the wind turbine, the current drawn from the grid by the nonlinear load is sinusoidal and harmonic-free. Scenario 3. In this section, the performance of the proposed management strategy is verifed under the conditions of operating scenario 3. During the frst phase, i.e., between 0 s and 0.5 s, the power required by the load is lower than the power produced by the PV system  but greater than the power produced by the wind turbine. During the second phase, i.e., between 0.5 s and 1 s, the power required by the load is greater than the power produced by the PV system but lower than the power produced by the wind turbine. Te simulation parameters of the nonlinear load are R � 6.5Ω and L � 2.6mH. Te temperature is fxed at 25°C. Te solar irradiation profle is given in Figure 21.  Figure 26 shows the modulation coefcients fxed by supervisor. As the load is fxed throughout the simulation, its waveform does not change and stays distorted with a THD of 25% (see Figure 22). During the frst  phase, as the power required by the load is lower than the power produced by the PV system but greater than the power produced by the wind turbine, the modulation coefcients of the reference currents of the grid-connected inverter to the PV system are set to 1 for the harmonic component and 1.6 for the fundamental component. For the grid-connected inverter to the wind turbine, these components are set to 0 for the harmonic component and 0.8 for the fundamental component. Tis means that in this phase, the harmonics are eliminated by the PV system, the load is supplied by the renewable energy sources, and the surplus renewable energy produced is injected into the grid. Indeed, in this phase, the flter current injected by the wind turbine is sinusoidal with a THD lower than 1%, the flter current injected by the PV system is distorted with a THD close to 20%, and the current injected into the grid is sinusoidal with a THD lower than 1%. Te THD of the grid current is always less than 1%.

Performances under Operating
During the second phase, as the power required by the load is lower than the power produced by the wind turbine but greater than the power produced by the PV system, the modulation coefcients of the reference currents of the gridconnected inverter to the wind turbine are set to 1 for the harmonic component and 1.6 for the fundamental component. For the grid-connected inverter to the PV system, these components are set to 0 for the harmonic component and 0.8 for the fundamental component. Tis means that in this phase, the harmonics are eliminated by the wind turbine, the load is supplied by renewable energy sources, and the surplus renewable energy produced is injected into the grid. Indeed, in this phase, the flter current injected by the PV system is sinusoidal with a THD lower than 1%, the flter current injected by the wind turbine is distorted with a THD close to 20%, and the current injected into the grid is sinusoidal with a THD lower than 1%.

Journal of Renewable Energy 13
Te diferent power fows in the two phases of this scenario can also be seen in Figure 27 where the PF changes from a positive value before the RES connection to a negative value close to −1. Te value of −1 means that during the whole scenario, a current with low THD in phase opposition with the voltage is injected into the grid.

. Conclusion
In this paper, a new management strategy for a hybrid multisource PV, wind, and grid plant is proposed. Tis management strategy allows the renewable energy sources, depending on the weather conditions, to perform the functions of partial or full load supply, power quality, and low-THD current injection into the grid. Te principle of this strategy is to provide a reference current with two components, one, the harmonic component linked to the harmonics contained in the load current, and the fundamental component linked to the fundamental of the load current. Te harmonic component is used for the power quality function and the fundamental component for the load supply and grid injection functions. Te combinations of these two components allow the RES to perform the functions of load supply, harmonic elimination, PF correction, reactive energy compensation, and low-THD current injection into the grid. In order to facilitate the management of the multisource plant while allowing the renewable energy sources to perform their functions, a new structure of hybrid multisource plant based on a shunt active power flter is proposed. Tis structure consists of two separate energy conversion chains. Each chain is equipped with an gridconnected inverter, which is controlled in such a way that one and only one of the renewable sources provide the power quality function. Tis is achieved by modulating the amplitudes of the harmonic and fundamental components of the reference currents. Diferent operating scenarios were simulated using Matlab/Simulink software, and from the results obtained, the following contributions can be noted: (i) In case of overproduction of RES, they supply the load alone and inject into the grid a current with a THD value lower than 1% (ii) In case of underproduction, the RES partially contributes to supplying the load and eliminates harmonics at the network level. Main current THD values must be less than 1%.
All these results, although promising, were obtained for a balanced three-phase load and for a perfect grid. A study for an unbalanced three-phase load is an interesting perspective to test the performances of the proposed management strategy.

Data Availability
Te data used to support the fndings of this study are available from the corresponding author upon request.

Conflicts of Interest
Te author hereby declares no conficts of interest with the work under consideration.