This article will walk you through the construction of an extremely simple dispatch engine programmed in GMPL. While my preferred language is Python, GLPK lets us focus exclusively on the equations behind the dispatch engine, enabling us to understand the basics of how dispatch works in the energy market.
So what is a dispatch engine? It is a program that allows us to figure out the optimial volume of power that different power stations should dispatch into the grid. As power is instantly produced and consumed, the total volume of power generated must equal demand at any time. Given that power stations sell different volumes of power at varying prices, the purpose of a dispatch engine is to identify how much each power station should generate to meet demand, while minimizing the total cost to supply that power.
Another important detail is that all power stations are ultimately paid the same price for the power they generate within a given interval – the most expensive power station called on to dispatch in order to satisfy demand effectively becomes the ‘price setter’.
Our dispatch engine is based on the technique of linear optimization – you can find out more background on the technique here if you’re interested.
Install GLPK (GNU Linear Programming Kit) – you can do this with the following command once you have Anaconda installed:
conda install -c conda-forge glpk
We’re going to start by setting out all the parameters for our optimization:
- We’re simulating a single region with a demand target of 150 MW
- We’ll have 3 power stations – 2 coal, and 1 gas
- Coal 1 sells power at $10/MWh and has a max output of 100 MW
- Coal 2 sells power at $20/MWh and has a max output of 100 MW
- Gas 1 sells power at $100/MWh and has a max output of 50 MW