Renewable energy optimization