optimize energy resources