Saturday, 3 August 2019

Danger! Danger! Devaluation!

Right now, Brexiters keep claiming that devaluation is good for the economy. They're almost certainly wrong.

Intuitively, a fall in the pound is a bad thing: anything we buy from overseas goes up in price and since a high proportion of what we buy comes from overseas, our cost of living will go up.

But then Brexiters jump in and say "Devaluation is great, because it means more exports and that will make the economy grow." As a general rule, because Brexiters often distort the truth, you should be skeptical. So, are they wrong here too?

It's a good question. Recently I was at my Dad's house and we were watching a TV show called "Factory Wars" on the Yesterday channel. I was surprised to find a bloke from The Institute of Economic Affairs. Why was an economist from a lobbying organisation with secretive funding (hint, Big tobacco and the climate denying US groups like the Heartland Institute) on a history show?

Basically he was using it to push free market ideology. He claimed that the UK escaped the recession in the 1930s because it implemented austerity unlike the US which implemented a Keynesian New Deal. This was completely different to how I'd understood these economies in the 1930s: on the basis that austerity empirically doesn't work; its easy to explain why, and it was the Keynesian New Deal that empowered the US to manufacture the armaments that helped the allies overcome the Nazis.

It's not coincidence that the IEA offered a completely different explanation than what is normally understood: they're based at 55, Tufton Street where Vote Leave was also based. So, again we have another ideologue whose views we should suspect.

So, I checked out what really happened in the UK's economy in the 1930s? Economics Help is really useful. Basically, the crash of 1929 caused a lot of hardship in the UK, but in the mid to late 1930s we dropped the gold standard; which lead to a deflation of the pound and this lead to a mild economic recovery in the south, but the North still had it tough.

So, it looks like Brexiters might be a bit right, and the IEA were misleading as normal. But is it?

Devaluation Model

Actually we can work this out ourselves, because it's easy to model. In our model (for a business, but it can apply at a larger scale) we consider just three variables:

  1. Profits
  2. Internal costs (labour minus rises in the cost of living due to buying overseas goods, maintenance of equipment etc). We assume this is a constant.
  3. Imports (including the increases in the cost of living for employees from overseas goods).

Case A

In the first scenario, we consider a company with reasonably high import costs (50%), a profit margin of 30% and the rest is internal costs (20%). If the pound deflates by 25%, then imports go up to 50*1.25 = 62.5%. So, now our profits are 30-12.5 = 17.5% profits. This means that the company needs to sell 30/17.5 = 71% more goods, but the domestic market will buy less, and the overseas market will only find its products are 25% cheaper (due to devaluation).

So, the question is: is it like overseas customers will buy 71% more, if it's 25% cheaper? This seems unlikely to me.

Case B

Let's consider the second case: profits are 70%, internal costs 20% and imports are 10%. Imports increase by 25% => 12.5%, so we now need to sell: 70/(70-2.5) = 3.7% more. OK, so in this case our product is 25% cheaper, and we only need to sell 3.7% more for us to make more profit, this seems plausible.

So, we have to ask ourselves, what kinds of businesses are like this? Mass market manufacturing (cars, aircraft, smoke alarms) will rely a lot on imports and will make a relatively small profit. Apple, for example has margins between 20% to 30%. Dyson is also about 21%. DELL has an operating profit of just 1.1%. Companies producing consumer items such as smoke alarms have fairly low margins which explains why they would move to cheaper EU countries.

What companies are like case B? Services and financial companies are like that. However, financial companies are likely to move out of the UK due to Brexit, so this means service companies would benefit.

However, to some people, UK manufacturing companies can look good: namely, if you hold a lot of offshore wealth, then UK manufacturing companies struggling under devaluation look like a good buy. In other words, disaster capitalists with offshore accounts, such as people like Jacob Rees Mogg and a large proportion of Conservative party members and MPs.

Epilogue

Brexiters are wrong: it's just a front for their disaster capitalist mission. We can summarise our model and convey why in a simple table:



So, why did the UK not crash due to a double-whammy of austerity and devaluation in the 1930s? That's pretty simple, being the biggest power bloc at the time meant that although most of its food (91%?) was imported along with a significant proportion of goods, a great deal of this was essentially an internal market, with the added advantage that many resources, particularly coal were internal.

Saturday, 6 July 2019

Let the EVs Take the Strain

A recent BBC article says EVs won't solve congestion problems. It's yet another negative headline about EVs to follow from yesterday's negative EV headline where they said EVs were falling in sales for the first month in whatever (when in fact BEV sales had gone up 67%). They even go to the trouble of showing a picture of a rare EV, an 8 year old early prototype Smart ED TwoFour, rather than - say EVs hundreds of times more popular, to get across the idea that EVs are toys. Next week, watch out for the Tesla-bashing article ;-) and no mention of how sales of real EVs in the EU, the US and globally are rocketing.

Similarly, this article uses a bit of truth to hide a bigger lie. In fact EVs will go quite a long way to solving congestion.

Car Use is Falling

Car use is already going down in some parts of the UK, mostly because in London, they're not needed much and elsewhere because insurance for young drivers is prohibitive.
But actually, the nature of EVs will themselves radically change our vehicle usage, primarily because they have so few moving parts and batteries last much longer than originally expected (and will get several times better), to get sufficient wear and tear we're going to have to drive them much more often.

ICE Drives Congestion

The problems we see with urban vehicles are problems relating to ICEs themselves. For example, you can't have a filling station at everyone's house - it's far too dangerous and far too expensive! ICEs force us to place filling stations as widely as can be tolerated and because the effort taken to fill up (compared with plugging in an EV); this in turn forces infrequent filling; large tanks and very long ranges.

But long ranges themselves have the side effect of increasing our journey lengths which impacts everything: distance travelled to shop, to our workplaces, to schools and hospitals and all this increases traffic.

EV Transformations Will Blow Our Minds

EVs will change this radically. We'll have to share cars to get the wear and tear out of them and because charging will become ubiquitous (think every forecourt where your car might hang around); we'll need cars with much shorter ranges on average than even the first generation of EVs: think 10KWh or even 5KWh for the majority of cars and in turn two person EVs will dominate for the vast majority of journeys. But in turn, because we can charge easily, we can expect journeys to shorten too.

Remember in this model, people don't own their cars as much.

Why will people choose tiny, 'under-capacity' cars? It's simple, they'll be much cheaper to build, sell and drive! My Zoe (22KWh) gets about 4 to 4.5 miles per KWh at maybe 12p/KWh. Given a gallon of petrol (4.5L) = 4.5*£1.25 = £5.63, I get 5.63/0.12*4.5 up to 210mpg running costs.

But a Renault Twizy (a 2 person EV with a 6.7KWh battery) will get 6 to 8 miles per KWh, equivalent to 300 to 400mpg running costs.

Given a typical day's travelling in the UK is only about 10 to 20 miles, about 3KWh, that's only half a Twizy's battery. And considering the sheer number of charging points there will be, the average needed journey between charges will only be 5 to 10 miles, just 1.5KWh.

On that basis, a future EV with a 5KWh will seem ample, even though right now, all the talk is about 50KWh to 100KWh batteries.

So, EVs will go a long way to reduce congestion in themselves owing to the different driving model.

Friday, 12 April 2019

Plottastic ZX80!

A guide to plotting pixels in Basic on a ZX80!


Introduction

Both the ZX80 and ZX81 support 8x8 pixel character-only displays and contain 16 graphic characters that can be used to plot fat 4x4 pixel pixels on a two-by-two grid within each character:

These are called Battenberg graphics after the cake of the same name 😀

On a ZX81 it's easy to use these characters to plot (crude) graphics on the screen, the computer provides a PLOT x,y and UNPLOT x,y for this purpose. But with half the ROM on a ZX80, it's much harder - so I wondered, how much harder is it to plot pixels? It turns out it's pretty formidable!

Challenges


  • The ZX80 doesn't have any PLOT or UNPLOT commands.
  • The screen on a ZX80 is like that on a ZX81, when you run a program, the screen first collapses to a minimum of 25 newline characters and expands as you display text. However, on a ZX80, unlike the ZX81, you can't print anywhere on the screen as there's no PRINT AT function, this means we'll have to poke onto the screen.
  • The memory map on a ZX81 has the display immediately after the program, but on a ZX80, the display comes after the variables and the editing workspace which means that it'll move around just by creating a new variable or possibly by performing input (which is a potential problem).
  • Ideally, to convert from pixel coordinates to Battenberg graphics you'd want to map the odd and even x and y coordinates to successive bit positions to index the character.


  • But, unlike the ZX81, the character set on a ZX80 doesn't have the characters in the right order to display Battenberg characters. Instead they contain gaps; the last 8 codes are generated from the first 8 but in reverse order; and some of the first 8 are taken from what ought to be the inverse characters!

The Solution

The solution really comes in a few parts. Firstly, the easiest way to be able to map an ideal pixel value to its Battenberg character is to create a table in RAM, by putting them into a REM statement (the ZX80 has no READ and DATA commands so it's hard to put a table of data into an array, but the first REM statement in a program is at a fixed location). However, even this presents a problem, because only 8 of the graphics characters can be typed. The easiest way to handle that is to write a program which converts a different representation of the characters into the correct ones.

So, on the ZX80, first type this:
After you run it, you'll get this:
Even this was tricky; I had to use character codes above 32, since symbols such as +, -, /, ", etc get translated into keyword codes for the Basic interpreter. The above program illustrates an interesting feature of ZX80 Basic that differs from ZX81 and ZX Spectrum Basic in that AND and OR operations are actually bitwise operations rather than short-circuit boolean operations. Thus P AND 15 masks in only the bottom 4 bits.

Once we have generated the symbols we can delete lines 10 to 30.

The next step is to actually write the code to generate pixels and plot them. Once we know how, it's actually a bit simpler. Firstly, we fill out the screen with spaces (or in my case, with '.'):
This gives us 20, full lines of characters. Because it's going to be difficult to plot a pixel by reading the screen, figuring out the plotted pixels then incorporating the new pixel; I cache a single character in the variable P and its location in the variable L. All my variables a single letters to save space if you try to run it on a 1Kb ZX80. The idea is that if the new print location in L changes, we reset P back to 0, otherwise we incorporate the new pixel.

Next we start the loop and calculations for plotting, in this case a parabola. We loop X=0 to 63 and calculate Y on each loop (it's a parabola that starts at the bottom of the screen):

Finally we perform the pixel plotting and loop round.

This involves saving the previous location in K so we can compare it later; then calculating the new location based on X and Y (since each character position is 2 pixels, we need to divide X and Y by 2 and since there are 32 visible characters and an invisible NEWLINE character on every screen line we must multiply Y/2 by 33). Note, a quirk of ZX80 Basic means that multiplies happen before divides, so Y/2*33 would calculate Y/66!

The pixel bit calculation in line 50 makes use of ZX80 bitwise operators, we want to generate 1 if X=0 (so 1+(X AND 1) will generate either 1 or 2) and then we need to multiply that by the effect of the Y coordinate, which is 1 on the top line, and 4 on the bottom: 1+(Y AND 1)*3 will do that. Hence this will generate the values 1, 2, 4, 8 depending on bit 0 of X, Y.

We must POKE the location L plus an offset of 1 (because the first character of the display is a NEWLINE) and also we must add the location of the display file (it turns out that these calculations don't make the display file move around). We poke it with the pixel value we want indexed into the right character code from the REM statement. Finally we loop round X.

This code generates this graph:
It looks reasonable even though it's generated with integer arithmetic. It's the first pixel plotted graph I've ever seen on a ZX80!

More Examples

My original reason for doing this was to see if I could generate sine waves using a simple method I once found for a Jupiter Ace. Here's the program and the result:
It looks fairly convincing, especially as it's all done with integer arithmetic. Because the code generates both the sine and cosine value, it's easy to turn this into a circle drawing program which produces the following:

It looks a bit odd, that's because the algorithm doesn't quite generate sine and cosine curves. What it's really doing is computing a rotation matrix, but only one of the terms is computed for sine and cosine each time. Hence, the circle looks a bit like an oval with a slight eccentricity.

My graph drawing algorithm has one very serious limitation. Because it doesn't read the screen in order to compute a new pixel, if the graph goes over the same part of the screen twice, the second pass will muck up what was there before. Doing the correct calculations is possible using some table lookups and bitwise operations, though it would slow down the graph generation. I didn't bother, because I only wanted to generate simple graphs.

Conclusion

The ZX80 and ZX81 have very similar hardware, but a number of design decisions in the ZX80's firmware made drawing circles much harder than you might expect. With a lot of effort it is possible to generate some simple graphs 😀

Saturday, 3 November 2018

The Gift of Sisyphus

George Monbiot always writes great articles on sustainability (and although this one is 6 years old it holds up well). Here, what George Monbiot is saying is that (as well as the abusive consequences of extractivism) about 50% of CO2 production is due to this kind of consumerism.

However, I would argue that the priority for everyone is simply to stop using fossil fuels asap. Imagine the same argument if we already had 100% clean energy: Monbiot would be saying that this pointless conumerism causes 0% of CO2 production. So, it would still be pointless, extractivist, and abusive, but it won't fundamentally be raising global temperatures for thousands of years.

The key thing to remember is that it's the total amount of CO2 emissions since the industrial revolution that matters, not the rate we emit. So, Reduce/ Re-use / Recycle (RRR) by itself won't fix global warming if we still use fossil fuel energy at all: it's simply like a bath that's trickling instead of gushing - it'll still overflow eventually.

But eliminating our fossil fuel usage and employing RRR makes it easier and quicker to get to 0 emissions. This still means the priority is clean energy now.

It's possible for most of us to cut out around 66+% of our domestic CO2 production by making just a few big decisions that keep paying both us and the world back. Listed in order of lowest to highest investment:

  1. Switch over to a 100% renewable energy supplier, like Ecotricity, or Good Energy. Pick a big supplier that actually owns Wind turbines, solar power and is starting to invest in baseload energy storage. This will cut out 30% of your emissions.
  2. Radically switch over any gas appliances to electricity. This will probably take a few years, but will include your gas fire and cooker / oven. This will probably address another 15% of your emissions (up to 45% now).
  3. Buy solar power for your house or invest in an Energy4All renewable cooperative. This will make other people's decisions for them, by removing some of the market for the existing fossil fuel industry and placing energy production power in your hands rather than theirs.
  4. Switch to an electric vehicle as soon as you can afford it. This will cut out another 30% of CO2 emissions. Even if you cut down on car driving and cycle or walk instead (a good thing), it's a false economy to believe that it's less polluting to keep an old fossil fuel car going as long as possible, because all it does is delay the time when you go clean: because the emissions involved in the new car will be a fixed cost. Every year we delay on this is a year the fossil fuel car industry has less incentive to switch: vote with your bank account.

The total here amounts to about 75% of your CO2 production and up to 30% of other's CO2 production. I cover this in a bit more detail in this post.

By contrast, difficulty with putting Monbiot's argument into practice is that to address it, we have to change our lifestyles in hundreds of small ways and a few big ways:

  1. To eliminate the consumerism we generate (though it's hard to predict when we'll stop using new things and there are also multiple ways of addressing consumerism, e.g. sharing as many consumables as possible).
  2. To eliminate the consumerism others generate for us (e.g gifts) without appearing to be kill-joys.
  3. To campaign for governments and world organisations to address the root causes, like conflict minerals. This is needed, because time and time again we're going to be suckered by cheaper products that we think we do need, and we don't have the time or knowledge to fully (or even partially) analyse the supply chains and ethics involved. Regulations are needed to shift the playing field in favour. Consider the effort involved by the company Fairphone (I have a fairphone 1) in tracing mineral sources.

So, the probability is that we'll try to do these things for a while, but slowly get overwhelmed by the market forces pushing us in the opposite direction.

This is really just an application of Every Big Helps from Sustainability Without the Hot Air.

Sunday, 8 July 2018

Three steps to Carbon Free Me (part 1)

Introduction

Recently I posted a comment to my cousin's post about the heatwave:

Ok, so no comments on the elephant in the room here. It’s not just us, much of the world is in the grip of a heatwave right now. 33 people have died in Quebec. We need to start addressing the underlying causes - talking about it is a good start. And it will help us if we understand this will get worse. In a few decades, this will be a normal summer. Sorry I bang on about it all the time.

Citing this Guardian article:


And she replied:

I think people (including myself) don't know what to say because it's such a big issue that we feel quite helpless about it... I don't think the majority are in denial that climate change is a real danger. It's more just that it feels so far out of our control that it's hard to think about it.. "10 things you can do now to reduce your impact on climate change" type articles would probably get more people on board

Sigh, I can really see her point. So, this is my first shot at an article like that.

Background

I think, to be able to respond at a personal level is to be clear about what the plan is. If we don't know what we're aiming for we won't know what to do and wouldn't even know how successful we've been. So, the goal here is very, very simple. It's not about plastic or planting trees, or a million things you can do that make a small difference. it's about relatively easy things you can do that will make literally a huge difference, like 30% to 60% of the whole way, for you.

The plan, globally, is to cut down on the emissions of CO2. To Zero. You may have heard talk of a low-carbon economy. A low-carbon economy will still be a disaster. Globally we have to cut down to nothing and then beyond. We have roughly 50 years to do this and in developing countries we have 30 years.

The positive news is that can cut out the majority of this or a substantial fraction of 30% to 60% pretty quickly. Cutting out 30% jumps us into the 2030s; cutting out 60% jumps us into the 2040s and we can feasibly do this in a fraction of the time. And the great thing about that is that the sooner we make these steps, the more breathing room we'll have along with other benefits. The principle here is "Every Big Helps".

This is a plan for domestic emissions.

Domestic emissions fall into 3, roughly similar sections: Electricity, Heating and Transport.


I obtained these values from some simple searching on the internet with phrases like "average electricity UK per year" etc. I'll update with proper links later, but for now, I found this CO2 calculator web page handy.

The total is: 7084Kg, 7 Tonnes for an average household! Wow! But a few decades ago in the UK it was 10 tonnes, and even a decade ago it was noticeably higher, so we've progressed. Let's deal with this from the easiest to the hardest. But before that...

Politics

We can't divorce politics from choices about energy. This should be obvious. Energy gives us (quite literally) power. Globally, 80% of that power currently comes from the fossil fuel industry. To put it another way, 80% of global power resides with the fossil fuel industry, an industry that has spent decades covering up the fact that their product is adding a blanket of heat to the world. To decarbonise means deliberately taking power away from them.

Here's an example, of how much power they have. The Church of England has a mission statement that says we have to look after the earth. It's called Stewardship. It means we think it's wrong to wreck God's creation, because God thinks his creation (which includes us) is good.

However, the Anglican church also has over £100 million pounds of investments in the fossil fuel industry and some sectors of that church have realised that's in conflict with the mission statement (really?). One of the most promising Christian movements to resolve this is Bright Now, which campaigns for churches to divest from fossil fuels.

So, in February 2014, in the Church's global get-together (the General Synod), they tabled a motion to promise a debate on divestment for the following year's Synod and in the meantime, they'd divest from the Alberta Tar Sands investments, the worst fossil fuels in the world, an industry so bad that the eminent ex-Nasa climate scientist, James Hansen said if the pipelines go ahead it's game over for the climate. So, the CofE divested from the worst of worst in 2015. Good on them - that's the way to show leadership, and I'm sure it had nothing to do with the crash in oil prices in 2014, making tar sands completely uneconomical.

Then I found out in early 2015 that the debate on divestment was being replaced by a debate on engagement with the fossil fuel industry, i.e. a commitment to the fossil fuel industry - with a wagging investment finger. How did this happen? Well, I found out directly from one of the key members of the Ethical Investment Advisory Group, Richard Burridge at a fringe meeting at that 2015 Synod in York. He explained that after the resolution in 2014, Rex Tillerson personally phoned them up to propose an alternative arrangement. And then the resolution was dropped. What this means is Rex Tillerson although not a member of the CofE, has more power over it than the Synod itself. Then after the meeting, in conversation, Richard Burridge started singing from the fossil fuel industry hymn sheet, explaining why divestment itself was bad for everyone and why developing countries needed fossil fuels. It's not, as Katherine Hayhoe explains.

Never underestimate the deviousness of the fossil fuel industry.

Efficiency

This blog ignores efficiency. That's because people concentrate on that so much I figure you probably know about some efficiency issues: LCD TVs, LED lights, that kind of thing. But also, because I want to focus on the key issue: efficiency by itself won't lead us to our zero-carbon future; we have to actively switch our energy sources. Also, I want to concentrate on the stuff that makes a huge difference: a huge difference is a big psychological boost as well as a practical action.

Actions

Step 1: Electricity Provider

By far the easiest way to cut down on your emissions is to choose a renewable energy company for your electricity. All it involves is switching supplier. It requires no investment and because renewable energy is getting cheaper thanks to economy of scale, these suppliers are relatively and increasingly competitive. The three main 100% renewable electricity suppliers in the UK are:

  1. Ecotricity - run by the visionary Dale Vince. They have their own (onshore) wind and solar farms. They also source renewable energy from overseas to meet demand.
  2. Good Energy - a well-established 100% renewable energy supplier and they're great for feed-in-tariff support.
  3. Cooperative Energy - their green pioneer electricity tariff is now 100% renewable. They have their own wind and solar farms.
There are other pop-up renewable companies such as bulb, but until you know where they get their renewable energy from I wouldn't recommend them, though they may be perfectly fine.

For an average household this will remove 23% of your emissions in one go. This takes you to November 2025 (if we lowered emissions steadily - in reality it'll take us a bit further than that, because it will be a curve).

Step 2: Heating and Cooking

The next easiest thing to do is to replace as many heating and cooking devices with electrical ones as the opportunity arises. For example, if you have the money, replace a gas fire with an electric fire. It won't be as warm, since they're limited to 2KW, but if you can tolerate it; then that's a way to go.

Also replace gas cookers with ceramic or induction electric cookers.

This is different to most of the advice you'll see, because they'll be comparing the CO2 emissions of an average electricity supplier with gas, but we are comparing renewable energy heating and cooking with gas. It will be more expensive, since electricity per KWh is more expensive than gas; so this requires an initial outlay, and an ongoing cost. We haven't found a massive increase in our electricity bills as a result.

Also, when I get figures for this, I'll update it in this blog post. Until then I'll assume that - based on these two items alone, you can save maybe 50% of gas emissions: 1565Kg of CO2, nearly as much as for electricity itself.

This would take 45% of the way, to the year: 2032.

Step 3: Transport

The next 'easiest' thing to do is to switch to electric vehicles as soon as you get a chance. An EV, running from a renewable electricity supply will save 100% of your transport emissions. Switching to electric transport involves a cost outlay, but the costs of running an EV are less than for a fossil fuel car, so it will pay back in the long term. There are many ways you can partially or fully achieve this and they're all based on the observation that most of our journeys are short.

  1. Buy an electric bicycle! Most EBs can suffice for journeys up to 45Km, enough for a visit to a friend, maybe a journey to work and back. They're limited to 15Km/h. Of course if you can handle a normal bicycle, then you'll get fitter too (but it won't save emissions, if you already have renewable electricity). Let's assume this deals with 30% of your journeys.
  2. If you have two cars, make one of them a second-hand EV and use it as the run-around: for shopping and shorter journeys. Second-hand EVs are increasingly available via auto-trader or ebay from about £5500 upwards. Most of them are first generation Nissan Leafs, some will be Zoes and BMW i3s; a few will be MiEv's (with a more limited range). These cars can carry a family on a journey 20 miles out and back, or 40 miles if you can charge it at your destination or will carry you on a 50 to 70 mile journey in total. Perhaps this will handle 70% of your journeys.
  3. If you're prepared to adapt your lifestyle, replace your car with an EV (100% of your journeys).
    1. For first generation EVs (like the 2016 Zoe we own), practical journeys will be in the 60 to 120 mile range (with one en-route re-charge) or 240 miles if you can charge at either end. We bought a second-user EV for £7500, but essentially it was new, so similar bargains may be possible. In essence, the vast majority of your journeys will fit these rules.
    2. For second generation EVs practical journeys will be in the range of 150 to 200+ miles either way. These vehicles start at £19K for the Zoe (with a leased battery); £20K for a Smart EQ; £25K or so for a new Leaf; about £34K for an i3; or similar for a Tesla model 3 (available from 2019), going up to £60K to £115K for a Tesla model S, Roadster or X.
With option 1, that saves: 700Kg of CO2 per year (assuming you use it consistently).

With option 2, it's 1623Kg of CO2 per year (assuming you use it consistently).

With option 3, you save 2319Kg of CO2 per year.

This takes us to a maximum potential of 78% of your emissions cut, ie. from 7084Kg to 1565Kg. It's equivalent to living in the year 2042. In other words, it gives us another 25 years to plan to eliminate the other 22%

Conclusion

This guide gives you actual figures. Things you can attain; that tell you roughly how far along the path to decarbonisation you've done. You can quote it in years so you know what year you're really living in. For me, that's a way to bring practical hope to the challenge.

Don't burn yourself out. It took us about 3 or 4 years to get as far as we have (which is about 2042), but we bought Solar Panels in the meantime and started on a mortgage. It might take you a bit longer, or you might have the resources to make major shifts now (the renewable energy shift is the easiest). Whatever you do, take a positive angle and encourage others to do the same :-)

Here's to a happy Carbon Free You!

Saturday, 13 January 2018

EV Intentionality

We have a cute Renault Zoe EV, called Evie as it happens, and when I get a chance at traffic lights I slip it into non-ECO mode so I can leave all the hotshot BMWs / Audis / Mercedes and Jaguars in the dust as I zoom away (within the speed limit of course :-) ) !

EV Intentionality is about driving and thinking EV in such a way as to convey the genuine benefits of the technology. They're the rapidly approaching future (fuel cell cars aren't) and we're in competition with the Fossil Fuel industry who are orders of magnitude bigger than us (until their stranded assets catch up with them ;-) ).

Friends frequently ask me if it's better to (a) buy an EV now, (b) buy a hybrid or (c) drive their current car into the ground. (c) Seems like common sense, but actually it's worse for the environment and your pocket. This is why (assumes average ICE car driving 12703Km/year at 120g/Km):
The way to look at it is to add up your emissions over the long-term. Put simply, buying an EV involves a one-time emissions hit (the production of the car, including the extraction of its raw materials) and after that, it can be emissions-free. This assumes you'll charge it on renewable energy, because we do.

Therefore every fossil fuel mile you add now, adds to your final emissions. By 2040, the EV bought in 2018 still has the same emissions, but the one bought in 2022, just 4 years later resulted in another 60% emissions and the one kept going until 2040 resulted in nearly 4x the emissions - before the EV was eventually bought).

Let's consider what happens if you buy a Hybrid (at 100g/Km) or a Plug-in Hybrid (PHEV) (at 45g/Km) or an EV vs driving the same ICE car for as long as possible:

Basically, the EV results in lower total emissions than continuing with your ICE by 2024 (in 6 years), the PHEV manages it by 2027 (in 9 years), and the Hybrid by 2040 (22 years), in other words, a long time after its life expectancy. Looking at the life expectancy (on average by 2032, given our start date); by then, the PHEV's total emissions are 75% more than the EV, but the Hybrid car has more total emissions than the ICE. In other words - you're very unlikely recoup the manufacturing emissions by buying a new Hybrid car compared with driving an existing ICE into the ground, though of course it'll be less emissions than buying a new ICE.

From an intentional viewpoint though we want to promote the transformation of transport. Consider:

  • Every fossil fuel mile you drive now, is a donation to the fossil fuel industry. They're not a charity. The first question to ask is "how much of my money do I want to give them?" If it's nothing (which is the right answer), then your basic decisions are made for you.
  • EVs will come down in price over time and improve faster over time. But the rate of this depends upon how quickly we switch. If we takes decades to go clean the rate of improvement will be much slower. It's what's called a market signal, which is a vote. You put your money in the market you have faith in and the market responds accordingly.
  • EV production will get cleaner over time as industrial practices decarbonise, but this will happen much slower than we can switch to EVs. By switching to EVs and running them on clean energy, we send another market signal, that we want a carbon-free lifestyle sooner. This is another market signal.
And given there seems to be at least one car advert on every commercial break on TV, we're going to have to be 100% intentional for the foreseeable future :-) !

[Edit: Graphs updated to include manufacturing footprints for EVs and ICE cars based on This Guardian Article. The article provides only EV and ICE footprints; I've estimated a Hybrid and PHEV manufacturing footprints based on typical CO2 emissions for the technologies on the basis that the battery technology and/or drivetrain is what contributes to the higher manufacturing emissions in proportion to the battery technology provided. In addition, I've assumed that manufacturing footprints will fall linearly until they fully decarbonise by 2070. These are provisional calculations until I get better information. Similarly, the study used to estimate EV manufacturing at 8.8Tonnes may assume a Tesla Model S as the standard EV, and that will not be representative across the globe - and it might not even be true for the Tesla Model S.]

Wednesday, 3 January 2018

A Listing As High As The Moon!

Did you know that the source code for the Apollo Guidance Computer would reach all the way to the moon if it was printed out?


No? Good - because it's not true and we'll do the math here. There's a whole world of computing mythology that's sprung up over the decades. A classic claim is that the computers on the Apollo spacecraft were less powerful than the computer inside a typical digital watch.

That means there's more software on that watch than you need to reach the Moon!

It's all rubbish. The Apollo Guidance Computer was relatively complex; it was a 16-bit machine that had 36KW of firmware on it and ran. It would take a typical software engineer years to write the code that filled it, and in fact it did take a team of talented software engineers (headed by Margaret Hamilton who coined the term software engineer) years to write its code - in assembler.

Fortunately we can see the source code for the AGC these days as it's on github. Based on the Wikipedia article and assuming each Timing Pulse is 1.024MHz, then instructions would typically take between 12 timing pulses, which gives 85.3 KIPs and most instructions might require twice as much as that (assuming a memory access took another 12 pulses), giving speeds between 42.7KIPs and 85.3KIPs (which can be verified here).

36KW of firmware is equivalent to about 72Kb of firmware. That means the computer could handle software about as complex as microcomputers from the year 1984, where the limits of 16-bit addressing and the shift from writing in assembler to writing in high level languages were being tested. Some microcomputers from that era did have more RAM (e.g. the ACT Sirius), but here I'm taking common home computers as the baseline.

When you look at the software in GitHub you find that there are a reasonable number of files, usually of a reasonable length. The source code there has a GitHub header of about 26 lines on every file, but the rest of it is the original software.

Let's first think about how much code might be on there. Each assembler line is probably 1 instruction, which is one word (though it might be more if they used a macro assembler). Typical listing paper had 66 lines per page, So, 36,864 words would be 36,864/66 = 558.5 pages. So, how thick is a page? You can still buy listing paper, and it works out at 24.1cm for 700 pages, so the whole listing is, at a minimum: 558.5/700*24.1cm = 19.22cm high, just under half-way up to my knee.

So, at a first guess, it's not very high. But I could be badly wrong, because the real software was different for the Command module and the Lunar module; and also they would have had many comments in the code, which would have lengthened it. So, I took a look at the actual source files.

Helpfully, they have page numbers in them. Luminary099, which was the Lunar module's software has 1510 pages, and the command module's software in Commanche055 had 1516 pages. The total is thus: 3026 pages which is: 114.5cm tall. That's a bit more like the diagram, but it still only goes up to my chest.

Again this might not quite be accurate, because some of the code could have been shared, I hope to post a future update when I've figured out how much is!