diff --git a/LimitsToGrowth.ipynb b/LimitsToGrowth.ipynb index 489692723a032b6e2ea21c299778c5b943818173..75028fdcf95fec21a3ab684785f17961997e509e 100644 --- a/LimitsToGrowth.ipynb +++ b/LimitsToGrowth.ipynb @@ -13,35 +13,6 @@ "metadata": { "tags": [] }, - "outputs": [], - "source": [ - "import json\n", - "import pydynamo as dno\n", - "from world3.plot_utils import plot_world_with_scales\n", - "definitions = json.load(open('world3/variable_definitions.json'))" - ] - }, - { - "cell_type": "code", - "execution_count": 2, - "metadata": { - "tags": [] - }, - "outputs": [], - "source": [ - "# Convert DYNAMO to pdynamo\n", - "dno.dynamo_converter.convert_dynamo_file(\n", - " 'world3/world3_DYNAMO_code.py',\n", - " 'world3/world3_pydynamo_code.py')\n", - "from world3.colors import var_colors # Get colors from pydynamo file" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": { - "tags": [] - }, "outputs": [ { "data": { @@ -55,33 +26,32 @@ } ], "source": [ - "# Get System object, add comments, run and plot\n", - "s = dno.parse_system.system_from_file('world3/world3_pydynamo_code.py')\n", - "s.add_comments(definitions)\n", + "from world3 import s, plot_world_with_scales, var_color\n", + "import pydynamo as dno\n", "s.run(N=300, dt=1)\n", "plot_world_with_scales(s, title='World3 standart model')" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Show the graph of direct relations (interactive with pyvis)\n", - "dno.plot_system.show_pyvis(s, notebook=False, options=[], quotient=True, colors=var_colors).show('world3.html')" + "dno.plot_system.show_pyvis(s, notebook=False, options=[], quotient=True, colors=var_color).show('world3.html')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ - "" + "" ] }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -104,7 +74,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -113,7 +83,7 @@ "'industrial capital depreciation rate [dollars/year].'" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -139,7 +109,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -173,7 +143,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -191,7 +161,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 8, "metadata": {}, "outputs": [ { diff --git a/TP.ipynb b/TP.ipynb index 915dd5607d25484839fc12ae565fe07850b320cf..2334b56883eac71f7f4b1cc7f75fc42509a26349 100644 --- a/TP.ipynb +++ b/TP.ipynb @@ -9,26 +9,17 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 1, "metadata": {}, "outputs": [], "source": [ - "# Prepare & import\n", - "import pydynamo as dno\n", - "import matplotlib.pyplot as plt\n", - "from world3.colors import var_colors\n", - "from world3.plot_utils import plot_world_with_scales\n", - "import json\n", - "filename = \"world3/limits_to_growth_pydynamo_code.py\"\n", - "dno.dynamo_converter.convert_dynamo_file(\"world3/limits_to_growth_DYNAMO_code.py\", filename)\n", - "definitions = json.load(open('world3/variable_definitions.json'))\n", - "s = dno.parse_system.system_from_file(filename)\n", - "s.add_comments(definitions)" + "from world3 import s, plot_world_with_scales, var_color\n", + "import pydynamo as dno" ] }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 2, "metadata": {}, "outputs": [ { @@ -50,7 +41,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 3, "metadata": {}, "outputs": [ { @@ -67,22 +58,22 @@ " " ], "text/plain": [ - "<IPython.lib.display.IFrame at 0x7f6d6d96cbe0>" + "<IPython.lib.display.IFrame at 0x7f93a7d15760>" ] }, - "execution_count": 15, + "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Plot graph variables\n", - "dno.plot_system.show_pyvis(s, notebook=True, colors=var_colors).show('world3.html')" + "dno.plot_system.show_pyvis(s, notebook=True, colors=var_color).show('world3.html')" ] }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 4, "metadata": {}, "outputs": [ { @@ -91,7 +82,7 @@ "'industrial capital depreciation rate [dollars/year].'" ] }, - "execution_count": 13, + "execution_count": 4, "metadata": {}, "output_type": "execute_result" } @@ -103,7 +94,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -128,9 +119,9 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "dnovenv", "language": "python", - "name": "python3" + "name": "dnovenv" }, "language_info": { "codemirror_mode": { diff --git a/world3/__init__.py b/world3/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..67f274f45ba4731be0b143f6093f3b27a9f9b171 --- /dev/null +++ b/world3/__init__.py @@ -0,0 +1,21 @@ +__version__ = "0.1" + +import pydynamo as dno +from world3.plot_utils import plot_world_with_scales +from world3.infos import get_sectors, get_definitions +from world3.infos.get_sectors import sector_color + +code_file = 'world3/code/limits_to_growth_pydynamo_code.py' + +# Get every informations +var_sector, var_subsector = get_sectors.get_sectors(code_file) +sector_vars = {sector: [] for sector in var_sector.values()} +for var in var_sector: + sector_vars[var_sector[var]].append(var) +var_color = {v: sector_color[sector] for v, sector in var_sector.items()} + +translated_defs = get_definitions.read_translated_defs('world3/infos/translated_defs.md') +definitions = {v: d[0] for v, d in translated_defs.items()} + +s = dno.parse_system.system_from_file(code_file) +s.add_comments(definitions) diff --git a/world3/code/limits_to_growth_DYNAMO_code.py b/world3/code/limits_to_growth_DYNAMO_code.py new file mode 100644 index 0000000000000000000000000000000000000000..ca0625ce7d778d8bf1eb75ada3bb49ea1d447bc0 --- /dev/null +++ b/world3/code/limits_to_growth_DYNAMO_code.py @@ -0,0 +1,339 @@ +# Population sector +A pop.k = p1.k + p2.k + p3.k + p4.k +L p1.k = p1.j + dt*(b.jk - d1.jk - mat1.jk) +N p1 = p1i +C p1i = 65e7 +R d1.kl = p1.k * m1.k +A m1.k = tabhl(m1t, le.k, 20, 80, 10) +T m1t = [0.0567, 0.0366, 0.0243, 0.0155, 0.0082, 0.0023, 0.001] +R mat1.kl = p1.k*(1 - m1.k)/15 +L p2.k = p2.j + dt*(mat1.jk - d2.jk - mat2.jk) +N p2 = p2i +C p2i = 70e7 +R d2.kl = p2.k * m2.k +A m2.k = tabhl(m2t, le.k, 20, 80, 10) +T m2t = [0.0266, 0.0171, 0.0110, 0.0065, 0.0040, 0.0016, 0.0008] +R mat2.kl = p2.k*(1 - m2.k)/30 +L p3.k = p3.j + dt*(mat2.jk-d3.jk-mat3.jk) +N p3 = p3i +C p3i = 19e7 +R d3.kl = p3.k * m3.k +A m3.k = tabhl(m3t, le.k, 20, 80, 10) +T m3t = [0.0562, 0.0373, 0.0252, 0.0171, 0.0118, 0.0083, 0.006] +R mat3.kl = p3.k*(1 - m3.k)/20 +L p4.k = p4.j + dt*(mat3.jk - d4.jk) +N p4 = p4i +C p4i = 6e7 +R d4.kl = p4.k * m4.k +A m4.k = tabhl(m4t, le.k, 20, 80, 10) +T m4t = [0.13, 0.11, 0.09, 0.07, 0.06, 0.05, 0.04] + +# Death rate subsector +A d.k = d1.jk + d2.jk + d3.jk + d4.jk +S cdr.k = 1000*d.k/pop.k +A le.k = len*lmf.k*lmhs.k*lmp.k*lmc.k +C len = 28 +A lmf.k = tabhl(lmft, fpc.k/sfpc, 0, 5, 1) +T lmft = [0, 1, 1.2, 1.3, 1.35, 1.4] +A hsapc.k = tabhl(hsapct, sopc.k, 0, 2000, 250) +T hsapct = [0, 20, 50, 95, 140, 175, 200, 220, 230] +A ehspc.k = smooth(hsapc.k, hsid) +C hsid = 20 +A lmhs.k = clip(lmhs2.k, lmhs1.k, time.k, 1940) +A lmhs1.k = tabhl(lmhs1t, ehspc.k, 0, 100, 20) +T lmhs1t = [1, 1.1, 1.4, 1.6, 1.7, 1.8] +A lmhs2.k = tabhl(lmhs2t, ehspc.k, 0, 100, 20) +T lmhs2t = [1, 1.4, 1.6, 1.8, 1.95, 2.0] +A fpu.k = tabhl(fput, pop.k, 0, 16e9, 2e9) +T fput = [0, 0.2, 0.4, 0.5, 0.58, 0.65, 0.72, 0.78, 0.80] +A cmi.k = tabhl(cmit, iopc.k, 0, 1600, 200) +T cmit = [0.5, 0.05, -0.1, -0.08, -0.02, 0.05, 0.1, 0.15, 0.2] +A lmc.k = 1 - (cmi.k*fpu.k) +A lmp.k = tabhl(lmpt, ppolx.k, 0, 100, 10) +T lmpt = [1, 0.99, 0.97, 0.95, 0.90, 0.85, 0.75, 0.65, 0.55, 0.40, 0.20] + +# Birth rate subsector +R b.kl = clip(d.k, (tf.k*p2.k*0.5/rlt), time.k, pet) +C rlt = 30 +C pet = 4000 +S cbr.k = 1000*b.jk/pop.k +A tf.k = min(mtf.k, (mtf.k*(1-fce.k) + dtf.k*fce.k)) +A mtf.k = mtfn * fm.k +C mtfn = 12 +A fm.k = tabhl(fmt, le.k, 0, 80, 10) +T fmt = [0, 0.2, 0.4, 0.6, 0.8, 0.9, 1, 1.05, 1.1] +A dtf.k = dcfs.k*cmple.k +A cmple.k = tabhl(cmplet, ple.k, 0, 80, 10) +T cmplet = [3, 2.1, 1.6, 1.4, 1.3, 1.2, 1.1, 1.05, 1] +A ple.k = dlinf3(le.k, lpd) +C lpd = 20 +A dcfs.k = clip(2.0, dcfsn*frsn.k*sfsn.k, time.k, zpgt) +C zpgt = 4000 +C dcfsn = 4 +A sfsn.k = tabhl(sfsnt, diopc.k, 0, 800, 200) +T sfsnt = [1.25, 1, 0.9, 0.8, 0.75] +A diopc.k = dlinf3(iopc.k, sad) +C sad = 20 +A frsn.k = tabhl(frsnt, fie.k, -0.2, 0.2, 0.1) +T frsnt = [0.5, 0.6, 0.7, 0.85, 1] +N frsn = 0.82 +A fie.k = (iopc.k - aiopc.k)/aiopc.k +A aiopc.k = smooth(iopc.k, ieat) +C ieat = 3 +A nfc.k = (mtf.k / dtf.k) - 1 +A fce.k = clip(1.0, tabhl(fcet, fcfpc.k, 0, 3, 0.5), time.k, fcest) +C fcest = 4000 +T fcet = [0.75, 0.85, 0.9, 0.95, 0.98, 0.99, 1] +A fcfpc.k = dlinf3(fcapc.k, hsid) +A fcapc.k = fsafc.k*sopc.k +A fsafc.k = tabhl(fsafct, nfc.k, 0, 10, 2) +T fsafct = [0, 0.005, 0.015, 0.025, 0.03, 0.035] + +# Capital sector +## Industrial subsector +A iopc.k = io.k/pop.k +# ATTENTION: from next line a small difference is induced +A io.k = ic.k*(1-fcaor.k)*cuf.k/icor.k +A icor.k = clip(icor2, icor1, time.k, pyear) +C icor1 = 3 +C icor2 = 3 +L ic.k = ic.j + dt*(icir.jk-icdr.jk) +N ic = ici +C ici = 2.1e11 +R icdr.kl = ic.k/alic.k +A alic.k = clip(alic2, alic1, time.k, pyear) +C alic1 = 14 +C alic2 = 14 +R icir.kl = io.k*fioai.k +A fioai.k = 1- fioaa.k - fioas.k - fioac.k +A fioac.k = clip(fioacv.k, fioacc.k, time.k, iet) +C iet = 4000 +A fioacc.k = clip(fioac2, fioac1, time.k, pyear) +C fioac1 = 0.43 +C fioac2 = 0.43 +A fioacv.k = tabhl(fioacvt, iopc.k/iopcd, 0, 2, 0.2) +T fioacvt = [0.3, 0.32, 0.34, 0.36, 0.38, 0.43, 0.73, 0.77, 0.81, 0.82, 0.83] +C iopcd = 400 + +## Service subsector +A isopc.k = clip(isopc2.k, isopc1.k, time.k, pyear) +A isopc1.k = tabhl(isopc1t, iopc.k, 0, 1600, 200) +T isopc1t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +A isopc2.k = tabhl(isopc2t, iopc.k, 0, 1600, 200) +T isopc2t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +A fioas.k = clip(fioas2.k, fioas1.k, time.k, pyear) +A fioas1.k = tabhl(fioas1t, sopc.k/isopc.k, 0, 2, 0.5) +T fioas1t = [0.3, 0.2, 0.1, 0.05, 0] +A fioas2.k = tabhl(fioas2t, sopc.k/isopc.k, 0, 2, 0.5) +T fioas2t = [0.3, 0.2, 0.1, 0.05, 0] +R scir.kl = io.k*fioas.k +L sc.k = sc.j + dt*(scir.jk-scdr.jk) +N sc = sci +C sci = 1.44e11 +R scdr.kl = sc.k/alsc.k +A alsc.k = clip(alsc2, alsc1, time.k, pyear) +C alsc1 = 20 +C alsc2 = 20 +A so.k = (sc.k*cuf.k)/scor.k +A sopc.k = so.k/pop.k +A scor.k = clip(scor2, scor1, time.k, pyear) +C scor1 = 1 +C scor2 = 1 + +## Job subsector +# ! Replaced J by jobs +A j.k = pjis.k + pjas.k +pjss.k +A pjis.k = ic.k*jpicu.k +A jpicu.k = tabhl(jpicut, iopc.k, 50, 800, 150)*1e-3 +T jpicut = [0.37, 0.18, 0.12, 0.09, 0.07, 0.06] +A pjss.k = sc.k*jpscu.k +A jpscu.k = tabhl(jpscut, sopc.k, 50, 800, 150)*1e-3 +T jpscut = [1.1, 0.6, 0.35, 0.2, 0.15, 0.15] +A pjas.k = jph.k*al.k +A jph.k = tabhl(jpht, aiph.k, 2, 30, 4) +T jpht = [2, 0.5, 0.4, 0.3, 0.27, 0.24, 0.2, 0.2] +A lf.k = (p2.k + p3.k)*lfpf +C lfpf = 0.75 +A luf.k = j.k/lf.k +A lufd.k = smooth(luf.k, lufdt) +C lufdt = 2 +A cuf.k = tabhl(cuft, lufd.k, 1, 11, 2) +N cuf = 1 +T cuft = [1, 0.9, 0.7, 0.3, 0.1, 0.1] + +# Agricultural sector +## Loop1: food from investment in land development +A lfc.k = al.k/palt +C palt = 3.2e9 +L al.k = al.j + dt*(ldr.jk - ler.jk - lrui.jk) +N al = ali +C ali = 0.9e9 +L pal.k = pal.j + dt*(-ldr.jk) +N pal = pali +C pali = 2.3e9 +A f.k = ly.k*al.k*lfh*(1-pl) +C lfh = 0.7 +C pl = 0.1 +A fpc.k = f.k/pop.k +A ifpc.k = clip(ifpc2.k, ifpc1.k, time.k, pyear) +A ifpc1.k = tabhl(ifpc1t, iopc.k, 0, 1600, 200) +T ifpc1t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +A ifpc2.k = tabhl(ifpc2t, iopc.k, 0, 1600, 200) +T ifpc2t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +A tai.k = io.k*fioaa.k +A fioaa.k = clip(fioaa2.k, fioaa1.k, time.k, pyear) +A fioaa1.k = tabhl(fioaa1t, fpc.k/ifpc.k, 0, 2.5, 0.5) +T fioaa1t = [0.4, 0.2, 0.1, 0.025, 0, 0] +A fioaa2.k = tabhl(fioaa2t, fpc.k/ifpc.k, 0, 2.5, 0.5) +T fioaa2t = [0.4, 0.2, 0.1, 0.025, 0, 0] +R ldr.kl = tai.k*fiald.k/dcph.k +A dcph.k = tabhl(dcpht, pal.k/palt, 0, 1, 0.1) +T dcpht = [1e5, 7400, 5200, 3500, 2400, 1500, 750, 300, 150, 75, 50] + +## Loop2: food from investment in agricultural inputs +A cai.k = tai.k * (1 - fiald.k) +A ai.k = smooth(cai.k, alai.k) +N ai = 5e9 +A alai.k = clip(alai2, alai1, time.k, pyear) +C alai1 = 2 +C alai2 = 2 +A aiph.k = ai.k*(1 - falm.k)/al.k +A lymc.k = tabhl(lymct, aiph.k, 0, 1000, 40) +T lymct = [1, 3, 3.8, 4.4, 4.9, 5.4, 5.7, 6, 6.3, 6.6, 6.9, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +A ly.k = lyf.k*lfert.k*lymc.k*lymap.k +A lyf.k = clip(lyf2, lyf1, time.k, pyear) +C lyf1 = 1 +C lyf2 = 1 +A lymap.k = clip(lymap2.k, lymap1.k, time.k, pyear) +A lymap1.k = tabhl(lymap1t, io.k/io70, 0, 30, 10) +T lymap1t = [1, 1, 0.7, 0.4] +A lymap2.k = tabhl(lymap2t, io.k/io70, 0, 30, 10) +T lymap2t = [1, 1, 0.7, 0.4] +C io70 = 7.9e11 + +## Loop 1 & 2: the investment allocation decision +A fiald.k = tabhl(fialdt, mpld.k/mpai.k, 0, 2, 0.25) +T fialdt = [0, 0.05, 0.15, 0.30, 0.50, 0.70, 0.85, 0.95, 1] +A mpld.k = ly.k/(dcph.k*sd) +C sd = 0.07 +A mpai.k = alai.k*ly.k*mlymc.k/lymc.k +A mlymc.k = tabhl(mlymct, aiph.k, 0, 600, 40) +T mlymct = [0.075, 0.03, 0.015, 0.011, 0.009, 0.008, 0.007, 0.006, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005] + +## Loop 3: land erosion and urban-industrial use +A all.k = alln*llmy.k +C alln = 6000 +A llmy.k = clip(llmy2.k, llmy1.k, time.k, pyear) +A llmy1.k = tabhl(llmy1t, ly.k/ilf, 0, 9, 1) +T llmy1t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +A llmy2.k = tabhl(llmy2t, ly.k/ilf, 0, 9, 1) +T llmy2t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +R ler.kl = al.k/all.k +A uilpc.k = tabhl(uilpct, iopc.k, 0, 1600, 200) +T uilpct = [0.005, 0.008, 0.015, 0.025, 0.04, 0.055, 0.07, 0.08, 0.09] +A uilr.k = uilpc.k*pop.k +R lrui.kl = max(0, (uilr.k - uil.k)/uildt) +C uildt = 10 +L uil.k = uil.j + dt*(lrui.jk) +N uil = uili +C uili = 8.2e6 + +## Loop 4: land fertility degradation +L lfert.k = lfert.j + dt*(lfr.jk-lfd.jk) +N lfert = lferti +C lferti = 600 +A lfdr.k = tabhl(lfdrt, ppolx.k, 0, 30, 10) +T lfdrt = [0, 0.1, 0.3, 0.5] +R lfd.kl = lfert.k*lfdr.k + +## Loop 5: land fertility regeneration +R lfr.kl = (ilf-lfert.k)/lfrt.k +C ilf = 600 +A lfrt.k = tabhl(lfrtt, falm.k, 0, 0.10, 0.02) +T lfrtt = [20.0, 13.0, 8.0, 4.0, 2.0, 2.0] + +## Loop 6: dDiscontinuing land maintinance +A falm.k = tabhl(falmt, pfr.k, 0, 4, 1) +T falmt = [0.0, 0.04, 0.07, 0.09, 0.1] +A fr.k = fpc.k/sfpc +C sfpc = 230 +A pfr.k = smooth(fr.k, fspd) +N pfr = 1 +C fspd = 2 + +# Nonrenewable resource sector +L nr.k = nr.j + dt*(-nrur.jk) +N nr = nri +C nri = 1e12 +R nrur.kl = pop.k * pcrum.k * nruf.k +A nruf.k = clip(nruf2, nruf1, time.k, pyear) +C nruf1 = 1 +C nruf2 = 1 +A pcrum.k = tabhl(pcrumt, iopc.k, 0, 1600, 200) +T pcrumt = [0.0, 0.85, 2.6, 4.4, 5.4, 6.2, 6.8, 7.0, 7.0] +A nrfr.k = nr.k/nri +A fcaor.k = clip(fcaor2.k, fcaor1.k, time.k, pyear) +A fcaor1.k = tabhl(fcaor1t, nrfr.k, 0, 1, 0.1) +T fcaor1t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] +A fcaor2.k = tabhl(fcaor2t, nrfr.k, 0, 1, 0.1) +T fcaor2t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] + +# Persistent pollution sector +R ppgr.kl = (ppgio.k + ppgao.k)*ppgf.k +A ppgf.k = clip(ppgf2, ppgf1, time.k, pyear) +C ppgf1 = 1 +C ppgf2 = 1 +A ppgio.k = pcrum.k * pop.k * frpm*imef*imti +C frpm = 0.02 +C imef = 0.1 +C imti = 10 +A ppgao.k = aiph.k*al.k*fipm*amti +C fipm = 0.001 +C amti = 1 +R ppapr.kl = delay3(ppgr.jk, pptd) +C pptd = 20 +L ppol.k = ppol.j + dt*(ppapr.jk-ppasr.jk) +N ppol = 2.5e7 +A ppolx.k = ppol.k/ppol70 +C ppol70 = 1.36e8 +R ppasr.kl = ppol.k/(ahl.k*1.4) +A ahlm.k = tabhl(ahlmt, ppolx.k, 1, 1001, 250) +T ahlmt = [1.0, 11.0, 21.0, 31.0, 41.0] +A ahl.k = ahl70*ahlm.k +C ahl70 = 1.5 + +# Supplementary equations +S foa.k = 0.22*f.k/(0.22*f.k + so.k + io.k) +S foi.k = io.k/(0.22*f.k + so.k + io.k) +S fos.k = so.k/(0.22*f.k + so.k + io.k) + +# Control card for simulation +# Some have been removed because not implemented this way in pydynamo +# SPEC dt = 0.5 +# SPEC length = 2100 +C pyear = 1975 +# N time = 1900 +C start_date = 1900 +# A pltper.k = step(plp, plit) +# C plp = 5 +# C plit = 1900 +# C prp = 0 +# A prtper.k = step(prp, prit) + step(-prp, prtt) +# C prit = 1900 +# C prtt = 2100 + +# Take care to keep the last line ! +# Parameter and structural changes for limits to growth + + +# Additional lines for limits to growth code +R icir.kl = clip(icir2.k, io.k*fioai.k, time.k, icet) + +A helpicir2.k = min(icdr.jk, io.k* fioai.k) +A icir2.k = clip(helpicir2.k, io.k* fioai.k, diopc.k-diop.k, 0) +C icet=4000 +A diop.k = sample(iopc.k, dist.k, 0) +A dist.k = step(4000, disi+1905)+disi +C disi=4000 + + diff --git a/world3/code/limits_to_growth_pydynamo_code.py b/world3/code/limits_to_growth_pydynamo_code.py new file mode 100644 index 0000000000000000000000000000000000000000..6788a3c7acd1cff5a7abb67f34ded7e2bbc06fe3 --- /dev/null +++ b/world3/code/limits_to_growth_pydynamo_code.py @@ -0,0 +1,339 @@ +# Population sector +pop.k = p1.k + p2.k + p3.k + p4.k +p1.k = p1.j + dt*(b.j - d1.j - mat1.j) +p1.i = p1i +p1i = 65e7 +d1.k = p1.k * m1.k +m1.k = tabhl(m1t, le.k, 20, 80, 10) +m1t = [0.0567, 0.0366, 0.0243, 0.0155, 0.0082, 0.0023, 0.001] +mat1.k = p1.k*(1 - m1.k)/15 +p2.k = p2.j + dt*(mat1.j - d2.j - mat2.j) +p2.i = p2i +p2i = 70e7 +d2.k = p2.k * m2.k +m2.k = tabhl(m2t, le.k, 20, 80, 10) +m2t = [0.0266, 0.0171, 0.0110, 0.0065, 0.0040, 0.0016, 0.0008] +mat2.k = p2.k*(1 - m2.k)/30 +p3.k = p3.j + dt*(mat2.j-d3.j-mat3.j) +p3.i = p3i +p3i = 19e7 +d3.k = p3.k * m3.k +m3.k = tabhl(m3t, le.k, 20, 80, 10) +m3t = [0.0562, 0.0373, 0.0252, 0.0171, 0.0118, 0.0083, 0.006] +mat3.k = p3.k*(1 - m3.k)/20 +p4.k = p4.j + dt*(mat3.j - d4.j) +p4.i = p4i +p4i = 6e7 +d4.k = p4.k * m4.k +m4.k = tabhl(m4t, le.k, 20, 80, 10) +m4t = [0.13, 0.11, 0.09, 0.07, 0.06, 0.05, 0.04] + +# Death rate subsector +d.k = d1.j + d2.j + d3.j + d4.j +cdr.k = 1000*d.k/pop.k +le.k = dynamo_len*lmf.k*lmhs.k*lmp.k*lmc.k +dynamo_len = 28 +lmf.k = tabhl(lmft, fpc.k/sfpc, 0, 5, 1) +lmft = [0, 1, 1.2, 1.3, 1.35, 1.4] +hsapc.k = tabhl(hsapct, sopc.k, 0, 2000, 250) +hsapct = [0, 20, 50, 95, 140, 175, 200, 220, 230] +ehspc.k = smooth(hsapc.j, hsid) +hsid = 20 +lmhs.k = clip(lmhs2.k, lmhs1.k, time.k, 1940) +lmhs1.k = tabhl(lmhs1t, ehspc.k, 0, 100, 20) +lmhs1t = [1, 1.1, 1.4, 1.6, 1.7, 1.8] +lmhs2.k = tabhl(lmhs2t, ehspc.k, 0, 100, 20) +lmhs2t = [1, 1.4, 1.6, 1.8, 1.95, 2.0] +fpu.k = tabhl(fput, pop.k, 0, 16e9, 2e9) +fput = [0, 0.2, 0.4, 0.5, 0.58, 0.65, 0.72, 0.78, 0.80] +cmi.k = tabhl(cmit, iopc.k, 0, 1600, 200) +cmit = [0.5, 0.05, -0.1, -0.08, -0.02, 0.05, 0.1, 0.15, 0.2] +lmc.k = 1 - (cmi.k*fpu.k) +lmp.k = tabhl(lmpt, ppolx.k, 0, 100, 10) +lmpt = [1, 0.99, 0.97, 0.95, 0.90, 0.85, 0.75, 0.65, 0.55, 0.40, 0.20] + +# Birth rate subsector +b.k = clip(d.k, (tf.k*p2.k*0.5/rlt), time.k, pet) +rlt = 30 +pet = 4000 +cbr.k = 1000*b.j/pop.k +tf.k = min(mtf.k, (mtf.k*(1-fce.k) + dtf.k*fce.k)) +mtf.k = mtfn * fm.k +mtfn = 12 +fm.k = tabhl(fmt, le.k, 0, 80, 10) +fmt = [0, 0.2, 0.4, 0.6, 0.8, 0.9, 1, 1.05, 1.1] +dtf.k = dcfs.k*cmple.k +cmple.k = tabhl(cmplet, ple.k, 0, 80, 10) +cmplet = [3, 2.1, 1.6, 1.4, 1.3, 1.2, 1.1, 1.05, 1] +ple.k = dlinf3(le.k, lpd) +lpd = 20 +dcfs.k = clip(2.0, dcfsn*frsn.k*sfsn.k, time.k, zpgt) +zpgt = 4000 +dcfsn = 4 +sfsn.k = tabhl(sfsnt, diopc.k, 0, 800, 200) +sfsnt = [1.25, 1, 0.9, 0.8, 0.75] +diopc.k = dlinf3(iopc.k, sad) +sad = 20 +frsn.k = tabhl(frsnt, fie.k, -0.2, 0.2, 0.1) +frsnt = [0.5, 0.6, 0.7, 0.85, 1] +frsn.i = 0.82 +fie.k = (iopc.k - aiopc.k)/aiopc.k +aiopc.k = smooth(iopc.j, ieat) +ieat = 3 +nfc.k = (mtf.k / dtf.k) - 1 +fce.k = clip(1.0, tabhl(fcet, fcfpc.k, 0, 3, 0.5), time.k, fcest) +fcest = 4000 +fcet = [0.75, 0.85, 0.9, 0.95, 0.98, 0.99, 1] +fcfpc.k = dlinf3(fcapc.k, hsid) +fcapc.k = fsafc.k*sopc.k +fsafc.k = tabhl(fsafct, nfc.k, 0, 10, 2) +fsafct = [0, 0.005, 0.015, 0.025, 0.03, 0.035] + +# Capital sector +## Industrial subsector +iopc.k = io.k/pop.k +# ATTENTION: from next line a smdynamo_all difference is induced +io.k = ic.k*(1-fcaor.k)*cuf.k/icor.k +icor.k = clip(icor2, icor1, time.k, pyear) +icor1 = 3 +icor2 = 3 +ic.k = ic.j + dt*(icir.j-icdr.j) +ic.i = ici +ici = 2.1e11 +icdr.k = ic.k/alic.k +alic.k = clip(alic2, alic1, time.k, pyear) +alic1 = 14 +alic2 = 14 +icir.k = io.k*fioai.k +fioai.k = 1- fioaa.k - fioas.k - fioac.k +fioac.k = clip(fioacv.k, fioacc.k, time.k, iet) +iet = 4000 +fioacc.k = clip(fioac2, fioac1, time.k, pyear) +fioac1 = 0.43 +fioac2 = 0.43 +fioacv.k = tabhl(fioacvt, iopc.k/iopcd, 0, 2, 0.2) +fioacvt = [0.3, 0.32, 0.34, 0.36, 0.38, 0.43, 0.73, 0.77, 0.81, 0.82, 0.83] +iopcd = 400 + +## Service subsector +isopc.k = clip(isopc2.k, isopc1.k, time.k, pyear) +isopc1.k = tabhl(isopc1t, iopc.k, 0, 1600, 200) +isopc1t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +isopc2.k = tabhl(isopc2t, iopc.k, 0, 1600, 200) +isopc2t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +fioas.k = clip(fioas2.k, fioas1.k, time.k, pyear) +fioas1.k = tabhl(fioas1t, sopc.k/isopc.k, 0, 2, 0.5) +fioas1t = [0.3, 0.2, 0.1, 0.05, 0] +fioas2.k = tabhl(fioas2t, sopc.k/isopc.k, 0, 2, 0.5) +fioas2t = [0.3, 0.2, 0.1, 0.05, 0] +scir.k = io.k*fioas.k +sc.k = sc.j + dt*(scir.j-scdr.j) +sc.i = sci +sci = 1.44e11 +scdr.k = sc.k/alsc.k +alsc.k = clip(alsc2, alsc1, time.k, pyear) +alsc1 = 20 +alsc2 = 20 +so.k = (sc.k*cuf.k)/scor.k +sopc.k = so.k/pop.k +scor.k = clip(scor2, scor1, time.k, pyear) +scor1 = 1 +scor2 = 1 + +## Job subsector +# ! Replaced J by jobs +j.k = pjis.k + pjas.k +pjss.k +pjis.k = ic.k*jpicu.k +jpicu.k = tabhl(jpicut, iopc.k, 50, 800, 150)*1e-3 +jpicut = [0.37, 0.18, 0.12, 0.09, 0.07, 0.06] +pjss.k = sc.k*jpscu.k +jpscu.k = tabhl(jpscut, sopc.k, 50, 800, 150)*1e-3 +jpscut = [1.1, 0.6, 0.35, 0.2, 0.15, 0.15] +pjas.k = jph.k*al.k +jph.k = tabhl(jpht, aiph.k, 2, 30, 4) +jpht = [2, 0.5, 0.4, 0.3, 0.27, 0.24, 0.2, 0.2] +lf.k = (p2.k + p3.k)*lfpf +lfpf = 0.75 +luf.k = j.k/lf.k +lufd.k = smooth(luf.j, lufdt) +lufdt = 2 +cuf.k = tabhl(cuft, lufd.k, 1, 11, 2) +cuf.i = 1 +cuft = [1, 0.9, 0.7, 0.3, 0.1, 0.1] + +# Agricultural sector +## Loop1: food from investment in land development +lfc.k = al.k/palt +palt = 3.2e9 +al.k = al.j + dt*(ldr.j - ler.j - lrui.j) +al.i = ali +ali = 0.9e9 +pal.k = pal.j + dt*(-ldr.j) +pal.i = pali +pali = 2.3e9 +f.k = ly.k*al.k*lfh*(1-pl) +lfh = 0.7 +pl = 0.1 +fpc.k = f.k/pop.k +ifpc.k = clip(ifpc2.k, ifpc1.k, time.k, pyear) +ifpc1.k = tabhl(ifpc1t, iopc.k, 0, 1600, 200) +ifpc1t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +ifpc2.k = tabhl(ifpc2t, iopc.k, 0, 1600, 200) +ifpc2t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +tai.k = io.k*fioaa.k +fioaa.k = clip(fioaa2.k, fioaa1.k, time.k, pyear) +fioaa1.k = tabhl(fioaa1t, fpc.k/ifpc.k, 0, 2.5, 0.5) +fioaa1t = [0.4, 0.2, 0.1, 0.025, 0, 0] +fioaa2.k = tabhl(fioaa2t, fpc.k/ifpc.k, 0, 2.5, 0.5) +fioaa2t = [0.4, 0.2, 0.1, 0.025, 0, 0] +ldr.k = tai.k*fiald.k/dcph.k +dcph.k = tabhl(dcpht, pal.k/palt, 0, 1, 0.1) +dcpht = [1e5, 7400, 5200, 3500, 2400, 1500, 750, 300, 150, 75, 50] + +## Loop2: food from investment in agricultural inputs +cai.k = tai.k * (1 - fiald.k) +ai.k = smooth(cai.j, alai.k) +ai.i = 5e9 +alai.k = clip(alai2, alai1, time.k, pyear) +alai1 = 2 +alai2 = 2 +aiph.k = ai.k*(1 - falm.k)/al.k +lymc.k = tabhl(lymct, aiph.k, 0, 1000, 40) +lymct = [1, 3, 3.8, 4.4, 4.9, 5.4, 5.7, 6, 6.3, 6.6, 6.9, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +ly.k = lyf.k*lfert.k*lymc.k*lymap.k +lyf.k = clip(lyf2, lyf1, time.k, pyear) +lyf1 = 1 +lyf2 = 1 +lymap.k = clip(lymap2.k, lymap1.k, time.k, pyear) +lymap1.k = tabhl(lymap1t, io.k/io70, 0, 30, 10) +lymap1t = [1, 1, 0.7, 0.4] +lymap2.k = tabhl(lymap2t, io.k/io70, 0, 30, 10) +lymap2t = [1, 1, 0.7, 0.4] +io70 = 7.9e11 + +## Loop 1 & 2: the investment allocation decision +fiald.k = tabhl(fialdt, mpld.k/mpai.k, 0, 2, 0.25) +fialdt = [0, 0.05, 0.15, 0.30, 0.50, 0.70, 0.85, 0.95, 1] +mpld.k = ly.k/(dcph.k*sd) +sd = 0.07 +mpai.k = alai.k*ly.k*mlymc.k/lymc.k +mlymc.k = tabhl(mlymct, aiph.k, 0, 600, 40) +mlymct = [0.075, 0.03, 0.015, 0.011, 0.009, 0.008, 0.007, 0.006, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005] + +## Loop 3: land erosion and urban-industrial use +dynamo_all.k = alln*llmy.k +alln = 6000 +llmy.k = clip(llmy2.k, llmy1.k, time.k, pyear) +llmy1.k = tabhl(llmy1t, ly.k/ilf, 0, 9, 1) +llmy1t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +llmy2.k = tabhl(llmy2t, ly.k/ilf, 0, 9, 1) +llmy2t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +ler.k = al.k/dynamo_all.k +uilpc.k = tabhl(uilpct, iopc.k, 0, 1600, 200) +uilpct = [0.005, 0.008, 0.015, 0.025, 0.04, 0.055, 0.07, 0.08, 0.09] +uilr.k = uilpc.k*pop.k +lrui.k = max(0, (uilr.k - uil.k)/uildt) +uildt = 10 +uil.k = uil.j + dt*(lrui.j) +uil.i = uili +uili = 8.2e6 + +## Loop 4: land fertility degradation +lfert.k = lfert.j + dt*(lfr.j-lfd.j) +lfert.i = lferti +lferti = 600 +lfdr.k = tabhl(lfdrt, ppolx.k, 0, 30, 10) +lfdrt = [0, 0.1, 0.3, 0.5] +lfd.k = lfert.k*lfdr.k + +## Loop 5: land fertility regeneration +lfr.k = (ilf-lfert.k)/lfrt.k +ilf = 600 +lfrt.k = tabhl(lfrtt, falm.k, 0, 0.10, 0.02) +lfrtt = [20.0, 13.0, 8.0, 4.0, 2.0, 2.0] + +## Loop 6: dDiscontinuing land maintinance +falm.k = tabhl(falmt, pfr.k, 0, 4, 1) +falmt = [0.0, 0.04, 0.07, 0.09, 0.1] +fr.k = fpc.k/sfpc +sfpc = 230 +pfr.k = smooth(fr.j, fspd) +pfr.i = 1 +fspd = 2 + +# Nonrenewable resource sector +nr.k = nr.j + dt*(-nrur.j) +nr.i = nri +nri = 1e12 +nrur.k = pop.k * pcrum.k * nruf.k +nruf.k = clip(nruf2, nruf1, time.k, pyear) +nruf1 = 1 +nruf2 = 1 +pcrum.k = tabhl(pcrumt, iopc.k, 0, 1600, 200) +pcrumt = [0.0, 0.85, 2.6, 4.4, 5.4, 6.2, 6.8, 7.0, 7.0] +nrfr.k = nr.k/nri +fcaor.k = clip(fcaor2.k, fcaor1.k, time.k, pyear) +fcaor1.k = tabhl(fcaor1t, nrfr.k, 0, 1, 0.1) +fcaor1t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] +fcaor2.k = tabhl(fcaor2t, nrfr.k, 0, 1, 0.1) +fcaor2t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] + +# Persistent pollution sector +ppgr.k = (ppgio.k + ppgao.k)*ppgf.k +ppgf.k = clip(ppgf2, ppgf1, time.k, pyear) +ppgf1 = 1 +ppgf2 = 1 +ppgio.k = pcrum.k * pop.k * frpm*imef*imti +frpm = 0.02 +imef = 0.1 +imti = 10 +ppgao.k = aiph.k*al.k*fipm*amti +fipm = 0.001 +amti = 1 +ppapr.k = delay3(ppgr.j, pptd) +pptd = 20 +ppol.k = ppol.j + dt*(ppapr.j-ppasr.j) +ppol.i = 2.5e7 +ppolx.k = ppol.k/ppol70 +ppol70 = 1.36e8 +ppasr.k = ppol.k/(ahl.k*1.4) +ahlm.k = tabhl(ahlmt, ppolx.k, 1, 1001, 250) +ahlmt = [1.0, 11.0, 21.0, 31.0, 41.0] +ahl.k = ahl70*ahlm.k +ahl70 = 1.5 + +# Supplementary equations +foa.k = 0.22*f.k/(0.22*f.k + so.k + io.k) +foi.k = io.k/(0.22*f.k + so.k + io.k) +fos.k = so.k/(0.22*f.k + so.k + io.k) + +# Control card for simulation +# Some have been removed because not implemented this way in pydynamo +# SPEC dt = 0.5 +# SPEC length = 2100 +pyear = 1975 +# N time = 1900 +start_date = 1900 +# A pltper.k = step(plp, plit) +# C plp = 5 +# C plit = 1900 +# C prp = 0 +# A prtper.k = step(prp, prit) + step(-prp, prtt) +# C prit = 1900 +# C prtt = 2100 + +# Take care to keep the last line ! +# Parameter and structural changes for limits to growth + + +# Additional lines for limits to growth code +icir.k = clip(icir2.k, io.k*fioai.k, time.k, icet) + +helpicir2.k = min(icdr.j, io.k* fioai.k) +icir2.k = clip(helpicir2.k, io.k* fioai.k, diopc.k-diop.k, 0) +icet=4000 +diop.k = sample(iopc.k, dist.k, 0) +dist.k = step(4000, disi+1905)+disi +disi=4000 + + diff --git a/world3/world3_DYNAMO_code.py b/world3/code/world3_DYNAMO_code.py similarity index 100% rename from world3/world3_DYNAMO_code.py rename to world3/code/world3_DYNAMO_code.py diff --git a/world3/code/world3_pydynamo_code.py b/world3/code/world3_pydynamo_code.py new file mode 100644 index 0000000000000000000000000000000000000000..b787cc46e6c8088853ad20888377fe4545c19e86 --- /dev/null +++ b/world3/code/world3_pydynamo_code.py @@ -0,0 +1,326 @@ +# Population sector +pop.k = p1.k + p2.k + p3.k + p4.k +p1.k = p1.j + dt*(b.j - d1.j - mat1.j) +p1.i = p1i +p1i = 65e7 +d1.k = p1.k * m1.k +m1.k = tabhl(m1t, le.k, 20, 80, 10) +m1t = [0.0567, 0.0366, 0.0243, 0.0155, 0.0082, 0.0023, 0.001] +mat1.k = p1.k*(1 - m1.k)/15 +p2.k = p2.j + dt*(mat1.j - d2.j - mat2.j) +p2.i = p2i +p2i = 70e7 +d2.k = p2.k * m2.k +m2.k = tabhl(m2t, le.k, 20, 80, 10) +m2t = [0.0266, 0.0171, 0.0110, 0.0065, 0.0040, 0.0016, 0.0008] +mat2.k = p2.k*(1 - m2.k)/30 +p3.k = p3.j + dt*(mat2.j-d3.j-mat3.j) +p3.i = p3i +p3i = 19e7 +d3.k = p3.k * m3.k +m3.k = tabhl(m3t, le.k, 20, 80, 10) +m3t = [0.0562, 0.0373, 0.0252, 0.0171, 0.0118, 0.0083, 0.006] +mat3.k = p3.k*(1 - m3.k)/20 +p4.k = p4.j + dt*(mat3.j - d4.j) +p4.i = p4i +p4i = 6e7 +d4.k = p4.k * m4.k +m4.k = tabhl(m4t, le.k, 20, 80, 10) +m4t = [0.13, 0.11, 0.09, 0.07, 0.06, 0.05, 0.04] + +# Death rate subsector +d.k = d1.j + d2.j + d3.j + d4.j +cdr.k = 1000*d.k/pop.k +le.k = dynamo_len*lmf.k*lmhs.k*lmp.k*lmc.k +dynamo_len = 28 +lmf.k = tabhl(lmft, fpc.k/sfpc, 0, 5, 1) +lmft = [0, 1, 1.2, 1.3, 1.35, 1.4] +hsapc.k = tabhl(hsapct, sopc.k, 0, 2000, 250) +hsapct = [0, 20, 50, 95, 140, 175, 200, 220, 230] +ehspc.k = smooth(hsapc.j, hsid) +hsid = 20 +lmhs.k = clip(lmhs2.k, lmhs1.k, time.k, 1940) +lmhs1.k = tabhl(lmhs1t, ehspc.k, 0, 100, 20) +lmhs1t = [1, 1.1, 1.4, 1.6, 1.7, 1.8] +lmhs2.k = tabhl(lmhs2t, ehspc.k, 0, 100, 20) +lmhs2t = [1, 1.4, 1.6, 1.8, 1.95, 2.0] +fpu.k = tabhl(fput, pop.k, 0, 16e9, 2e9) +fput = [0, 0.2, 0.4, 0.5, 0.58, 0.65, 0.72, 0.78, 0.80] +cmi.k = tabhl(cmit, iopc.k, 0, 1600, 200) +cmit = [0.5, 0.05, -0.1, -0.08, -0.02, 0.05, 0.1, 0.15, 0.2] +lmc.k = 1 - (cmi.k*fpu.k) +lmp.k = tabhl(lmpt, ppolx.k, 0, 100, 10) +lmpt = [1, 0.99, 0.97, 0.95, 0.90, 0.85, 0.75, 0.65, 0.55, 0.40, 0.20] + +# Birth rate subsector +b.k = clip(d.k, (tf.k*p2.k*0.5/rlt), time.k, pet) +rlt = 30 +pet = 4000 +cbr.k = 1000*b.j/pop.k +tf.k = min(mtf.k, (mtf.k*(1-fce.k) + dtf.k*fce.k)) +mtf.k = mtfn * fm.k +mtfn = 12 +fm.k = tabhl(fmt, le.k, 0, 80, 10) +fmt = [0, 0.2, 0.4, 0.6, 0.8, 0.9, 1, 1.05, 1.1] +dtf.k = dcfs.k*cmple.k +cmple.k = tabhl(cmplet, ple.k, 0, 80, 10) +cmplet = [3, 2.1, 1.6, 1.4, 1.3, 1.2, 1.1, 1.05, 1] +ple.k = dlinf3(le.k, lpd) +lpd = 20 +dcfs.k = clip(2.0, dcfsn*frsn.k*sfsn.k, time.k, zpgt) +zpgt = 4000 +dcfsn = 4 +sfsn.k = tabhl(sfsnt, diopc.k, 0, 800, 200) +sfsnt = [1.25, 1, 0.9, 0.8, 0.75] +diopc.k = dlinf3(iopc.k, sad) +sad = 20 +frsn.k = tabhl(frsnt, fie.k, -0.2, 0.2, 0.1) +frsnt = [0.5, 0.6, 0.7, 0.85, 1] +frsn.i = 0.82 +fie.k = (iopc.k - aiopc.k)/aiopc.k +aiopc.k = smooth(iopc.j, ieat) +ieat = 3 +nfc.k = (mtf.k / dtf.k) - 1 +fce.k = clip(1.0, tabhl(fcet, fcfpc.k, 0, 3, 0.5), time.k, fcest) +fcest = 4000 +fcet = [0.75, 0.85, 0.9, 0.95, 0.98, 0.99, 1] +fcfpc.k = dlinf3(fcapc.k, hsid) +fcapc.k = fsafc.k*sopc.k +fsafc.k = tabhl(fsafct, nfc.k, 0, 10, 2) +fsafct = [0, 0.005, 0.015, 0.025, 0.03, 0.035] + +# Capital sector +## Industrial subsector +iopc.k = io.k/pop.k +# ATTENTION: from next line a smdynamo_all difference is induced +io.k = ic.k*(1-fcaor.k)*cuf.k/icor.k +icor.k = clip(icor2, icor1, time.k, pyear) +icor1 = 3 +icor2 = 3 +ic.k = ic.j + dt*(icir.j-icdr.j) +ic.i = ici +ici = 2.1e11 +icdr.k = ic.k/alic.k +alic.k = clip(alic2, alic1, time.k, pyear) +alic1 = 14 +alic2 = 14 +icir.k = io.k*fioai.k +fioai.k = 1- fioaa.k - fioas.k - fioac.k +fioac.k = clip(fioacv.k, fioacc.k, time.k, iet) +iet = 4000 +fioacc.k = clip(fioac2, fioac1, time.k, pyear) +fioac1 = 0.43 +fioac2 = 0.43 +fioacv.k = tabhl(fioacvt, iopc.k/iopcd, 0, 2, 0.2) +fioacvt = [0.3, 0.32, 0.34, 0.36, 0.38, 0.43, 0.73, 0.77, 0.81, 0.82, 0.83] +iopcd = 400 + +## Service subsector +isopc.k = clip(isopc2.k, isopc1.k, time.k, pyear) +isopc1.k = tabhl(isopc1t, iopc.k, 0, 1600, 200) +isopc1t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +isopc2.k = tabhl(isopc2t, iopc.k, 0, 1600, 200) +isopc2t = [40, 300, 640, 1000, 1220, 1450, 1650, 1800, 2000] +fioas.k = clip(fioas2.k, fioas1.k, time.k, pyear) +fioas1.k = tabhl(fioas1t, sopc.k/isopc.k, 0, 2, 0.5) +fioas1t = [0.3, 0.2, 0.1, 0.05, 0] +fioas2.k = tabhl(fioas2t, sopc.k/isopc.k, 0, 2, 0.5) +fioas2t = [0.3, 0.2, 0.1, 0.05, 0] +scir.k = io.k*fioas.k +sc.k = sc.j + dt*(scir.j-scdr.j) +sc.i = sci +sci = 1.44e11 +scdr.k = sc.k/alsc.k +alsc.k = clip(alsc2, alsc1, time.k, pyear) +alsc1 = 20 +alsc2 = 20 +so.k = (sc.k*cuf.k)/scor.k +sopc.k = so.k/pop.k +scor.k = clip(scor2, scor1, time.k, pyear) +scor1 = 1 +scor2 = 1 + +## Job subsector +# ! Replaced J by jobs +j.k = pjis.k + pjas.k +pjss.k +pjis.k = ic.k*jpicu.k +jpicu.k = tabhl(jpicut, iopc.k, 50, 800, 150)*1e-3 +jpicut = [0.37, 0.18, 0.12, 0.09, 0.07, 0.06] +pjss.k = sc.k*jpscu.k +jpscu.k = tabhl(jpscut, sopc.k, 50, 800, 150)*1e-3 +jpscut = [1.1, 0.6, 0.35, 0.2, 0.15, 0.15] +pjas.k = jph.k*al.k +jph.k = tabhl(jpht, aiph.k, 2, 30, 4) +jpht = [2, 0.5, 0.4, 0.3, 0.27, 0.24, 0.2, 0.2] +lf.k = (p2.k + p3.k)*lfpf +lfpf = 0.75 +luf.k = j.k/lf.k +lufd.k = smooth(luf.j, lufdt) +lufdt = 2 +cuf.k = tabhl(cuft, lufd.k, 1, 11, 2) +cuf.i = 1 +cuft = [1, 0.9, 0.7, 0.3, 0.1, 0.1] + +# Agricultural sector +## Loop1: food from investment in land development +lfc.k = al.k/palt +palt = 3.2e9 +al.k = al.j + dt*(ldr.j - ler.j - lrui.j) +al.i = ali +ali = 0.9e9 +pal.k = pal.j + dt*(-ldr.j) +pal.i = pali +pali = 2.3e9 +f.k = ly.k*al.k*lfh*(1-pl) +lfh = 0.7 +pl = 0.1 +fpc.k = f.k/pop.k +ifpc.k = clip(ifpc2.k, ifpc1.k, time.k, pyear) +ifpc1.k = tabhl(ifpc1t, iopc.k, 0, 1600, 200) +ifpc1t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +ifpc2.k = tabhl(ifpc2t, iopc.k, 0, 1600, 200) +ifpc2t = [230, 480, 690, 850, 970, 1070, 1150, 1210, 1250] +tai.k = io.k*fioaa.k +fioaa.k = clip(fioaa2.k, fioaa1.k, time.k, pyear) +fioaa1.k = tabhl(fioaa1t, fpc.k/ifpc.k, 0, 2.5, 0.5) +fioaa1t = [0.4, 0.2, 0.1, 0.025, 0, 0] +fioaa2.k = tabhl(fioaa2t, fpc.k/ifpc.k, 0, 2.5, 0.5) +fioaa2t = [0.4, 0.2, 0.1, 0.025, 0, 0] +ldr.k = tai.k*fiald.k/dcph.k +dcph.k = tabhl(dcpht, pal.k/palt, 0, 1, 0.1) +dcpht = [1e5, 7400, 5200, 3500, 2400, 1500, 750, 300, 150, 75, 50] + +## Loop2: food from investment in agricultural inputs +cai.k = tai.k * (1 - fiald.k) +ai.k = smooth(cai.j, alai.k) +ai.i = 5e9 +alai.k = clip(alai2, alai1, time.k, pyear) +alai1 = 2 +alai2 = 2 +aiph.k = ai.k*(1 - falm.k)/al.k +lymc.k = tabhl(lymct, aiph.k, 0, 1000, 40) +lymct = [1, 3, 3.8, 4.4, 4.9, 5.4, 5.7, 6, 6.3, 6.6, 6.9, 7.2, 7.4, 7.6, 7.8, 8, 8.2, 8.4, 8.6, 8.8, 9, 9.2, 9.4, 9.6, 9.8, 10] +ly.k = lyf.k*lfert.k*lymc.k*lymap.k +lyf.k = clip(lyf2, lyf1, time.k, pyear) +lyf1 = 1 +lyf2 = 1 +lymap.k = clip(lymap2.k, lymap1.k, time.k, pyear) +lymap1.k = tabhl(lymap1t, io.k/io70, 0, 30, 10) +lymap1t = [1, 1, 0.7, 0.4] +lymap2.k = tabhl(lymap2t, io.k/io70, 0, 30, 10) +lymap2t = [1, 1, 0.7, 0.4] +io70 = 7.9e11 + +## Loop 1 & 2: the investment allocation decision +fiald.k = tabhl(fialdt, mpld.k/mpai.k, 0, 2, 0.25) +fialdt = [0, 0.05, 0.15, 0.30, 0.50, 0.70, 0.85, 0.95, 1] +mpld.k = ly.k/(dcph.k*sd) +sd = 0.07 +mpai.k = alai.k*ly.k*mlymc.k/lymc.k +mlymc.k = tabhl(mlymct, aiph.k, 0, 600, 40) +mlymct = [0.075, 0.03, 0.015, 0.011, 0.009, 0.008, 0.007, 0.006, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005, 0.005] + +## Loop 3: land erosion and urban-industrial use +dynamo_all.k = alln*llmy.k +alln = 6000 +llmy.k = clip(llmy2.k, llmy1.k, time.k, pyear) +llmy1.k = tabhl(llmy1t, ly.k/ilf, 0, 9, 1) +llmy1t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +llmy2.k = tabhl(llmy2t, ly.k/ilf, 0, 9, 1) +llmy2t = [1.2, 1, 0.63, 0.36, 0.16, 0.055, 0.04, 0.025, 0.015, 0.01] +ler.k = al.k/dynamo_all.k +uilpc.k = tabhl(uilpct, iopc.k, 0, 1600, 200) +uilpct = [0.005, 0.008, 0.015, 0.025, 0.04, 0.055, 0.07, 0.08, 0.09] +uilr.k = uilpc.k*pop.k +lrui.k = max(0, (uilr.k - uil.k)/uildt) +uildt = 10 +uil.k = uil.j + dt*(lrui.j) +uil.i = uili +uili = 8.2e6 + +## Loop 4: land fertility degradation +lfert.k = lfert.j + dt*(lfr.j-lfd.j) +lfert.i = lferti +lferti = 600 +lfdr.k = tabhl(lfdrt, ppolx.k, 0, 30, 10) +lfdrt = [0, 0.1, 0.3, 0.5] +lfd.k = lfert.k*lfdr.k + +## Loop 5: land fertility regeneration +lfr.k = (ilf-lfert.k)/lfrt.k +ilf = 600 +lfrt.k = tabhl(lfrtt, falm.k, 0, 0.10, 0.02) +lfrtt = [20.0, 13.0, 8.0, 4.0, 2.0, 2.0] + +## Loop 6: dDiscontinuing land maintinance +falm.k = tabhl(falmt, pfr.k, 0, 4, 1) +falmt = [0.0, 0.04, 0.07, 0.09, 0.1] +fr.k = fpc.k/sfpc +sfpc = 230 +pfr.k = smooth(fr.j, fspd) +pfr.i = 1 +fspd = 2 + +# Nonrenewable resource sector +nr.k = nr.j + dt*(-nrur.j) +nr.i = nri +nri = 1e12 +nrur.k = pop.k * pcrum.k * nruf.k +nruf.k = clip(nruf2, nruf1, time.k, pyear) +nruf1 = 1 +nruf2 = 1 +pcrum.k = tabhl(pcrumt, iopc.k, 0, 1600, 200) +pcrumt = [0.0, 0.85, 2.6, 4.4, 5.4, 6.2, 6.8, 7.0, 7.0] +nrfr.k = nr.k/nri +fcaor.k = clip(fcaor2.k, fcaor1.k, time.k, pyear) +fcaor1.k = tabhl(fcaor1t, nrfr.k, 0, 1, 0.1) +fcaor1t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] +fcaor2.k = tabhl(fcaor2t, nrfr.k, 0, 1, 0.1) +fcaor2t = [1.0, 0.9, 0.7, 0.5, 0.2, 0.1, 0.05, 0.05, 0.05, 0.05, 0.05] + +# Persistent pollution sector +ppgr.k = (ppgio.k + ppgao.k)*ppgf.k +ppgf.k = clip(ppgf2, ppgf1, time.k, pyear) +ppgf1 = 1 +ppgf2 = 1 +ppgio.k = pcrum.k * pop.k * frpm*imef*imti +frpm = 0.02 +imef = 0.1 +imti = 10 +ppgao.k = aiph.k*al.k*fipm*amti +fipm = 0.001 +amti = 1 +ppapr.k = delay3(ppgr.j, pptd) +pptd = 20 +ppol.k = ppol.j + dt*(ppapr.j-ppasr.j) +ppol.i = 2.5e7 +ppolx.k = ppol.k/ppol70 +ppol70 = 1.36e8 +ppasr.k = ppol.k/(ahl.k*1.4) +ahlm.k = tabhl(ahlmt, ppolx.k, 1, 1001, 250) +ahlmt = [1.0, 11.0, 21.0, 31.0, 41.0] +ahl.k = ahl70*ahlm.k +ahl70 = 1.5 + +# Supplementary equations +foa.k = 0.22*f.k/(0.22*f.k + so.k + io.k) +foi.k = io.k/(0.22*f.k + so.k + io.k) +fos.k = so.k/(0.22*f.k + so.k + io.k) + +# Control card for simulation +# Some have been removed because not implemented this way in pydynamo +# SPEC dt = 0.5 +# SPEC length = 2100 +pyear = 1975 +# N time = 1900 +start_date = 1900 +# A pltper.k = step(plp, plit) +# C plp = 5 +# C plit = 1900 +# C prp = 0 +# A prtper.k = step(prp, prit) + step(-prp, prtt) +# C prit = 1900 +# C prtt = 2100 + +# Take care to keep the last line ! + diff --git a/world3/colors.py b/world3/colors.py deleted file mode 100644 index 08daf4c85febb2d27bf811954e6bd693e065d092..0000000000000000000000000000000000000000 --- a/world3/colors.py +++ /dev/null @@ -1,14 +0,0 @@ -sector_colors = { - 'Persistent pollution sector': '#19D9FF', - 'Population sector': '#CF4125', - 'Capital sector': '#0073E6', - 'Agricultural sector': '#66CC00', - 'Nonrenewable resource sector': '#8080FF', -} - -from .get_sectors import get_sectors -def get_colors(fname): - sectors = get_sectors(fname) - return {v: sector_colors[sectors[v]] for v in sectors} - -var_colors = get_colors('world3/world3_pydynamo_code.py') diff --git a/world3/get_sectors.py b/world3/get_sectors.py deleted file mode 100644 index 944dbfb01b602227568b20b1eb959b07097cb40f..0000000000000000000000000000000000000000 --- a/world3/get_sectors.py +++ /dev/null @@ -1,25 +0,0 @@ -import pprint -import re - -sectors = {} -subsectors = {} -def get_sectors(fname): - with open(fname, 'r') as f: - for l in f.readlines(): - if l.startswith('#'): - if ' sector' in l: - sector = l[1:].strip() - subsector = '' - elif ' subsector' in l: - subsector = l[1:].strip() - - else: - try: - var = re.findall('^(\w*)[\. ]', l)[0] - sectors[var] = sector - subsectors[var] = subsector - - except Exception as e: - assert l.strip() == '', 'error: ' + l + '\n' + repr(e) - return sectors - diff --git a/world3/standart_run.png b/world3/images/standart_run.png similarity index 100% rename from world3/standart_run.png rename to world3/images/standart_run.png diff --git a/world3/variable_graph.png b/world3/images/variable_graph.png similarity index 100% rename from world3/variable_graph.png rename to world3/images/variable_graph.png diff --git a/world3/infos/get_definitions.py b/world3/infos/get_definitions.py new file mode 100644 index 0000000000000000000000000000000000000000..bcba64de667ce601f5bb95e4bbc16284455f2f7e --- /dev/null +++ b/world3/infos/get_definitions.py @@ -0,0 +1,50 @@ +def read_translated_defs(filename): + """Reads definitions with markdown format (see begin_sentence) + and returns the definitions dictionnary + """ + defs = {} + with open(filename, 'r') as f: + var_name = '' + for l in f.readlines(): + if l.startswith('##'): + var_name = l[2:].strip() + defs[var_name] = [] + elif l.startswith('- '): + defs[var_name].append(l[2:].strip()) + return defs + +begin_sentence = """# World3 definitions +Definitions in french and english, but differently formatted, +in order to write transalations by hand more easily. +Go to file get_definitions.py to convert this file to jso. + +Syntax: +Variable name should begin by a '## ' and definitions in english and then french are at the two next lines begining by a '- '. +""" + +def write_translated_defs(filename, defs): + """Write definitions that are in the dictionnary defs + in markdown format in the filename + """ + + with open(filename, 'w+') as f: + f.write(begin_sentence) + for k in defs: + f.write(f'## {k}\n') + f.write(f'- {defs[k][0]}\n') + f.write(f'- {defs[k][1]}\n') + + +# import json + +# From markdown to definitions dict +# translated_defs = read_translated_defs('translated_defs.md') + +# From definitions dict to markdown +# with open('translated_defs.json', 'w+') as f: + # json.dump(translated_defs, f) + +# # From json to dict +# with open('translated_defs.json', 'r') as f: +# translated_defs = json.load(f) + diff --git a/world3/infos/get_sectors.py b/world3/infos/get_sectors.py new file mode 100644 index 0000000000000000000000000000000000000000..2b03692f6aa223a4bc30229ed7f52457bb88f35b --- /dev/null +++ b/world3/infos/get_sectors.py @@ -0,0 +1,54 @@ +import re + +def get_sectors(fname): + """From the code get all sectors""" + sectors = {} + subsectors = {} + + with open(fname, 'r') as f: + for l in f.readlines(): + if l.startswith('#'): + if ' sector' in l: + sector = l[1:].strip() + subsector = '' + elif ' subsector' in l: + subsector = l[1:].strip() + + else: + try: + var = re.findall('^(\w*)[\. \=]', l)[0] + sectors[var] = sector + subsectors[var] = subsector + + except Exception as e: + assert l.strip() == '', 'error: ' + l + '\n' + repr(e) + return sectors, subsectors + +sector_color = { + 'Persistent pollution sector': '#19D9FF', + 'Population sector': '#CF4125', + 'Capital sector': '#0073E6', + 'Agricultural sector': '#66CC00', + 'Nonrenewable resource sector': '#8080FF', +} + + +# # Dict(variable: corresponding sector) +# var_sector, var_subsector = get_sectors('../limits_to_growth_pydynamo_code.py') + +# # Dict(sector: [corresponding variables] +# sector_vars = {sector: [] for sector in var_sector.values()} +# for var in var_sector: +# sector_vars[var_sector[var]].append(var) + +# # Dict(variable: corresponding color) +# var_color = {v: sector_color[sector] for v, sector in var_sector.items()} + +# Note: variables but also constants and tables are included +# import json + +# for dico, filename in ((var_sector, 'var_sector.json'), +# (sector_vars, 'sector_vars.json'), +# (var_color, 'var_color.json')): +# with open(filename, 'w+') as f: +# json.dump(dico, f) diff --git a/world3/infos/translated_defs.md b/world3/infos/translated_defs.md new file mode 100644 index 0000000000000000000000000000000000000000..77b59e32256c887b83db65326a04b5970e24fddb --- /dev/null +++ b/world3/infos/translated_defs.md @@ -0,0 +1,855 @@ +# World3 definitions +Definitions in french and english, but differently formatted, +in order to write transalations by hand more easily. +Go to file get_definitions.py to convert this file to jso. + +Syntax: +Variable name should begin by a '## ' and definitions in english and then french are at the two next lines begining by a '- '. +## ali +- arable land initial [hectares]. The default is 0.9e9. +- Surface initiale de terres arables. + +## pali +- potentially arable land initial [hectares]. The default is 2.3e9. +- Surface initiale de terres poteniellement arables. + +## lfh +- land fraction harvested []. The default is 0.7. +- Proportion des terres cultivées. + +## palt +- potentially arable land total [hectares]. The default is 3.2e9. +- Quantité total des terres potentiellement arables. + +## pl +- processing loss []. The default is 0.1. +- Proportion de nourriture perdues pendant la production. + +## alai1 +- alai, value before time=pyear [years]. The default is 2. +- alai avant pyear. + +## alai2 +- alai, value after time=pyear [years]. The default is 2. +- alai après pyear. + +## io70 +- industrial output in 1970 [dollars/year]. The default is 7.9e11. +- Production industrielle en 1970. + +## lyf1 +- lyf, value before time=pyear []. The default is 1. +- lyf avant pyear. + +## lyf2 +- lyf, value after time=pyear []. The default is 1. +- lyf après pyear. + +## sd +- social discount [1/year]. The default is 0.07. +- Ratio utilisé pour obtenir la valeur de la productivité de développement de champs. + +## uili +- urban-industrial land initial [hectares]. The default is 8.2e6. +- Surface initiale de terrains industriels et urbanisés. + +## alln +- average life of land normal [years]. The default is 6000. +- Valeur moyenne du temps de vie d'un hectare selon les méthodes normales d'agriculture. Est une mesure de l'érosion. + +## uildt +- urban-industrial land development time [years]. The default is 10. +- Temps avant que la quantité de terrain urbanisés/industriels atteignent la quantité nécessaire. + +## lferti +- land fertility initial [vegetable-equivalent kilograms/hectare-year]. The default is 600. +- Fertilité initiale des terres. + +## ilf +- inherent land fertility [vegetable-equivalent kilograms/hectare-year]. The default is 600. +- Fertinilité inhérentes des terres. + +## fspd +- food shortage perception delay [years]. The default is 2. +- Temps de perception d'un manque de nourriture. + +## sfpc +- subsistence food per capita [vegetable-equivalent kilograms/person-year]. The default is 230. +- Nourriture de subsistence nécessaire par personne. + +## al +- arable land [hectares]. +- Surface de terres arables. + +## pal +- potentially arable land [hectares]. +- Surface de terres potentiellement arables. + +## dcph +- development cost per hectare [dollars/hectare]. +- Coût de développement des terres par hectare. + +## f +- food [vegetable-equivalent kilograms/year]. +- Quantité de nourriture. + +## fpc +- food per capita [vegetable-equivalent kilograms/person-year]. +- Quantité de nourriture par personne. + +## fioaa +- fraction of industrial output allocated to agriculture []. +- Proportion de la production industrielle dédiée à l'agriculture. + +## fioaa1 +- fioaa, value before time=pyear []. +- fioaa avant pyear. + +## fioaa2 +- fioaa, value after time=pyear []. +- fiaa après pyear. + +## ifpc +- indicated food per capita [vegetable-equivalent kilograms/person-year]. +- Quantité indiquée (~désirée) de nourriture par personne. + +## ifpc1 +- ifpc, value before time=pyear [vegetable-equivalent kilograms/person-year]. +- ifpc avant pyear + +## ifpc2 +- ifpc, value after time=pyear [vegetable-equivalent kilograms/person-year]. +- ifpc après pyear + +## ldr +- land development rate [hectares/year]. +- Surface de terres développées par an. + +## lfc +- land fraction cultivated []. +- Proportion des terres cultivées. + +## tai +- total agricultural investment [dollars/year]. +- Investiment total dans l'agriculture. + +## ai +- agricultural inputs [dollars/year]. +- Entrées agricoles. + +## aiph +- agricultural inputs per hectare [dollars/hectare-year]. +- Entrées agricoles par hectare par an. + +## alai +- average lifetime of agricultural inputs [years]. +- Temps de vie moyen des entrées agricoles. + +## cai +- current agricultural inputs [dollars/year]. +- Entrées agricoles actuelles. + +## ly +- land yield [vegetable-equivalent kilograms/hectare-year]. +- Production agricole par hectare par an. + +## lyf +- land yield factor []. +- Fraction réelle de la production agricole. (Permet de modéliser un impact externe sur cette production) + +## lymap +- land yield multiplier from air pollution []. +- Impact de la pollution de l'air sur la productivité agricole. + +## lymap1 +- lymap, value before time=pyear []. +- lymap avant pyear + +## lymap2 +- lymap, value after time=pyear []. +- lymap après pyear + +## lymc +- land yield multiplier from capital []. +- Impact du captial sur la productivité agricole. + +## fiald +- fraction of inputs allocated to land development []. +- Proportion des entrées dédiées à l'agriculture. + +## mlymc +- marginal land yield multiplier from capital [hectares/dollar]. +- Multiplier de la productivité marginale des terres par le capital. + +## mpai +- marginal productivity of agricultural inputs. [vegetable equivalent kilograms/dollar]. +- Productivité marginale des entrées agricoles + +## mpld +- marginal productivity of land development [vegetable-equivalent kilograms/dollar]. +- Productivité marginale du développement des terres. + +## uil +- urban-industrial land [hectares]. +- Terres urbanisées/industrielles. + +## all +- average life of land [years]. +- Temps de vie moyen d'une terre. + +## llmy +- land life multiplier from yield []. +- Impact de la production sur le temps de vie moyen d'une terre. + +## llmy1 +- llmy, value before time=pyear []. +- llmy avant pyear. + +## llmy2 +- llmy, value after time=pyear []. +- llmy après pyear. + +## ler +- land erosion rate [hectares/year]. +- + +## lrui +- land removal for urban-industrial use [hectares/year]. +- + +## uilpc +- urban-industrial land per capita [hectares/person]. +- + +## uilr +- urban-industrial land required [hectares]. +- + +## lfert +- land fertility [vegetable-equivalent kilograms/hectare-year]. +- + +## lfd +- land fertility degradation [vegetable-equivalent kilograms/hectare-year-year]. +- + +## lfdr +- land fertility degradation rate [1/year]. +- + +## lfr +- land fertility regeneration [vegetable-equivalent kilograms/hectare-year-year]. +- + +## lfrt +- land fertility regeneration time [years]. +- + +## falm +- fraction of inputs allocated to land maintenance [dimensionless]. +- + +## fr +- food ratio []. +- + +## pfr +- perceived food ratio []. +- + +## ici +- industrial capital initial [dollars]. The default is 2.1e11. +- + +## sci +- service capital initial [dollars]. The default is 1.44e11. +- + +## iet +- industrial equilibrium time [years]. The default is 4000. +- + +## iopcd +- industrial output per capita desired [dollars/person-year]. The default is 400. +- + +## lfpf +- labor force participation fraction []. The default is 0.75. +- + +## lufdt +- labor utilization fraction delay time [years]. The default is 2. +- + +## icor1 +- icor, value before time=pyear [years]. The default is 3. +- + +## icor2 +- icor, value after time=pyear [years]. The default is 3. +- + +## scor1 +- scor, value before time=pyear [years]. The default is 1. +- + +## scor2 +- scor, value after time=pyear [years]. The default is 1. +- + +## alic1 +- alic, value before time=pyear [years]. The default is 14. +- + +## alic2 +- alic, value after time=pyear [years]. The default is 14. +- + +## alsc1 +- alsc, value before time=pyear [years]. The default is 20. +- + +## alsc2 +- alsc, value after time=pyear [years]. The default is 20. +- + +## fioac1 +- fioac, value before time=pyear []. The default is 0.43. +- + +## fioac2 +- fioac, value after time=pyear []. The default is 0.43. +- + +## ic +- industrial capital [dollars]. It is a state variable. +- + +## io +- industrial output [dollars/year]. +- + +## icdr +- industrial capital depreciation rate [dollars/year]. +- + +## icir +- industrial capital investment rate [dollars/year]. +- + +## icor +- industrial capital-output ratio [years]. +- + +## iopc +- industrial output per capita [dollars/person-year]. +- + +## alic +- average lifetime of industrial capital [years]. +- + +## fioac +- fraction of industrial output allocated to consumption []. +- + +## fioacc +- fioac constant []. +- + +## fioacv +- fioac variable []. +- + +## fioai +- fraction of industrial output allocated to industry []. +- + +## sc +- service capital [dollars]. It is a state variable. +- + +## so +- service output [dollars/year]. +- + +## scdr +- service capital depreciation rate [dollars/year]. +- + +## scir +- service capital investment rate [dollars/year]. +- + +## scor +- service capital-output ratio [years]. +- + +## sopc +- service output per capita [dollars/person-year]. +- + +## alsc +- average lifetime of service capital [years]. +- + +## isopc +- indicated service output per capita [dollars/person-year]. +- + +## isopc1 +- isopc, value before time=pyear [dollars/person-year]. +- + +## isopc2 +- isopc, value after time=pyear [dollars/person-year]. +- + +## fioas +- fraction of industrial output allocated to services []. +- + +## fioas1 +- fioas, value before time=pyear []. +- + +## fioas2 +- fioas, value after time=pyear []. +- + +## j +- jobs [persons]. +- + +## jph +- jobs per hectare [persons/hectare]. +- + +## jpicu +- jobs per industrial capital unit [persons/dollar]. +- + +## jpscu +- jobs per service capital unit [persons/dollar]. +- + +## lf +- labor force [persons]. +- + +## cuf +- capital utilization fraction []. +- + +## luf +- labor utilization fraction []. +- + +## lufd +- labor utilization fraction delayed []. +- + +## pjas +- potential jobs in agricultural sector [persons]. +- + +## pjis +- potential jobs in industrial sector [persons]. +- + +## pjss +- potential jobs in service sector [persons]. +- + +## ppoli +- persistent pollution initial [pollution units]. The default is 2.5e7. +- + +## ppol70 +- persistent pollution in 1970 [pollution units]. The default is 1.36e8. +- + +## ahl70 +- assimilation half-life in 1970 [years]. The default is 1.5. +- + +## amti +- agricultural materials toxicity index [pollution units/dollar].The default is 1. +- + +## imti +- industrial materials toxicity index [pollution units/resource unit]. The default is 10. +- + +## imef +- industrial materials emission factor []. The default is 0.1. +- + +## fipm +- fraction of inputs as persistent materials []. The default is 0.001. +- + +## frpm +- fraction of resources as persistent materials []. The default is 0.02. +- + +## ppgf1 +- ppgf value before time=pyear []. The default is 1. +- + +## ppgf2 +- ppgf value after time=pyear []. The default is 1. +- + +## ppgf21 +- DESCRIPTION. The default is 1. +- + +## pptd1 +- pptd value before time=pyear [years]. The default is 20. +- + +## pptd2 +- pptd value after time=pyear [years]. The default is 20. +- + +## ppol +- persistent pollution [pollution units]. It is a state variable. +- + +## ppolx +- index of persistent pollution []. +- + +## ppgao +- persistent pollution generated by agricultural output [pollution units/year]. +- + +## ppgio +- persistent pollution generated by industrial output [pollution units/year]. +- + +## ppgf +- persistent pollution generation factor []. +- + +## ppgr +- persistent pollution generation rate [pollution units/year]. +- + +## ppapr +- persistent pollution appearance rate [pollution units/year]. +- + +## ppasr +- persistent pollution assimilation rate [pollution units/year]. +- + +## pptd +- persistent pollution transmission delay [years]. +- + +## ahl +- assimilation half-life [years]. +- + +## ahlm +- assimilation half-life multiplier []. +- + +## p1i +- p2 initial [persons]. The default is 65e7. +- + +## p2i +- p2 initial [persons]. The default is 70e7. +- + +## p3i +- p3 initial [persons]. The default is 19e7. +- + +## p4i +- p4 initial [persons]. The default is 6e7. +- + +## dcfsn +- desired completed family size normal []. The default is 4. +- + +## fcest +- fertility control effectiveness set time [year]. The default is 4000. +- + +## hsid +- health services impact delay [years]. The default is 20. +- + +## ieat +- income expectation averaging time [years]. The default is 3. +- + +## len +- life expectancy normal [years]. The default is 28. +- + +## lpd +- lifetime perception delay [years]. The default is 20. +- + +## mtfn +- maximum total fertility normal []. The default is 12. +- + +## pet +- population equilibrium time [year]. The default is 4000. +- + +## rlt +- reproductive lifetime [years]. The default is 30. +- + +## sad +- social adjustment delay [years]. The default is 20. +- + +## zpgt +- time when desired family size equals 2 children [year]. The default is 4000. +- + +## p1 +- population, ages 0-14 [persons]. It is a state variable. +- + +## p2 +- population, ages 15-44 [persons]. It is a state variable. +- + +## p3 +- population, ages 45-64 [persons]. It is a state variable. +- + +## p4 +- population, ages 65+ [persons]. It is a state variable. +- + +## pop +- population [persons]. +- + +## mat1 +- maturation rate, age 14-15 [persons/year]. +- + +## mat2 +- maturation rate, age 44-45 [persons/year]. +- + +## mat3 +- maturation rate, age 64-65 [persons/year]. +- + +## d +- deaths per year [persons/year]. +- + +## d1 +- deaths per year, ages 0-14 [persons/year]. +- + +## d2 +- deaths per year, ages 15-44 [persons/year]. +- + +## d3 +- deaths per year, ages 45-64 [persons/year]. +- + +## d4 +- deaths per year, ages 65+ [persons/year]. +- + +## cdr +- crude death rate [deaths/1000 person-years]. +- + +## ehspc +- effective health services per capita [dollars/person-year]. +- + +## fpu +- fraction of population urban []. +- + +## hsapc +- health services allocations per capita [dollars/person-year]. +- + +## le +- life expectancy [years]. +- + +## lmc +- lifetime multiplier from crowding []. +- + +## lmf +- lifetime multiplier from food []. +- + +## lmhs +- lifetime multiplier from health services []. +- + +## lmhs1 +- lmhs, value before time=pyear []. +- + +## lmhs2 +- lmhs, value after time=pyear []. +- + +## lmp +- lifetime multiplier from persistent pollution []. +- + +## m1 +- mortality, ages 0-14 [deaths/person-year]. +- + +## m2 +- mortality, ages 15-44 [deaths/person-year]. +- + +## m3 +- mortality, ages 45-64 [deaths/person-year]. +- + +## m4 +- mortality, ages 65+ [deaths/person-year]. +- + +## b +- births per year [persons/year]. +- + +## aiopc +- average industrial output per capita [dollars/person-year]. +- + +## cbr +- crude birth rate [births/1000 person-years]. +- + +## cmi +- crowding multiplier from industrialization []. +- + +## cmple +- compensatory multiplier from perceived life expectancy []. +- + +## diopc +- delayed industrial output per capita [dollars/person-year]. +- + +## dtf +- desired total fertility []. +- + +## dcfs +- desired completed family size []. +- + +## fcapc +- fertility control allocations per capita [dollars/person-year]. +- + +## fce +- fertility control effectiveness []. +- + +## fcfpc +- fertility control facilities per capita [dollars/person-year]. +- + +## fie +- family income expectation []. +- + +## fm +- fecundity multiplier []. +- + +## frsn +- family response to social norm []. +- + +## fsafc +- fraction of services allocated to fertility control []. +- + +## mtf +- maximum total fertility []. +- + +## nfc +- need for fertility control []. +- + +## ple +- perceived life expectancy [years]. +- + +## sfsn +- social family size norm []. +- + +## tf +- total fertility []. +- + +## nri +- nonrenewable resources initial [resource units]. The default is 1e12. +- + +## nruf1 +- nruf value before time=pyear []. The default is 1. +- + +## nruf2 +- nruf value after time=pyear []. The default is 1. +- + +## nr +- nonrenewable resources [resource units]. It is a state variable. +- + +## nrfr +- nonrenewable resource fraction remaining []. +- + +## nruf +- nonrenewable resource usage factor []. +- + +## nrur +- nonrenewable resource usage rate [resource units/year]. +- + +## pcrum +- per capita resource usage multiplier [resource units/person-year]. +- + +## fcaor +- fraction of capital allocated to obtaining resources []. +- + +## fcaor1 +- fcaor value before time=pyear []. +- + +## fcaor2 +- fcaor value after time=pyear []. +- + diff --git a/world3/variable_definitions.json b/world3/infos/variable_definitions.json similarity index 100% rename from world3/variable_definitions.json rename to world3/infos/variable_definitions.json