Method and System For Controlling Inverters in Microgrid