Energy-efficient battery charging in electric vehicles with solar panels