Simulation
Natural disaster simulation
A hurricane hits the coast of Mexico and a model decides what to move, when and where. Ensemble forecast, wind field, expected damage and a log that explains every decision, with the math step by step.
Mexico has coastline on two oceans, and every hurricane season forces the same decisions with little time and a lot of uncertainty: whom to warn, what to move before landfall, where to wait and whom to help first once the wind finally drops. The difference between a response that arrives in hours and one that arrives in days is rarely about having more resources. It is about moving them earlier and in the right order.
I built this experiment as a miniature situation room. A synthetic hurricane approaches the coast, a forecast ensemble computes the probability of impact for each place, and a planner decides what ships, helicopters, medical teams and supply convoys do. Every decision goes into a log with its reason, and further down I explain each model with its formulas and a worked example.
How to use it
- Pick a scenario. There are four, inspired by real hurricanes, and one you can draw yourself.
- Switch the strategy. Anticipatory moves units closer before landfall; reactive waits for the storm to pass. The panel below compares both with the same storm.
- Click a place to see its wind, surge, rain, damage, priority and when it received care.
- Open “Why?” on any log entry to read the reason behind each move.
SIM-02 · Hurricane and response simulator · Gersaín Barrón Velázquez
Stages units outside the impact zone with every forecast and dispatches them to arrive just as the operating window opens.
Sustained wind (knots)
- 34
- 50
- 64 · H1
- 83 · H2
- 96 · H3
- 113 · H4
- 137 · H5
- Place · color = damage
- hit
- already reached
- +hospital (crossed: out of service)
- △port with units
- ship
- Hhelicopter
- +medical team
- supply convoy
Click a place to see its details. Hover over a unit to see what it is and where it is going. Routes are drawn as straight lines; travel time does include the detour of roads and coastlines.
What you are looking at
- The color over the sea is the sustained wind computed at each point: from green (storm) to magenta (category 5). The light dotted circle marks the radius of storm-force winds (34 knots); the yellow one, hurricane-force winds (64 knots).
- The faint lines before landfall are the 40 ensemble tracks. The dashed line is their average. The yellow ring around a place is its probability of hurricane-force winds.
- The moving icons are the units. A solid line is the distance already covered; the dashed line, what is left. A gray crossed icon is a unit caught inside the hurricane and out of service.
- Places change color with damage once the hurricane has passed over them. A blue ring means they have been reached. Squares are cities; small dots are coastal communities.
The operation plan
Before the models, the plan. A hurricane is not handled with one action but with many in parallel, and each has its moment. What matters most is what happens before landfall: whatever was not moved in time cannot be moved once the wind exceeds operating limits.
- 1
Each new forecast narrows the uncertainty in track and intensity. The plan is not set once: it is reviewed with every release. In the simulator forecasts are issued at T−48, T−24 and T−12, and staged units can change their staging point.
- 2
After landfall, decisions are no longer made with probabilities but with what is observed: field reports, satellite imagery and drones. In the simulator, each place’s “actual” damage replaces the forecast’s expected damage.
- 3
A 48-hour notice gives people time to buy water, protect their homes and know where to go. Warning too early with little certainty breeds fatigue, and people ignore the next one.
- 4
Evacuation is by flood zone and housing type, not by whole city. Storm surge and flooding usually kill more people than wind, and precarious housing is the first to fail.
- 5
Shelters need water, toilets, food and basic medical care. A population gathered in shelters is easier to care for, but also easier to infect: diarrhea and respiratory infections.
- 6
Before sailing, ships load supplies, water, purification plants and medical equipment. A ship that leaves empty comes back with nothing to give.
- 7
A ship moored in a port that gets hit can sink or be trapped. At sea, away from the dangerous quadrant, or in an alternate port, it keeps its full capacity. In the simulator both strategies do this, because it is safety, not response.
- 8
They are slow (about 28 km/h) but carry thousands of rations, produce water and may have an operating room. They do not depend on roads or airports, which are often the first to fail. That is why the model sends them to coastal cities with many people.
- 9
A helicopter on the ground inside the hurricane can be lost. They move inland to an airfield outside the radius of storm-force winds.
- 10
They do not fly in sustained winds above about 35 knots or in heavy rain with poor visibility. That is the reason for the “operating window”: there are hours when nobody can get in, however great the need.
- 11
They are fast (about 210 km/h) but carry little. They pay off most where nothing else can get through: small, isolated communities with no hospital or with cut roads. They also fly critical patients to a working hospital.
- 12
Before landfall they move to a safe point: where the chance of storm-force winds is under 15% but close enough to arrive within hours. It is the difference between care in hours or in days. Careful: if the point ends up inside the hurricane, the unit is lost.
- 13
They wait at the safe point until the worst has passed. Leaving early puts staff at risk; leaving late wastes the advantage of having moved closer.
- 14
First comes triage and injuries (wounds, fractures, burns), then chronic patients who lost their treatment: diabetes, hypertension, dialysis, pregnancies and mental health. From day 2, outbreaks are watched: contaminated water, diarrhea, dengue from standing water and tetanus in wounds.
- 15
At collection centers far from the impact zone, food packs, water, blankets and hygiene kits are assembled.
- 16
They wait for roads to be checked: fallen bridges, landslides and trees block the way. In the model, travel time already adds a 45% detour over the straight line.
- 17
They carry the largest volume of aid but are the slowest to arrive. They enter by the roads as they clear, first to the largest cities and then to the communities.
- 18
Before landfall, stable patients are discharged, generators, water and supplies for at least 72 hours are checked, and critical equipment is protected.
- 19
If the hospital is still standing, it works in emergency mode: more urgent care, less scheduled surgery. The model estimates the chance it loses function with a fragility curve (wind and flooding).
- 20
If the hospital goes down, its patients are referred to the nearest working hospital and a field hospital is set up. In the model this raises the “isolation” of the communities that relied on it, and with it their priority.
© Gersaín Barrón Velázquez · gersadesign.com
The model chain
The simulator chains eight steps. None is complicated on its own; the value lies in connecting them, because each feeds the next and a decision is only as good as the weakest link.
01Forecastpredictive
Monte Carlo ensemble, 40 tracks
In: position, intensity and typical error by lead time
Out: probability of winds ≥ 34 and ≥ 64 knots per place
02Hazardphysical
Holland (1980) + asymmetry · Kaplan and DeMaria (1995) · parametric surge and rain
In: hour-by-hour track
Out: peak wind, surge and rain at each place
03Exposuredata
Spatial overlay
In: population, hospitals and ports
Out: who and what is in the way
04Vulnerabilityprobabilistic
Lognormal fragility curves
In: wind, surge, rain and housing type
Out: expected damage and failing hospitals
05Needcalculation
Population × damage
In: damage per place
Out: people who need help
06Prioritydecision
risk × √need × vulnerability × isolation
In: everything above
Out: order of care
07Assignmentoptimization
Constrained greedy heuristic
In: units, speeds, wind limits and range
Out: which unit goes where and when
08Evaluationlearning
Indicators and strategy comparison
In: the full run
Out: hours to first care, coverage and units lost
© Gersaín Barrón Velázquez · gersadesign.com
1. The predictive model: ensemble forecast
A forecast is not a line, it is a cloud of possibilities. That is why planning is not done with “the hurricane will pass here”, but with “there is a 60% chance this place gets hurricane-force winds”. The ensemble turns uncertainty into a number you can decide with.
Step 1: error grows with lead time. The farther away landfall is, the more the forecast can be wrong. The simulator uses a typical error that grows linearly with hours:
The second factor just makes the error almost zero at the current position, which is already known, and brings it close to 1 within a few hours.
Step 2: each member drifts a little. Each of the tracks is shifted across () and along () the central track:
where each is a standard normal random number. The key is that is the same for all 40 members: it represents the error all models share on a given day. Without it the ensemble would be overconfident, because independent errors cancel out when averaged and real errors do not. Since , the total cross-track spread is still .
Step 3: from tracks to probability. For each place , the model computes the peak wind it would get under each member and counts how many exceed 64 knots:
is 1 when the condition holds and 0 otherwise. It is literally “the share of possible futures in which this place gets hurricane-force winds”.
Move the lead time and watch the fan open or close. At 72 hours the three towns have similar probabilities and there is no way to know which one will be hit. At 12 hours one stands out.
© Gersaín Barrón Velázquez · gersadesign.com
Step 4: intensity is forecast too, and it can be wrong. Each member has its own intensity:
is the intensity when the forecast is issued, the intensity it will actually have, and how much of the change the forecast manages to see:
With the forecast sees the whole change. In the Guerrero scenario I use : at 48 hours it sees only half.
2. The wind field
To know how much wind each point gets I use the Holland (1980) profile, one of the most widely used parametric models in risk engineering:
- is the maximum sustained wind.
- is the radius of maximum winds, the eyewall.
- controls how fast the wind falls away from the center. Here it grows with intensity, because intense hurricanes are more compact: , clamped between 1.4 and 2.4.
How to read the formula. Let . There are three zones:
- At the eyewall (): , so . The maximum is right there.
- Inside the eye (): is large and becomes tiny. The wind drops to almost zero: that is why the eye is calm.
- Far from the center (): is small, and you get . Wind decays as a power of distance: with , twice as far means half the wind.
Asymmetry. Besides spinning, the hurricane moves. In the northern hemisphere it spins counterclockwise, so on the right side of its motion the forward speed adds to the rotation and on the left side it subtracts:
is the angle measured from the right of the motion, so on the right and on the left. is the Holland profile computed with , so the right-side maximum is still exactly . Over land, wind is multiplied by 0.85 because of terrain roughness.
© Gersaín Barrón Velázquez · gersadesign.com
3. What happens at landfall
Without the warm sea that feeds it, the hurricane weakens. Kaplan and DeMaria (1995) described that decay with an exponential curve still in operational use at NOAA:
How to read the formula.
- : as soon as it crosses the coast it loses 10% at once from friction with the land.
- is the floor: wind tends to 26.7 kt, not zero, because the system keeps spinning as a low.
- What decays exponentially is the excess above the floor, . That excess halves every hours.
When the window opens. Solving for gives how many hours it takes for wind to drop below any threshold :
This curve defines the operating window: the moment wind falls below 34 knots and helicopters and teams can go in without risking their crews.
© Gersaín Barrón Velázquez · gersadesign.com
If the center returns to sea, the simulator lets it recover toward its potential at up to 6 kt per hour.
4. Storm surge and rain
Wind is not the only thing that causes damage. Two approximations complete the hazard.
Storm surge. Wind pushes the sea toward the coast. The force of wind on water grows with the square of its speed, , and so does the surge:
stands for the continental shelf: in the Gulf and the Caribbean it is wide and shallow, and water piles up more than in the Pacific, where the seafloor drops quickly. The result is capped at 7 m.
Rain. Each hour, rain is added according to distance from the center and intensity:
A 120-kt hurricane drops 13.2 mm/h near the eye and 4.9 mm/h at 190 km. Time is what decides it: total rain is proportional to how many hours the hurricane spends nearby, that is, inversely proportional to its forward speed. A hurricane moving at half the speed leaves twice the water even with the same wind.
5. From wind to damage: fragility curves
The same wind does not damage a tin-roof house and a concrete building equally. Fragility curves express that difference as a probability:
Where it comes from. Each building withstands up to a certain wind, its capacity . Not all houses of the same type hold up equally, and that variation is modeled with a lognormal distribution: is normal with mean and standard deviation . The house is damaged if the wind exceeds its capacity, so:
is the cumulative normal distribution. is the median: at , and . measures the spread: with a small the curve is almost a step; with a large , a gentle ramp.
| Curve | Median | Spread |
|---|---|---|
| Precarious housing (wind) | 38 m/s | 0.35 |
| Hospital, loss of function (wind) | 48 m/s | 0.35 |
| Confined masonry (wind) | 62 m/s | 0.30 |
| Flooding from surge | 2.0 m | 0.45 |
| Flooding and landslides from rain | 350 mm | 0.50 |
An important detail for health: a hospital does not have to collapse to stop working. Losing windows, power or water is enough. That is why its curve has a lower median than masonry.
© Gersaín Barrón Velázquez · gersadesign.com
Combining hazards. For a place where a share of housing is precarious:
Why “one minus the product”? is the probability that wind does not cause damage, and the same for surge and rain. If the three mechanisms are independent, the probability of escaping all three is the product, and is the probability that at least one causes damage. Adding them would be wrong: three hazards at 50% would sum to 150%. Surge only counts for coastal places.
Hospitals use the same logic, . If the result exceeds 50%, the hospital is considered out of service.
6. Whom to help first
With the estimated damage, each place gets a priority score:
- , risk: probability of impact before the hurricane; 1 once damage is confirmed.
- , affected: population times damage. The square root is deliberate (see the example).
- , vulnerability: share of precarious housing or social fragility.
- , isolation: , where is the distance in km to the nearest working hospital. If the region’s hospital goes down, every community that relied on it moves up in priority.
The weights. In the table below each factor is raised to a weight :
Taking logarithms gives a weighted sum, and each weight reads as an elasticity: if a factor rises 10%, the score rises roughly . With the factor stops mattering; with it matters twice as much.
Move the weights and watch the order change. There are no “correct” weights: it is a public policy decision that the model makes explicit and open to debate.
| # | Place | Risk | Affected | Vuln. | Isol. | Score |
|---|
▲▼ change in rank versus equal weights · the dot marks synthetic communities
© Gersaín Barrón Velázquez · gersadesign.com
7. Which unit goes where
Every hour, the planner reviews free units and assigns each the destination with the highest value:
- is travel time in hours: straight-line distance times a detour factor (1.05 for helicopters, 1.25 for ships and 1.45 by road), divided by speed .
- The denominator penalizes distance: 8 hours of travel halve the value, 24 hours cut it to a quarter.
- adjusts by unit type: 1.6 for helicopters going to communities without a hospital and 1.3 for ships going to cities of more than 100,000 people.
| Unit | Speed | Operates with wind below | Capacity per deployment | Most useful for |
|---|---|---|---|---|
| Ship | 28 km/h | 34 kt | 4,000 people | large coastal cities, no roads needed |
| Helicopter | 210 km/h | 35 kt | 250 people | small, isolated communities; 700 km range |
| Medical team | 45 km/h | 34 kt | 900 people | medical care by road |
| Supply convoy | 38 km/h | 34 kt | 2,500 people | large volumes by road |
The operating window as a constraint. Let be the first hour after the peak when wind at place drops below 34 kt. Both strategies use exactly the same rules; only when a unit may leave changes:
The reactive strategy leaves once the window is open; the anticipatory one leaves earlier, timing it to arrive just as it opens. In addition, with each forecast the anticipatory strategy moves up to 12 units to a staging point where .
Other rules: ground units do not cross the Gulf of California or reach islands, ships do not switch oceans, and a unit caught in hurricane-force winds goes out of service.
It is a greedy heuristic: fast, transparent and easy to explain in a crisis room, but it does not guarantee the optimum. The rigorous version of this problem is a vehicle routing problem with time windows, solved with integer programming.
8. How to tell whether the plan works
Three indicators summarize each run.
Average hours to first care, weighted by affected people so a large city weighs more than a small community:
A place that never receives care is assigned 96 hours, so leaving someone out makes the indicator worse instead of dropping out of the average.
Coverage at 24 and 72 hours: people reached by or divided by total affected.
Units lost: those caught in hurricane-force winds.
What the simulator shows
With the same data and the same storm, the anticipatory strategy arrives sooner in all four scenarios and never loses more units than the reactive one. In Guerrero and Baja California Sur the reactive strategy loses the teams that stayed at the bases that were hit; in Quintana Roo both lose the Isla Mujeres units, which have no road out of the island. The largest differences show up where logistics are hard: in Quintana Roo the slow hurricane keeps the window closed for hours, and units waiting nearby use it as soon as it opens; in Baja California Sur the peninsula can only be reached by air and sea, and no ground staging makes up for that geography.
The other finding is about scale. In the scenarios that hit large cities, not even the best strategy reaches every affected person within 72 hours with the units available. The model does not hide it: it shows how much capacity is missing and where.
Limits, stated plainly
- Illustrative data. Population is approximate (INEGI’s 2020 Census, rounded and processed by me; not an official INEGI figure). Vulnerability, hospitals, beds and response units are made-up values for the exercise. Communities labeled “C-01, C-02…” are synthetic.
- Synthetic scenarios. The tracks are inspired by real hurricanes but are not their official tracks.
- Straight-line routes. Travel time adds a fixed detour, but it does not use the real road network or know which bridges fell.
- Simplified physics. No terrain, no hydrodynamic surge model and no orographic rain. The surge, rain and fragility coefficients are order-of-magnitude values, not calibrated for Mexico.
- Not a warning tool. During a real hurricane, official information comes from Mexico’s National Meteorological Service and Civil Protection.
How it would grow with real data
This is the first experiment that truly calls for the lab’s pipeline. With it, the next step would be replacing every illustrative value with an open source:
- Real health facilities from the CLUES catalog, with their level of care and location.
- Real places from INEGI’s ITER, with population by locality instead of by municipality.
- Real vulnerability from CONAPO’s marginalization index.
- Real routes over the National Road Network, with times by road type.
- Real forecasts read at each release during the season, to run the planner live.
- Optimal assignment with integer programming, to measure how far the heuristic is from the best possible plan.
All with Apache Airflow downloading and cleaning the sources, and the site reading only the result.