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 full spaCy pipeline and models for scientific/biomedical documents.

This repository contains custom pipes and models related to using spaCy for scientific documents. In particular, there is a custom tokenizer that adds

AI2 1.3k Jan 03, 2023
Reformer, the efficient Transformer, in Pytorch

Reformer, the Efficient Transformer, in Pytorch This is a Pytorch implementation of Reformer https://openreview.net/pdf?id=rkgNKkHtvB It includes LSH

Phil Wang 1.8k Dec 30, 2022
The Internet Archive Research Assistant - Daily search Internet Archive for new items matching your keywords

The Internet Archive Research Assistant - Daily search Internet Archive for new items matching your keywords

Kay Savetz 60 Dec 25, 2022
Product-Review-Summarizer - Created a product review summarizer which clustered thousands of product reviews and summarized them into a maximum of 500 characters, saving precious time of customers and helping them make a wise buying decision.

Product-Review-Summarizer - Created a product review summarizer which clustered thousands of product reviews and summarized them into a maximum of 500 characters, saving precious time of customers an

Parv Bhatt 1 Jan 01, 2022
A Python module made to simplify the usage of Text To Speech and Speech Recognition.

Nav Module The solution for voice related stuff in Python Nav is a Python module which simplifies voice related stuff in Python. Just import the Modul

Snm Logic 1 Dec 20, 2021
This project uses word frequency and Term Frequency-Inverse Document Frequency to summarize a text.

Text Summarizer This project uses word frequency and Term Frequency-Inverse Document Frequency to summarize a text. Team Members This mini-project was

1 Nov 16, 2021
iBOT: Image BERT Pre-Training with Online Tokenizer

Image BERT Pre-Training with iBOT Official PyTorch implementation and pretrained models for paper iBOT: Image BERT Pre-Training with Online Tokenizer.

Bytedance Inc. 435 Jan 06, 2023
This converter will create the exact measure for your cappuccino recipe from the grandiose Rafaella Ballerini!

About CappuccinoJs This converter will create the exact measure for your cappuccino recipe from the grandiose Rafaella Ballerini! Este conversor criar

Arthur Ottoni Ribeiro 48 Nov 15, 2022
Materials (slides, code, assignments) for the NYU class I teach on NLP and ML Systems (Master of Engineering).

FREE_7773 Repo containing material for the NYU class (Master of Engineering) I teach on NLP, ML Sys etc. For context on what the class is trying to ac

Jacopo Tagliabue 90 Dec 19, 2022
The code for the Subformer, from the EMNLP 2021 Findings paper: "Subformer: Exploring Weight Sharing for Parameter Efficiency in Generative Transformers", by Machel Reid, Edison Marrese-Taylor, and Yutaka Matsuo

Subformer This repository contains the code for the Subformer. To help overcome this we propose the Subformer, allowing us to retain performance while

Machel Reid 10 Dec 27, 2022
CPC-big and k-means clustering for zero-resource speech processing

The CPC-big model and k-means checkpoints used in Analyzing Speaker Information in Self-Supervised Models to Improve Zero-Resource Speech Processing.

Benjamin van Niekerk 5 Nov 23, 2022
PyTorch implementation of Tacotron speech synthesis model.

tacotron_pytorch PyTorch implementation of Tacotron speech synthesis model. Inspired from keithito/tacotron. Currently not as much good speech quality

Ryuichi Yamamoto 279 Dec 09, 2022
多语言降噪预训练模型MBart的中文生成任务

mbart-chinese 基于mbart-large-cc25 的中文生成任务 Input source input: text + /s + lang_code target input: lang_code + text + /s Usage token_ids_mapping.jso

11 Sep 19, 2022
Implementation of the Hybrid Perception Block and Dual-Pruned Self-Attention block from the ITTR paper for Image to Image Translation using Transformers

ITTR - Pytorch Implementation of the Hybrid Perception Block (HPB) and Dual-Pruned Self-Attention (DPSA) block from the ITTR paper for Image to Image

Phil Wang 17 Dec 23, 2022
PyTorch Implementation of the paper Single Image Texture Translation for Data Augmentation

SITT The repo contains official PyTorch Implementation of the paper Single Image Texture Translation for Data Augmentation. Authors: Boyi Li Yin Cui T

Boyi Li 52 Jan 05, 2023
a test times augmentation toolkit based on paddle2.0.

Patta Image Test Time Augmentation with Paddle2.0! Input | # input batch of images / / /|\ \ \ # apply

AgentMaker 110 Dec 03, 2022
Syntax-aware Multi-spans Generation for Reading Comprehension (TASLP 2022)

SyntaxGen Syntax-aware Multi-spans Generation for Reading Comprehension (TASLP 2022) In this repo, we upload all the scripts for this work. Due to siz

Zhuosheng Zhang 3 Jun 13, 2022
Official PyTorch implementation of Time-aware Large Kernel (TaLK) Convolutions (ICML 2020)

Time-aware Large Kernel (TaLK) Convolutions (Lioutas et al., 2020) This repository contains the source code, pre-trained models, as well as instructio

Vasileios Lioutas 28 Dec 07, 2022
ConvBERT-Prod

ConvBERT 目录 0. 仓库结构 1. 简介 2. 数据集和复现精度 3. 准备数据与环境 3.1 准备环境 3.2 准备数据 3.3 准备模型 4. 开始使用 4.1 模型训练 4.2 模型评估 4.3 模型预测 5. 模型推理部署 5.1 基于Inference的推理 5.2 基于Serv

yujun 7 Apr 08, 2022
It analyze the sentiment of the user, whether it is postive or negative.

Sentiment-Analyzer-Tool It analyze the sentiment of the user, whether it is postive or negative. It uses streamlit library for creating this sentiment

Paras Patidar 18 Dec 17, 2022