FOUNDATIONS OF SMART GRIDS