Designing Gear-Shift Pattern for an Electric Vehicle to Optimize Energy Consumption