PyCon AU 2025

Building an electricity market model from scratch
2025-09-12 , Ballroom 2

This presentation will introduce the audience to the fields of electricity market modelling and mathematical optimisation (MO).The talk will be comprised of three sections:

The first section will provide some background and context for the audience. We will describe what an electricity market is, how it functions, and the energy transition which is changing how we build and operate the grid. We will also provide some background on mathematical optimisation - how it works, and why it is the most common way to model energy markets.

In the second section, we will walk through how you build an optimisation model together. We will describe an extremely simple electrical grid, and show we can simulate the dispatch of power stations through a mathematical optimisation model. We will also explore some of the benefits of these models, including how electricity prices are generated by extracting the marginal value of constraints.

Finally, we will break down the core components of a mathematical optimisation model and discuss how this approach can be used to solve quantitative problems in many other sectors.


By 2050, the electrical grid will be a fundamentally different system to the one we have today. Over the coming years, we need to learn how to plan, build, and run a new type of grid, and all the while preventing it going down, even for a second.

In order to conduct the analysis and experiments required for this transition, we need to be able to model the grid in all of its rich detail and complexity. If we close a coal power station in New South Wales, build a solar farm in Queensland, new transmission lines are delayed in South Australia, or the build cost of offshore wind in Victoria changes, we need to be able to rapidly assess how this will impact the stability and future of the grid.

To accomplish this, we utilise the analytical technique of mathematical optimisation (MO). This allows us to build a mathematical representation of the grid, describe its constraints and limitations, and then simulate how it will operate and evolve now and into the future.

In this presentation, we will introduce the audience to the field of electricity market modelling and explain how to turn the data and structure of the grid into a mathematical optimisation that we can solve. We’ll build a very simple electricity market dispatch optimisation together and explore the key components of an optimisation model that can be applied to problems in multiple industries.