Energy Management and Adaptive Error-Gradient Control for Resilient Islanded Microgrid,