Estimation of the equivalent inertia of grid-forming and grid-following inverter-based resources