An analog method for building smart electrical grids