Feasibility investigation of dispatch strategies and energy storage systems of microgrid in islanded and grid connected modes