Text this: Simultaneous Minimization of Energy Losses and Greenhouse Gas Emissions in AC Distribution Networks Using BESS