← All work

Energy simulation, University of Galway

GridAI

A digital twin of the Irish power grid in Rust, where a custom reinforcement learner runs 2.5 million simulated grid-years an hour to find a net-negative path to 2050.

Role
Built it solo
Timeline
November 2024 to March 2025
Recognition
EirGrid Cleanergrid finalist
Two duotone maps of Ireland side by side, each dotted with simulated generator placements scaled by capacity
The simulator’s view of Ireland: generators and offsets placed across the country, sized by capacity.
simulated grid-years per hour
2.5M
net-negative emissions reached by
2050
finalist teams nationally
1 of 5

The idea

Planning a national grid is a brutal optimisation problem: you are balancing cost, reliability, emissions, and whether people will actually tolerate what you build, all the way out to 2050. Humans do this with spreadsheets and intuition. I wanted to see what an agent could do if you let it run the experiment millions of times.

So I built GridAI: a digital twin of the Irish power grid in Rust, paired with a learner that designs 25-year investment strategies and gets rewarded for the outcomes they produce. It is not a black box. The policy is a set of weighted, year-indexed actions, so you can read back exactly what it decided to build and when.

Learning by playing it out

The core is a custom policy gradient optimiser, written from scratch rather than pulled off a shelf. Each iteration plays a full timeline from 2025 to 2050: build generators, add storage, plant carbon offsets, then score the result against four objectives at once.

Moves that improve the final outcome get reinforced. When progress stalls, the learner contrasts the current run against its best-known strategy and nudges itself back toward what worked, while a deficit mode biases it toward fast-ramping capacity any time reliability slips.

Flowchart of the learning loop: initialise weights, simulate outcomes, evaluate, then either contrast-learn on no improvement or apply rewards on improvement, then repeat

The decision loop: simulate a full timeline, score it, then reinforce or course-correct.

Stacked bar chart of power usage against power generation from 2025 to 2050, with generation staying comfortably above demand every year

Generation stays ahead of demand across the whole run, holding reliability while emissions fall.

2.5 million grid-years an hour

To learn anything useful, the agent has to play out an enormous number of timelines. GridAI runs roughly 2.5 million simulated grid-years an hour, parallelised across cores, with checkpointing so long training runs can pause and resume without losing the policy.

On Apple Silicon there is a Metal GPU shader that scores candidate generator sites in parallel, with a deterministic CPU fallback everywhere else. The result: a strategy that reaches net-negative emissions by 2050 while keeping the lights on every single year.

What the simulator sees

The environment is grounded in real geography and economics: settlements drawn from census data, existing generators from public power-plant databases, and costs that drift with inflation and technology maturity over time.

Every placement carries consequences. Distance to settlements feeds transmission cost and public opinion, land use rules keep plants out of urban and protected areas, and coastal proximity unlocks offshore wind and wave. The map below is the simulator’s own render of a finished rollout.

The GridAI renderer showing a legend of generator types beside two maps of Ireland covered in coloured dots for settlements, wind, solar, and other generators

The renderer’s output: settlements and generators across Ireland, colour-coded by type.

Duotone close-up of simulated generator placements scattered across the map of Ireland

The same rollout rendered in the site’s palette.

Cleanergrid finalist

GridAI was a finalist in EirGrid’s Cleanergrid competition, one of five teams nationally, and I presented the approach to EirGrid stakeholders. The full report walks through the simulation engine, the policy search, and the year-by-year strategy it landed on.

Rust Policy gradient RL Metal GPU compute Multi-objective optimisation Python data pipelines Geospatial modelling
← All work Next project

StudySmith →