Modeling and Stability Analysis of Inverter-Based Resources