How to use batteries in power plants