Exploring the Limits to Growth with Python | World3, World2, PyWorld3 & PyWorld2 | Charles Vanwynsberghe | Towards Data Science

Because of its alarming forecast about the sustainable nature of the current World evolution, the Limits to Growth book written by Meadows et al became world-renowned when it came out in 1972. Yet, it faded from memory quite quickly, probably because it received lots of bad criticisms due to its conclusions, considered as too pessimistic and doomsday-oriented. Another understandable reason is that the core of all the scientific evidences rely on simulations of one unique model named World3, whereas this model is seriously complex at first sight. Actually, it takes a lot of time before one could get a reasonable grasp of the whole systemic approach defining World3: some extra effort is necessary beyond the reading of the book.
Still, the claims in the Limits to Growth show a resurgence of interest, especially because different tangible signals seriously question the sustainability of the world in which we live today. It may concern the Covid-19 pandemic and all its consequences on the economic and physical flows, climate trends, or the evolution of Anthropocene indicators, to mention a few. Today, even the European Environment Agency is formal, and admits that a path towards “Growth without economic growth” is necessary now — if not happening later on under physical and systemic constraints. Recurrent studies show that what we can gauge from the real World state desperately fit well with the variables of World3 scenarios leading to a situation of overshoot and collapse:
the zero policy scenario called Business as usual, or
assuming that economic growth remains a target, the scenario in which, an intensive technological development intends to counterbalance all undesired effects of the maintained growth.
Beyond these facts, it seems more important than ever that this complex model, defined under the framework of System Dynamics, should be more accessible and intelligible in sharper detail to anyone.
Due to the different existing versions & implementations of World3, the newcomer might get lost in choosing the right one to study.First, note that 4 different versions exist in terms of model parameters and structure. Each time that Meadows et al released a book, they re-calibrated the model so that it matched the real world state at that moment.Second, different software implementations can be found on the web. The well-known implementations of World3–03 — the last version to date from 2004 — work on software tools with a graphical user interface:
the official implementation on Stella — the CD was provided with the 2004 book Limits to Growth: The 30-year Update, but now seems to be out of stock;
unofficial implementations for Vensim and Modelica.
Note that the very first implementation, provided in the Dynamic of Growth in a Finite World technical book, was a source code in a language called DYNAMO. However, because of its strong specificity to System Dynamics and to the computer hardware used at that time, DYNAMO has not become a popular language and is now deprecated.
Despite the success of the model, there are surprisingly few source codes of World3 available in today’s mainstream scientific programming languages. I found these ones:
in Javascript, written by Brian Haynes;
this same Javascript code was wrapped in Python, but with specific features for Causal inference and Reinforcement Learning;
a Python version made by INRIA, based on a translation of the Vensim model by PySD.
The last option seems interesting for Research purposes, yet the source code is still quite dense to grasp. This is why I preferred an implementation of World3 from scratch, as I wanted something:
based on a straight translation of the original DYNAMO script given in the technical report Dynamics of Growth in a Finite World,able to run different configurable scenarios,in a widely used programming language,hopefully as clear and minimal as possible!
based on a straight translation of the original DYNAMO script given in the technical report Dynamics of Growth in a Finite World,
able to run different configurable scenarios,
in a widely used programming language,
hopefully as clear and minimal as possible!
I finally opted for a Python 3 code with minimal dependencies. It is not pure Python, since it calls functions from the Numpy & Scipy librairies to easily handle array operations and interpolation functions. The code is available on GitHub.
PyWorld3 can be installed via the command pip install pyworld3. Due to the different nature of the parameters and functions, the simulation setup is split into 5 parts. All default variables returns the Business as usual scenario:
from pyworld3 import World3world3 = World3()world3.init_world3_constants()world3.init_world3_variables()world3.set_world3_table_functions()world3.set_world3_delay_functions()world3.run_world3()
As shown below, the simulation output compares well with the original plot indicating Pollution, Population, Food, Industrial output and the remaining Nonrenewable Resources.
The simulation can be configured by specifying inputs of the setup functions. For example, one of the first conclusions from the Limits to Growth states that doubling the initial Nonrenewable Resource stock only leads to a worse pollution crisis. It is illustrated in the books as the second analyzed scenario, and the simulation can be obtained by simply changing the second line to double the Nonrenewable Resource Initial constant nri:
world3.init_world3_constants(nri=2e12)  # default is 1e12
By gradually increasing nri, the Pollution quickly overshoots, and the decline rate of the Population becomes more and more important than its preceding growth rate. Ugo Bardi called this kind of trajectory the Seneca effect, as a nod to Seneca’s famous quote: “Fortune is of sluggish growth, but ruin is rapid”. Note that the Seneca effect also appears on the evolution of food and industrial output stocks.
On the basis of PyWorld3, all the remaining scenarios should be feasible. This could be an interesting project in an educational perspective. For a softer learning curve in System Dynamics, I suggest to start with PyWorld2, my previous project on the Python implementation of Forrester’s World2 model. As shown below, the computed variables reveal a similar overshoot and collapse evolution, although World2 is significantly less complex than its successor. For more details about the History of World2, see the excellent A. Mignan’s blog post.
When I decided to write PyWorld3 — and PyWorld2 — I wanted a code devoid of unnecessary complications, for educational or research purposes. It may meet your needs, but it should depend on what you really need to do.
If you have Machine Learning or statistical analysis in mind, starting from a source code implementation seems to be a good option because you may need efficient function calls, and avoid the cumbersome task of wrapping a third-party software.However, if you want to design your own model from scratch, I would definitely not recommend to start you project by coding with a text editor, unless you enjoy headaches... Coding a System Dynamics model in a sequential programming paradigm can become a hassle, because of all the interdependent model equations. Rather, any software with a graphical unit interface really helps to pay attention to the design of your model.
If you need to have it both ways, designing with Vensim for the ease of use, followed by an automated port to Python with PySD to keep efficiency, seems to be the most straightforward solution on paper.
Meadows, Donella H., et al. The Limits to Growth, 1972.
Meadows, Dennis L., et al. Dynamics of Growth in a Finite World, 1974.
Bardi, Ugo. The Seneca Effect, 2017.
Hayes, Brian. Computation and human condition (video + slides), 2012.
Mignan, Arnaud. World2 model, from DYNAMO to R, 2020.