Smart Grids Analysis and Design