Git Product home page Git Product logo

pyworld2's Introduction

Logo

A Python implementation of the World2 model

DOI License: MIT


PyWorld2 is a Python implementation of the World2 model, designed by Jay W. Forrester to predict trajectories of growth-focused Humankind in a world bounded by its physical limits. The model structure is thouroughly described in the book World Dynamics. Although World3 later became the reference, World2 is much less complex than its successor: it helps to get a good understanding of how the world could be modeled by a System Dynamics approach. World2 is a nonlinear 5-th order differential equation model with the following state variables:

  • human population P,
  • nonreplaceable natural resources NR,
  • pollution POL,
  • capital investement CI,
  • and the fraction of capital devoted to agriculture CIAF.

Quick install

The easiest way to install pyworld2 is via pip:

pip install pyworld2

It will automatically install the requirements numpy, scipy and matplotlib. Otherwise you can clone the repository and do:

python setup.py install

Hello World2

Run the provided example:

import pyworld2
pyworld2.hello_world2()

It simulates the 2 scenarios described in the Forrester's book:

  • the standard run, or Business as Usual
  • an hypothetical scenario where the usage rate of Natural Resources is reduced by 75% in 1970.

Below is a comparaison with the original figures. They plot the population P, pollution rate POLR, capital investment CI, quality of life QL and natural resources NR.

Standard run - Business as usual Reduced usage of Natural Resources

How to go further

If you want to run your own simulations with different policies, you need to:

  • copy-paste the configuration file ./pyworld2/functions_switch_default.json into your current directory
  • modify it at your convenience. Each policy is defined by its due date and its due variable (NAME switches to NAME1 at the year trigger.value).
  • Finally, run the following lines of code:
from pyworld2 import World2

w2 = World2()
w2.set_state_variables()
w2.set_initial_state()
w2.set_table_functions()
w2.set_switch_functions("./functions_switch_modified.json")
w2.run()

pyworld2.utils.plot_world_state(w2)

How to cite the project with Bibtex

The project is under the MIT Licence & open-source, see the licence terms for more details.

To cite PyWorld2 via BibTex:

@software{vanwynsberghe2020pyworld2,
  author       = {Charles Vanwynsberghe},
  title        = {{PyWorld2 - a Python implementation of the World2 
                   model.}},
  month        = nov,
  year         = 2020,
  publisher    = {Zenodo},
  version      = {v1.1},
  doi          = {10.5281/zenodo.4274586},
  url          = {https://doi.org/10.5281/zenodo.4274586}
}

References and acknowledgment

PyWorld2 is forked from the Rworld2 Software held by Arnaud Mignan.

pyworld2's People

Contributors

cvanwynsberghe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.