Every time a storm such as Hurricane Maria heads toward land, authorities have to decide how to protect people from harm.
Much of the time, that will mean some people have to evacuate from an area.
These evacuations are coordinated using a kind of scientific research called "evacuation modeling," a somewhat obscure field that plays a significant role in how cities and other entities prepare for natural disasters.
"Evacuation modeling involves trying to determine how many cars, how many people, are trying to leave a location and go to another location, and then try to figure out how they are going to get there," said Pamela Murray-Tuite, an associate professor of civil engineering at Clemson University, in an interview with CNBC.
Teams of researchers run countless simulations on computers, in the hopes of finding the smoothest path out of danger.
The simulations they run rely on several different kinds of information, such as survey data, maps, and data from transportation departments. Traffic engineers put all the data into a traffic congestion model and try to figure out how long an evacuation is going to take.
Sometimes, the unusual characteristics of an area add extra layers of difficulty.
For example, planners needed to design a way to empty all of the Florida Keys in 24 hours, said Brian Wolshon, a professor of civil engineering at Louisiana State University, who helped design the evacuation plan for the region. The historical pattern shows hurricanes take a single day to escalate from Category 4 on the Saffir-Simpson scale to Category 5, the most severe in terms of damage from wind speeds.
Major hurricanes in 2017 have generally intensified rapidly. Harvey, Irma, Jose, and Maria all climbed at least one category within 24 hours, as The Washington Post noted. Maria went all the way from Category 1 to Category 5 in that time.
Only one road, the Overseas Highway, connects the Florida Keys to each other and the mainland. With Hurricane Irma looming, the Keys had to be evacuated.
Planners will often open all lanes on a road or highway to outbound traffic to ease congestion. "But you couldn't do that" with the Overseas Highway, Wolshon said. "Emergency managers were worried if something happened, like someone had a heart attack, responders wouldn't be able to get in."
Planners then settled on a few other solutions, such as opening up shoulders on the side of the highway.
Unconnected islands pose an even bigger challenge. Shelters are typically built for residents, and visitors or tourists are often taken off the island, if possible, said Karl Kim, executive director of the National Disaster Preparedness Training Center at the University of Hawaii.
"Last year I was on Ternate in Indonesia when Gamalama volcano erupted," Kim told CNBC. The airports were closed, so Kim had to take a 15-hour boat ride to the Indonesian city of Manado, where he then boarded a plane for Jakarta.
"The importance of early warning systems and early evacuation, like I experienced last week in Charleston with Irma's remnants, is key," he said. Many people tend to wait until the last minute to evacuate, which decreases the chances of success, he added.
But a variety of improvements in the field is giving researchers an ever clearer picture of the situations most likely to occur, and what to do about them. Computing power has improved in recent years, and collaborations with social scientists have produced better data collection, Murray-Tuite said.
"We can account for different characteristics like the number of people in a household, the number of pets in a household," she said.
The models are also more granular. They can model individual cars on the road, and capture variables such as lane-changing behavior. If there is a left-turn lane on a road, for example, they can model how cars blocking the intersection will affect congestion.
"Our transportation systems are not designed or planned to handle these situations," Wolshon said. "So what we try to do is plan what is the best thing to do given the infrastructure that is out there."
There is still more to learn. One of the projects Murray-Tuite and her colleagues are working on is studying how uncertainty affects decisions at various levels, from emergency management agencies to households, and how households resolve internal conflicts over evacuating.
It is important that people take evacuation warnings seriously, Wolshon said.
"Listen to local government," he said. "When they say you need to evacuate or you don't need to evacuate, listen. These decisions are not made lightly. You have to be well-informed and plan these things in advance."