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

Latest data pull 72 rows
Aug 27, 2026 (pulled Aug 27, 2026 UTC)
City
Hour
PM2.5 (µg/m³)
Berlin
0
8.7
Berlin
1
8.4
Berlin
2
8.4
Berlin
3
8.2
Berlin
4
8.5
Berlin
5
9.2
Berlin
6
10.3
Berlin
7
10
Berlin
8
9.4
Berlin
9
8.2
Berlin
10
7.6
Berlin
11
7.5
Berlin
12
7.3
Berlin
13
7.1
Berlin
14
7.2
Berlin
15
7.2
Berlin
16
7.1
Berlin
17
7.2
Berlin
18
7.3
Berlin
19
7.7
Berlin
20
8
Berlin
21
8.1
Berlin
22
7.9
Berlin
23
7.8
Delhi
0
78.7
Delhi
1
75.7
Delhi
2
66.4
Delhi
3
59
Delhi
4
58.6
Delhi
5
61
Delhi
6
64
Delhi
7
65.2
Delhi
8
67.3
Delhi
9
70.3
Delhi
10
68.7
Delhi
11
65.2
Delhi
12
67.3
Delhi
13
78.5
Delhi
14
91
Delhi
15
96.4
Delhi
16
102.9
Delhi
17
110.8
Delhi
18
117.3
Delhi
19
118.7
Delhi
20
120.6
Delhi
21
123.4
Delhi
22
126.2
Delhi
23
127.1
Los Angeles
0
28.9
Los Angeles
1
30.2
Los Angeles
2
30.9
Los Angeles
3
32.2
Los Angeles
4
34.2
Los Angeles
5
37
Los Angeles
6
39.9
Los Angeles
7
41.7
Los Angeles
8
43.2
Los Angeles
9
44
Los Angeles
10
45.3
Los Angeles
11
46.6
Los Angeles
12
47.1
Los Angeles
13
47.1
Los Angeles
14
47.1
Los Angeles
15
45.4
Los Angeles
16
41.9
Los Angeles
17
40.4
Los Angeles
18
38.9
Los Angeles
19
37.1
Los Angeles
20
36.1
Los Angeles
21
35.2
Los Angeles
22
32.5
Los Angeles
23
32.5

All 72 hourly PM2.5 samples are listed below.