Power price vs Carbon Intensity

Data Sources

import pandas as pd
import numpy as np
import requests
url = 'https://api.carbonintensity.org.uk/intensity/{}Z/{}Z'
def get_intensity(x):
return (x['from'],
x['intensity']['actual'],
x['intensity']['forecast'])
startdate = pd.datetime(2017,12,31,23,30)
enddate = pd.datetime(2018,1,14,23,0)
data = []
for w in range(0, 32):
start = (startdate+pd.offsets.Day(14*w)).isoformat()[:-3]
end = (enddate + pd.offsets.Day(14*w)).isoformat()[:-3]
r = requests.get(url.format(start, end))
intensity = [get_intensity(x) for x in r.json()['data']]
data+=intensity
df = pd.DataFrame(data, columns=['from', 'actual', 'forecast'])
df['intensity'] = np.where(df.actual.isna(), df.forecast, df.actual)
df_hourly = pd.DataFrame(0.5*(df.intensity.values[1::2]
+df.intensity.values[::2]))
  • The call allows a maximum of 14 days of data at a time. Hence I had to use a loop to get the data.
  • The start and end strings included in the url are of the format YYYY-MM-DDTHH:MMZ. The start string indicates the end of the first half-hour included. The end string indicates the end of the last half hour included.
  • A small number of half hours were missing an actual intensity value, therefore I used the forecast for these.
  • To get hourly data, I calculated the average of the two half hourly data points.

Analysis

        |  Price   |   Intensity
Mean | 57.44 | 248.0
Min | 9.09 | 70.0
Max | 191.55 | 474.5
StDev | 13.11 | 67.1
Correlation: 38%
  • What is the average carbon intensity? 248g/kWh
  • What is the minimum carbon intensity for each day and how much lower is it than the average for the day? 190g/kWh, 58 below the average
  • What is the carbon intensity during the cheapest hour, and how much lower is it than the average? 206g/kWh, 41 below the average
  • What is the maximum carbon intensity and how much higher is it than the average? 295g/kWh, 47 above the average
  • What is the carbon intensity during the most expensive hour, and how much higher is it than the average? 284g/kWh, 36 above the average

What is the appropriate carbon intensity metric?

Conclusion

--

--

--

Fascinated by what makes societies and markets work, especially in sustainable energy. http://guylipman.com. Views not necessarily reflect those of my employer.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

A Digital Solution For Plastic

Week of April 26, 2021

How I make my Christmas as Sustainable as possible….

8th Grade Class Takes a Stand For Public Lands

Researchers Working To Replace Nature One GMO At A Time

The 5 Cheapest Forms of Renewable Energy

Ferrets and Prairie Dogs and Bison, Oh My!

Black-footed ferrets

California Condors: It Takes a Village to Save a Species

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Guy Lipman

Guy Lipman

Fascinated by what makes societies and markets work, especially in sustainable energy. http://guylipman.com. Views not necessarily reflect those of my employer.

More from Medium

Fixing Global Warming is Simple

Investment Migration Insights

Airspeeder: Real Life Podracing

Tesla Model S…X? — the beginning…