Potential-Function Based Control of a Microgrid in Islanded and Grid-Connected Modes | Synapse