Modeling and Simulation of a STATCOM for reactive power control