Power System Simulation and Optimization