# Differential Evolution and Fuzzy-Logic-Based Predictive Algorithm for V2G Charging Stations
## 3 Results
The abbreviation adopted were S for small (S0, S1 and S2), M for medium (M0 and M1) and B for big, referring to the obtained \(K_{4}\) output. It is important to notice that the analysis obtained in Figures 5 and 6 established that the system was much more sensitive when it works with \(K_{4}\) varying in an interval between zero and one. Thus, the output membership functions were built by focusing on the impact that lower values of \(K_{4}\) had when applied to the system, in a way where the small functions had much more interactions and influence on each other than the medium and big functions, so that, for higher values, the controller focused on establishing an optimal state of charge. In Figures 8-11, the curves called \"Photovoltaic\" correspond to the proposal that prioritized battery charging when there was greater photovoltaic generation. The so-called \"Cost\" curves correspond to the proposal in which the energy stored in the batteries was sold at the energy cost peak and the batteries were charged when the cost was minimal. For Figures 8 and 9, the \"sunny\" profile of photovoltaic generation was used, while in Figures 10 and 11, the \"cloudy\" profile was adopted. From the analysis of Figures 8-11, it is possible to observe that the three algorithm alternatives have similarities. It is evident that the fuzzy curve, which takes into account self-generation and electricity cost, primarily respects the cost curve during the moments of reduction in photovoltaic generation. On the other hand, for the moments when there is energy from the photovoltaic system, the Fuzzy system tends to migrate to the \"Photovoltaic\" curve. Figure 10: Behavior of parameters for dynamic values of \({}^{\kappa}\)K\({}_{4}\)” with an estimated budget of 100 USD, \(SoC_{0}=50\%\) and cloudy day. (**a**) SoC (%) of the battery; (**b**) Expense (USD) throughout the day; (**c**) Battery current; (**d**) Grid current. Figure 9: Behavior of parameters for dynamic values of \({}^{\kappa}\)K\({}_{4}\)” with an estimated budget of USD 300, \(SoC_{0}=50\%\), and sunny day. (**a**) SoC (%) of the battery; (**b**) Expense (USD) throughout the day; (**c**) Battery current; (**d**) Grid current. The analyses showed that for both cost and fuzzy curves, depending on the available budget, the algorithm sought to increase the battery state of charge so that, at the beginning of the next day, there was a sufficient availability of stored energy. On the other hand, the photovoltaic curve showed the priority was on the battery charging when the photovoltaic generation was sufficiently high, so that, at the beginning and end of a day, the battery bank had a charge state of approximately 50%. Assuming that the battery bank was mobile (i.e., part of a vehicle), the low percentage of charge storage at the beginning of the day constituted a major disadvantage for the algorithm with the photovoltaic profile; however, if the battery bank was stationary, the behavior of the photovoltaic curve became attractive, mainly because it increased the obtained profits. In comparison with the cloudy profile, even though the sunny profile injected a higher average current, the curves presented a very similar behavior regarding the battery charging (Figure 12a,c). From the obtained results, we obtained that between 5 a.m. and 6 a.m. (300 min and 360 min, respectively), the battery bank was in a state of charge between 90% and 95%. With adjustments in the fuzzy rules, this state of charge could also be higher, even reaching full load. Figure 12b,d illustrate that the greatest discrepancies were seen in the injection of the generated current and the total profit at the end of the day. It is also worth mentioning that the variations in the cloudy profile did not bring as much impact to the system as the variations in the sunny profile, although the current injected into the cloudy profile is smaller. In the last analysis, in Figure 12, the comparison of the fuzzy proposal is presented for the different generation profiles (sunny and cloudy).