Determining optimal schedule and generating capacity renewable energy