## 3 Case Study  
In this study, algorithms developed in MATLAB were implemented to conduct real-time tests on an isolated microgrid. The microgrid consists of polycrystalline solar panels with an installed capacity of 10 kW (\(PV\)), a single 5 kW variable-speed wind turbine, and the Li-Ion BESS with a capacity of 44 kWh. For this specific case study, the Micro-Grid Laboratory at the University of Cuenca (CCTI-B), Ecuador [28], was utilized. The equipment was configured to establish an isolated network, as depicted in Figure 6, which shows the presence of the solar panel array \((P_{PV})\), a wind generator \((P_{W})\), a thermal diesel generator \((GD)\), a three-phase programmable load \((Load)\), and an EVCS with a BYD electric vehicle, all interconnected with their respective inverters to a network operating at a voltage of 220 \(V_{AC}\). In order to ensure the system's overall power balance, a constant value of 20 kW was set in the three-phase programmable load. The rationale behind maintaining a constant value over time was to create controlled laboratory conditions where power disturbances were solely attributed to intermittent renewable power (solar and wind) injection. This decision was made to eliminate the risk of the thermal diesel generator receiving a reverse power flow when there is an excess of renewable generation, ensuring safe and reliable implementation of the V2G concept. These controlled conditions not only enhanced the system's safety but also contributed to a more accurate and reliable assessment of the effectiveness of the proposed V2G method, as the single power disturbance source was carefully controlled. Additionally, the Micro-Grid Laboratory has a BYD van, model T3, with a power of 300 kW and electric motor of 100 kW, called BYD-1814 TZ-XS-B35 KW. The van's battery belongs to the LiNIMnCo (Lithium, Nickel, Magnesium, and Cobalt) type, with a capacity of 50.3 kWh and total voltage of 438 Vdc. This BESS comprises 12 modules housing 120 cells and has a CCS2-type connector [29]. To emulate the V2G connection, the rechargeable lithium-ion battery bank from the Micro-Grid Laboratory [28] was used. This bank consists of 11 cells of 58.36 VDC, connected in series (model ELPT392-0002, Samsung). The bank's output voltage is 642 VDC, with a power of 88 kW and energy storage capacity of 44 kWh. The BESS bank is connected to a 50 kW power converter that emulates a bidirectional charger, injecting energy from the BESS back into the grid. It also has various adjustable features, such as peak demand  
Figure 6: Isolated microgrid of the University of Cuenca laboratory (CCTI-B). management, power stabilization, and energy conversion. This bidirectional power flow enables two modes of electric vehicle operation: G2V and V2G. It is essential to consider that the variability in daily PV and WP generation can significantly impact the operation and performance of isolated systems and the design and sizing requirements of the Li-Ion BESS or management systems. The analysis and understanding of the daily solar and wind production curve, with both high and low fluctuations, are fundamental for the planning, operation, and optimizing of PV and WP energy equipment, adapting to the specific conditions and needs of each project or application. In this case, two power curves were considered: one for photovoltaic solar energy (\(P_{PV}\)) (see Figure 7, profile highlighted in red) and another for wind energy (\(P_{W}\)) (see Figure 8), randomly selected annually for emulation. The variation in the total power curve delivered to the system (\(P_{T}=P_{PV}+P_{W}\)) can be significant from one day to another, depending on the weather conditions, geographical location, and system characteristics. Figures 7 and 8 represent possible daily power curves with variability based on actual records measured on the roof of the Micro-Grid Laboratory building in the city of Cuenca, Ecuador (WGS84 coordinate system \(-\)2.891918819933002, \(-\)79.03857439068271) [28].