**6. Conclusions**

This work deepens the new advances in nonsinusoidal power theory thanks to geometric algebra. Due to the large deployment of electronic loads in today's microgrid, it is increasingly common to find a more distorted supply and with high harmonic content. This situation generates noise and harmonic pollution, degrading the power supply of the existing electrical receivers on the microgrid. In this work, a detailed study of new mathematical techniques applied to the analysis of nonsinusoidal cases is carried out, and a compensation method based on the use of geometric algebra is proposed. Thanks to this technique, it is possible to reduce the geometric reactive power component, something that other traditional methods such as Budeanu or Fryze cannot do. It is also demonstrated that the technique proposed by Castro-Nuñez is far superior to the one proposed by Castilla, as it is able to better identify the power flows due to crossed voltage and current products (*CNd* and *CNr*), which allowed identifying those components of the current not in phase with the voltage, and thus suppressing them with the appropriate compensator. The main contribution of this work is in the application of geometric algebra to the resolution of power flows in nonsinusoidal electrical systems so that their direction and sense can be correctly determined when considering compensation models. This approach opens up new perspectives in the field of nonsinusoidal systems optimisation, as well as a proper and adequate definition of indices associated with power quality.

**Funding:** This research has been supported by the Ministry of Science, Innovation and Universities at the University of Almeria under the programme "Proyectos de I+D de Generacion de Conocimiento" of the National Programme for the Generation of Scientific and Technological Knowledge and Strengthening of the R+D+I System, gran<sup>t</sup> number PGC2018-098813- B-C33.

**Acknowledgments:** The author would like to thank the Spanish Government and regional authorities for their support through the gran<sup>t</sup> PGC2018-098813-B-C33.

**Conflicts of Interest:** The author declares no conflicts of interest.
