Control and Optimization Methods for Electric Smart Grids