City digital twin · Part 5 · The synthetic city

A synthetic Newcastle: a city that moves, checked against the real one

A weekend twin of one stadium precinct taught me what a small twin can do. Alongside it I was building a much bigger one: a working digital twin of Greater Newcastle, in which six hundred thousand synthetic residents live, travel by twelve modes on the region's real roads and timetables, and are checked against how the real city travels. This post shows what it looks like and what it can already say.

· ~9 min read · Part 5 of a series · with Pranav Dhoolia

What I built

Previously I built a twin by hand for one question: how long a stadium precinct takes to empty. It ended with a list of what it lacked: real demand instead of numbers I made up, real targets to check against, many runs instead of one, and a record of where every number came from. The Newcastle twin has each of these, for a whole city.

The twin's 3D viewer over central Newcastle at a steep tilt. Every street is coloured by how delayed its traffic was over a simulated weekday, mostly green for flowing with red on the busiest stretches; rail lines run in purple into Newcastle Interchange, the Stockton ferry crosses the harbour in cyan, and buildings stand in 3D.
FIG 1 - Central Newcastle in the twin's own viewer, after a full simulated weekday. Each street is coloured by how much slower its traffic ran than when empty; the rail lines, the light rail and the Stockton ferry run on their real timetables.

The city is Newcastle, in New South Wales, across its five council areas. It was chosen for a question: the city opened a 2.7 km light rail in 2019 whose business case, the state's Auditor-General found, was written after the decision to build it, and nobody has measured what it changed since. Answering that needs a model of how the whole city travels that can be trusted first, so the twin became the goal and the light rail its first question.

In one sentence: every resident of the study area has a synthetic counterpart with a home, a household, an age, a job or a school, a driver's licence or not, and a car or not; each of them has a day to get through; and each chooses how to travel it - drive, get a lift, walk, cycle, ride a motorbike, take a taxi, a bus, a train, the light rail or the ferry - on the real network, while trucks and freight trains take their real share of the roads and level crossings.

The hand-built precinct twinThe Newcastle twin
Demand I wrote down: attendance × car share ÷ 2.5A population generated from the census, which chooses its own way to travel
One precinct's roadsThe whole region: every road, footpath and cycle path, and every public transport timetable
Cars onlyTwelve modes, each moving through the network
Nothing to check againstTwelve real ridership figures, checked every run

The city, rebuilt from open data

Everything under the people is public data, rebuilt by scripts so that it can be rebuilt again. The roads, footpaths and cycle paths come from OpenStreetMap across four thousand square kilometres; the timetables from the transport department's open feeds for buses, trains, the light rail and the ferry.

Map of the twin's network across Greater Newcastle: about 200,000 road links in grey and about 170,000 footpath and cycle path links in green, dense in the city centre and the suburbs around Lake Macquarie and Maitland.
FIG 2 - The network the people move on: 200,935 road links and 169,509 footpath and cycle path links, so a walk to the bus stop is a walk on a real footpath, not a straight line.
Map of every timetabled public transport service in the twin: bus routes in green covering the city and suburbs, train lines in blue running north-west to Maitland and south towards Lake Macquarie, the light rail in purple in the city centre and the ferry across the harbour.
FIG 3 - Every timetabled service, drawn on the streets and tracks it was mapped to: 996 bus route patterns, 270 train patterns, the light rail and the Stockton ferry.

The people are generated from the 2021 census, one census area (SA1) at a time, so that added up they match what was published there: household sizes, cars per household, age and sex, work and study, income. Driver licences come from the transport department's published counts, and each person's day is shaped by the state's travel survey: about three and a half trips, to real buildings. What nobody is given is a mode. They choose it in the simulation.

Hexagon density map of where the twin's synthetic residents live, densest in central Newcastle and its inner suburbs, with clusters at Maitland, Cessnock, Raymond Terrace, Port Stephens and around Lake Macquarie.
FIG 4 - Where the synthetic residents live, from one run's quarter-sample of them. The pattern follows the region's real settlement.

A day in the twin

The engine is MATSim. Every synthetic person carries a plan for the day and tries it on the network, where the plans meet in queues. Each plan is scored - time at work or at home is good, time stuck in traffic or waiting at a stop is bad, fares and parking cost money - and between rounds some people try something else: another route, another time, another mode. After a couple of hundred rounds the choices stop changing much, and the mode shares are read from that state.

Stacked area chart of trips starting in each fifteen minutes of a simulated weekday by mode, with a morning peak around 08:30 and a larger afternoon peak around 16:00, dominated by car drivers, then car passengers, walking, trucks, cycling, taxis and public transport.
FIG 5 - A simulated weekday in Greater Newcastle: every trip by every simulated traveller, residents, visitors, through traffic and trucks, by the time it starts, scaled up from the quarter sample the run simulates.

The twin has its own viewer. It opens any run, finished or still going, and draws the whole region: each street by how delayed it was, each rail, light rail and ferry line from the run's own timetable, and beside the map the twelve modes against their real targets.

Animated view in the twin's 3D viewer, turning slowly over central Newcastle, the harbour and Stockton, with streets coloured by simulated delay and rail lines in purple.
FIG 6 - Turning over the city in the viewer. Everything drawn comes from the run: the delays, the lines, the ferry.
The viewer's full view of a finished run: the whole region's network coloured by delay on the right, and on the left the run's card - settled, accounting closes, 250 of 250 iterations in 27 hours 51 minutes - and the table of the twelve modes against their targets.
FIG 7 - The same run from above, with its card: 158,161 people simulated, 250 rounds in just under 28 hours on one workstation, and every mode read against its target.

How close to the real city

A twin is only worth what it can be checked against, so each of the twelve modes is scored on the basis its real figure is published on: the travel survey's shares of residents' trips, the Opal card's boardings at train stations, on the light rail and at the ferry wharves, and road counts for trucks. There is no single "public transport" row that could hide trains overshooting while trams undershoot.

DEVIATION FROM THE REAL FIGURE one completed run, 25% sample, iteration 250, 30 Sep 2026 -200%-100%0+100%+200% car +8.5% motorbike -4.1% walk -24.7% ride (passenger) -25.0% bus -30.7% light rail -74.0% ferry +95.4% heavy rail +119.3% bike +149.1% taxi +161.1% shaded: inside 10% (the goal) · dashed: the 20% stop bar truck and freight train are checked as levels and representation, not as a deviation
FIG 8 - The honest scoreboard: 2 of 12 modes inside 10% of the real figure. Data: the run's own twelve-mode reading, published on the twin's status board.

Two of twelve modes are within 10% so far. Each mode has a constant that could be adjusted until it matches its target, but that would hide the missing behaviour rather than fix it, so the constants are left alone. The misses point at things the city does that the twin does not yet: people drive most trips under a kilometre, because the walk to a parked car costs them nothing yet; almost half of the attempts to plan a public transport journey find no route; and people without a car, with no lift and no bus, fall back on cycling and taxis far more than real people do. The light rail, the question the project started from, is still the furthest off.

What comes next

The next steps are the missing behaviours the scoreboard points to, then the question the twin was built for: Newcastle with its light rail, and without it. The next post opens the twin up stage by stage: the network, the timetables, the population and their days, the simulation, how each run is checked, and what it takes to run one.

Sources & anchors

  1. The twin's repository, public - github.com/praneetdhoolia/city-digital-twin · its goal - docs/GOAL.md · its status board - docs/STATUS.md · its project reports - praneetdhoolia.github.io/city-digital-twin
  2. Figures 1, 7 and 8: the twin's run viewer on run 20260929T072135_250it_25pct · figures 2 to 4 and 6: drawn from the same run's network, timetables, persons and trips · map data © OpenStreetMap contributors (ODbL), buildings from Overture Maps
  3. MATSim - matsim.org · Horni, Nagel & Axhausen (eds.), The Multi-Agent Transport Simulation MATSim, Ubiquity Press (2016) - doi.org/10.5334/baw · pt2matsim - github.com/matsim-org/pt2matsim
  4. The origin question, the Newcastle light rail - newcastle-lr-proposal.md · the population and demand - population-and-demand.md · ABS Census DataPacks - abs.gov.au
  5. The network, timetables and signals - network-and-inputs.md · signals-and-crossings.md · the targets and the scoreboard - public-transport-and-yardsticks.md

City digital twin · Part 5 of the series · ← Brisbane 2032 egress from Victoria Park Inside the Newcastle twin →