Text this: A Novel Loss Minimization Algorithm for the 3-Port Converter in a Multi-Subgrid Microgrid