Here is the thought problem. Its a very cold day. I have to drive 60 miles to my destination. Assume, just as an example, cabin heater needs to draw 5 kW to maintain a given cabin temperature. What would be the ideal speed to drive at for the least kWh/mile for this trip? Obviously if you are traveling at, say 1 mph, the cabin heat draw overwhelms what it would take to move the car, and the battery would be exhausted long before your destination. On the other hand, If you drove at 120 mph, you would drastically reduce total energy needed to keep the cabin warm for those 30', but the energy cost per mile to move the car at that speed would be very high. I'm sure there is an "ideal" speed at which to make that trip which would net the least total energy consumption from the battery!
It would be very interesting to have a formula to make that calculation based on outside temperature and desired cabin temperature. Naturally there would have to be empirically derived factors to make that work, andI know there are a number of potentially confounding variables to such an equation, but a "ball park" figure would still be useful.
Welcome to the exciting world of calculus! The variable here is the speed you drive (lets assume constant speed end-to-end for simplicity) and the derived (computed) value is total energy consumed. You want to solve to find the speed that yields the minimum energy. The calculus is not hard, BUT the relationship between speed and power consumed ("instant" energy, though maths purists will wince at that) is complex, since it involves air resistance, rolling resistance, and motor power consumption. I'm not sure if there is an approximation equation around for this.