College of Civil Aviation, Nanjing University of Aeronautics and Astronautics, Nanjing 210016, China.
* Corresponding Author
International Journal of Science and Research Archive, 2026, 20(02), 685–689
Article DOI: 10.30574/ijsra.2026.20.2.1677
Received on 18 July 2026; revised on 25 August 2026; accepted on 27 August 2026
This study presents a reproducible implementation of a doubly constrained gravity model for origin-destination trip distribution. The formulation preserves prescribed trip productions and attractions while representing the effect of generalized travel cost through an exponential deterrence function. A four-zone numerical case is implemented in Python 3.12.7 using iterative balancing of origin and destination factors. For the baseline case, with β = 0.10, the model converges in 16 balancing cycles to a maximum marginal relative error below 10^-10, producing an OD matrix whose row and column totals match the target trip ends simultaneously. A sensitivity analysis for β values from 0.05 to 0.20 shows that stronger cost sensitivity reduces the flow-weighted mean travel cost from 10.25 to 6.79 cost units and increases the intrazonal share from 37.54% to 61.82%. The results demonstrate the practical importance of explicit convergence checks and parameter calibration in gravity-based demand modelling. The paper provides a compact computational framework suitable for model verification, teaching, and as a transparent baseline for larger empirical transport-planning applications.
Gravity Model, Origin-Destination Matrix, Trip Distribution, Furness Balancing, Deterrence Function, Python
Preview Article PDF
Lima N Fernandes Bonfim Marcal. DOUBLY CONSTRAINED GRAVITY MODEL FOR ORIGIN-DESTINATION TRIP DISTRIBUTION: A PYTHON-BASED FOUR-ZONE CASE STUDY. International Journal of Science and Research Archive, 2026, 20(02), 685–689. Article DOI: https://doi.org/10.30574/ijsra.2026.20.2.1677.






