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: Aug 6, 2026 (pulled Aug 6, 2026 UTC)

Latest data pull 72 rows
Aug 6, 2026 (pulled Aug 6, 2026 UTC)
City
Hour
PM2.5 (µg/m³)
Berlin
0
11.6
Berlin
1
12.4
Berlin
2
13
Berlin
3
11.8
Berlin
4
10.4
Berlin
5
10.3
Berlin
6
10.8
Berlin
7
9.4
Berlin
8
7.4
Berlin
9
6.6
Berlin
10
6.2
Berlin
11
5.6
Berlin
12
5.8
Berlin
13
5.5
Berlin
14
5.7
Berlin
15
6
Berlin
16
6
Berlin
17
5.6
Berlin
18
5.1
Berlin
19
5.3
Berlin
20
5.5
Berlin
21
5.5
Berlin
22
5.9
Berlin
23
6
Delhi
0
68.7
Delhi
1
70.3
Delhi
2
75
Delhi
3
70.1
Delhi
4
54.6
Delhi
5
45.3
Delhi
6
44.6
Delhi
7
44.9
Delhi
8
47.4
Delhi
9
51.9
Delhi
10
50.9
Delhi
11
57.6
Delhi
12
58
Delhi
13
55.8
Delhi
14
54.5
Delhi
15
53.1
Delhi
16
50.1
Delhi
17
47.7
Delhi
18
47.7
Delhi
19
47.1
Delhi
20
40.2
Delhi
21
40.5
Delhi
22
37.6
Delhi
23
38.2
Los Angeles
0
14.9
Los Angeles
1
13.9
Los Angeles
2
12.8
Los Angeles
3
12.2
Los Angeles
4
11.9
Los Angeles
5
11.8
Los Angeles
6
12.5
Los Angeles
7
14.8
Los Angeles
8
17.9
Los Angeles
9
21.1
Los Angeles
10
24
Los Angeles
11
26.9
Los Angeles
12
29.9
Los Angeles
13
32.7
Los Angeles
14
35.6
Los Angeles
15
26.9
Los Angeles
16
22
Los Angeles
17
23.2
Los Angeles
18
24.6
Los Angeles
19
24.9
Los Angeles
20
23.5
Los Angeles
21
21.5
Los Angeles
22
19.7
Los Angeles
23
18.7

All 72 hourly PM2.5 samples are listed below.