Materials Decoded Lab · Artifact 03

Where critical materials come from, how long they stay in use, and whether recycling them matters

mfa-engine is a dynamic material flow analysis engine. It runs three technology systems, Denmark's wind fleet, the world's electric cars and the world's data centres, through the same reusable code, and follows six critical materials from the year they enter service to the year they are recycled or lost. It then asks a narrow question about each one: if the largest supplier stopped exporting for a year, would the material coming back from recycling make a dent in the gap?

Open the live dashboard →Read the code

3

technology systems, one engine

Danish wind turbines, the global EV fleet and global data centres, one per textbook dMFA mode

8

material and system pairs

copper, lithium, nickel, cobalt, graphite and rare earths, tied to 2023 UN Comtrade trade data

10⁻⁹ t

worst yearly mass-balance gap

stock change equals inflow minus outflow, checked every year for every material

6

mistakes caught and fixed

listed below, including one that undervalued lithium 5.3-fold

The dashboard's supply map for copper: circles sized by 2024 mine production over Chile, Peru, DR Congo, China and others, with curved arcs carrying the largest 2023 trade flows between countries.
The Supply map page. Circles show 2024 mine production, arcs the largest 2023 trade flows with dots moving from exporter to importer. Pressing play removes the chosen supplier and replays the cascade round by round as countries that lose too much trade fail in turn.

Three systems, three ways of modelling a stock

Dynamic material flow analysis has three textbook ways to build a stock over time: from a register of assets known to be standing, from a record of what was sold, or from the stock a system needs. Each case here needs a different one, so each uses a different one, all on the same base classes. That is the practical test of "modular and reusable": a new technology system is a new subclass with its own data, not a rewrite.

SystemModeDataHow it works
Danish wind turbinesRegister-basedDanish Energy Agency's national turbine registerKaplan-Meier and Weibull lifetimes fitted to every turbine, standing or retired; reproduces dk-wind-mfa's published numbers exactly
Global EV fleetInflow-drivenIEA Global EV Outlook sales and chemistry mix, NHTSA survival, CRS/GREET cathode massesEach year of sales decays from its own sale year; metal content from cathode stoichiometry (NMC811, LFP)
Global data centresStock-drivenMcKinsey capacity demand (60 GW in 2023, 171 to 219 GW by 2030), IEA, Masanet et al. 2020, ASHRAE service livesRequired capacity drives new build plus replacement; copper per MW from WEF/Kearney; servers left out, no consistent per-MW figure exists

From stocks and flows to supply risk

ODYM and flodym, the standard open-source dMFA tools, cover the physical side; the aim here is to put the trade-risk side next to it for the same materials, in one place, with every number traceable to a source.

Mistakes it caught, and what changed

Each of these produced numbers that looked plausible. None threw an error. They were found by checking results against physics, sources and common sense; the fixes and their reasons are written into the code and the README.

  1. Comparing a 25-year recovery total with a one-year supply shortfall. Graphite came out at over 1,000% "coverage". Both sides are now one-year figures, with the peak year shown beside the average.
  2. Treating every tonne leaving service as recycled. Overstated copper recovery by about half and lithium and rare earths by over 100 times. Cited end-of-life recycling rates now apply (UNEP IRP 2011; EU Batteries Regulation targets as an upper bound).
  3. A snapshot filter that dropped 2025 and 2026 EV sales. About 43 million real vehicles never reached the model.
  4. A scenario extrapolated past its source. IEA's STEPS trajectory kept climbing after 2035 to an 87% EV share no source gives. It now holds at its published 2035 endpoint.
  5. EV sales treated as vehicles still on the road. Overstated the fleet and pushed retirements that had already happened into the future. Sales now enter as cohorts and decay from their sale year.
  6. Lithium metal valued at the lithium carbonate price. One tonne of lithium is 5.32 tonnes of carbonate, so every lithium dollar figure was 5.3 times too low. Found in a review before this page was written.

Reading the dashboard

Thirteen pages follow the analysis in order, from how long one unit lasts to what a disruption would cost, and a glossary explains all 45 technical terms, with the exact formula behind each one. Pick a material in the sidebar and every page follows it, in that material's own colour. Each chart opens with one sentence worked out from the numbers on screen, keeps its formula and sources in a "How this is calculated" panel, and downloads as CSV; a "How to read this page" button at the top of every page explains the page in a minute. The colours were checked for colour-vision deficiency and contrast in light and dark mode.

What this is not