Thursday, March 3, 2016

Range polynomial

Previously, I wrote a blog post in trying to analyze SparkEV's range. It was done using known parameters of the car, such as weight, drag coefficient, and some guesses as to rolling resistance and efficiency. Basically, it was an attempt to model the car and estimate the range. If you haven't already, that blog post should be read first, because I discuss where the real world data comes from.

http://sparkev.blogspot.com/2016/01/sparkev-range.html

Since we're guessing some parameters, we can ignore the entire car, and only use observed range data to make some models. In this blog post, we'll do just that: model the power using polynomial, and derive the range and other interesting values using the polynomial. In short,
WE'LL JUST MAKE STUFF UP!
As such, one should read this blog post with plenty of seasoning (ie, should not trust any of it). I'll describe my methodology later in this post, so you can judge for yourself how accurate they might be.

Below are plots of ranges as functions of speeds and various battery capacities.

Because the graphs show maximum ranges at various speeds and various battery capacities, one can estimate the range for partial battery. For example, if one charges 14 kWh using DCFC, and speed is about 45 MPH with little stopping, the maximum range for each DCFC session would be about 85 miles. If one charges 1.5 hours using 3.3kW L2AC (assume 80% efficient = 4kW) and drove at 45 MPH, maximum could be about 25 miles. As always, leave 10 miles as margin, so the actual could be 75 miles and 15 miles, respectively. Again, this is without running down the battery completely, but merely to get back to state of charge before the drive began.

One can also guesstimate the battery capacity. For example, if one normally got 75 miles with 10 miles remaining driving 60 MPH with new battery that would be 18 kWh battery. Later, if he (or she; hi Lindsay!) is getting 60 miles with 10 miles remaining under same conditions (same road, driving habit, weather, etc), then the battery capacity would be about 15 kWh.

Range with extra power use

Another interesting graph is to find what happens when extra power is used, such as with heater, AC, open windows with dogs sticking their heads out. The plots show ranges at speeds for various additional power use in kW. They are based on brand new battery, so old battery ranges would not apply. Still, one can get a "feel" for what extra power use would do to the range.


To read the graph, you have to convert the parameters to power in kW. For example, we can assume the heater takes 2kW on average, about two space heaters you might have in the bathroom, and windows up and driving at constant speed at 65 MPH. Then the maximum range would be bit under 70 miles with 2015 (red line). Leaving 10 miles as margin, usable range would be 60 miles.

But if you decided to waste energy by rolling down the windows and blasting the heater, that could result in lot more power use. Let's guess 9 kW. Then the range at 65 MPH for 2015 would be bit under 50 miles (also red line), with 10 miles as margin would leave about 40 miles.

We really should investigate lower battery capacity range with additional power use. I could do that and generate a 3 dimensional plot, but there'd be no way to effectively display it without using some active code such as Javascript. I hate active code in a web page; it's just inviting malware. Ah, the good old days of strict HTML when you never had to worry about malware, but I digress.

What we can do is to find the worst case battery degradation, and use that as the basis for additional power drain. What is the worst case? SparkEV battery warranty is to about 65% capacity (35% below peak). According to MrDRMorgan of forum, this is found in warranty booklet page 14.

http://www.mychevysparkev.com/forum/viewtopic.php?f=9&t=4457&start=28

Then I guesstimate 60% capacity as maximum degradation, and plot the ranges with additional power drains.

For 2015 with worst degraded battery driven at 65 MPH and 4 kW for heater use would result in about 35 miles range. With 10 miles of margin, usable would be 25 miles range. Of course, you can turn off the heater, radio, lights, and windows up in order to result in 45 miles (35 miles with margin). Yup, that's pretty bad, but it'd still be usable if one commutes only 40 miles a day (20 miles each way).

If one can charge at work, even using the heater would be fine or 40 miles each way. And if the commute happen to be only on local road or in Los Angeles (entire city is one giant traffic mess), the range could still be be close to 80 miles (40 miles each way, or 80 miles one way with charging at work). But 80 miles in LA could take 4 hours; what, you get to work and clock out right away?

miles per kWh with extra power use

Sometimes, forum discussion turns to miles per kWh battery used (hi Norton). We know someone did 7.2 mi/kWh for entire battery capacity using 2014 model (see previous blog post on range). But what would it be for various speeds and extra power use, such as heater? If one drives at local speeds (35 MPH), he'd get far higher mi/kWh than driven at freeway speeds (65 MPH). Below graphs show just that.


Without any extra energy use (no heater, AC), one can expect pretty high mi/kWh at low speeds in local roads and traffic. Regenerative braking won't be 100% efficient, so it would take away from this with lots of braking. Still, careful driving could result in close to 8 mi/kWh (or 270 MPGe energy strictly from battery to wheels)

Because these are only dependent on car's geometry, and not battery capacity, these numbers hold regardless of battery capacity. That assumes battery efficiency would not change as it degrades, which is not correct. Still, the battery should not be as big a factor compared to other parameters. Did I mention that I make stuff up?

How they're made

There's a saying, if you want to eat sausage, don't find out how they're made. In this case, you probably want to find out how the plots are made. I mean, you drive a SparkEV, presumably because you did the research to find that it's the best car in the world, and not just as EV. Put it another way, you have to be smart and inquisitive to be a SparkEV driver. I think that's probably why Chevy has been limiting SparkEV sales: not enough smart people in the world. :-)  (Unfortunately in my case, I happened on it by coincidence, not due to any smart research)

Anyway, let's get to it. What we need is power at various speeds and battery capacity. Once they are known, we can find out everything else (range, mi/kWh, etc) without knowing anything about the car, or whether it's a car or a potato.

Once we have the data, we can find a function that fits the data. As you might recall from basic Calculus, polynomials with enough order can fit just about everything. If there's infinite data, we can use infinite order polynomial series (prove it, Mr. Taylor!). Even without infinite data, we can use the polynomial to make up infinite data using the function to find data we don't actually have, and it should be pretty close to actual.

Polynomial theory

So the secret sauce is the combination of sparse, but enough data (not infinite) for power use over speed, and some polynomial function that fits the data. But there's a problem. We don't have a lot of data. As such, that will limit the polynomial order. But we also know that car's aerodynamic power is cube of speed. Then the minimum polynomial should be third power with some coefficients as follows.

(coeff1 * speed^3) + (coeff2 * speed^2) + (coeff3 * speed) + coeff4 = power

For third order polynomial, we need at least 4 data points of speed and corresponding power. Unfortunately, there aren't many. One is by bicycleguy at 0 MPH (1.25 kW). I have "rough" power at 30 MPH=3 to 4 kW and 60 MPH=12 to 13 kW. We have to extract power from other measurements. Following are available.

2014 model = 140 miles at 24 MPH at 7.2 mi/kWh (digital trends)
2014 model = 98 miles at 62 MPH at 5 mi/kWh (Tony Williams)
2015 model = 93 miles at 55 MPH at 5.166 mi/kWh (me! 93/18kWh=5.166 mi/kWh)

Converting to power is speed divided by mi/kWh. Then we have the following.

2014: 0=1.25kW, 24=3.33kW, 62=12.4kW
2015: 0=1.25kW, 30=3 to 4 kW, 55=10.6kW, 60=12 to 13kW

Oops, 2014 is only 3 data while 2015 has range of power for speed at 30 MPH and 60 MPH. Due to lack of display resolution, 2015 power figure accuracy suffer far more. This is where hocus pocus make up stuff as you go along come into play. It's pure fantasy mixed in with some reality.

We know that everything should result in higher power use. That means all the coefficients of the polynomial must be positive numbers. Yes, there could be some higher order effects (100th order?) that could cause our tiny 3rd order polynomial to exhibit weird behavior, but by and large, we can just guesstimate those effects to be small. Did I mention we make stuff up as we go along?

Making stuff up

First, let's assume 1 kW at 0 MPH rather than 1.24 kW. It could be that bicycleguy had the lights on and his radio playing when he measured it. Besides, 1 is lot quicker to type than 1.24.

2015 data is lot more tricky, because the display did not have enough resolution. In-between could be anything. Two data we have that are "pretty close" are 0 and 55 MPH. We can guesstimate 30 MPH as something like 3.5 kW and 60 MPH to be something like 12.5 kW to start.

We plug in 2015 data to Octave (or Matlab) polynomial estimator, we get some values. Then some coefficients are negative! Especially troubling is the third order coefficient being negative. That means SparkEV would eventually generate power when going fast enough. There's no new Physics here, simple error in value. Then we play with the values (leaving 0 MPH at 1 kW) by tweaking small amounts until we have all positive coefficients.

2015: 0=1kW, 30=3.9kW, 55=10.6kW, 60=12.73kW

We have to come up with one additional data point for 2014 model. Given that 2014 is taller gear (motor spins lower RPM), we can guesstimate 55 MPH power could be slightly less than 2015. How much less? I don't know, let's just start with 10.5 kW. Then we do hocus pocus with the polynomial estimator and values until we get all positive coefficient. The result I like happens at the following.

2014: 0=1kW, 24=3.33kW, 55=10.2kW, 62=12.7kW

Something you should be aware is that the coefficients are extremely sensitive to data. If you'd like, you can do the sensitivity analysis, but since the data are "made up" anyway, analysis won't mean much. For now, we have all positive coefficients, making it consistent with the laws of Physics in our third order polynomial universe. Then the coefficients are as follows:

2014: 2.1007e-005, 6.0466e-004, 7.0472e-002, 1
2015: 3.5859e-005, 6.7172e-005, 6.2379e-002, 1

What's interesting is that the linear term for  2015 is less than 2014. Since the linear term is related to weight, and 2015 weighs less than 2014, this is consistent with that. But then the gearing is different, too, so one could say that's also bogus rationale. The life of meta analysis is full of make beliefs.

Polynomial made up data

Using the polynomial, we can plot power and range over speeds. The equation for range is simply speed / power * battery where battery is 19 kWh for 2014 and 18 kWh for 2015.

Note that the ranges for 2014 at 24 MPH and 62 MPH are pretty close to the actual values found through experiment. For 2015, only range data I have is 55 MPH, which is also close to the actual; 62 MPH is also close to what was found by TonyWilliams. However, all of them are slightly lower than experimental data (ie, these are conservative values).

1000 miles a day revisited

Now that we have more uniform data, we can revisit our 1000 miles a day test. The data may not be accurate, but they are at least uniform (accuracy? reality? they don't mean jack!) 1000 miles / 24 hours = 41.667 MPH. With 20 minutes of DCFC + 10 minutes to get on/off the freeway, we have to keep an average speed of 41.7 MPH to drive 1000 miles a day. Below is a plot of average speed over driving speed.


Note the red line for 41.7 MPH and another line for 20.8 MPH needed for 500 miles a day.2014 SparkEV with new battery could easily make 1000 miles a day, even when driven at 65 MPH. But with 2015 SparkEV, it could barely make it when driven at 70 MPH or 75 MPH (72.5 MPH?). So far, all the indications are that SparkEV should be able to drive 1000 miles in a day.

You might poo-poo 1000 miles a day as something insignificant, but many cars without DCFC can't even drive 500 miles in a day.

For example, Fiat 500e has 87 miles range, 24 kWh battery, 6.6 kW on-board charger. Let's assume 95 miles range at 65 MPH (1.46 hours) and 22 kWh (22 kWh / 6.6 kW / 85% efficiency = 3.92 hours). Then the average speed is only 95 / (1.46+3.92) = 17.6 MPH. That's not even enough to drive 500 miles in a day. 500e would need 112 miles range with 22 kWh to achieve 500 miles a day (5.1 mi/kWh). Given that 500e is less efficient than SparkEV, and SparkEV can barely reach 4.2 mi/kWh at 65 MPH (see plot way above), it's unlikely 500e could ever reach 500 miles a day.

In another example, 24kWh Nissan Leaf DCFC is far slower than SparkEV. While it's not known how much slower over typical case for different cars and weather, we can guesstimate 20 minutes for 11 kWh (vs 20 min for 13.5 kWh for SparkEV). You can do the math, but that's not nearly enough to get 1000 miles a day; however, it would be enough to clear 500 miles a day. 30 kWh may be able to clear 1000 miles a day; that's left as exercise to Leaf owners who care to experiment.

Edit: 2016-10-20

Someone drove over 1000 km in one day (16 hours) with SparkEV! That might be one day distance record for SparkEV. Below is the video.



Below is the discussion. It's in French since he's in Canada (yes, they sell SparkEV in Canada, Mexico, and Korea), but you can use google translate to view in any language.

http://menu-principal-forums-aveq.1097349.n5.nabble.com/1000km-en-une-journee-td53319.html

It works out to 1050 km (650 miles) in 16 hours, which is 65.6 km/hr (40.6 MPH) on average. Had he driven 24 hours in same pattern, he would've driven 1575 km (975 miles). Such feat would not be possible with slower charging EV like Nissan Leaf (24 kWh version) or EV without DCFC like Fiat 500e.

So for now, the real world range of SparkEV per day is 1050 km (650 miles) while leaving 8 hours for sleeping and extrapolated 1575 km (975 miles) in 24 hours without sleeping.

Conclusion

In this post, I tried to make up data that at least better fit known experimental values, and used lowest order polynomial to estimate various scenarios. Given enough time and money, one could obtain better data and better polynomial that would account for many other aspects of the car. But for now, this simple polynomial should be enough to get a rough idea of SparkEV performance over various battery capacities and energy use, and another hint to a possibility of 1000 miles a day.

Appendix

All plots and analysis were generated using Octave (freeware Matlab clone), but Matlab should work as well. You can get Octave from

https://www.gnu.org/software/octave/download.html

Below is my "m file". Copy-paste into Octave, or you can save it to a file and tweak as you see fit.

clear; close all;

speed=0:5:90;

batt_2014 = 19;
speed_2014=[0 24 55 62]; 
power_2014=[1 3.33 10.2 12.7]; 

batt_2015 = 18;
speed_2015=[0 30 55 60];
power_2015=[1 3.9 10.6 12.73]; 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% power polynomial and max range

poly_2014=polyfit(speed_2014, power_2014, 3)
power_2014=polyval(poly_2014, speed); 
range_2014=speed./power_2014*batt_2014;

poly_2015=polyfit(speed_2015, power_2015, 3)
power_2015=polyval(poly_2015, speed); 
range_2015=speed./power_2015*batt_2015;

% plot power vs speed
figure;
plot(speed, power_2014, 'o-', speed, power_2015, 'o-');
axis([0 90 0 40]); grid on;
set(gca, 'xtick', speed, 'ytick', 0:5:40);
title('SparkEV power'); xlabel('Speed (mph)'); ylabel('power (kW)');
legend('2014', '2015/16'); 

% plot range vs speed
figure;
plot(speed, range_2014, 'o-', speed, range_2015, 'o-');
axis([0 90 40 150]); grid on; 
set(gca, 'xtick', speed, 'ytick', 40:10:150);
title('SparkEV range'); xlabel('Speed (mph)'); ylabel('range (miles)');
legend('2014', '2015/16'); 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% function to have uniform range vs speed plot axis

function plot_speed_range(speed, ranges, legend_val)
  plot(speed, ranges, 'o-'); 
  axis([0 90 0 140]); grid on; 
  set(gca, 'xtick', speed, 'ytick', 0:10:140);
  xlabel('Speed (mph)'); ylabel('range (miles)');
  legend(cellstr(num2str(legend_val')));
endfunction

function plot_speed_mikwh(speed, mikwhs, legend_val)
  plot(speed, mikwhs, 'o-'); 
  axis([0 90 0 8]); grid on; 
  set(gca, 'xtick', speed, 'ytick', 0:8);
  xlabel('Speed (mph)'); ylabel('miles/kwh');
  legend(cellstr(num2str(legend_val')));
endfunction

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ranges for various battery capacity

function range_over_battery(batt, speed, power)
  N=15;
  batt_var = 0:(N-1);
  batts_var = repmat(batt_var, length(power), 1)';
  powers = repmat(power, N, 1);
  ranges = repmat(speed, N, 1) ./ powers .* (batt - batts_var);  
  plot_speed_range(speed, ranges, batt-batt_var);
endfunction

figure;
range_over_battery(batt_2014, speed, power_2014);
title('2014 SparkEV ranges for various battery kWh');

figure;
range_over_battery(batt_2015, speed, power_2015);
title('2015/2016 SparkEV ranges for various battery kWh');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% ranges for various power levels

function range_over_power(batt, speed, power)
  N=10;
  power_var = 0:(N-1);
  powers_var = repmat(power_var, length(power),1)';
  powers = repmat(power, N, 1) + powers_var;
  ranges = repmat(speed, N, 1) ./ powers * batt;  
  plot_speed_range(speed, ranges, power_var);  
endfunction

figure;
range_over_power(batt_2014, speed, power_2014);
title('2014 SparkEV ranges for various power use');
figure;
range_over_power(batt_2015, speed, power_2015);
title('2015/2016 SparkEV ranges for various power use');

figure;
range_over_power(batt_2014*.6, speed, power_2014);
title('2014 SparkEV worst case ranges for various power use');
axis([0 90 0 90]); set(gca, 'ytick', 0:10:90);
figure;
range_over_power(batt_2015*.6, speed, power_2015);
title('2015/2016 SparkEV worst case ranges for various power use');
axis([0 90 0 90]); set(gca, 'ytick', 0:10:90);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% mi/kwh for various power levels

function mikwh_over_power(speed, power)
  N=10;
  power_var = 0:(N-1);
  powers_var = repmat(power_var, length(power),1)';
  powers = repmat(power, N, 1) + powers_var;
  speeds = repmat(speed, N, 1);
  mikwhs = speeds ./ powers;
  plot_speed_mikwh(speed, mikwhs, power_var);
endfunction

figure;
mikwh_over_power(speed, power_2014);
title('2014 SparkEV mi/kWh for various power use');
figure;
mikwh_over_power(speed, power_2015);
title('2015/2016 SparkEV mi/kWh for various power use');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Can you drive 1000 miles in a day using multiple DCFC?

batt1k_2014=13.25;
range1k_2014=speed ./ power_2014 * batt1k_2014;
time1k_2014=batt1k_2014 ./ power_2014; 
speed1k_2014=range1k_2014 ./ (time1k_2014+0.5);

batt1k_2015=batt1k_2014;
range1k_2015=speed ./ power_2015 * batt1k_2015;
time1k_2015=batt1k_2015 ./ power_2015; 
speed1k_2015=range1k_2015 ./ (time1k_2015+0.5);

figure;
plot(speed, speed1k_2014, 'o-'
  , speed, speed1k_2015, 'o-'
  , speed, ones(length(speed), 1)*1000/24, 'r-'
  , speed, ones(length(speed), 1)*500/24, 'm-');
axis([20 90 20 46]); grid on;
set(gca, 'xtick', speed);   set(gca, 'ytick', 20:2:46);
title('SparkEV average speed (20 min for 13.25 kWh + 10 min to get off/on road)'); 
xlabel('Speed while running (mph)'); 
ylabel('Average speed including DCFC time (mph)');
legend(
    '2014 average speed'
  , '2015/2016 average speed'
  , '41.7 mph needed for 1000 miles a day'
  , '20.8 mph needed for 500 miles a day'
  , "location", "southeast");

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%resize all plots for easy viewing

% for n=1:11; a=figure(n); set(a, 'Position',[200,100,440,300]); end

2 comments:

  1. That's an amazing work you've done! Thank you so much to share this priceless information. That's gonna be an interesting program and formulas to do, for sure.

    ReplyDelete
  2. Thanks for the compliment, but I wouldn't call it "priceless information". It's nothing special that anyone with SparkEV and minimum knowledge about math can't do. It's simple polynomial curve fitting. Even then, I was lazy and used other people's data instead of obtaining all the data myself.

    ReplyDelete