Energy storage in rotating machines