The laws of physics can predict the movement of dust particles or the growth of cells. Can there be a universal law that predicts the growth of cities?

It seems impossible. When people decide to move from or to a city, it’s usually of their own free will. The rise and fall of urban populations is dependent on thousands, if not millions, of individual decisions that people make about their lives every day, and these are often related to longer-term policy decisions, economic climates, and political trends.

Cities have memory.

However, physicists in Spain have created what they believe to be a model for predicting how any given cities’ population will fall and rise, based on knowledge of the city’s past and current state, as well as data about population trends in neighboring cities.

“We found that cities have memory, in the demographic sense. We can measure the characteristic time of this memory. For the Spanish city, it’s 15 years,” quantum physicist Alberto Hernando de Castro, the lead author of a new study published in the Journal of the Royal Society Interface, tells Co.Exist.

While studying a historical dataset of Spanish cities dating back 100 years, he and his co-authors discovered two underlying rules. The first “law” was that cities have inertia: A city’s future growth depended heavily on its past—particularly the last 15 years of history. Looking back 30 years wouldn’t help improve a prediction, and 10 years was probably not enough. Secondly, they also found that cities can become “entangled” with each other: Nearby urban bodies, particularly those within 50 miles, played a big role in predicting a given city’s fate.

The physics in Barcelona should be the same as the physics in New York City.

The case of Barcelona was very typical of the trends Hernando, a researcher at Ecole Polytechnique Federale de Lausanne, found over the last 50 years as Spanish residents moved from small villages to big cities. He could model how cities close to Barcelona, even if they started small, grew in tandem with the urban hub and developed a full “multi-core metropolitan area.” “It can sound obvious to some people, but what we have learned is how to measure and quantify these phenomena. If we can analyze it quantitatively, it means that in a near future we can accurately simulate it, and predict the complex outcome that a migration of this kind can generate in the future,” he says.

The work began when Hernando, finishing his PhD in Barcelona at the time, started investigating intriguing patterns he noticed in Spain’s 2008 electoral results. He saw that when correlated to the population of a city, he could predict the electoral results for each party based on the same physical models he usually in his own work. Like dust floating in the air, each individual decision was like a randomly moving particle, but when millions of decisions were viewed as one, he got something like Newton’s laws of motion: a predictable equation about how a system should behave–about where the dust would settle.