If you read my About Me section then you are aware that I work within the energy industry within the province of Ontario. Before working within the energy industry, I had never really given much thought to how people use energy, but I think this is an interesting subject that can be explored more fully in Ontario. Especially since the provincial government required that technologies be installed to track customers’ energy usage information at a more granular level, hourly as opposed to monthly (in most cases).
In this post, I want to take a look at energy usage at a system level over the course of a day, broken down by various date variables. This will give us an opportunity to see how the province uses energy during the day broken down by month and season and even by day of the week.
The Independent Electricity Systems Operator (IESO) posts hourly provincial energy demand data that spans as far back as 1994. From 2003 onward this data is broken down by 10 geographic zones within the province, which should be interesting to take a look at as well. This analysis is going to take a look at energy demand data for the 2015 calendar year that is going to be done within the R environment. Alright, let’s read some data into R and see what the first couple of lines look like.
This data is super clean and tidy but we are going to need some additional date variables in order to move forward. So let’s load the dplyr and magrittr packages into R to edit our data. The dplyr package does the actual data manipulation and the magrittr package just makes it so I can chain statements together and have them execute one after the other.
The date variables I want to create are a month variable ordered from 1 to 12 and two new day variables, one keeping track of what day of the week it is (1-7) and another tracking what day of the month it is (1- whatever the last day of the month is). Once these are created I format my month variable from numbers to actual month names and create a Season variable that has four values and allocates the months as follows:
Winter - Dec, Jan, and Feb
Spring - Mar, Apr, and May
Summer - Jun, July, and Aug
Fall - Sept, Oct, and Nov
Alright, let’s start plotting some of this data, my preferred way of doing this is using the ggplot2 package. I started using this package approximately 1.5 years ago and while it takes some time to get used to, it can create some very clean, professional looking graphs.
The next couple of figures below look at hourly system energy demand profiles in three ways: the first graph contains hourly load profiles for every day of the year, the second graph contains average daily load profiles broken down by month, and the third graph contains average daily load profiles broken down by season.
Starting from the leftmost graph we can get a sense of daily provincial energy demand, broken down by month. The yearly peak, the highest point of energy demanded within the province, seems to have occurred in on the Tuesday July 28 at 5pm (heatmaps I produce later on in this post confirm this to be true).
Although I don’t produce any variability measures, you can get a sense just by eyeballing the graphs that some months are far more variable in daily energy demand than others. Comparing the daily load profiles to the average monthly load profiles (first and second graphs) January and February seem to be more consistent than say July and August, which appear to be all over the place and this shows in the average monthly load profiles. January and February are everywhere above the other average monthly load profiles, while April, May, and October are duking it out for last place.
The final graph presents average load profiles grouped by season and shows, for at least most hours of the day that the winter and summer seasons are more energy intensive than the fall and spring seasons. However, the summer season curve does not exhibit the same sort of pronounced bi-modal peak of the other three curves.
Alright, let’s produce the same set of graphs as before but exclude weekends.
Looks similar enough to the previous set of graphs. Lets look at the same set of graphs but weekends only.
It appears that on weekends (in 2015 at least), Ontario experiences a gradual increase in energy demand that peaks somewhere between 5pm and 8pm, depending on the month and or season. The average winter system load profile is everywhere above the other seasonal load profiles.
Okay, now lets take a look at system load profiles, broken down by day of the week. Before I do this I want to format the weekly date variable from a number format (1-7) to a date format (Mon-Sun), it’ll look nicer and I am picky.
The seasonal graphs seem to show, that on average, the winter and summer seasonal load profiles appear to have a higher overall system demand between 10am and 8pm than the fall and spring seasons.
Finally, because why not, and I want an excuse to play around with the d3heatmap package. Lets create two pretty heatmaps that have the month of the year on the horizontal axis, the day of the week or month on the vertical axis and each cell within the heatmap contains the max demand within that week or month day/ month of the year combination.
If this is not interactive, then I have failed. But it still looks cool! The comparison between the weekly and monthly day variables are interesting. Conditional on month, the first four days of the week appear to always have a higher maximum system demand than the last three days of the week (except for February, August, and November who seem to want to ruin this for me). The second heat map shows that the monthly maximum is typically grouped with daily maximum demands that are larger than that month’s average daily maximum demand.
Given that the heat maps above have provided us with information on when the monthly maximums occur, let’s compare these maximum load profiles to the average daily load profiles we created earlier.
This is it, the last set of graphs for this post! In terms of monthly maximums, Ontario definitely experiences higher demand (at least in 2015) in the summer period I defined. However, on average the winter seasonal load profile is everywhere above the summer load profile. I think in a future post it would be interesting to look across multiple years to see what sort of seasonal relationships exist, while also accounting for weather.