World3 tutorial
Tutorial to use pydynamo with the World3 model.
Installation
To install the pydynamo module, execute:
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ pydynamo-abaucher
then you can import pydynamo ! This command installs the pydynamo module with pip, but from the test.pypi.org package index, and install other librairies from the standart pip index. For more precisions about how to install it in a virtual environment, and how to install jupyter, you can have a look at the README of the project.
First simulation
[2]:
from pydynamo import World3
w = World3(1) # Import the first scenario
w.run()
w.plot_world(title="World3 scenario 1: Business as usual")

[3]:
# Get an other scenario
w_s4 = World3(4)
w_s4.run()
w_s4.plot_world(title="World3 scenario 4: A lot of magic")

More informations
Looking at the documentation of each variable is really helpful ! For exemple, for the io
variable, see https://abaucher.gitlabpages.inria.fr/pydynamo/w3_variables/io.html
You can also use these functions:
[4]:
# Get definition about some variable
w.definition('icdr')
[4]:
'industrial capital depreciation'
[5]:
# Get the non linear formula of some variable
w.plot_non_linearity('dcph')

[6]:
# Specific plot
w.plot(['al', 'dcph'], rescale=True, title='Arable land and development cost per hectare in the first scenario')

[7]:
# Compare 2 simulations for specific variables
w.plot_compare(w_s4, ['al', 'dcph'], rescale=True, title='Comparison of Arable land and development cost per hectare in the first and fourth scenarios')

[8]:
# Show a graph of the variables influencing ai with 2 steps of depth, in a file named exemple.html
w.show_influence_graph(variables=['al'], depth = 2).show('al.html')
[8]:
Introduce changes
[9]:
w = World3()
w.nri = 2e12 # Twice more non-renewable ressources at initial
w.new_politic('amti', 2020, 0.1) # From 2020, amti goes down to 0.1
w.run()
w.plot_world(title= "Scenario bonus: more resources and less agricole toxicity from 2020")

More
More information about the TP is explained in french in the practical session, that you can install with the the README of the project.