Enhancing Microgrid Flexibility, Stability, And Economy With Inverter-Based Resources