real-time energy balancing