Energy systems and energy management