How batteries store solar energy