A hurricane over a grid, taken apart
How the Maria showcase is made: the model chain behind it, the checks against the satellite and the outage reports, and what went wrong
The Maria showcase sends Hurricane Maria across a model of Puerto Rico’s transmission grid, hour by hour, and then holds the result up against the satellite and the outage reports. Its verdict: the model gets the direction right and misses the depth. This article takes it apart: what each piece does, the code that does it, the idea behind it, what went wrong, and what to read to go further.
Built with AI coding tools: I set the direction, tested and decided; the tools wrote the code and the first draft of this article. The reference list was checked against Crossref (one report without a DOI and one preprint against their PDFs), and what I say about each source against its abstract or an open copy. I am not an expert in this field. I am learning it, and this article is my map so far.
A screening model, held up against the record
The showcase does not forecast anything. It replays a storm that happened, through a model whose every piece is a first draft, and then asks how far the result is from what was measured. LiveLines, the tool behind it, calls such a comparison a record and keeps the records that miss as well as those that hit. The Maria record is a miss with a likely cause, and the most useful part of this article is the last third, on what a later look at that miss found.
The chain
The model is a chain of small modules in the LiveLines kernel. Each takes the output of the one before (Figure 2): a grid, a storm, a rule for when lines break, a power flow, and an outcome per substation and hour. The comparison with the satellite and the reports happens outside the chain, on its last hour.
The whole run is written down as one small file, a preset, so that the app and the page run the same thing: 48 model hours from 13:00 UTC on 19 September 2017, 8 runs from the seed 42. The page’s data come from a script, scripts/showcase_maria/build_data.py, that sends the preset to a locally running kernel three times (as it is, with the collapse rule on, and with it plus an over-frequency rule), re-derives the record’s scores from the answer, and stops if they differ from the record. The numbers from the run are not typed by hand: they come from the file this script writes.
The grid
The grid comes from OpenStreetMap, turned into a network model by PyPSA-Earth (Parzen et al. 2023), an open model built on the PyPSA toolbox (Brown, Hörsch, and Schlachtberger 2018). It has 56 substations and 92 branches at 115 and 230 kV: 76 lines and 16 transformers. To it come the island’s power plants built by 2017, mostly from Global Energy Monitor’s trackers, some matched with powerplantmatching (Gotzens et al. 2019), with their status as of the trackers’ 2025 releases, and an hourly demand series (DemandCast) that PyPSA-Earth spreads over the substations.
Three things about this grid matter for everything below:
- It is today’s map, not 2017’s. Of the 2,659 km of overhead line mapped in Puerto Rico, the model keeps 1,415 km.
- The line ratings are standard values per voltage, not the real ones.
- The plants are at nameplate: 5,666 MW of them, against 1,889 MW of load at the model’s last hour. Whether they were available in September 2017 is not in the model.
The wind
The storm is Maria’s track from IBTrACS (Knapp et al. 2010), the US agency columns only: position, strongest wind, central pressure and the radius of strongest wind every few hours. From these a wind profile gives the wind at any distance from the centre. LiveLines uses the profile of Holland (1980) (Figure 3).
The model is a few lines of algebra. With \(\Delta p\) the drop in pressure from the surroundings to the centre, \(\rho\) the density of air, \(R_m\) the radius of strongest wind and \(r\) the distance from the centre, the wind above the surface layer is, in the cyclostrophic form the kernel uses (the Earth’s rotation is left out),
\[ V_g(r) = \sqrt{\frac{B\,\Delta p}{\rho}\,u\,e^{-u}}, \qquad u = \left(\frac{R_m}{r}\right)^{B}, \]
and \(B\) follows from the track’s strongest wind and pressure drop, kept between 1 and 2.5. In the kernel (from src/kritis/chain/storm.py, shortened):
c_lat, c_lon = at(track.lat), at(track.lon)
dp = at(track.p_env_pa) - at(track.p_c_pa)
rmax = at(track.r_max_m)
vg_max = at(track.v_max_ms) / params.k_surface
vtrans, heading = at(track.v_trans_ms), at(track.heading_deg)
b = holland_b(vg_max, dp, params.rho_air)
b_use = np.where(np.isfinite(b), np.clip(b, params.b_min, params.b_max), params.b_min)
r, theta = geodesy.inverse(c_lat, c_lon, pts[None, :, 1], pts[None, :, 0],
a=params.wgs84_a, inv_f=params.wgs84_inv_f)
v_g = gradient_wind(r, rmax, b_use, dp, params.rho_air)
_, gust = surface_gust(v_g, vtrans, theta, heading, c_lat, k_surface=params.k_surface,
asymmetry_a=params.asymmetry_a, gust_factor=params.gust_factor)at interpolates the track to the times wanted. surface_gust then brings the wind down to the surface (a factor of 0.9), adds up to half the storm’s forward speed on its right-hand side, where the winds of a moving northern-hemisphere storm are strongest, takes as much away on the left, and turns the result into a 3-second gust with a factor of 1.23. That factor is the cell of a WMO guideline’s table for a 3-second gust within one minute, at a coastline with the wind coming off the sea (Harper, Kepert, and Ginger 2010, Table 1.1).
Where is the wind needed? Every branch is cut into pieces of at most 10 km, and the wind is computed at the middle of each piece, twice per model hour. The hour’s value is the higher of the two.
When a line breaks
A line does not break at one wind speed. Two towers of the same design, in the same gust, may fare differently. A fragility curve describes this as a probability: the chance that a piece of line breaks at a given gust (Figure 4).
The curve is borrowed. Raj, Bhatia, and Kumar (2021) fitted it to the transmission towers of Odisha in India after Cyclone Fani in 2019: 128 towers at 132 and 220 kV that collapsed or lost their function, out of a network of 41,814. Its median is 78.6 m/s, and it is steep: the chance rises from 1 in 100 at about 65 m/s to 99 in 100 at about 96 m/s. Hold on to that steepness; it comes back below. One more thing comes with the curve: the authors fitted it to gusts from a different wind profile (Willoughby, Darling, and Rahn 2006), scaled by their own factor, so it carries that wind model’s errors too.
The kernel draws, for every run and every piece of line, a breaking gust from that curve, and lets the piece break in the first hour its peak gust so far reaches it. A line is out as soon as one of its pieces is (from src/kritis/chain/fragility.py):
rng = np.random.default_rng(seed)
z = rng.standard_normal((n_sample, n_point))
cap = np.exp(np.log(median_ms[pl])[None, :] + beta[pl][None, :] * z)
# running peak gust per point: a segment that has failed stays failed
peak = np.maximum.accumulate(wind.gust_ms, axis=0) # (hour, point)
exceeded = peak[None, :, :] >= cap[:, None, :] # (sample, hour, point)
seg_fail = np.where(exceeded.any(axis=1), exceeded.argmax(axis=1), n_hour)
t_fail = np.full((n_sample, n_line), n_hour, dtype=np.int64)
np.minimum.at(t_fail, (slice(None), pl), seg_fail.astype(np.int64))cap is the breaking gust: a normal random number \(z\), turned into a lognormal one with the curve’s median and spread. Nothing is ever repaired in this run. With the seed 42, the eight runs lose between 39 and 45 of the 92 branches. The 16 transformers are treated like lines here, with the same tower curve, and 3 to 8 of them fail per run; whether that is intended is an open question in LiveLines.
Fragility curves for power lines in storms are a field of their own. Panteli and Mancarella (2017) introduce a framework in which weather- and time-dependent failure probabilities from such curves drive a sequential Monte Carlo simulation of a power system; Panteli et al. (2017) build fragility models of components and of the whole transmission system for wind and test them on a version of Great Britain’s grid. LiveLines follows the same pattern, in a much smaller form.
Where the power goes
Breaking lines is not yet an outage. What matters is whether power still gets from the plants to the load. The kernel answers this with a DC power flow, the linear approximation that power-system planners use when they need many answers fast. Stott, Jardim, and Alsac (2009) re-examine it and note that correct flows from it are “by no means assured”.
Each hour, the kernel does four things for every run:
- Islands. It finds the groups of substations still connected by working lines.
- Dispatch. In each island, the plants cover the load as far as they can. An island without a plant goes dark; one with too little serves every load the same fraction.
- Flows. It solves the DC power flow in each island.
- Cascade. Any line carrying more than 1.5 times its rating trips, and the kernel goes back to step 1, until nothing more trips.
The cascade is the part a picture of the network alone would miss. Hines, Cotilla-Sanchez, and Blumsack (2010) compared measures of vulnerability taken from the network’s shape with a model of cascading failure, found only a mild correlation, and concluded that judging a grid by its topology alone can mislead. In the Maria run the cascade adds up to 6 trips to the wind’s damage.
A second engine, PyPSA itself, solves the same hour as an optimisation: an ideal operator who sheds as little load as possible and never overloads a line. The page shows both; the ideal operator serves a little more here.
The rule that turns the lights off
Step 2 above has a blind spot. A real grid that is suddenly cut in two does not quietly serve what it can. If an island loses more generation than its automatic load shedding can make up, its frequency falls, plants protect themselves by tripping, and the whole island goes dark in seconds. Without a rule for this, the model reroutes power around every gap.
LiveLines has such a rule, switched off in the main run and on in two variants. An island goes dark when its sudden shortfall, measured against the load it served the hour before, exceeds a threshold (from src/kritis/chain/powerflow_dc.py):
for isl in np.unique(label):
buses = label == isl
s = float(prev_served[buses].sum())
if s <= _EPS:
continue
g = float(prev_gen[gen_label == isl].sum()) + float(prev_used[buses].sum())
if s - g > threshold * s + tol_mw:
out |= busesThe threshold is 25 %. It comes from a North American reliability standard (NERC PRC-006-5), which asks that load-shedding schemes survive an imbalance of up to that size. It is the least a scheme must survive, not a measured breaking point, and Puerto Rico is not under NERC. A second rule does the same for an island that suddenly has too much generation.
Holding it up against the record
The model ends after 48 hours. Two kinds of observation are held against its last hour.
Lights at night
NASA’s Black Marble product gives the light the Earth emits at night, every day, at about 500 m, corrected among other things for the moon and for stray light (Román et al. 2018). The light is not electricity, but where a whole town’s power fails, its light goes too. Román et al. (2019) used Black Marble to follow the outage and the restoration in Puerto Rico after Maria; by their estimate, the island’s lights fell by about 80 % right after the storm.
The showcase uses the same data in a simpler way. Every land pixel on the island goes to its nearest substation. For every pixel, the normal light is the median over the clear nights before 6 September (when Irma passed north of the island). For every substation area and night, the light ratio is the light of the clear pixels that night, divided by their normal light (from LiveLines’ scripts/nightlight_bus_areas.py):
sel = usable & has_base
num = np.bincount(bus[sel], weights=ntl[sel], minlength=len(names))
den = np.bincount(bus[sel], weights=base0[sel], minlength=len(names))A night counts for an area only if at least half its normal light was seen through clear sky. From 21 September on, the first such nights were the 27th and 28th. On those two nights every one of the 50 substation areas with data was below half its normal light, and on average they kept 19 %. The model, at its last hour, still served 63 % in the same areas (a plain mean over them), and only 17 of them fell below half.
Customers without power
The U.S. Department of Energy published situation reports through the crisis. On 24 September 2017 they counted 1,569,796 customers without power: all of them. The model, at its last hour three days earlier, still served 39 % of the island’s load.
Both comparisons say the same thing. The model gets the direction right, a severe outage, and misses the depth, an island that went entirely dark. Its first explanation was on the page from the start: there is no system-wide collapse in the main run. With the collapse rule on, the areas’ mean drops to 57 %; with both rules, to 55 %. Closer, but nowhere near 19 %.
The page itself
The page is plain HTML with one script and no library. Two things in it are worth taking away.
The run’s numbers are checked. Most numbers from the run sit in a small tagged element in the text that carries the value as written. When the page loads, the script computes the same value from the data file and complains in the browser’s console if they differ (from showcases/assets/maria.js):
root.querySelectorAll('[data-k]').forEach(function (s) {
var k = s.getAttribute('data-k');
if (!(k in K)) { console.warn('maria: no value for', k); return; }
var v = String(K[k]);
if (s.textContent.trim() !== v) console.warn('maria: text says', s.textContent.trim(), 'data says', v, '(' + k + ')');
s.textContent = v;
});So these numbers cannot quietly drift away from the run. The text around them is still written by hand, so it reads like text and works without the script. Numbers from other sources on the page, such as the kilometres of mapped line, are typed and were checked by hand.
Scrolling runs the clock. On the step “Hour by hour”, how far the step has scrolled sets the model hour, from hour 12 to hour 47, and the map redraws. Visitors who have asked their device for less motion get four still maps instead (hours 19, 21, 24 and 47).
What came later
A day after the page was built, LiveLines looked at the miss again, with a method it had used before on Typhoon Haiyan: rank the possible causes, say what each rests on, change no parameter and fit nothing. The full analysis is a record in the LiveLines repository; here is what it found, and what it means for the page.
Two errors that hide each other
LiveLines compared its wind with the gusts that weather stations on the island measured, as the National Hurricane Center’s report on Maria lists them. At the five stations whose records are not marked incomplete, the measured gust was 0.71 of the model’s (the median), and the model was 16.0 m/s higher on average. Four wind models from CLIMADA, run on the same track and the same points, were also higher, by 10.3 to 18.3 m/s on average. There is no correction for the stations’ height or exposure, and the report states no averaging time for its gusts, so this is a pointer, not a measurement of the error.
Now recall how steep the line curve is. What happens if the wind is a little weaker? The analysis ran the model with every gust scaled down:
| Gust × | Branches expected to fail | Island load served, end |
|---|---|---|
| 1.0 | 41.6 | 39 % |
| 0.9 | 19.1 | 83 % |
| 0.8 | 2.5 | 99 % |
| 0.7 | 0.0 | 99 % |
With a fifth less wind, almost nothing breaks. Yet Puerto Rico’s transmission lines did break, badly: Kwasinski et al. (2019) describe damage to transmission and distribution far worse than in other recent US hurricanes. So if the stations are right, the borrowed Indian tower curve is far too strong for Puerto Rico’s lines, and the model’s too-strong wind hides it. Fix one without the other and the model breaks almost no lines at all. Both must move together, from sources, and neither may be tuned to make Maria come out right.
Two of the readings behind this article point at the wind. Willoughby, Darling, and Rahn (2006) compared the most common profile functions with aircraft measurements and found that “winds near the peak are too strong” and fall off too fast away from it. And the WMO guideline whose 1.23 the kernel uses says that a “maximum 1-min sustained” wind, the kind a best track reports, is itself a gust, not a mean (Harper, Kepert, and Ginger 2010, 2); a gust factor is meant for a mean wind. Whether either explains the excess here has not been tested.
The median hid the blackouts
The collapse rule seemed to change little: the median over the eight runs barely moved. A closer look found that the largest sudden shortfall of any island of five or more substations lies between 18 % and 31 % in six of the runs, right around the 25 % threshold. With both rules on, three of the eight runs end with the island completely dark, which is what was reported, and the other five keep between 32 % and 44 % of the load. The median sits among the five. A model on a knife-edge needs its spread reported, not just its middle; showing “3 of 8 runs went dark” is now an open proposal in LiveLines.
The outage started earlier
A DOE report not used on the page says that at 07:37 UTC on 20 September, 2.6 hours before landfall, about 56 % of customers were already without power. The model still served almost all of its load then. What failed first is not known from the reports.
A different measure, a different gap
The page’s “63 % served” is a plain mean over 50 areas, and 13 of them have no load in the model, so they count as fully served. The analysis took the measure apart:
| Measure (DC engine, last hour) | Served |
|---|---|
| plain mean, all 50 areas with light data | 63 % |
| plain mean, the 37 of them with load | 51 % |
| weighted by load, the same 37 | 33 % |
| island total | 39 % |
The honest size of the miss is the island total against the reports, about 39 points, not the 45 points between 63 % and 19 %. The page already gives both numbers; it says which is which in small print.
What this means for the page
The page stands as it is: every number on it comes from the run it names, and its “why it misses” says the collapse is the likely cause, not the proven one. Two things on it are now known to be incomplete. Its fragility caveat (“borrowed”) understates how much rests on the wind, and its collapse variant reports the median that hides three dark runs. Since then LiveLines has also rebuilt its night-light table so that it drops pixels on nights lit by the moon; on that table the satellite mean is 18 %, not 19 %. The page keeps the numbers of the run it names; a rebuilt page would take the new ones.
From screening to model
What would it take before a model like this could say something about the next storm?
The distribution grid. The model stops at the substation. The lines to streets and homes, where much of Maria’s damage was, are not in it. Kwasinski et al. (2019) describe an outage that “initially affected the entire island” and lasted more than ten months, with transmission and distribution damaged far worse than in other recent US hurricanes and generation only lightly.
A tower curve from the place. Puerto Rico’s own damage records, not Odisha’s, and a curve per tower rather than per 10 km of line.
Wind checked against stations, with height, exposure and averaging time corrected, before the wind is changed.
Repair. Without repair, the model’s last hour has to stand for every later date. With it, the model could be held against the months of restoration that Román et al. (2019) followed from space.
More runs and the spread. Eight runs are enough to see a knife-edge, not to measure it.
What the model leaves out
No distribution lines and no repair. Today’s map, standard line ratings, plants at nameplate. A tower curve from another country, applied per 10 km. A wind profile from a formula, unchecked against stations. Collapse thresholds from North American standards. Night lights as a stand-in for power. Eight runs. Every module in the chain is at placeholder maturity, and the page says so.
A reading guide
Wind in a hurricane. The profile (Holland 1980), an alternative fitted to aircraft data (Willoughby, Darling, and Rahn 2006), gusts and averaging times (Harper, Kepert, and Ginger 2010), the tracks (Knapp et al. 2010).
Grids under storms. Fragility and resilience (Panteli and Mancarella 2017; Panteli et al. 2017), a tower curve and its data (Raj, Bhatia, and Kumar 2021), why flows and not only topology (Hines, Cotilla-Sanchez, and Blumsack 2010), the DC approximation (Stott, Jardim, and Alsac 2009).
Open grid models. (Brown, Hörsch, and Schlachtberger 2018; Parzen et al. 2023; Gotzens et al. 2019).
Seeing outages from space. (Román et al. 2018, 2019).
Maria and Puerto Rico’s grid. (Kwasinski et al. 2019; Román et al. 2019).
Data and sources
The figures and numbers in this article come from the Maria showcase’s run and from the LiveLines repository. The data behind them, as on the showcase page:
- Grid (the map in Figure 1, 56 substations, 92 branches): © OpenStreetMap contributors, ODbL 1.0, built with PyPSA-Earth.
- Power plants (the 5,666 MW): Global Energy Monitor, Global Oil and Gas Plant Tracker (August 2025 release), Global Coal Plant Tracker (July 2025 release), Global Solar Power Tracker and Global Wind Power Tracker (February 2025 releases), CC BY 4.0. Three combined-cycle units: data obtained from GlobalEnergyObservatory.org, CC BY 3.0 US. Modified: units built after 2017 removed, used at nameplate.
- Demand (the 1,889 MW and every share of load): DemandCast, Antonini, E., V. P. Goli, K. Steijn (2026), Global Dataset of Forecasted Hourly Electricity Demand from 2000 to 2024 Using DemandCast, version 1.0.0, doi:10.5281/zenodo.18374352; Steijn, K., V. P. Goli, E. Antonini (2025), DemandCast: Global hourly electricity demand forecasting, arXiv:2510.08000. CC BY 4.0. The island series is split over the substations by PyPSA-Earth, so load per substation is modelled. The split over buses uses GADM 4.1 administrative units (gadm.org) as weights. GADM allows free academic and other non-commercial use; whether numbers weighted by its units count as redistribution is not settled, and GADM has not been asked.
- Storm track: IBTrACS, NHC best track (USA columns only), Knapp et al. (2010); Gahtan, J. et al. (2024), IBTrACS Project, Version 4r01, NOAA National Centers for Environmental Information, doi:10.25921/82ty-9e16.
- Night lights: NASA Black Marble VNP46A2, Collection 2, doi:10.5067/VIIRS/VNP46A2.002, CC0. Credit: NASA.
- Outage reports: U.S. Department of Energy, Office of Electricity, Hurricanes Nate, Maria, Irma, and Harvey Situation Reports (2017–2018), public domain. With thanks to the Department of Energy.
- Station gusts: Pasch, R. J., A. B. Penny and R. Berg, National Hurricane Center Tropical Cyclone Report: Hurricane Maria (AL152017), nhc.noaa.gov; used through LiveLines’ comparison, not shown. A National Weather Service product; the Weather Service states that its information is in the public domain unless specifically noted otherwise.
- Model and records: LiveLines kernel, commit 865bcc9, preset chain_maria_pr; the later analysis is the LiveLines record
pypsaearth_pr_maria_gap_analysis.
