PyWorld3 is a Python implementation of the World3 model

Overview

Logo

The World3 model revisited in Python

License: CeCILL 2.1


PyWorld3 is a Python implementation of the World3 model, as described in the book Dynamics of Growth in a Finite World. This version slightly differs from the previous one used in the world-known reference the Limits to Growth, because of different numerical parameters and a slightly different model structure.

The World3 model is based on an Ordinary Differential Equation solved by a Backward Euler method. Although it is described with 12 state variables, taking internal delay functions into account raises the problem to the 29th order. For the sake of clarity and model calibration purposes, the model is structured into 5 main sectors: Population, Capital, Agriculture, Persistent Pollution and Nonrenewable Resource.

Install and Hello World3

Install pyworld3 either via:

pip install pyworld3

or by cloning the repository, installing the requirements numpy, scipy and matplotlib and do:

python setup.py install

Run the provided example to simulate the standard run, known as the Business as usual scenario:

import pyworld3
pyworld3.hello_world3()

As shown below, the simulation output compares well with the original print. For a tangible understanding by the general audience, the usual chart plots the trajectories of the:

  • population (POP) from the Population sector,
  • nonrenewable resource fraction remaining (NRFR) from the Nonrenewable Resource sector,
  • food per capita (FPC) from the Agriculture sector,
  • industrial output per capita (IOPC) from the Capital sector,
  • index of persistent pollution (PPOLX) from the Persistent Pollution sector.

How to tune your own simulation

One simulation requires a script with the following steps:

from pyworld3 import World3

world3 = World3()                    # choose the time limits and step.
world3.init_world3_constants()       # choose the model constants.
world3.init_world3_variables()       # initialize all variables.
world3.set_world3_table_functions()  # get tables from a json file.
world3.set_world3_delay_functions()  # initialize delay functions.
world3.run_world3()

You should be able to tune your own simulations quite quickly as long as you want to modify:

  • time-related parameters during the instantiation,
  • constants with the init_world3_constants method,
  • nonlinear functions by editing your modified tables ./your_modified_tables.json based on the initial json file pyworld3/functions_table_world3.json and calling world3.set_world3_table_functions("./your_modified_tables.json").

Licence

The project is under the CeCILL 2.1 licence, a GPL-like licence compatible with international and French laws. See the terms for more details.

How to cite PyWorld3 with Bibtex

To cite the project in your paper via BibTex:

@softwareversion{vanwynsberghe:hal-03414394v1,
  TITLE = {{PyWorld3 - The World3 model revisited in Python}},
  AUTHOR = {Vanwynsberghe, Charles},
  URL = {https://hal.archives-ouvertes.fr/hal-03414394},
  YEAR = {2021},
  MONTH = Nov,
  SWHID = {swh:1:dir:9d4ad7aec99385fa4d5057dece7a989d8892d866;origin=https://hal.archives-ouvertes.fr/hal-03414394;visit=swh:1:snp:be7d9ffa2c1be6920d774d1f193e49ada725ea5e;anchor=swh:1:rev:da5e3732d9d832734232d88ea33af99ab8987d52;path=/},
  LICENSE = {CeCILL Free Software License Agreement v2.1},
  HAL_ID = {hal-03414394},
}

References and acknowledgment

  • Meadows, Dennis L., William W. Behrens, Donella H. Meadows, Roger F. Naill, Jørgen Randers, and Erich Zahn. Dynamics of Growth in a Finite World. Cambridge, MA: Wright-Allen Press, 1974.
  • Meadows, Donella H., Dennis L. Meadows, Jorgen Randers, and William W. Behrens. The Limits to Growth. New York 102, no. 1972 (1972): 27.
  • Markowich, P. Sensitivity Analysis of Tech 1-A Systems Dynamics Model for Technological Shift, (1979).
Comments
  • No output files using

    No output files using "example_world3_standard.py"

    Hello,

    I try your script. I can't find the "fig_world3_standard_x.pdf" files anywhere after using "example_world3_standard.py".

    I'm not confortable with Python, so may be I don't use the script properly.

    Regards.

    bug good first issue 
    opened by 012abcd 9
  • Missing requirement for cbr in Population

    Missing requirement for cbr in Population

        @requires(["cbr"], ["pop"])
        def _update_cbr(self, k, jk):
            """
            From step k requires: POP
            """
            self.cbr[k] = 1000 * self.b[jk] / self.pop[k]
    

    I believe the function _update_cbr in the Population class is missing the requirement for the birth rate

    opened by iancostalves 1
  • 29th order

    29th order

    Hi, I believe the 29th order in the README is a bit misleading.. The word order is used for the order of the differential equation, not the number of state variables. I believe the highest DE order of world3 is three.

    https://pure.tue.nl/ws/files/3428351/79372.pdf

    opened by burakbayramli 0
  • Improved usability with Bokeh

    Improved usability with Bokeh

    I'm not sure this is an upstream consideration or a sub-project so I wanted to raise it here.

    This model should lend itself quite well to a bokeh model (https://bokeh.org) allowing live adjustment of the input variables and the enabling and disabling of particular plots and other functionality. I may attempt to wrap something up if I get some time as I don't expect it to be too difficult.

    opened by klattimer 4
  • Additional time series data

    Additional time series data

    Immediately it becomes obvious that global temperature and sea levels should be plotted, but also population density, and energy consumption. This would suggest the possibility of tools to prepare and overlay any time-series data set.

    opened by klattimer 0
  • Adding a plot of the historic population

    Adding a plot of the historic population

    Hello, Thank you for making this python version of world3. I think it would be useful to add a option in order to plot the historic population next to the predicted population. Would you mind if I add an option to do so and prepare a pull request ? Best, A. below a draft (historic population in purple) draft :

    opened by alan-man 4
Releases(v1.1)
Owner
Charles Vanwynsberghe
Associate professor
Charles Vanwynsberghe
A number of methods in order to perform Natural Language Processing on live data derived from Twitter

A number of methods in order to perform Natural Language Processing on live data derived from Twitter

1 Nov 24, 2021
File-based TF-IDF: Calculates keywords in a document, using a word corpus.

File-based TF-IDF Calculates keywords in a document, using a word corpus. Why? Because I found myself with hundreds of plain text files, with no way t

Jakob Lindskog 1 Feb 11, 2022
Official code repository of the paper Linear Transformers Are Secretly Fast Weight Programmers.

Linear Transformers Are Secretly Fast Weight Programmers This repository contains the code accompanying the paper Linear Transformers Are Secretly Fas

Imanol Schlag 77 Dec 19, 2022
Voilà turns Jupyter notebooks into standalone web applications

Rendering of live Jupyter notebooks with interactive widgets. Introduction Voilà turns Jupyter notebooks into standalone web applications. Unlike the

Voilà Dashboards 4.5k Jan 03, 2023
100+ Chinese Word Vectors 上百种预训练中文词向量

Chinese Word Vectors 中文词向量 中文 This project provides 100+ Chinese Word Vectors (embeddings) trained with different representations (dense and sparse),

embedding 10.4k Jan 09, 2023
BERN2: an advanced neural biomedical namedentity recognition and normalization tool

BERN2 We present BERN2 (Advanced Biomedical Entity Recognition and Normalization), a tool that improves the previous neural network-based NER tool by

DMIS Laboratory - Korea University 99 Jan 06, 2023
My Implementation for the paper EDA: Easy Data Augmentation Techniques for Boosting Performance on Text Classification Tasks using Tensorflow

Easy Data Augmentation Implementation This repository contains my Implementation for the paper EDA: Easy Data Augmentation Techniques for Boosting Per

Aflah 9 Oct 31, 2022
A fast hierarchical dimensionality reduction algorithm.

h-NNE: Hierarchical Nearest Neighbor Embedding A fast hierarchical dimensionality reduction algorithm. h-NNE is a general purpose dimensionality reduc

Marios Koulakis 35 Dec 12, 2022
Extract city and country mentions from Text like GeoText without regex, but FlashText, a Aho-Corasick implementation.

flashgeotext ⚡ 🌍 Extract and count countries and cities (+their synonyms) from text, like GeoText on steroids using FlashText, a Aho-Corasick impleme

Ben 57 Dec 16, 2022
Finds snippets in iambic pentameter in English-language text and tries to combine them to a rhyming sonnet.

Sonnet finder Finds snippets in iambic pentameter in English-language text and tries to combine them to a rhyming sonnet. Usage This is a Python scrip

Marcel Bollmann 11 Sep 25, 2022
Saptak Bhoumik 14 May 24, 2022
Deep Learning for Natural Language Processing - Lectures 2021

This repository contains slides for the course "20-00-0947: Deep Learning for Natural Language Processing" (Technical University of Darmstadt, Summer term 2021).

0 Feb 21, 2022
🐍💯pySBD (Python Sentence Boundary Disambiguation) is a rule-based sentence boundary detection that works out-of-the-box.

pySBD: Python Sentence Boundary Disambiguation (SBD) pySBD - python Sentence Boundary Disambiguation (SBD) - is a rule-based sentence boundary detecti

Nipun Sadvilkar 549 Jan 06, 2023
MRC approach for Aspect-based Sentiment Analysis (ABSA)

B-MRC MRC approach for Aspect-based Sentiment Analysis (ABSA) Paper: Bidirectional Machine Reading Comprehension for Aspect Sentiment Triplet Extracti

Phuc Phan 1 Apr 05, 2022
Pipeline for fast building text classification TF-IDF + LogReg baselines.

Text Classification Baseline Pipeline for fast building text classification TF-IDF + LogReg baselines. Usage Instead of writing custom code for specif

Dani El-Ayyass 57 Dec 07, 2022
Generate a cool README/About me page for your Github Profile

Github Profile README/ About Me Generator 💯 This webapp lets you build a cool README for your profile. A few inputs + ~15 mins = Your Github Profile

Rahul Banerjee 179 Jan 07, 2023
nlabel is a library for generating, storing and retrieving tagging information and embedding vectors from various nlp libraries through a unified interface.

nlabel is a library for generating, storing and retrieving tagging information and embedding vectors from various nlp libraries through a unified interface.

Bernhard Liebl 2 Jun 10, 2022
nlpcommon is a python Open Source Toolkit for text classification.

nlpcommon nlpcommon, Python Text Tool. Guide Feature Install Usage Dataset Contact Cite Reference Feature nlpcommon is a python Open Source

xuming 3 May 29, 2022
WikiPron - a command-line tool and Python API for mining multilingual pronunciation data from Wiktionary

WikiPron WikiPron is a command-line tool and Python API for mining multilingual pronunciation data from Wiktionary, as well as a database of pronuncia

213 Jan 01, 2023
xFormers is a modular and field agnostic library to flexibly generate transformer architectures by interoperable and optimized building blocks.

Description xFormers is a modular and field agnostic library to flexibly generate transformer architectures by interoperable and optimized building bl

Facebook Research 2.3k Jan 08, 2023