Smart Grid: Fundamentals of Design and Analysis