MPGe of an electric car

Posted on November 17th, 2009 by Alex Willmer

Does an electric car gets better or worse mileage than a conventional petrol or diesel car? To a large extent, it depends on what we choose to include or exclude in the calculation. We can measure the whole chain, accounting for every step in the process of extraction, refinement, transportation and use – a well to wheel model. Or more easily, and less accurately, we can account only for burning the fuel – a tank to wheel model. A tank to wheel module is what I shall use here to compare 2 cars (one petrol and one electric) on:

  • Direct fuel/charge cost per mile
  • Carbon dioxide (CO2) emitted per mile

Petrol Car

First the petrol car, for which I’ll be using my Ford SportKa. At it’s last fill this car used 37.6 litres of petrol to drive 306 miles, thus obtaining 37 mpg.

So fuel cost is easy:

(37.6 l / 306 miles) * 105 p/l = 12.9 pence/mile.

CO2 emissions for a car are:

(Mass of fuel burnt * Proportion of carbon * Relative mass of CO2) / Distance

Density of petrol is 0.72 kg/l, and by mass it contains approx 85 % carbon [wp:Gasoline]. Each carbon atom has an atomic mass of 12, and combines with 2 oxygen atoms with atomic mass 16. So 12 kg of carbon (C) burns to make 12 + 16 + 16 = 44 kg of CO2, or 3.67 kg/kg.

So CO2 emitted is:

(37.6 litres * 0.72 kg/l * 0.85 * 3.67 kg/kg) / 306 miles =  275 g/mile

Electric Car

All the emissions of the electric car happen at the power station, so the calculation is more involved. For this I shall use the BMW Mini E. The Mini E has a quoted energy use of 20 kWh/100 km or 0.323 kWh/mile [mini_e]. This makes the direct fuel cost

0.323 kWh/mile *9.8 p/kWh = 3.1 p/mile.

The CO2 emissions follow the same formula as a petrol car:

(Mass of fuel burnt * Proportion of carbon * Relative mass of CO2) / Distance

The mass of fuel burned is given by:

Electricity used / (Fuel energy density * Power plant efficiency * Grid efficiency)

Referring to the Digest of UK Energy Statistics (DUKES) 2008, coal has a gross energy density of 25.4 GJ/tonne, or 7.05 kWh/kg [dukes08]. Coal burnt in 2007 by Drax – the UK’s largest coal fired power station station – was 60 % carbon [draxenv:table7]. The relative mass of CO2 remains the same. Coal plants in the UK were overall 33 % efficient in 2008, and grid losses were about 8 % [dukes08]. So:

0.323 kWh/mile / (7.05 kWh/kg * 0.33 * 0.92) = 151 g/mile of coal.

Working through:

0.151 kg/mile * 0.60 * 3.67 kg/kg = 332 g/mile of CO2.

Results

To my surprise, based on emissions a 37 mpg petrol car beats an electric car run exclusively on coal. The MPGe is only 30.6 mpg.

Based on cost an electric car run on electricity costing 9.8 p/kWh gets an MPGe of 154 mpg.

Considerations

Such numbers are very sensitive to the assumptions made. For instance if the same car is powered exclusively by natural gas, then the MPGe is nearer 65 mpg, because gas emits less than half the CO2/kWh of coal. If the petrol car were filled at US prices, the cost based MPGe would be much lower.

I would love to improve upon these simple calculations. Please try the numbers with your own figures and post the results for comparison. If I’ve made a bad assumption, or calculations errors, or if you have other sources please let me know.

Here are the assumptions I used, primarily to keep things simple, secondly to make it unfair to the electric car:

  • Manufacturing, maintenance, component replacement, insurance, tax, congestion charges, parking and battery replacement are excluded.
  • Extraction, refinement and transportation of petrol/diesel is excluded, as is extraction and transport of coal.
  • Electricity is generated from coal, the dirtiest of sources.
  • Gross calorific value is used for all fuels, rather than net.
  • The fuel is burnt perfectly, so all the contained carbon is emitted as CO2.
  • Electrical use by the electric car is measured at the wall socket.
  • When referred to imperial (UK) gallons, and metric tonnes are used throughout.
  • Petrol is taken to cost £1.05 per litre, and electricity 9.8p per kWh.

Electric vehicle forums and websites

Posted on September 24th, 2009 by Alex Willmer

There are quite a few forums on the net for electric bikes, scooters, motorcycles and cars. Mostly they cover early adopter issues, tinkering, advocacy and DIY conversions. Here are the ones I’ve been drawn to:

  • Endless Sphere, A lively forum with an emphasis on electric bikes
  • V is for Voltage Another lively forum with many posts on scooters and motorcycles, particularly the Vectrix
  • Electric Motoring A UK forum that’s relatively new, it covers mostly imported Chinese scooters
  • Battery Vehicle Society A UK site with many posts concerning electric car/van conversions, and (unsurprisingly) batteries
  • Elmoto A forum dedicated electric motorcycles and conversions
  • DIY Electric Car Forums Electric car conversions galore, including a gallery and blogs

Also for those just dipping their toe, these sites give a nice overview/introduction:

  • Autoblog Green An offshoot of the automitive news site Autoblog that covers alternative fuel and fuel efficient vehicles
  • EV World Electric vehicle news
  • EVcast Electric vehicle podcasts from the US and the UK
  • EVTV.me Video blog of a thorough BMW Mini EV conversion
  • EV Album A gallery of electric vehicles big and small, from around the world

I’m sure there are plenty more I’ve missed, please leave a comment if you know of any.

A new twist on spam?

Posted on September 24th, 2009 by Alex Willmer

These two messages appeared on the Spatialite mailing list today:

From: stefanobartol87453@gmail.com
Subject:Where can I find an online anti-virus that doesn’t install on your PC?
I’ve got 5 PCs that I’m trying to use to train disadvantaged young people. The problem is they are riddled with viruses and a firewall blocks me from updating them. The people in charge of maintaining the PCs won’t fix them or give me the admin password (Win XP) to let me install a new or updated antivirus the centre is being shut down in afew months.
If they were working, I could still do a lot with them, so I’ve been looking for a good online virus scan – but they all try to download a little .exe onto your PC first, and the settings on the PCs won’t allow that.
Suggestions? Solutions? Links?

The alleged reply:

From: schinicamiyake54418@gmail.com
To: Where can I find an online anti-virus that doesn’t install on your PC?
>so I’ve been looking for a good online virus scan

I usually use this one http://pmcware.conartists/freedowns

That site (address altered to protect the vulnerable) is most definitely not hosting anti-virus. In fact it’s certainly hosting malware. The page claimed that it found ‘Nuker.Win32.CGSi’ in ‘C:\WINDOWS\system32′, on my Linux laptop.

Given the site, the similarity of the email addresses, and the impossibility of a request (virus scan without any download) – I think both messages are part of the same phishing attempt. Which makes this the first time I’ve seen a spammer have a conversion with them-self.

Electric scooter

Posted on September 3rd, 2009 by Alex Willmer

Petrol is fantastic stuff. It’s driven modern society, to the point of defining it: dirty, but very effective. Petrol has been so popular because of it’s convenience – as a liquid it’s easy to handle; and the fantastic amount of energy it holds – about 10 kilowatt hours in each litre. That’s an amazing amount of energy, in a very small space

If the chemical energy in petrol could be be turned directly into electricity:

  • A teacup full could boil enough water for 114 cups of tea
  • A shot glass full could run my laptop for 13 hours. Compared to only 3 hours on battery.
  • A petrol pump filling my car at 45 litres/minute would have a power output of 26 megawatts. Enough to power about 58 000 UK homes.

Of course, currently we can’t turn petrol directly into electricity. Instead we run internal combustion engines with it, to power cars and generators. Car engines operate at around 20% efficiency – for every 10 kW hours (1 litre) of fuel burnt, only 2 kW hours (0.2 litres) turn the wheels. The rest is lost as heat.

Electric motors are highly efficient. Brushless DC motor are around 85% efficient – for every 10 kW hours of electricity that flow in, 8.5 kW hours turn the wheels.

Batteries however, are not nearly so great. The current leader is Lithium ion batteries, which at best achieve up to 0.5 kWh/litre (and more typically 0.25 – 0.3 kWh/l). Petrol is 20 times more energy dense than batteries (by volume).

To put it bluntly

  1. Petrol is a brilliant energy carrier. The internal combustion engine sucks at using that energy.
  2. The electric motor is a brilliant energy user. Batteries suck, at storing or delivering that energy.

What does this have to do with scooters?

Well, electric cars are just entering the market. To have a 100+ mile range, they must carry hundreds of kilos of batteries. Those batteries is expensive, and in the case of the Mini E consume the back seats. For me, the electric car is not practical yet.

Scooters are easier to electrify. They’re lighter, simpler and more practical as a supplement to a petrol car. Because there is less weight to carry, they need only a fraction (perhaps 1/5) of the batteries, so they’re only a fraction of the price.

Eco Machines Electra 2012 Review

p_1600_1200_225700FE-CFF9-4248-8E43-5C3EA409BB06.jpegl_1600_1200_8CA06209-FC72-4A03-94AF-A936AD0E7C45.jpeg

In June I bought an Eco Machines Electra 2012 scooter. An electric scooter restricted to 30 mph, with a 2 kW motor in the hub of the rear wheel. The scooter carries 8 lead acid batteries, in 2 parallel strings. Each is 12 V, giving a capacity of 40 AH at 48 V and a quoted range of 30 miles. The cost of the scooter is currently about £1000, plus delivery and a one off registration fee. A full recharge takes 8 hours, and costs no more than 25 pence.

p_1600_1200_551DA55F-E65B-4D8D-A6C9-E6B85A899C8D.jpeg

I went for the Electra because the dealer is local to me, and because of the internals. The parallel strings of batteries are to my knowledge unique with in this class of scooter, most use only 4 or 5 batteries. The wiring and motor controller are similarly up rated for better performance. Customer service from Eco Machines was great, they knew their products well.

So far I’ve been riding for 2 weeks, on a 16 mile round trip. Overall I’m happy with the scooter. It copes okay with the 40 mph dual-carriageway sections of my route, and fine with city centre streets. Acceleration is good for a 50 cc equivalent, it’s smooth off the line and reaches top speed quickly enough. I would like more acceleration off the line, for when joining large roundabouts from a stand still.

Riding a scooter is similar to riding a bicycle, minus the pedals, so experience on one is useful. The front brake is on the right handle bar, and the rear is on the left. The throttle is controlled by twisting the right handle bar, a spring returns it to 0 if the pressure is released. Lights, indicators and the horn are controlled by thumb switches. There are no gears or clutch to worry about, and nothing for your feet to do whilst on the move.

l_1600_1200_8CF3CC3E-88A2-49FB-8FC1-2CFB30F7788F.jpeg

I spend most of my journey at the scooter’s top speed. Without a top-up at work it’s top speed has reduced to about 27 mph by the time I reach home. Like all lead acid scooters, power fades as the battery discharges. I expect that on a scooter with fewer batteries, I would see much greater fade. The ‘fuel gauge’ measures the voltage of the batteries, rather than smoothly decreasing with distance it will droop when under acceleration. The amount of droop indicates the amount of charge left – more droop, less charge.

p_1600_1200_FCFC3871-67F8-4E2B-9E8F-8BCA487D2CB3.jpegl_1600_1200_4AEC2230-07B0-41C6-95B0-5B9CC98B04E2.jpeg

I’ve had no problems with the included charger, which has an aluminium housing that feels robust. I’m able to leave it unattended, as it switches off once it senses charging has completed. The charger fits in the under-seat storage with room to spare. Although the ignition switch suggests The Electra also has a glove box with enough space for a pair of gloves and some waterproofs. Mine came with a top box mounted behind the seat, this had sufficient space for an open face helmet, but not a full face helmet. The glove box and under-seat storage open with the ignition key, the top box uses a second key.

The headlights are suitable for urban use. To be more visible, I run them during the day as well as night time. I wouldn’t ride this scooter on unlit roads. The horn is nice and loud. The steering is responsive, the instruments are clear, and the front disc brake/rear drum brake are good enough for my needs

Overall I’m happy with the purchase, particularly as a gadget to tinker with. If Eco Machines had offered it, I would have gone for lithium ion batteries. When it comes time to replace the batteries, I shall look in to making the switch.

Electric Scooter Costs

The purchase price, and the electricity to run an electric scooter are not the only costs to be budgeted for. You should budget at least £500, for protective clothing and ancillary items. The following one off costs are compulsory or highly advisable:

Item Description Price range
Helmet Required by law for protection. A proper fit is essential, so be fitted in person by somebody experienced. Don’t buy second hand or by mail order. Price alone does not determine level of protection. £50 – £500+
Number plate Required by law. Must adhere to regulation size/lettering. Proof of registration required £10 – £20
Tax disc holder Required to display tax disc £15 – £20
Gloves Strongly Advised for comfort and protection. Sturdy leather on the palms and fingers is important £10 – £80
Jacket Advised for comfort and protection. Leather or polyester fabric with ‘CE armour’ shoulder and elbow pads. Some have thermal and waterproof lining £60 – £300+
CBT Compulsory Basic Training required by law unless a pre-2001 car licence holder, but then still strongly advised. Lasts 1 day, teaches the basics £90 – £120
Trousers Advised for comfort and protection. Leather or polyester, with ‘CE armour’ knee pads and padding. Some have thermal and waterproof lining £45 – £250
Boots Advised for protection and comfort. Leather with reinforced ankle and sole, waterproof. £50 – £180+
Chain/lock Advised, to deter thieves. A chain/padlock and/or disc-lock. Sold Secure or Thatcham approved ones may reduce insurance. £20 – £150+
Ground anchor Optional. Provides a secure attachment point for a chain. Sold Secure or Thatcham approved ones may reduce insurance. £10 – £150

Items other than the helmet could be bought second hand, to bring down the cost. The following recurring costs must also be budgeted for:

Item Description Price range
Insurance Required by law. Price is highly variable. Claim history, address and other factors determine price. Car NCD usually doesn’t transfer. £100+ / year
Batteries Necessary. To replace worn out lead acid cells. £XXX / 500 full charges

Electric Scooter Tips

  • Don’t take specifications such as range at face value. Most range figures are optimistic, or quoted under ideal conditions at low speeds. Hills and stop-start traffic will reduce you range significantly.
  • Get to know the dealer and their warranty/after sales support. Are you confident in the support they can provide?
  • For an idea of the dealers in the UK, visit the A to B electric motorcycle price guide.
  • Take photocopies of your licence, licence counterpart and any documentation, before sending them with the V55 registration form to DVLA.
  • Consider where you will keep a scooter, and how you will plug it in to charge. Is there room to manoeuvre, and if necessary to perform a 3 point turn?
  • Outside charging is possible, by running the cable through a nearby window, or having a weather proof IP66 socket on an external wall.
  • Insurance can be arranged the same day over the phone, and registration may take weeks to complete, so wait until registration documents are received before taking out insurance. A list of insurers thread mentions some electric scooter insurers.
  • Take CBT whether it’s required or not, and further training as you see fit. On 2 wheels you are more vulnerable, and inexperienced. The Motorcycle Training Beginners Guide has more information
  • Experience with a car does not automatically make you experienced on 2 wheels. In fact some car instincts are counter productive on 2 wheels.
  • Pay attention on the road, and don’t ride in the gutter. Treat everything as a potential threat when riding.
  • Pay particular attention in wet weather. Roads become very slippery on 2 wheels, in such condition.
  • In Birmingham (unlike London, where there are currently trials) motorcycles and scooters are not automatically allowed to use bus lanes. However many bus lanes are marked for motorcycle use.
  • Ask questions. Here, at the Electric Transport forum or at Bike Chat Forums.

Some LocalView Intranet performance tips

Posted on August 4th, 2009 by Alex Willmer

LocalView Intranet is a web mapping product developed and sold by ESRI UK, predominantly to local councils. The current version (as of August 2009) is 2.1 SP2, supported on ArcGIS Server 9.2 SP5. The following are some straight forward tips for improving it’s performance:

  1. The ArcMap document (mxd)  defining each map service is critical to every aspect of LocalView performance. Simplify, simplify, simplify. Start with a few, simple layers and test the responsiveness of the site, particularly with simultaneous users.
  2. You’re only as fast as your slowest layer. Test your mxd separately with MXDPERFSTAT.  For an overall quick map response, with many concurrent users then you should aim for a worst case 0.5-1.0 second draw time per layer.
  3. File Geodatabases are very fast. Hold as many layers as you can (all if possible) locally in a File Geodatabase. Small latencies in the data access add up, and you may be surprised at the performance gain, perhaps 50% or higher.
  4. Minimize the number of tasks you assign to each role, don’t assign every task to every user. Each task added increases the cost of starting a new session.
  5. Don’t enable the navigation overlay, if you can avoid it.
  6. LocalView is written in ASP.NET, using the Web ADF. To maintain your session these use ViewState extensively. With each request the ViewState is sent from the browser to the server and back. This has a performance impact, particularly on high latency network links. To keep the ViewState manageable keep the number of layers and tasks to a minimum.
    To monitor the ViewState use Firefox with the ViewState size addon. For LocalView I consider a 2 kB ViewState small, a 20 kB ViewState on the large size, and a 200 kB ViewState very large.
  7. Within the MXD hide any attributes that are unnecessary. Each visible attribute contributes to the size of ViewState. However, do not hide the spatial column – it is necessary for the correct function of LocalView.
  8. Read and understand the articles listed in Top Ten Most Helpful ArcGIS Server Help Topics Countdown. But don’t spend too long reading about the map cache, LocalView won’t use it.

Once you’ve taken care of the above, there are some more esoteric

  1. Enable HTTP Keep-Alive in IIS. LocalView makes a lot of GETs and POSTs, and establishing a new connection for each one is unnecessary.
  2. Enable persistent Kerberos Integrated Authentication. If you’re in an Active Directory domain and using Integrated Authentication, then the default configuration of IIS and Internet Explore may double the number of requests made by the browser.
    NB: You must still set EnableKerbAuthPersist whether you have the hotfix or SP2, the Microsoft Knowledge-base article doesn’t make this clear.
  3. If your server has CPU cycles to spare, enable HTTP compression for both static and dynamic content. This should reduce your network traffic significantly. Follow the instructions at Coding Horror. The bulk of LocalView traffic is from dynamic content, unfortunately.
  4. Choose the image format of your map carefully. On a large monitor, each map zoom could result in a 1 MB image being generated. If your data is mostly vector and pre-rendered rasters (e.g. OS 1:50000), then 8-bit PNG should suffice. If you are using scanned maps, or aerial imagery in your map, then JPEG may be better.
  5. Check what requests and responses are happening, with Firebug for Firefox and Fiddler for Internet Explorer. Bare in mind that they may behave differently, depending on your proxy and authentication settings.
  6. If you can choose the browser, then I’ve found that Firefox 3 is most responsive, then Internet Explorer 7, and Internet Explorer 6 is the least responsive. Particularly, IE 6 can freeze for many seconds at a time.

To enable integrated authentication within Firefox, the following 2 items should be configured within about:config:

  • network.automatic-ntlm-auth.trusted-uris
  • network.negotiate-auth.trusted-uris

Back on the air

Posted on July 6th, 2009 by Alex Willmer

Apologies if your email to me has bounced these last few days. My domain was due for renewal, and neither I nor my calendar went bing. Everything should be back now, if you’ve sent me something and I haven’t reacted or replied please resend it.

Make a Windows installer for your python module

Posted on March 17th, 2009 by Alex Willmer

To help you build and distribute your Python packges, Python provides distutils. This library knows how to bring together your modules, where to put scripts and how to compile C extensions. The process is driven by a setup.py file, written by the package author or maintainer. Depending on what argument is passed, setup.py can install the package, build an archive or build an installer. To create a Windows installer for a module called wibble.py proceeed as follows.

Create a setup.py file in the same directory as your existing module(s), describing what is to be installed:

from distutils.core import setup
setup(name='Wibble',
      version='1.0',
      description='A utility to deal with underpants and pencils.',
      author='Fred Bloggs',
      author_email='fbloggs@example.org',
      py_modules=['wibble'], # Add more modules as desired
      )

Run the following command:

python setup.py bdist_wininst

This will generate wibble-1.0.win32.exe, which can install Wibble on any Windows PC already having a version of Python. As a bonus the bdist_wininst command doesn’t itself require Windows, so you can create the installer on Linux or Mac OS.

EuroPython 2009 open for registration

Posted on March 4th, 2009 by Alex Willmer

If you’ve enjoyed PyCon UK the last 2 years, the bad news is that it won’t be happening this year. The good news is that  EuroPython 2009 is coming to sunny Birmingham instead, for 3 days from Tues 30th June to Thurs 2nd July and registration is now open. The even better news is that until 14th March it’s really cheap, like 50% off cheap making the 3 day conference only £95.

As a warm up, from Sunday we have 2 days of tutorials at the bargain price of £70. To close there will be sprints from Friday 3rd July, and in case any Django coders get home sick it all coincides with the Birmingham International Jazz Festival.

My talk on ArcGIS and IronPython has been approved. So I’ll see you there.

The Shapefile 2.0 manifesto

Posted on March 1st, 2009 by Alex Willmer

Geographic Information Systems (GIS) are by their nature data driven. The data comes in a wide variety of raster and vector formats. Rasters hold raw, continuous data recorded striaght from the real world. An example is Satellite/aerial imagery, this is a commonly held in an open format with broad support, such as GeoTIFF or GeoJPEG.

Vector formats hold refined, discrete data, which has been manually traced or otherwise derived other data sources. Examples include building outlines, contours, road routes, pipe networks land land parcels and locations. Vector data is usually traced or derived, at great expense from raster data, to encode business information – as a result it’s usually highly valuable.

Unfortunately, there are many GIS vector file formats,  and most are proprietary. They can only be used to their full in their native software. Three of the biggest are AutoCAD DXF, MapInfo TAB and ArcGIS Personal Geodatabase. One vector format is unique – both an open standard, and in wide use: Shapefile

Shapefile is publicly documented in ESRI Shapefile Technical Description by ESRI Inc., it’s creator. Any GIS software worth it’s salt can read and write to the format, so it’s become the least common denominator. It is the format for storing and exchanging vector data between teams, departments, businesses and government. In my opinion this makes Shapefile the best thing ever to happen to GIS, without it the GIS market would be a fraction of it’s current size. Read more »

MXDPERFSTAT

Posted on February 14th, 2009 by Alex Willmer

Investigating the performance of an intranet mapping website this week, I was introduced MXDPERFSTAT. It’s a fantastic tool for investigating map display performance. Given an ArcMap document (a .mxd file) it runs ArcMap and loops over the map layers, displaying each at a list of  scales (e.g.  1:100000, 1:10000, 1:2500,  1:500) automatically. Scale cut-offs are followed, in the same way ArcMap would.

Once done, MXDPERFSTAT writes an html report, of the time taken and features retrieved to display each layer at each scale. Since it runs in situ, network delays and other real world bottlenecks are accounted for. It even highlights layers that are abnormally slow, or that fetch an excessive number of features. Perfect for diagnosing a slow map, or guiding a tune up of the infrastructure.

Supporting ArcGIS installations, I’m a regular searcher on ArcScripts. How did I miss this for the last 4 years, and what other gems are there? What GIS utilities do you find indispensable?