Chapter 4 of The Nature of Code, Particle Systems, builds emitters that spawn short-lived particles at a controlled rate. The controlling variable here is a measured concentration of airborne particles.

I let Open-Meteo PM2.5 readings set each city’s spawn rate, so the particle system is driven by measured particulate load rather than a fixed emitter constant.

Each of three cities is an emitter whose spawn rate and particle color are set by its current PM2.5 reading, the mass concentration of fine particulate matter, from the Open-Meteo air-quality forecast. The rendered particles stand for the measured particulates, so the emission rate is a physical scalar rather than a chosen constant.

Each particle integrates by explicit (forward) Euler, \(\mathbf{x}_{t+1} = \mathbf{x}_t + \mathbf{v}_t\,\Delta t\), and carries a finite lifespan. The number spawned per frame is proportional to concentration, \(r \propto C_{\text{PM2.5}}\), where \(C\) is in \(\mu\mathrm{g}/\mathrm{m}^3\); the WHO 24-hour guideline is \(15\,\mu\mathrm{g}/\mathrm{m}^3\). PM2.5 denotes particulate matter with aerodynamic diameter \(\le 2.5\,\mu\mathrm{m}\).

Data source: Open-Meteo Air Quality API
Endpoint: https://air-quality-api.open-meteo.com/v1/air-quality?latitude=...&longitude=...&hourly=pm2_5
Access: Public, no key. Loaded from an hourly server-side refresh when possible, with a bundled snapshot fallback, and a live browser fetch only when the API allows CORS. Data window: Sep 15, 2026 (pulled Sep 15, 2026 UTC)

Latest data pull 72 rows
Sep 15, 2026 (pulled Sep 15, 2026 UTC)
City
Hour
PM2.5 (µg/m³)
Berlin
0
11.2
Berlin
1
11.1
Berlin
2
10.4
Berlin
3
9.9
Berlin
4
10.1
Berlin
5
10.5
Berlin
6
11.2
Berlin
7
11.8
Berlin
8
12.3
Berlin
9
12.1
Berlin
10
11
Berlin
11
9.2
Berlin
12
8.3
Berlin
13
7.5
Berlin
14
6.6
Berlin
15
6.4
Berlin
16
6.2
Berlin
17
6.5
Berlin
18
6.8
Berlin
19
6.8
Berlin
20
7.1
Berlin
21
7.2
Berlin
22
7
Berlin
23
6.4
Delhi
0
52
Delhi
1
56.1
Delhi
2
55.8
Delhi
3
46.7
Delhi
4
41.4
Delhi
5
37.6
Delhi
6
38.3
Delhi
7
39.8
Delhi
8
40.7
Delhi
9
41.3
Delhi
10
41.2
Delhi
11
40
Delhi
12
40.2
Delhi
13
46.4
Delhi
14
52.9
Delhi
15
54.8
Delhi
16
56.2
Delhi
17
55.2
Delhi
18
54.8
Delhi
19
55.4
Delhi
20
53.6
Delhi
21
52
Delhi
22
50.8
Delhi
23
48.7
Los Angeles
0
11.6
Los Angeles
1
11
Los Angeles
2
11
Los Angeles
3
11.1
Los Angeles
4
12.1
Los Angeles
5
14
Los Angeles
6
16.6
Los Angeles
7
19
Los Angeles
8
18.7
Los Angeles
9
17.5
Los Angeles
10
17.3
Los Angeles
11
17.8
Los Angeles
12
18.2
Los Angeles
13
18.9
Los Angeles
14
19.7
Los Angeles
15
20.1
Los Angeles
16
19
Los Angeles
17
20.5
Los Angeles
18
17.6
Los Angeles
19
18
Los Angeles
20
18.5
Los Angeles
21
18.7
Los Angeles
22
18.7
Los Angeles
23
18.4

All 72 hourly PM2.5 samples are listed below.