Mathworks, the makers of general purpose mathematical software MATLAB, also develop an power systems simulation program. SimPowerSystems is a tool that extends MATLAB's Simulink and provides models of many components used in power systems, including three-phase machines, electric drives, and libraries of application-specific models such as Flexible AC Transmission Systems (FACTS) and wind-power generation. Harmonic analysis, calculation of Total Harmonic Distortion (THD), load flow, and other key power system analyses are automated.

Reference: SimPowerSystems