Adaptive Virtual Inertia Control for Microgrids