  The gravity model, inspired by Newton's law of universal gravitation, has
long served as a primary tool for interpreting trade flows between countries,
using a country's economic `mass' as a key determinant. Despite its wide
application, the definition of `mass' within this model remains ambiguous. It
is often approximated using indicators like GDP, which may not accurately
reflect a country's true trade potential. Here, we introduce a data-driven,
self-consistent numerical approach that redefines `mass' from a static proxy to
a dynamic attribute inferred directly from flow data. We infer mass
distribution and interaction nature through our method, mirroring Newton's
approach to understanding gravity. Our methodology accurately identifies
predefined embeddings and reconstructs system attributes when applied to
synthetic flow data, demonstrating its strong predictive power and
adaptability. Further application to real-world trade networks yields critical
insights, revealing the spatial spectrum of trade flows and the economic mass
of countries, two key features unexplored in depth by existing models. Our
methodology not only enables accurate reconstruction of the original flow but
also allows for a deep understanding of the unique capabilities of each node
within the network. This study marks a significant shift in the understanding
and application of the gravity model, providing a more comprehensive tool for
analyzing complex systems and uncovering new insights into various fields,
including global trade, traffic engineering, epidemic disease prevention, and
infrastructure design.
