diff --git a/run/index.html b/run/index.html index 0cb23c3..e0a059f 100644 --- a/run/index.html +++ b/run/index.html @@ -620,6 +620,15 @@ + + +
  • + + + Doing a baseline run + + +
  • @@ -763,6 +772,15 @@ +
  • + +
  • + + + Doing a baseline run + + +
  • @@ -1038,29 +1056,94 @@

    Doing multiple runs

    1. Don't forget to save each file to a different name, otherwise they will be overwritten at each iteration of the loop.
    +

    Doing a baseline run

    +

    It can be useful to do a MIMOSA run with zero mitigation: a baseline run. We distinguish two types of baseline runs: either ignoring damages (the true baseline run, in absence of climate policy and climate impacts), or with damages (a no-policy scenario, mainly to investigate the damages if no climate policy were implemented).

    +
    +
    +
    +
    from mimosa import MIMOSA, load_params
    +
    +params = load_params()
    +
    +params["emissions"]["carbonbudget"] = False
    +params["economics"]["damages"]["ignore damages"] = True
    +
    +params["model"]["welfare module"] = "cost_minimising"
    +
    +# Disable some emission reduction constraints
    +params["emissions"]["non increasing emissions after 2100"] = False
    +params["emissions"]["not positive after budget year"] = False
    +params["emissions"]["inertia"]["regional"] = False
    +params["emissions"]["inertia"]["global"] = False
    +
    +params["time"]["end"] = 2150
    +
    +model = MIMOSA(params)
    +model.solve()
    +model.save("baseline_ignore_damages")
    +
    +
    +
    +
    from mimosa import MIMOSA, load_params
    +
    +params = load_params()
    +
    +params["emissions"]["carbonbudget"] = False
    +params["economics"]["damages"]["ignore damages"] = False # (1)!
    +params["model"]["welfare module"] = "cost_minimising"
    +
    +# Force the mitigation effort to be zero
    +params["simulation"]["simulationmode"] = True
    +params["simulation"]["constraint_variables"] = {
    +     "relative_abatement": {
    +          year: {region: 0.0 for region in params["regions"]}
    +          for year in range(2025, 2151, 5)
    +     },
    +}
    +params["economics"]["MAC"]["gamma"] = "0.00001 USD2005/tCO2" # (2)!
    +
    +# Disable some emission reduction constraints
    +params["emissions"]["non increasing emissions after 2100"] = False
    +params["emissions"]["not positive after budget year"] = False
    +params["emissions"]["inertia"]["regional"] = False
    +params["emissions"]["inertia"]["global"] = False
    +
    +params["time"]["end"] = 2150
    +
    +model = MIMOSA(params)
    +model.solve()
    +model.save("baseline_no_policy")
    +
    +
      +
    1. This is default, so this line could be removed
    2. +
    3. Needed for numerical stability
    4. +
    +
    +
    +

    Advanced: logging

    The solve status (optimal, impossible, etc), model solve time and the final maximised value can be logged to an external log file (along with the warnings or errors from the code). This can be very useful when doing many runs overnight. In this code example, the log is written to the file mainlog.log:

    -
    import logging
    -import logging.handlers
    -
    -from mimosa import MIMOSA, load_params
    -
    -handler = logging.handlers.WatchedFileHandler("mainlog.log")
    -handler.setFormatter(
    -    logging.Formatter("[%(levelname)s, %(asctime)s] %(name)s - %(message)s")
    -)
    -root = logging.getLogger()
    -root.setLevel("INFO")
    -root.addHandler(handler)
    -
    -params = load_params()
    -
    -# Make changes to the params if needed
    -params["emissions"]["carbonbudget"] = False
    -
    -model1 = MIMOSA(params)
    -model1.solve(verbose=False) # (1)!
    -model1.save("run1")
    +
    import logging
    +import logging.handlers
    +
    +from mimosa import MIMOSA, load_params
    +
    +handler = logging.handlers.WatchedFileHandler("mainlog.log")
    +handler.setFormatter(
    +    logging.Formatter("[%(levelname)s, %(asctime)s] %(name)s - %(message)s")
    +)
    +root = logging.getLogger()
    +root.setLevel("INFO")
    +root.addHandler(handler)
    +
    +params = load_params()
    +
    +# Make changes to the params if needed
    +params["emissions"]["carbonbudget"] = False
    +
    +model1 = MIMOSA(params)
    +model1.solve(verbose=False) # (1)!
    +model1.save("run1")
     
    1. By setting verbose=False, the IPOPT output is not printed. diff --git a/search/search_index.json b/search/search_index.json index d28f63f..d4c4f70 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#mimosa-mathematical-integrated-model-for-optimal-and-stylised-assessment","title":"MIMOSA: Mathematical Integrated Model for Optimal and Stylised Assessment","text":"Warning

      This documentation is still under construction and will be updated regularly.

      MIMOSA is a recent simple IAM based on FAIR, with 26 regions covering the whole world. It is a relatively simple Cost-Benefit IAM but still covers the relevant technological and socio-economic dynamics. Temperature is a linear function of cumulative CO2 emissions. MIMOSA uses the DICE sea-level rise module. The mitigation costs, population, initial capital stock and baseline GDP and CO2 emissions are regional. The direct regional mitigation costs are calculated as area under the Marginal Abatement Cost (MAC) curve, and have been calibrated to the IPCC AR6 WGIII database.

      Documentation Installation Running

      "},{"location":"#general","title":"General","text":"

      The model is written in the Python optimisation package Pyomo. It is mainly an AbstractModel (object containing all the variables, parameters and constraints, without the actual data values), which is then transformed into a ConcreteModel by putting all the parameter values in it. This ConcreteModel is sent to the solver (IPOPT, an open-source large-scale nonlinear optimisation suite).

      Schematic overview of the MIMOSA model. From [1].

      "},{"location":"#how-to-cite","title":"How to cite","text":"

      When using MIMOSA, please cite [1] (global version) and [2] (regional version).

      "},{"location":"#references","title":"References","text":"

      [1] van der Wijst, KI., Hof, A.F. & van Vuuren, D.P. On the optimality of 2\u00b0C targets and a decomposition of uncertainty. Nature Communications 12, 2575 (2021). https://doi.org/10.1038/s41467-021-22826-5

      [2] van der Wijst, KI., Bosello, F., Dasgupta, S. et al. New damage curves and multimodel analysis suggest lower optimal temperature. Nature Climate Change 13, 434\u2013441 (2023). https://doi.org/10.1038/s41558-023-01636-1

      "},{"location":"extending_mimosa/","title":"Extending MIMOSA","text":"
      • Adding a variable
      • Adding a parameter

        • Either setting param directly from config
          • With string or dynamically
        • Or setting it automatically from regional param store
          • With string or dynamically
        • Or for more advanced manipulations by using instantiate_params.py
      • Adding a new component (import abstract_model etc)

      "},{"location":"installation/","title":"Installing MIMOSA","text":"

      MIMOSA is written in Python, can be installed using pip:

      pip install mimosa\n

      If you don't have Python installed yet, we highly recommend to use Anaconda to install python.

      "},{"location":"installation/#installing-the-optimisation-engine-ipopt","title":"Installing the optimisation engine IPOPT","text":"

      Since MIMOSA is an optimisation model, an optimisation engine needs to be specified. This can be installed locally (see With IPOPT installed locally), but an easier way is to use a free cloud-based optimisation service called NEOS.

      Using the NEOS serverWith IPOPT installed locally

      The MIMOSA runs can easily be sent to the NEOS server (https://neos-server.org) for remote optimisation. First, on their website, sign up for a free account. You can then run MIMOSA with NEOS enabled by simply providing it with the email address you used to sign up for NEOS:

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nmodel1 = MIMOSA(params)\nmodel1.solve(use_neos=True, neos_email=\"your.email@email.com\")\nmodel1.save(\"run1\")\n

      Depending on the MIMOSA parameters chosen and on how busy the NEOS server is, running the model might take a while (typically a couple of minutes).

      A faster way to run MIMOSA, and which doesn't require an internet connection, is to install the open-source optimisation engine IPOPT locally:

      conda install -c conda-forge ipopt\n
      However, this sometimes fails on Windows. To fix it, go to https://www.coin-or.org/download/binary/Ipopt/ and download the latest win64-version. Unzip the files. A subfolder bin should contain the file ipopt.exe. The next step is to add this folder to your PATH environment: Windows > Edit the system environment variables > Environment variables... > Select \"Path\" and click Edit... > Click New and browse to the folder you just unzipped. Make sure to select the bin subfolder as this folder contains the file ipopt.exe.

      More detailed steps on how to install IPOPT on Windows
      1. Once you've downloaded the zip file of the latest win64-version on the coin website (currently Ipopt-3.11.1-win64-intel13.1.zip), unzip this file to folder of your choice. In the unzipped folder, there should be a bin folder.
      2. The next step is to tell Windows to look for IPOPT in this bin directory. This is achieved by adding the relevant folder to the environment path of Windows. Click on Start (or press the Win key), type environment and press Enter. This should open the dialog Edit the system environment variables.
      3. Click on Environment variables, select Path and click edit.
      4. Here, you can add the folder with the IPOPT bin folder. Click on New and add the folder you unzipped IPOPT in, making sure to select the sub-folder bin:
      5. You can test if everything works by opening an Anaconda Prompt and typing ipopt. It should show something like this:

      Once IPOPT is installed, MIMOSA can be ran without NEOS:

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nmodel1 = MIMOSA(params)\nmodel1.solve()  # No NEOS required\nmodel1.save(\"run1\")\n

      Next: Running MIMOSA

      "},{"location":"parameters/","title":"Parameter reference","text":"SSP

      SSP, used for population, baseline GDP and baseline emissions

      • Type: enum

      • Default: SSP2

      • Can be false: False

      • Allowed values:

        • SSP1
        • SSP2
        • SSP3
        • SSP4
        • SSP5

      Example usage:

      params = load_params()\nparams[\"SSP\"] = \"SSP2\"\nmodel = MIMOSA(params)\n
      regionstype

      Name of the region definition. Used in the mapping of the regional parameters.

      • Type: enum

      • Default: IMAGE26

      • Can be false: False

      • Allowed values:

        • IMAGE26
        • SSP5
        • World

      Example usage:

      params = load_params()\nparams[\"regionstype\"] = \"IMAGE26\"\nmodel = MIMOSA(params)\n
      regionsmappings

      List of region types and their conversion tables. Only used for regional parameters, not for aggregating or disaggregating variables or other output.

      • Type: list

      • Default: [{'regionstype1': 'IMAGE26', 'regionstype2': 'COACCH', 'conversiontable': 'inputdata/regions/IMAGE26_COACCH.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2010', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2010.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2012', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2012.csv'}]

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regionsmappings\"] = [{'regionstype1': 'IMAGE26', 'regionstype2': 'COACCH', 'conversiontable': 'inputdata/regions/IMAGE26_COACCH.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2010', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2010.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2012', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2012.csv'}]\nmodel = MIMOSA(params)\n
      regional_parameter_files

      Dictionary of regional parameter files. If the regionstype of the file is different from the regionstype of the model, the file is converted using the regionsmappings parameter.

      • Type: dict

      • Default: {'economics': {'filename': 'inputdata/params/economics.csv', 'regionstype': 'IMAGE26'}, 'MAC': {'filename': 'inputdata/params/mac.csv', 'regionstype': 'IMAGE26'}, 'COACCH': {'filename': 'inputdata/params/COACCH.csv', 'regionstype': 'COACCH'}, 'ADRICE2010': {'filename': 'inputdata/params/ADRICE2010.csv', 'regionstype': 'ADRICE2010'}, 'ADRICE2012': {'filename': 'inputdata/params/ADRICE2012.csv', 'regionstype': 'ADRICE2012'}}

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regional_parameter_files\"] = {'economics': {'filename': 'inputdata/params/economics.csv', 'regionstype': 'IMAGE26'}, 'MAC': {'filename': 'inputdata/params/mac.csv', 'regionstype': 'IMAGE26'}, 'COACCH': {'filename': 'inputdata/params/COACCH.csv', 'regionstype': 'COACCH'}, 'ADRICE2010': {'filename': 'inputdata/params/ADRICE2010.csv', 'regionstype': 'ADRICE2010'}, 'ADRICE2012': {'filename': 'inputdata/params/ADRICE2012.csv', 'regionstype': 'ADRICE2012'}}\nmodel = MIMOSA(params)\n
      regions

      Dictionary of all regions with optional dictionaries defining, optionally, manual values for certain parameters for that specific region.

      • Type: dict

      • Default: {'CAN': None, 'USA': None, 'MEX': None, 'RCAM': None, 'BRA': None, 'RSAM': None, 'NAF': None, 'WAF': None, 'EAF': None, 'SAF': None, 'WEU': None, 'CEU': None, 'TUR': None, 'UKR': None, 'STAN': None, 'RUS': None, 'ME': None, 'INDIA': None, 'KOR': None, 'CHN': None, 'SEAS': None, 'INDO': None, 'JAP': None, 'OCE': None, 'RSAS': None, 'RSAF': None}

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regions\"] = {'CAN': None, 'USA': None, 'MEX': None, 'RCAM': None, 'BRA': None, 'RSAM': None, 'NAF': None, 'WAF': None, 'EAF': None, 'SAF': None, 'WEU': None, 'CEU': None, 'TUR': None, 'UKR': None, 'STAN': None, 'RUS': None, 'ME': None, 'INDIA': None, 'KOR': None, 'CHN': None, 'SEAS': None, 'INDO': None, 'JAP': None, 'OCE': None, 'RSAS': None, 'RSAF': None}\nmodel = MIMOSA(params)\n

      "},{"location":"parameters/#time_1","title":"time","text":"start

      Year in which the model starts

      • Type: int

      • Default: 2020

      • Can be false: False

      • Min: 1900

      • Max: 2100

      Example usage:

      params = load_params()\nparams[\"time\"][\"start\"] = 2020\nmodel = MIMOSA(params)\n
      end

      Last year of the model run

      • Type: int

      • Default: 2150

      • Can be false: False

      • Min: 1901

      • Max: 2300

      Example usage:

      params = load_params()\nparams[\"time\"][\"end\"] = 2150\nmodel = MIMOSA(params)\n
      dt

      Timestep in years

      • Type: float

      • Default: 5

      • Can be false: False

      • Min: 0.5

      • Max: 20

      Example usage:

      params = load_params()\nparams[\"time\"][\"dt\"] = 5\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics_1","title":"economics","text":"PRTP

      Pure rate of time preference

      • Type: float

      • Default: 0.015

      • Can be false: False

      • Min: 0

      • Max: 0.2

      Example usage:

      params = load_params()\nparams[\"economics\"][\"PRTP\"] = 0.015\nmodel = MIMOSA(params)\n
      elasmu

      Elasticity of marginal utility

      • Type: float

      • Default: 1.001

      • Can be false: False

      • Min: 0.1

      • Max: 10

      Example usage:

      params = load_params()\nparams[\"economics\"][\"elasmu\"] = 1.001\nmodel = MIMOSA(params)\n
      inequal_aversion

      Parameter of inequality aversion. Should be between 0 and elasmu. Only used when welfare_module='inequal_aversion_general'

      • Type: float

      • Default: 0.5

      • Can be false: False

      • Min: 0.0

      • Max: 3

      Example usage:

      params = load_params()\nparams[\"economics\"][\"inequal_aversion\"] = 0.5\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-gdp","title":"economics > GDP","text":"alpha

      Output elasticity of capital

      • Type: float

      • Default: 0.3

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"alpha\"] = 0.3\nmodel = MIMOSA(params)\n
      depreciation of capital

      Yearly depreciation rate of capital stock

      • Type: float

      • Default: 0.05

      • Can be false: False

      • Min: 0

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"depreciation of capital\"] = 0.05\nmodel = MIMOSA(params)\n
      savings rate

      Fraction of GDP used for investments

      • Type: float

      • Default: 0.21

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"savings rate\"] = 0.21\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-mac","title":"economics > MAC","text":"beta

      Power factor of the MAC curve

      • Type: float

      • Default: 3

      • Can be false: False

      • Min: 0.01

      • Max: 10

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"beta\"] = 3\nmodel = MIMOSA(params)\n
      rho

      Learning by doing rate (needs more explanation)

      • Type: float

      • Default: 0.82

      • Can be false: False

      • Min: 0.1

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"rho\"] = 0.82\nmodel = MIMOSA(params)\n
      gamma

      Calibration level of the MAC (carbon price for 100% reduction)

      • Type: quantity

      • Default: 2601 USD2005/tCO2

      • Can be false: False

      • Unit: currency_unit/emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"gamma\"] = \"2601 USD2005/tCO2\"\nmodel = MIMOSA(params)\n
      regional calibration factor

      Column from mac.csv to be used for the regional MACs. The MACs are calibrated from TIMER SSP2-RCP2.6 MACs at a given year and a given carbon price / abatement level.

      • Type: enum

      • Default: kappa_rel_abatement_0.75_2050

      • Can be false: False

      • Allowed values:

        • kappa_carbonprice_200_2030
        • kappa_carbonprice_200_2050
        • kappa_carbonprice_200_2070
        • kappa_carbonprice_200_2100
        • kappa_carbonprice_300_2030
        • kappa_carbonprice_300_2050
        • kappa_carbonprice_300_2070
        • kappa_carbonprice_300_2100
        • kappa_carbonprice_500_2030
        • kappa_carbonprice_500_2050
        • kappa_carbonprice_500_2070
        • kappa_carbonprice_500_2100
        • kappa_carbonprice_1000_2030
        • kappa_carbonprice_1000_2050
        • kappa_carbonprice_1000_2070
        • kappa_carbonprice_1000_2100
        • kappa_rel_abatement_0.25_2030
        • kappa_rel_abatement_0.25_2050
        • kappa_rel_abatement_0.25_2070
        • kappa_rel_abatement_0.25_2100
        • kappa_rel_abatement_0.4_2030
        • kappa_rel_abatement_0.4_2050
        • kappa_rel_abatement_0.4_2070
        • kappa_rel_abatement_0.4_2100
        • kappa_rel_abatement_0.5_2050
        • kappa_rel_abatement_0.5_2070
        • kappa_rel_abatement_0.5_2100
        • kappa_rel_abatement_0.75_2050
        • kappa_rel_abatement_0.75_2070
        • kappa_rel_abatement_0.75_2100

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"regional calibration factor\"] = \"kappa_rel_abatement_0.75_2050\"\nmodel = MIMOSA(params)\n
      rel_mitigation_costs_min_level

      Minimum level of mitigation costs (rel to GDP). By default, this is 0: no negative abatement costs are allowed. For certain burden sharing regimes, this value can become negative to allow certain (small) financial transfers.

      • Type: float

      • Default: 0

      • Can be false: False

      • Min: -2

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"rel_mitigation_costs_min_level\"] = 0\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-emission-trade","title":"economics > emission trade","text":"min rel payment level

      Which percentage of the area under the MAC of a region should it pay itself (minimum)? If false: no limt

      • Type: float

      • Default: False

      • Can be false: True

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"emission trade\"][\"min rel payment level\"] = False\nmodel = MIMOSA(params)\n
      max rel payment level

      Which percentage of the area under the MAC of a region should it pay itself (maximum)? If false: no limit

      • Type: float

      • Default: False

      • Can be false: True

      • Min: 1

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"emission trade\"][\"max rel payment level\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-damages","title":"economics > damages","text":"percentage reversible

      Factor of damages that are reversible

      • Type: float

      • Default: 1

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"percentage reversible\"] = 1\nmodel = MIMOSA(params)\n
      scale factor

      Manual scaling factor to increase or decrease damages

      • Type: float

      • Default: 1

      • Can be false: False

      • Min: -inf

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"scale factor\"] = 1\nmodel = MIMOSA(params)\n
      ignore damages

      Flag to not take into account the damages in the GDP (but damages are calculated)

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"ignore damages\"] = False\nmodel = MIMOSA(params)\n
      quantile

      Damage quantile (Only used for COACCH)

      • Type: float

      • Default: 0.5

      • Can be false: False

      • Min: 0.025

      • Max: 0.975

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"quantile\"] = 0.5\nmodel = MIMOSA(params)\n
      coacch_slr_withadapt

      Flag to use the SLR-with-Adapation damage functions (Only used for COACCH)

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"coacch_slr_withadapt\"] = True\nmodel = MIMOSA(params)\n
      coacch_combined_slr_nonslr_damages

      If true, do not model SLR damages separately from non-SLR, but use the combined damage functions (Only used for COACCH)

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"coacch_combined_slr_nonslr_damages\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-adaptation","title":"economics > adaptation","text":"curr_level

      When adaptation level is fixed, keep it at this level (Only used for AD-RICE2010)

      • Type: float

      • Default: 0

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"adaptation\"][\"curr_level\"] = 0\nmodel = MIMOSA(params)\n
      fixed

      Flag to keep adaptation at fixed value (curr_level). (Only used for AD-RICE2010) If false: the adaptation level is endogenously optimised.

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"adaptation\"][\"fixed\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#emissions_1","title":"emissions","text":"carbonbudget

      Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.

      • Type: quantity

      • Default: False

      • Can be false: True

      • Unit: emissions_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"carbonbudget\"] = False\nmodel = MIMOSA(params)\n
      global min level

      Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed

      • Type: quantity

      • Default: -20 GtCO2/yr

      • Can be false: True

      • Unit: emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"global min level\"] = \"-20 GtCO2/yr\"\nmodel = MIMOSA(params)\n
      regional min level

      Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed

      • Type: quantity

      • Default: -10 GtCO2/yr

      • Can be false: True

      • Unit: emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"regional min level\"] = \"-10 GtCO2/yr\"\nmodel = MIMOSA(params)\n
      not positive after budget year

      If true, impose net-zero emissions after budget year (2100)

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"not positive after budget year\"] = True\nmodel = MIMOSA(params)\n
      non increasing emissions after 2100

      If true, the regional emissions after 2100 are not allowed to climb.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"non increasing emissions after 2100\"] = True\nmodel = MIMOSA(params)\n
      baseline carbon intensity

      If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"baseline carbon intensity\"] = True\nmodel = MIMOSA(params)\n
      cumulative_emissions_trapz

      If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the approximation is usually still acceptable.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"cumulative_emissions_trapz\"] = True\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#emissions-inertia","title":"emissions > inertia","text":"global

      Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed

      • Type: float

      • Default: False

      • Can be false: True

      • Min: -inf

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"inertia\"][\"global\"] = False\nmodel = MIMOSA(params)\n
      regional

      Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed

      • Type: float

      • Default: -0.05

      • Can be false: True

      • Min: -inf

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"inertia\"][\"regional\"] = -0.05\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#burden-sharing","title":"burden sharing","text":"regime

      Type of burden sharing to be used

      • Type: enum

      • Default: noregime

      • Can be false: False

      • Allowed values:

        • noregime
        • equal_mitigation_costs
        • equal_total_costs
        • per_cap_convergence
        • per_cap_convergence_fake

      Example usage:

      params = load_params()\nparams[\"burden sharing\"][\"regime\"] = \"noregime\"\nmodel = MIMOSA(params)\n
      percapconv_year

      Year of convergence to per capita emission allowance (only used when burden sharing - regime is per_cap_convergence) Can also be false, then always use grandfathering

      • Type: float

      • Default: 2050

      • Can be false: True

      • Min: 2020

      • Max: 2200

      Example usage:

      params = load_params()\nparams[\"burden sharing\"][\"percapconv_year\"] = 2050\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#temperature_1","title":"temperature","text":"initial

      Temperature in initial year of model run (2020 by default).

      • Type: quantity

      • Default: 1.16 delta_degC

      • Can be false: False

      • Unit: temperature_unit

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"initial\"] = \"1.16 delta_degC\"\nmodel = MIMOSA(params)\n
      TCRE

      Transient Climate Response to CO2 Emissions

      • Type: quantity

      • Default: 0.62 delta_degC/(TtCO2)

      • Can be false: False

      • Unit: (temperature_unit)/(emissions_unit)

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"TCRE\"] = \"0.62 delta_degC/(TtCO2)\"\nmodel = MIMOSA(params)\n
      target

      Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed

      • Type: quantity

      • Default: False

      • Can be false: True

      • Unit: temperature_unit

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"target\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#model_1","title":"model","text":"damage module

      Damage module to be used

      • Type: enum

      • Default: COACCH

      • Can be false: False

      • Allowed values:

        • COACCH
        • RICE2010
        • RICE2012

      Example usage:

      params = load_params()\nparams[\"model\"][\"damage module\"] = \"COACCH\"\nmodel = MIMOSA(params)\n
      emissiontrade module

      Emission trade module to be used

      • Type: enum

      • Default: notrade

      • Can be false: False

      • Allowed values:

        • notrade
        • globalcostpool
        • emissiontrade

      Example usage:

      params = load_params()\nparams[\"model\"][\"emissiontrade module\"] = \"notrade\"\nmodel = MIMOSA(params)\n
      financialtransfer module

      Financial transfer module to be used

      • Type: enum

      • Default: notransfer

      • Can be false: False

      • Allowed values:

        • notransfer
        • globaldamagepool

      Example usage:

      params = load_params()\nparams[\"model\"][\"financialtransfer module\"] = \"notransfer\"\nmodel = MIMOSA(params)\n
      welfare module

      Welfare and utility module to be used

      • Type: enum

      • Default: welfare_loss_minimising

      • Can be false: False

      • Allowed values:

        • welfare_loss_minimising
        • cost_minimising
        • inequal_aversion_general

      Example usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"welfare_loss_minimising\"\nmodel = MIMOSA(params)\n
      objective module

      Objective module to be used

      • Type: enum

      • Default: utility

      • Can be false: False

      • Allowed values:

        • utility
        • globalcosts

      Example usage:

      params = load_params()\nparams[\"model\"][\"objective module\"] = \"utility\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input_1","title":"input","text":"db_filename

      Path to IAMC-formatted CSV file for baseline data

      • Type: filepath

      • Default: inputdata/data/data_IMAGE_SSP.csv

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"db_filename\"] = \"inputdata/data/data_IMAGE_SSP.csv\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines","title":"input > baselines","text":""},{"location":"parameters/#input-baselines-ssp1","title":"input > baselines > SSP1","text":"scenario

      Scenario name of SSP1 baseline

      • Type: str

      • Default: SSP1-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP1\"][\"scenario\"] = \"SSP1-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP1 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP1\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp2","title":"input > baselines > SSP2","text":"scenario

      Scenario name of SSP2 baseline

      • Type: str

      • Default: SSP2-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP2\"][\"scenario\"] = \"SSP2-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP2 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP2\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp3","title":"input > baselines > SSP3","text":"scenario

      Scenario name of SSP3 baseline

      • Type: str

      • Default: SSP3-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP3\"][\"scenario\"] = \"SSP3-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP3 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP3\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp4","title":"input > baselines > SSP4","text":"scenario

      Scenario name of SSP4 baseline

      • Type: str

      • Default: SSP4-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP4\"][\"scenario\"] = \"SSP4-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP4 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP4\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp5","title":"input > baselines > SSP5","text":"scenario

      Scenario name of SSP5 baseline

      • Type: str

      • Default: SSP5-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP5\"][\"scenario\"] = \"SSP5-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP5 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP5\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-variables","title":"input > variables","text":"GDP

      Variable name for GDP in data file

      • Type: enum

      • Default: GDP|PPP

      • Can be false: False

      • Allowed values:

        • GDP|PPP
        • GDP|MER

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"GDP\"] = \"GDP|PPP\"\nmodel = MIMOSA(params)\n
      emissions

      Variable name for emissions variable

      • Type: str

      • Default: Emissions|CO2

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"emissions\"] = \"Emissions|CO2\"\nmodel = MIMOSA(params)\n
      population

      Variable name for population variable

      • Type: str

      • Default: Population

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"population\"] = \"Population\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#simulation_1","title":"simulation","text":"simulationmode

      If true, the model is run in simulation mode: then some variables will be imposed exogenously and fixed. If false, constraint_variables and deactivated_constraints are ignored.

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"simulationmode\"] = False\nmodel = MIMOSA(params)\n
      constraint_variables

      Dictionary of variable names with associated path to file containing values for that variable

      • Type: dict

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"constraint_variables\"] = None\nmodel = MIMOSA(params)\n
      deactivated_constraints

      List of constraint names to be disabled

      • Type: list

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"deactivated_constraints\"] = None\nmodel = MIMOSA(params)\n
      custom_mapping

      Custom mapping of parameter values or variables

      • Type: dict

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"custom_mapping\"] = None\nmodel = MIMOSA(params)\n
      "},{"location":"run/","title":"Running MIMOSA","text":""},{"location":"run/#base-run","title":"Base run","text":"

      A basic run of MIMOSA requires 4 steps: loading the parameters, building the model instance, solving the model and finally saving the output. With this code, the default parameter values are used (see Parameter reference).

      from mimosa import MIMOSA, load_params\n\nparams = load_params()  # (1)!\n\nmodel1 = MIMOSA(params) # (2)!\nmodel1.solve() # (3)!\n\nmodel1.save(\"run1\") # (4)!\n
      1. Read the default parameters
      2. Build the model using the parameters
      3. Once the model is built, send the model to the solver. Note that if you use the NEOS solver, use the syntax model1.solve(use_neos=True, neos_email=\"your.email@email.com\")
      4. Export the output to the file output/run1.csv
      "},{"location":"run/#reading-the-output","title":"Reading the output","text":"

      Once the script above has finished running, it has produced two output files in the folder output: run1.csv and run1.csv.params.json. The latter is simply a JSON file with all the input parameter used for this particular run (for reproducibility). The former is a CSV file that contains all the output data. Every variable in MIMOSA is saved in this value in a format similar to IAMC data format:

      output/run1.csv

      Variable Region Unit 2020 2025 2030 2035 2040 2045 2050 2055 2060 2065 2070 2075 2080 2085 2090 2095 2100 2105 2110 2115 2120 2125 2130 2135 2140 2145 2150 regional_emissions CAN GtCO2/yr 0.511577 0.383683 0.255789 0.155544 0.136527 0.113384 0.0944834 0.0845257 0.077836 0.0694752 0.0588413 0.0469933 0.0359533 0.0269266 0.0199594 0.014565 0.0104499 0.0517489 0.0517486 0.0517485 0.0517484 0.0517483 0.0517482 0.0517481 0.051748 0.0517478 0.0517476 regional_emissions USA GtCO2/yr 5.39382 4.04537 2.69691 1.34846 0.789513 0.649695 0.531854 0.430432 0.341586 0.262853 0.195861 0.142273 0.101621 0.072636 0.0549502 0.0495887 0.0582421 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534748 0.534748 regional_emissions MEX GtCO2/yr 0.572878 0.429658 0.286439 0.250682 0.235195 0.210891 0.184067 0.159748 0.137097 0.114491 0.0904155 0.0650686 0.0402638 0.0171455 -0.00403092 -0.0236268 -0.0413935 6.53385e-05 6.49712e-05 6.47857e-05 6.46547e-05 6.45457e-05 6.4444e-05 6.4339e-05 6.42181e-05 6.40555e-05 6.37559e-05 ... ...

      These output files can be easily imported for plotting software (like using Plotly in Python). An easier way, however, to quickly visualise and compare MIMOSA outputs, is by using the MIMOSA Dashboard. After opening the online Dashboard, simply drag and drop all output files to the drag-and-drop input to visualise one or multiple MIMOSA output files. Also include the parameter files to directly see the difference in input parameters.

      Note: the MIMOSA Dashboard can sometimes take up to a few minutes to start, as it goes to sleep after 30 minutes of inactivity (restriction of the free plan of the hosting website).

      Open the MIMOSA Dashboard

      "},{"location":"run/#changing-parameters","title":"Changing parameters","text":"

      The default parameters from load_params() are given as a nested dictionary. Every item of this dictionary can be changed. Note that only the values can be changed, it is not possible to add or substract parameters to this dictionary (without Extending MIMOSA).

      "},{"location":"run/#example-1-carbon-budget","title":"Example 1: carbon budget","text":"
      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"emissions\"][\"carbonbudget\"] = \"500 GtCO2\" # (1)!\n\nmodel1 = MIMOSA(params)\nmodel1.solve()\n\nmodel1.save(\"run_example1\")\n
      1. Change the parameter of emissions > carbonbudget to the string \"500 GtCO2\"
      "},{"location":"run/#example-2-high-damages-high-tcre-low-discounting","title":"Example 2: high damages, high TCRE, low discounting","text":"

      Multiple parameters can also be changed at the same time. In this example, the high end of the damages and of the climate sensitivity (TCRE) are used, combined with the low end of the discount rate (PRTP).

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"economics\"][\"damages\"][\"quantile\"] = 0.95\nparams[\"temperature\"][\"TCRE\"] = \"0.82 delta_degC/(TtCO2)\"\nparams[\"economics\"][\"PRTP\"] = 0.001\n\nmodel2 = MIMOSA(params)\nmodel2.solve()\n\nmodel2.save(\"run_example2\")\n
      "},{"location":"run/#doing-multiple-runs","title":"Doing multiple runs","text":"

      Often, MIMOSA needs to be run with multiple values of the same parameter (multiple carbon budgets, multiple discount rates, etc.). While it is possible to simply run the file multiple times, it is much easier to run MIMOSA multiple times directly in the Python script through regular Python loops:

      from mimosa import MIMOSA, load_params\n\nfor budget in [\"500 GtCO2\", \"700 GtCO2\", \"1000 GtCO2\"]:\n\n     params = load_params()\n\n     params[\"emissions\"][\"carbonbudget\"] = budget\n\n     model3 = MIMOSA(params)\n     model3.solve()\n\n     model3.save(f\"run_example3_{budget}\") # (1)!\n
      1. Don't forget to save each file to a different name, otherwise they will be overwritten at each iteration of the loop.
      "},{"location":"run/#advanced-logging","title":"Advanced: logging","text":"

      The solve status (optimal, impossible, etc), model solve time and the final maximised value can be logged to an external log file (along with the warnings or errors from the code). This can be very useful when doing many runs overnight. In this code example, the log is written to the file mainlog.log:

      import logging\nimport logging.handlers\n\nfrom mimosa import MIMOSA, load_params\n\nhandler = logging.handlers.WatchedFileHandler(\"mainlog.log\")\nhandler.setFormatter(\n    logging.Formatter(\"[%(levelname)s, %(asctime)s] %(name)s - %(message)s\")\n)\nroot = logging.getLogger()\nroot.setLevel(\"INFO\")\nroot.addHandler(handler)\n\nparams = load_params()\n\n# Make changes to the params if needed\nparams[\"emissions\"][\"carbonbudget\"] = False\n\nmodel1 = MIMOSA(params)\nmodel1.solve(verbose=False) # (1)!\nmodel1.save(\"run1\")\n
      1. By setting verbose=False, the IPOPT output is not printed. If you're doing many runs, this is probably useful. The termination status of IPOPT is logged to the log file anyway.
      "},{"location":"components/economics/","title":"Economics","text":"

      Back to general structure

      "},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--economic-module-and-production-function","title":"Economic module and production function","text":""},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--gross-and-net-gdp","title":"Gross and net GDP","text":"

      The core of the model is the economic module, detailing how GDP, investments and consumptions vary over time. We use a traditional Cobb-Douglas production function. This means that the gross GDP is calculated by:

      $$ \\text{GDP}_{\\text{gross},t,r} = \\text{TFP}_{t,r} \\cdot L^{1-\\alpha}_{t,r} \\cdot K^{\\alpha}_{t,r}, $$ with \\(\\text{TFP}\\) the total factor productivity (exogenously calibrated from the baseline SSP scenarios) \\(L\\) the labor (represented by the total population), \\(K\\) the capital stock and \\(\\alpha\\) the share of capital in the production function.

      Source code in mimosa/common/economics.py
      def calc_GDP(TFP, L, K, alpha):\n    \"\"\"\n    $$ \\\\text{GDP}_{\\\\text{gross},t,r} = \\\\text{TFP}\\\\_{t,r} \\\\cdot L^{1-\\\\alpha}\\\\_{t,r} \\\\cdot K^{\\\\alpha}\\\\_{t,r}, $$\n    with $\\\\text{TFP}$ the total factor productivity (exogenously calibrated from the baseline SSP scenarios)\n    $L$ the labor (represented by the total population), $K$ the capital stock and $\\\\alpha$ the share of capital in the production function.\n\n    \"\"\"\n    return TFP * L ** (1 - alpha) * K**alpha\n

      The net GDP is then calculated by subtracting the damages and mitigation costs from the gross GDP. (Note that in MIMOSA, the damages are expressed as a fraction of the gross GDP, whereas the mitigation costs are expressed in absolute terms.)

      \\[ \\text{GDP}_{\\text{net},t,r} = \\text{GDP}_{\\text{gross},t,r} \\cdot (1 - \\text{damage costs}_{t,r}) - \\text{mitigation costs}_{t,r}\\]"},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--investments-and-consumption","title":"Investments and consumption","text":"

      This net GDP is then split in a part of investments (\\(I_t\\)) and a part of consumption (\\(C_t\\)), according to a fixed savings rate (\\(\\text{sr}\\)):

      \\[ I_{t,r} = \\text{sr} \\cdot \\text{GDP}_{\\text{net},t,r}, \\] \\[ C_{t,r} = (1 - \\text{sr}) \\cdot \\text{GDP}_{\\text{net},t,r}. \\]"},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--capital-stock","title":"Capital stock","text":"

      The capital stock \\(K_t\\) grows over time according to the investments and the depreciation of the capital stock:

      \\[ K_{t,r} = K_{t-1,r} + \\Delta t \\cdot \\frac{\\partial K_{t,r}}{\\partial t}, \\]

      with the change in capital stock calculated by:

      \\[ \\frac{\\partial K_{t,r}}{\\partial t} = \\frac{1}{\\Delta t} \\cdot ((1 - dk)^{\\Delta t} - 1) \\cdot K_{t,r} + I_{t,r}.\\] Source code in mimosa/common/economics.py
      def calc_dKdt(K, dk, I, dt):\n    \"\"\"\n    $$ \\\\frac{\\\\partial K_{t,r}}{\\\\partial t} = \\\\frac{1}{\\\\Delta t} \\\\cdot ((1 - dk)^{\\\\Delta t}  - 1) \\\\cdot K_{t,r} + I_{t,r}.$$\n    \"\"\"\n    return ((1 - dk) ** dt - 1) / dt * K + I\n

      Since this only gives the change in capital stock, we need to add the initial capital stock to get the actual capital stock. This is calculated as a region-dependent multiple of the initial GDP:

      \\[ K_{t=0,r} = \\text{init_capitalstock_factor}_r \\cdot \\text{GDP}_{t=0,r}. \\]

      The initial capital stock factor is a calibration factor to obtain the initial capital stock. TODO: Source (IMF)

      "},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • init_capitalstock_factor
      • alpha: Output elasticity of capital. Type: float. Default: 0.3. Min: 0. Max: 1.
      • dk: Yearly depreciation rate of capital stock. Type: float. Default: 0.05. Min: 0. Max: inf.
      • sr: Fraction of GDP used for investments. Type: float. Default: 0.21. Min: 0. Max: 1.
      • ignore_damages: Flag to not take into account the damages in the GDP (but damages are calculated). Type: bool. Default: False.
      Source code in mimosa/components/cobbdouglas.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    # Economic module and production function\n\n    ## Gross and net GDP\n\n    The core of the model is the economic module, detailing how GDP, investments and\n    consumptions vary over time. We use a traditional Cobb-Douglas production function. This means\n    that the gross GDP is calculated by:\n\n    :::mimosa.common.economics.calc_GDP\n\n    The net GDP is then calculated by subtracting the damages and\n    mitigation costs from the gross GDP. *(Note that in MIMOSA, the damages are expressed as a fraction of the gross GDP,\n    whereas the mitigation costs are expressed in absolute terms.)*\n\n    $$ \\\\text{GDP}_{\\\\text{net},t,r} = \\\\text{GDP}_{\\\\text{gross},t,r} \\\\cdot (1 - \\\\text{damage costs}_{t,r}) - \\\\text{mitigation costs}_{t,r}$$\n\n    ## Investments and consumption\n\n    This net GDP is then split in a part of investments ($I_t$) and a part of consumption ($C_t$), according to a fixed savings rate ($\\\\text{sr}$):\n\n    $$ I_{t,r} = \\\\text{sr} \\\\cdot \\\\text{GDP}_{\\\\text{net},t,r}, $$\n\n    $$ C_{t,r} = (1 - \\\\text{sr}) \\\\cdot \\\\text{GDP}_{\\\\text{net},t,r}. $$\n\n    ## Capital stock\n\n    The capital stock $K_t$ grows over time according to the investments and the depreciation of the capital stock:\n\n    $$ K_{t,r} = K_{t-1,r} + \\\\Delta t \\\\cdot \\\\frac{\\\\partial K_{t,r}}{\\\\partial t}, $$\n\n    with the change in capital stock calculated by:\n\n    :::mimosa.common.economics.calc_dKdt\n\n    Since this only gives the change in capital stock, we need to add the initial capital stock to get the actual capital stock.\n    This is calculated as a region-dependent multiple of the initial GDP:\n\n    $$ K_{t=0,r} = \\\\text{init_capitalstock_factor}_r \\\\cdot \\\\text{GDP}_{t=0,r}. $$\n\n    The initial capital stock factor is a calibration factor to obtain the initial capital stock. TODO: Source (IMF)\n    ``` plotly\n    {\"file_path\": \"./assets/plots/init_capital_factor.json\"}\n    ```\n\n    ## Parameters defined in this module\n    - init_capitalstock_factor\n    - alpha: Output elasticity of capital. Type: float. Default: 0.3. Min: 0. Max: 1.\n    - dk: Yearly depreciation rate of capital stock. Type: float. Default: 0.05. Min: 0. Max: inf.\n    - sr: Fraction of GDP used for investments. Type: float. Default: 0.21. Min: 0. Max: 1.\n    - ignore_damages: Flag to not take into account the damages in the GDP (but damages are calculated). Type: bool. Default: False.\n\n\n\n    \"\"\"\n    constraints = []\n\n    m.init_capitalstock_factor = Param(\n        m.regions,\n        units=quant.unit(\"currency_unit\"),\n        doc=\"regional::economics.init_capital_factor\",\n    )\n    m.capital_stock = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.init_capitalstock_factor[r] * m.GDP(m.year(t), r),\n        units=quant.unit(\"currency_unit\"),\n    )\n\n    # Parameters\n    m.alpha = Param(doc=\"::economics.GDP.alpha\")\n    m.dk = Param(doc=\"::economics.GDP.depreciation of capital\")\n    m.sr = Param(doc=\"::economics.GDP.savings rate\")\n\n    m.GDP_gross = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.GDP(m.year(0), r),\n        units=quant.unit(\"currency_unit\"),\n    )\n    m.GDP_net = Var(\n        m.t,\n        m.regions,\n        units=quant.unit(\"currency_unit\"),\n        initialize=lambda m, t, r: m.GDP(m.year(0), r),\n    )\n    m.investments = Var(m.t, m.regions, units=quant.unit(\"currency_unit\"))\n    m.consumption = Var(m.t, m.regions, units=quant.unit(\"currency_unit\"))\n\n    m.ignore_damages = Param(doc=\"::economics.damages.ignore damages\")\n\n    # Cobb-Douglas, GDP, investments, capital and consumption\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.GDP_gross[t, r]\n                    == economics.calc_GDP(\n                        m.TFP(m.year(t), r),\n                        m.L(m.year(t), r),\n                        soft_min(m.capital_stock[t, r], scale=10),\n                        m.alpha,\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"GDP_gross\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.GDP_gross[0, r] == m.GDP(m.year(0), r), \"GDP_gross_init\"\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.GDP_net[t, r]\n                == m.GDP_gross[t, r]\n                * (1 - (m.damage_costs[t, r] if not value(m.ignore_damages) else 0))\n                - m.mitigation_costs[t, r]\n                - m.financial_transfer[t, r],\n                \"GDP_net\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.investments[t, r] == m.sr * m.GDP_net[t, r],\n                \"investments\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.consumption[t, r] == (1 - m.sr) * m.GDP_net[t, r],\n                \"consumption\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    (\n                        m.capital_stock[t, r]\n                        == m.capital_stock[t - 1, r]\n                        + m.dt\n                        * economics.calc_dKdt(\n                            m.capital_stock[t, r], m.dk, m.investments[t, r], m.dt\n                        )\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"capital_stock\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.capital_stock[0, r]\n                == m.init_capitalstock_factor[r] * m.GDP(m.year(0), r)\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/","title":"Emissions and temperature","text":"

      Back to general structure

      Baseline and mitigated emissions Temperature Carbon budget, inertia and other restrictions

      The global temperature change is calculated as a linear function of cumulative emissions, with a slope given by the Transient Climate Response to CO2 Emissions (TCRE), following [Dietz et al.] who showed that this performed better than the default two-box DICE climate module.

      \\[ \\text{temperature}_{t} = T_0 + \\text{TCRE} \\cdot \\text{cumulative emissions}_{t}, \\]

      where \\(T_0\\) is the initial temperature at the start of the run (by default in 2020), and the TCRE is the Transient Climate Response to CO2 Emissions.

      The initial temperature is set to 1.16\u00b0C in 2020 by default, following [Visser et al.]. The TCRE is calibrated on the IPCC AR5 or AR6 reports (the median value of the TCRE is the same in the AR5 and AR6 calibration), but the distribution is different.

      Calibration of the TCRE

      The TCRE is calibrated on the IPCC AR5 and AR6 reports, both using the linear relation shown in the SPM figure of the WG1 report. The default value of the TCRE is 0.62\u00b0C per 1000 GtCO2 (median value of the AR5 and AR6 calibration). The 5th and 95th percentiles differ between the two calibrations, with the AR5 calibration having a wider distribution:

      Percentile AR5 TCRE (\u00b0C per TtCO2) AR6 TCRE (\u00b0C per TtCO2) 5th 0.42 0.42 50th 0.62 0.62 default 95th 0.82 0.75 Calibrated on IPCC AR5Calibrated on IPCC AR6

      Source: IPCC AR5 WG1 Figure SPM.10

      Source: IPCC AR6 WG1 Figure SPM.10

      Source code in mimosa/components/emissions.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    === \":octicons-cloud-24: Baseline and mitigated emissions\"\n\n        :::mimosa.components.emissions._get_emissions_constraints\n\n    === \":fontawesome-solid-temperature-half: Temperature\"\n\n        :::mimosa.components.emissions._get_temperature_constraints\n\n    === \":fontawesome-solid-chart-pie: Carbon budget, inertia and other restrictions\"\n\n        :::mimosa.components.emissions._get_inertia_and_budget_constraints\n\n    \"\"\"\n    constraints = (\n        _get_emissions_constraints(m)\n        + _get_temperature_constraints(m)\n        + _get_inertia_and_budget_constraints(m)\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--baseline-emissions","title":"Baseline emissions","text":"

      In MIMOSA, emissions are represented by CO2 emissions only1. The emissions are calculated relative to baseline emissions: emissions that would occur in the absence of any climate policy.

      There are two ways to calculate baseline emissions: either directly imported exogenously from the SSP scenarios, or calculated from the baseline carbon intensity from the SSPs. The latter accounts for the fact that in the absence of climate policy, baseline emissions would go down if the GDP goes down, and vice versa. This can be chosen with the parameter baseline_carbon_intensity. If this parameter is set to true, baseline emissions are calculated as:

      \\[ \\text{baseline emissions}_{t,r} = \\text{baseline carbon intensity}_{t,r} \\cdot \\text{GDP}_{\\text{net}, t,r} \\] Baseline emissions values

      "},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--emission-reductions","title":"Emission reductions","text":"

      To calculate the actual emissions per region, the baseline emissions are reduced by a relative abatement factor, which in term is determined by the Marginal Abatement Cost curve and the carbon price (see Mitigation). The regional emissions are then calculated as:

      \\[ \\text{regional emissions}_{t,r} = (1 - \\text{relative abatement}_{t,r}) \\cdot \\text{baseline emissions}_{t,r} \\]

      In the first period, reductions are assumed to be zero:

      \\[ \\text{regional emissions}_{0,r} = \\text{baseline emissions}_{0,r}. \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--global-and-cumulative-emissions","title":"Global and cumulative emissions","text":"

      The regional emissions are aggregated to global emissions:

      \\[ \\text{global emissions}_{t} = \\sum_r \\text{regional emissions}_{t,r}, \\]

      which are used to calculate the cumulative emissions. There are two ways to calculate them: using trapezoidal integration or by simply adding up all the years. The former is more accurate, while the latter is numerically more stable. This is chosen with the parameter cumulative_emissions_trapz.

      Trapezoidal integration defaultSimple sum \\[ \\begin{aligned} \\text{cumulative emissions}_{t} & = \\text{cumulative emissions}_{t-1} \\\\ & + \\frac{\\Delta t}{2} \\cdot (\\text{global emissions}_{t} + \\text{global emissions}_{t-1}) ,\\text{for } t > 0. \\end{aligned} \\] \\[ \\text{cumulative emissions}_{t} = \\text{cumulative emissions}_{t-1} + \\Delta t \\cdot \\text{global emissions}_{t} \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • baseline_carbon_intensity: If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.. Type: bool. Default: True.
      • cumulative_emissions_trapz: If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the approximation is usually still acceptable.. Type: bool. Default: True.
      1. The effect of other greenhouse gases is implicitly accounted for in the TCRE which translates cumulative CO2 emissions into temperature change. This assumes a linear relation between CO2 emissions and other greenhouse gases.\u00a0\u21a9

      Source code in mimosa/components/emissions.py
      def _get_emissions_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    ## Baseline emissions\n\n    In MIMOSA, emissions are represented by CO<sub>2</sub> emissions only[^1]. The emissions are calculated\n    relative to baseline emissions: emissions that would occur in the absence of any climate policy.\n\n    There are two ways to calculate baseline emissions: either directly imported exogenously from\n    the SSP scenarios, or calculated from the baseline carbon intensity from the SSPs. The latter\n    accounts for the fact that in the absence of climate policy, baseline emissions would go down if\n    the GDP goes down, and vice versa. This can be chosen with the parameter [`baseline_carbon_intensity`](../parameters.md#emissions.baseline carbon intensity).\n    If this parameter is set to true, baseline emissions are calculated as:\n\n    $$\n    \\\\text{baseline emissions}_{t,r} = \\\\text{baseline carbon intensity}_{t,r} \\\\cdot \\\\text{GDP}_{\\\\text{net}, t,r}\n    $$\n\n    ??? info \"Baseline emissions values\"\n\n        <div style=\"overflow: scroll;\" markdown>\n        ``` plotly\n        {\"file_path\": \"./assets/plots/baseline_emissions.json\"}\n        ```\n        </div>\n\n    ## Emission reductions\n    To calculate the actual emissions per region, the baseline emissions are reduced by a relative\n    abatement factor, which in term is determined by the Marginal Abatement Cost curve and the carbon price\n    (see [Mitigation](mitigation.md)). The regional emissions are then calculated as:\n\n    $$\n    \\\\text{regional emissions}_{t,r} = (1 - \\\\text{relative abatement}_{t,r}) \\\\cdot \\\\text{baseline emissions}_{t,r}\n    $$\n\n    In the first period, reductions are assumed to be zero:\n\n    $$\n    \\\\text{regional emissions}_{0,r} = \\\\text{baseline emissions}_{0,r}.\n    $$\n\n    ## Global and cumulative emissions\n\n    The regional emissions are aggregated to global emissions:\n\n    $$\n    \\\\text{global emissions}_{t} = \\\\sum_r \\\\text{regional emissions}_{t,r},\n    $$\n\n    which are used to calculate the cumulative emissions. There are two ways to calculate them:\n    using trapezoidal integration or by simply adding up all the years. The former is more accurate,\n    while the latter is numerically more stable. This is chosen with the parameter [`cumulative_emissions_trapz`](../parameters.md#emissions.cumulative_emissions_trapz).\n\n    === \"Trapezoidal integration `default`\"\n\n        $$\n        \\\\begin{aligned}\n        \\\\text{cumulative emissions}_{t} & = \\\\text{cumulative emissions}_{t-1} \\\\\\\\ \n        & + \\\\frac{\\\\Delta t}{2} \\\\cdot (\\\\text{global emissions}_{t} + \\\\text{global emissions}_{t-1}) ,\\\\text{for } t > 0.\n        \\\\end{aligned}\n        $$\n\n    === \"Simple sum\"\n\n        $$\n        \\\\text{cumulative emissions}_{t} = \\\\text{cumulative emissions}_{t-1} + \\\\Delta t \\\\cdot \\\\text{global emissions}_{t}\n        $$\n\n\n    ## Parameters defined in this module\n    - baseline_carbon_intensity: If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.. Type: bool. Default: True.\n    - cumulative_emissions_trapz: If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the  approximation is usually still acceptable.. Type: bool. Default: True.\n\n    [^1]: The effect of other greenhouse gases is implicitly accounted for in the TCRE which\n        translates cumulative CO<sub>2</sub> emissions into temperature change. This assumes a linear\n        relation between CO<sub>2</sub> emissions and other greenhouse gases.\n    \"\"\"\n\n    constraints = []\n\n    m.regional_emissions = Var(m.t, m.regions, units=quant.unit(\"emissionsrate_unit\"))\n    m.baseline = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.baseline_emissions(m.year(t), r),\n        units=quant.unit(\"emissionsrate_unit\"),\n    )\n    m.baseline_carbon_intensity = Param(doc=\"::emissions.baseline carbon intensity\")\n\n    m.relative_abatement = Var(\n        m.t,\n        m.regions,\n        initialize=0,\n        bounds=(0, 2.5),\n        units=quant.unit(\"fraction_of_baseline_emissions\"),\n    )\n    m.regional_emission_reduction = Var(\n        m.t, m.regions, units=quant.unit(\"emissionsrate_unit\")\n    )\n    m.cumulative_emissions = Var(m.t, units=quant.unit(\"emissions_unit\"))\n    m.global_emissions = Var(m.t, units=quant.unit(\"emissionsrate_unit\"))\n\n    m.cumulative_emissions_trapz = Param(doc=\"::emissions.cumulative_emissions_trapz\")\n\n    constraints.extend(\n        [\n            # Baseline emissions based on emissions or carbon intensity\n            RegionalConstraint(\n                lambda m, t, r: (\n                    (\n                        m.baseline[t, r]\n                        == m.carbon_intensity(m.year(t), r) * m.GDP_net[t, r]\n                    )\n                    if value(m.baseline_carbon_intensity)\n                    else (m.baseline[t, r] == m.baseline_emissions(m.year(t), r))\n                ),\n                name=\"baseline_emissions\",\n            ),\n            # Regional emissions from baseline and relative abatement\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r]\n                    == (1 - m.relative_abatement[t, r])\n                    * (\n                        m.baseline[t, r]\n                        if value(m.baseline_carbon_intensity)\n                        else m.baseline_emissions(m.year(t), r)\n                        # Note: this should simply be m.baseline[t,r], but this is numerically less stable\n                        # than m.baseline_emissions(m.year(t), r) whenever baseline intensity\n                        # is used instead of baseline emissions. In fact, m.baseline_emissions(m.year(t), r)\n                        # is just a fixed number, whereas m.baseline[t,r] is a variable depending on\n                        # GDP.\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"regional_abatement\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.regional_emissions[0, r]\n                == m.baseline_emissions(m.year(0), r)\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.regional_emission_reduction[t, r]\n                == m.baseline[t, r] - m.regional_emissions[t, r],\n                \"regional_emission_reduction\",\n            ),\n            # Global emissions (sum from regional emissions)\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t]\n                    == sum(m.regional_emissions[t, r] for r in m.regions)\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"global_emissions\",\n            ),\n            GlobalInitConstraint(\n                lambda m: m.global_emissions[0]\n                == sum(m.baseline_emissions(m.year(0), r) for r in m.regions),\n                \"global_emissions_init\",\n            ),\n            # Cumulative global emissions\n            GlobalConstraint(\n                lambda m, t: (\n                    m.cumulative_emissions[t]\n                    == m.cumulative_emissions[t - 1]\n                    + (\n                        (m.dt * (m.global_emissions[t] + m.global_emissions[t - 1]) / 2)\n                        if value(m.cumulative_emissions_trapz)\n                        else (m.dt * m.global_emissions[t])\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"cumulative_emissions\",\n            ),\n            GlobalInitConstraint(lambda m: m.cumulative_emissions[0] == 0),\n        ]\n    )\n\n    m.emission_relative_cumulative = Var(m.t, initialize=1)\n    constraints.extend(\n        [\n            GlobalConstraint(\n                lambda m, t: (\n                    (\n                        m.emission_relative_cumulative[t]\n                        == m.cumulative_emissions[t]\n                        / m.baseline_cumulative_global(m, m.year(0), m.year(t))\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                name=\"relative_cumulative_emissions\",\n            ),\n            GlobalInitConstraint(lambda m: m.emission_relative_cumulative[0] == 1),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_temperature_constraints--temperature-target","title":"Temperature target","text":"

      The usual way to specify a policy target in MIMOSA is using carbon budgets. However, it is also possible to specify a temperature target. This is done by setting the parameter temperature_target. This is an upper bound on the temperature: if the cost-optimal temperature is below this value, this constraint is not binding.

      If this parameter is set, the following constraint is active:

      \\[ \\text{temperature}_{t} \\leq \\text{temperature target} \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_temperature_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • T0: Temperature in initial year of model run (2020 by default).. Type: quantity. Default: 1.16 delta_degC. Unit: temperature_unit.
      • TCRE: Transient Climate Response to CO2 Emissions. Type: quantity. Default: 0.62 delta_degC/(TtCO2). Unit: (temperature_unit)/(emissions_unit).
      • temperature_target: Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed. Type: quantity. Default: False. Can also be false. Unit: temperature_unit.
      Source code in mimosa/components/emissions.py
      def _get_temperature_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    The global temperature change is calculated as a linear function of cumulative emissions, with a slope\n    given by the Transient Climate Response to CO<sub>2</sub> Emissions (TCRE), following [Dietz et al.] who\n    showed that this performed better than the default two-box DICE climate module.\n\n    $$\n    \\\\text{temperature}_{t} = T_0 + \\\\text{TCRE} \\\\cdot \\\\text{cumulative emissions}_{t},\n    $$\n\n    where [$T_0$](../parameters.md#temperature.initial) is the initial temperature at the start of the run (by default in 2020),\n    and the [TCRE](../parameters.md#temperature.TCRE) is the Transient Climate Response to CO<sub>2</sub> Emissions.\n\n    The initial temperature is set to 1.16\u00b0C in 2020 by default, following [Visser et al.]. The TCRE\n    is calibrated on the IPCC AR5 or AR6 reports (the median value of the TCRE is the same in the AR5\n    and AR6 calibration), but the distribution is different.\n\n    ??? info \"Calibration of the TCRE\"\n\n        The TCRE is calibrated on the IPCC AR5 and AR6 reports, both using the linear relation shown in the SPM figure of the WG1 report.\n        The default value of the TCRE is 0.62\u00b0C per 1000 GtCO<sub>2</sub> (median value of the AR5 and AR6 calibration). The 5th and 95th percentiles\n        differ between the two calibrations, with the AR5 calibration having a wider distribution:\n\n        | Percentile | AR5 TCRE <br><span style=\"font-weight: normal\">(\u00b0C per TtCO<sub>2</sub>)</span> | AR6 TCRE <br><span style=\"font-weight: normal\">(\u00b0C per TtCO<sub>2</sub>)</span> |\n        |------------|----------|----------|\n        | 5th        | 0.42     | 0.42     |\n        | 50th       | 0.62     | 0.62 `default` |\n        | 95th       | 0.82     | 0.75     |\n\n        === \"Calibrated on IPCC AR5\"\n\n            <div style=\"overflow: scroll;\" markdown>\n            ``` plotly\n            {\"file_path\": \"./assets/plots/ar5_tcre.json\"}\n            ```\n            </div>\n            Source: [IPCC AR5 WG1 Figure SPM.10](https://www.ipcc.ch/report/ar5/wg1/summary-for-policymakers/figspm-10/)\n\n        === \"Calibrated on IPCC AR6\"\n\n            <div style=\"overflow: scroll;\" markdown>\n            ``` plotly\n            {\"file_path\": \"./assets/plots/ar6_tcre.json\"}\n            ```\n            </div>\n\n            Source: [IPCC AR6 WG1 Figure SPM.10](https://www.ipcc.ch/report/ar6/wg1/figures/summary-for-policymakers/figure-spm-10)\n\n    ## Temperature target\n    The usual way to specify a policy target in MIMOSA is using carbon budgets. However, it is also possible to\n    specify a temperature target. This is done by setting the parameter [`temperature_target`](../parameters.md#temperature.target).\n    This is an upper bound on the temperature: if the cost-optimal temperature is below this value, this constraint is not binding.\n\n    If this parameter is set, the following constraint is active:\n\n    $$\n    \\\\text{temperature}_{t} \\\\leq \\\\text{temperature target}\n    $$\n\n    ## Parameters defined in this module\n    - T0: Temperature in initial year of model run (2020 by default).. Type: quantity. Default: 1.16 delta_degC. Unit: temperature_unit.\n    - TCRE: Transient Climate Response to CO2 Emissions. Type: quantity. Default: 0.62 delta_degC/(TtCO2). Unit: (temperature_unit)/(emissions_unit).\n    - temperature_target: Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed. Type: quantity. Default: False. Can also be false. Unit: temperature_unit.\n    \"\"\"\n\n    constraints = []\n\n    m.T0 = Param(units=quant.unit(\"degC_above_PI\"), doc=\"::temperature.initial\")\n    m.temperature = Var(\n        m.t, initialize=lambda m, t: m.T0, units=quant.unit(\"degC_above_PI\")\n    )\n    m.TCRE = Param(doc=\"::temperature.TCRE\")\n    m.temperature_target = Param(doc=\"::temperature.target\")\n    constraints.extend(\n        [\n            GlobalConstraint(\n                lambda m, t: m.temperature[t]\n                == m.T0 + m.TCRE * m.cumulative_emissions[t],\n                \"temperature\",\n            ),\n            GlobalInitConstraint(lambda m: m.temperature[0] == m.T0),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.temperature[t] <= m.temperature_target\n                    if (m.year(t) >= 2100 and value(m.temperature_target) is not False)\n                    else Constraint.Skip\n                ),\n                name=\"temperature_target\",\n            ),\n        ]\n    )\n\n    m.perc_reversible_damages = Param(doc=\"::economics.damages.percentage reversible\")\n\n    # m.overshoot = Var(m.t, initialize=0)\n    # m.overshootdot = DerivativeVar(m.overshoot, wrt=m.t)\n    # m.netnegative_emissions = Var(m.t)\n    # global_constraints.extend(\n    #     [\n    #         lambda m, t: m.netnegative_emissions[t]\n    #         == m.global_emissions[t] * (1 - tanh(m.global_emissions[t] * 10)) / 2\n    #         if value(m.perc_reversible_damages) < 1\n    #         else Constraint.Skip,\n    #         lambda m, t: m.overshootdot[t]\n    #         == (m.netnegative_emissions[t] if t <= value(m.year2100) and t > 0 else 0)\n    #         if value(m.perc_reversible_damages) < 1\n    #         else Constraint.Skip,\n    #     ]\n    # )\n\n    # global_constraints_init.extend([lambda m: m.overshoot[0] == 0])\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_inertia_and_budget_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • budget: Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.. Type: quantity. Default: False. Can also be false. Unit: emissions_unit.
      • inertia_global: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: False. Can also be false. Min: -inf. Max: 0.
      • inertia_regional: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: -0.05. Can also be false. Min: -inf. Max: 0.
      • global_min_level: Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -20 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.
      • regional_min_level: Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -10 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.
      • no_pos_emissions_after_budget_year: If true, impose net-zero emissions after budget year (2100). Type: bool. Default: True.
      • non_increasing_emissions_after_2100: If true, the regional emissions after 2100 are not allowed to climb.. Type: bool. Default: True.
      Source code in mimosa/components/emissions.py
      def _get_inertia_and_budget_constraints(\n    m: AbstractModel,\n) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    ## Parameters defined in this module\n    - budget: Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.. Type: quantity. Default: False. Can also be false. Unit: emissions_unit.\n    - inertia_global: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: False. Can also be false. Min: -inf. Max: 0.\n    - inertia_regional: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: -0.05. Can also be false. Min: -inf. Max: 0.\n    - global_min_level: Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -20 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.\n    - regional_min_level: Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -10 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.\n    - no_pos_emissions_after_budget_year: If true, impose net-zero emissions after budget year (2100). Type: bool. Default: True.\n    - non_increasing_emissions_after_2100: If true, the regional emissions after 2100 are not allowed to climb.. Type: bool. Default: True.\n\n    \"\"\"\n\n    constraints = []\n\n    m.budget = Param(doc=\"::emissions.carbonbudget\")\n    m.inertia_global = Param(doc=\"::emissions.inertia.global\")\n    m.inertia_regional = Param(doc=\"::emissions.inertia.regional\")\n    m.global_min_level = Param(doc=\"::emissions.global min level\")\n    m.regional_min_level = Param(doc=\"::emissions.regional min level\")\n    m.no_pos_emissions_after_budget_year = Param(\n        doc=\"::emissions.not positive after budget year\"\n    )\n    m.non_increasing_emissions_after_2100 = Param(\n        doc=\"::emissions.non increasing emissions after 2100\"\n    )\n    constraints.extend(\n        [\n            # Carbon budget constraints:\n            GlobalConstraint(\n                lambda m, t: (\n                    m.cumulative_emissions[t]\n                    - (\n                        m.budget\n                        + (\n                            m.overshoot[t] * (1 - m.perc_reversible_damages)\n                            if value(m.perc_reversible_damages) < 1\n                            else 0\n                        )\n                    )\n                    <= 0\n                    if (m.year(t) >= 2100 and value(m.budget) is not False)\n                    else Constraint.Skip\n                ),\n                name=\"carbon_budget\",\n            ),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] <= 0\n                    if (\n                        m.year(t) >= 2100\n                        and value(m.no_pos_emissions_after_budget_year) is True\n                        and value(m.budget) is not False\n                    )\n                    else Constraint.Skip\n                ),\n                name=\"net_zero_after_2100\",\n            ),\n            GlobalConstraint(lambda m, t: m.cumulative_emissions[t] >= 0),\n            # Global and regional inertia constraints:\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] - m.global_emissions[t - 1]\n                    >= m.dt\n                    * m.inertia_global\n                    * sum(m.baseline_emissions(m.year(0), r) for r in m.regions)\n                    if value(m.inertia_global) is not False and t > 0\n                    else Constraint.Skip\n                ),\n                name=\"global_inertia\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] - m.regional_emissions[t - 1, r]\n                    >= m.dt * m.inertia_regional * m.baseline_emissions(m.year(0), r)\n                    if value(m.inertia_regional) is not False and t > 0\n                    else Constraint.Skip\n                ),\n                name=\"regional_inertia\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] - m.regional_emissions[t - 1, r] <= 0\n                    if m.year(t - 1) > 2100\n                    and value(m.non_increasing_emissions_after_2100)\n                    else Constraint.Skip\n                ),\n                name=\"non_increasing_emissions_after_2100\",\n            ),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] >= m.global_min_level\n                    if value(m.global_min_level) is not False\n                    else Constraint.Skip\n                ),\n                \"global_min_level\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] >= m.regional_min_level\n                    if value(m.regional_min_level) is not False\n                    else Constraint.Skip\n                ),\n                \"regional_min_level\",\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/general/","title":"General structure","text":"

      The MIMOSA model consists of several sub-modules, called model components. Each component is made up of multiple variables (global or regional), parameters and equations (called constraints).

      "},{"location":"components/general/#economics","title":"Economics","text":"

      Cobb-Douglas production function, investments, consumption and capital stock

      Read more

      "},{"location":"components/general/#welfare","title":"Welfare","text":"

      Welfare and the utility function

      Read more

      "},{"location":"components/general/#emissions-and-temperature","title":"Emissions and temperature","text":"
      • Baseline emissions, regional mitigated emissions and cumulative emissions
      • Temperature module
      • Constraints on emissions like inertia

      Read more

      "},{"location":"components/general/#mitigation","title":"Mitigation","text":"

      Mitigation costs and Marginal Abatement Cost curve

      Read more

      "},{"location":"components/general/#sea-level-rise","title":"Sea-level rise","text":"

      Determines the level of global sea-level rise

      Read more

      "},{"location":"components/general/#damages","title":"Damages","text":"

      Temperature related damages and sea-level rise related damages

      Read more

      "},{"location":"components/general/#effort-sharing","title":"Effort-sharing","text":"

      Optional Various effort-sharing regimes to distribute the mitigation (and sometimes damage) costs

      Read more

      "},{"location":"components/general/#emission-trading","title":"Emission trading","text":"

      Optional Allows for global trade of emission reductions

      Read more

      "},{"location":"components/general/#financial-transfers","title":"Financial transfers","text":"

      Optional Financial transfer schemes like a global damage cost pool

      Read more

      "},{"location":"components/general/#mimosa.abstract_model.create_abstract_model--building-the-abstract-model","title":"Building the abstract model","text":"

      Builds the abstract model for MIMOSA by combining all components. Some components are optional. In the parameters, different variants of some components can be chosen. The components are:

      • damage_module: The damage module to use
      • emissiontrade_module: The emission trading module to use
      • financialtransfer_module: The financial transfer module to use
      • welfare_module: The welfare module to use
      • objective_module: The objective module to use
      Source code in mimosa/abstract_model.py
      def create_abstract_model(\n    damage_module: str,\n    emissiontrade_module: str,\n    financialtransfer_module: str,\n    welfare_module: str,\n    objective_module: str,\n) -> AbstractModel:\n    \"\"\"\n    ## Building the abstract model\n\n    Builds the abstract model for MIMOSA by combining all components. Some components are optional. In the\n    parameters, different variants of some components can be chosen. The components are:\n\n    - `damage_module`: The damage module to use\n    - `emissiontrade_module`: The emission trading module to use\n    - `financialtransfer_module`: The financial transfer module to use\n    - `welfare_module`: The welfare module to use\n    - `objective_module`: The objective module to use\n\n    \"\"\"\n    m = AbstractModel()\n\n    ## Constraints\n    # Each constraint will be put in this list,\n    # then added to the model at the end of this file.\n    constraints = []\n\n    ## Time and region\n    m.beginyear = Param()\n    m.dt = Param()\n    m.tf = Param()\n    m.t = Set()\n    m.year = None  # Initialised with concrete instance\n    m.year2100 = Param()\n\n    m.regions = Set(ordered=True)\n\n    ######################\n    # Create data functions\n    # Will be initialised when creating a concrete instance of the model\n    ######################\n\n    m.baseline_emissions = lambda year, region: None\n    m.population = lambda year, region: None\n    m.TFP = lambda year, region: None\n    m.GDP = lambda year, region: None\n    m.carbon_intensity = lambda year, region: None\n\n    def baseline_cumulative(year_start, year_end, region):\n        years = np.linspace(year_start, year_end, 100)\n        return np.trapz(m.baseline_emissions(years, region), x=years)\n\n    m.baseline_cumulative = baseline_cumulative\n    m.baseline_cumulative_global = lambda m, year_start, year_end: sum(\n        baseline_cumulative(year_start, year_end, r) for r in m.regions\n    )\n\n    ######################\n    # Components\n    ######################\n\n    # Emissions and temperature equations\n    constraints.extend(emissions.get_constraints(m))\n\n    # Sea level rise\n    constraints.extend(sealevelrise.get_constraints(m))\n\n    # Damage costs\n    if damage_module == \"RICE2010\":\n        constraints.extend(damages.ad_rice2010.get_constraints(m))\n    elif damage_module == \"WITCH\":\n        constraints.extend(damages.ad_witch.get_constraints(m))\n    elif damage_module == \"RICE2012\":\n        constraints.extend(damages.ad_rice2012.get_constraints(m))\n    elif damage_module == \"COACCH\":\n        constraints.extend(damages.coacch.get_constraints(m))\n    elif damage_module == \"nodamage\":\n        constraints.extend(damages.nodamage.get_constraints(m))\n    else:\n        raise NotImplementedError\n\n    # Abatement costs\n    constraints.extend(mitigation.get_constraints(m))\n\n    # Emission trading\n    if emissiontrade_module == \"notrade\":\n        constraints.extend(emissiontrade.notrade.get_constraints(m))\n    elif emissiontrade_module == \"globalcostpool\":\n        constraints.extend(emissiontrade.globalcostpool.get_constraints(m))\n    elif emissiontrade_module == \"emissiontrade\":\n        constraints.extend(emissiontrade.emissiontrade.get_constraints(m))\n    else:\n        raise NotImplementedError(\n            f\"Emission trading module `{emissiontrade_module}` not implemented\"\n        )\n\n    # Financial transfer\n    if financialtransfer_module == \"notransfer\":\n        constraints.extend(financialtransfer.notransfer.get_constraints(m))\n    elif financialtransfer_module == \"globaldamagepool\":\n        constraints.extend(financialtransfer.globaldamagepool.get_constraints(m))\n    else:\n        raise NotImplementedError(\n            f\"Financial transfer module `{financialtransfer_module}` not implemented\"\n        )\n\n    # Burden sharing regime\n    constraints.extend(burdensharing.get_constraints(m))\n\n    # Cobb-Douglas and economics\n    constraints.extend(cobbdouglas.get_constraints(m))\n\n    # Utility and welfare\n    if welfare_module == \"welfare_loss_minimising\":\n        constraints.extend(welfare.welfare_loss_minimising.get_constraints(m))\n    elif welfare_module == \"cost_minimising\":\n        constraints.extend(welfare.cost_minimising.get_constraints(m))\n    elif welfare_module == \"inequal_aversion_general\":\n        constraints.extend(welfare.inequal_aversion_general.get_constraints(m))\n    else:\n        raise NotImplementedError(f\"Welfare module `{welfare_module}` not implemented\")\n\n    # Objective of optimisation\n    if objective_module == \"utility\":\n        objective_rule, objective_constraints = objective.utility.get_constraints(m)\n    elif objective_module == \"globalcosts\":\n        objective_rule, objective_constraints = objective.globalcosts.get_constraints(m)\n    else:\n        raise NotImplementedError\n\n    constraints.extend(objective_constraints)\n\n    ######################\n    # Add constraints to abstract model\n    ######################\n\n    for constraint in constraints:\n        add_constraint(m, constraint.to_pyomo_constraint(m), constraint.name)\n\n    m.obj = objective_rule\n\n    return m\n
      "},{"location":"components/regions/","title":"Region definitions","text":"

      MIMOSA uses 26 regions, equal to the IMAGE regions. More info on the IMAGE website.

      Hover the map to see the region name:

      "},{"location":"components/welfare/","title":"Welfare","text":"

      Back to general structure

      "},{"location":"components/welfare/#welfare-and-utility","title":"Welfare and utility","text":"

      The optimisation goal of MIMOSA is to maximise discounted welfare or utility1. There are three ways to calculate welfare in MIMOSA: welfare-loss-minimising, cost-minimising, and a general inequality aversion setting which is the generalised version of the first two methods.

      The welfare module can be chosen using the parameter params[\"model\"][\"welfare module\"].

      Welfare-loss-minimising defaultCost-minimisingGeneral inequality aversion

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"welfare_loss_minimising\"\nmodel = MIMOSA(params)\n

      Welfare-loss-minimising setting

      In welfare-loss-minimising setting, the utility is first calculated regionally from the per capita consumption. These regional utilities are then summed up to get the global welfare. This means that costs are weighted differently in different regions, depending on the regional per capita consumption. As a consequence, this setting leads to differentiated carbon prices across regions: poorer regions typically will have lower carbon prices than richer regions.

      Difference with cost-minimising setting

      In the cost-minimising setting, the regional per capita consumption values are first added up to a global per capita consumption. The utility function is only then applied to this global per capita consumption to obtain global welfare.

      Equations

      First, calculate the regional utility using the regional consumption \\(C_{t,r}\\) and population \\(L_{t,r}\\): $$ U_{t,r} = \\text{utility}(C_{t,r}, L_{t,r}) $$

      Second, the global welfare is calculated as the sum of the regional utility values weighted by population: $$ W_t = \\sum_r L_{t,r} \\cdot U_{t,r} $$

      Utility function

      The utility function is a concave function of per-capita consumption, given by:

      \\[ \\text{utility}(C, L) = \\left( \\left(\\frac{C}{L}\\right)^{1 - \\text{elasmu}} - 1 \\right) \\cdot \\frac{1}{1 - \\text{elasmu}}\\]

      where \\(C\\) is the consumption and \\(L\\) the population of a region. \\(\\text{elasmu}\\) is the elasticity of marginal utility. A value of \\(\\text{elasmu}\\) close to 1 approaches a logarithmic utility function:

      Source code in mimosa/components/welfare/utility_fct.py
      def calc_utility(consumption, population, elasmu):\n    \"\"\"\n    The utility function is a concave function of per-capita consumption, given by:\n\n    $$ \\\\text{utility}(C, L) = \\\\left( \\\\left(\\\\frac{C}{L}\\\\right)^{1 - \\\\text{elasmu}} - 1 \\\\right) \\\\cdot \\\\frac{1}{1 - \\\\text{elasmu}}$$\n\n    where $C$ is the consumption and $L$ the population of a region. $\\\\text{elasmu}$ is the elasticity of marginal utility. A value of $\\\\text{elasmu}$ close to 1 approaches a logarithmic utility function:\n    ``` plotly\n    {\"file_path\": \"./assets/plots/utility_fct.json\"}\n    ```\n\n    \"\"\"\n\n    # Note that the `soft_min` function is used to avoid division by zero\n    return (soft_min(consumption / population) ** (1 - elasmu) - 1) / (1 - elasmu)\n
      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      Source code in mimosa/components/welfare/welfare_loss_minimising.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    <h3>Welfare-loss-minimising setting</h3>\n\n    In welfare-loss-minimising setting, the utility is first calculated regionally\n    from the per capita consumption. These regional utilities are then summed up to\n    get the global welfare. This means that costs are weighted differently in different\n    regions, depending on the regional per capita consumption. As a consequence, this\n    setting leads to differentiated carbon prices across regions: poorer regions typically\n    will have lower carbon prices than richer regions.\n\n    ???+ info \"Difference with cost-minimising setting\"\n        In the cost-minimising setting, the regional per capita consumption values\n        are first added up to a global per capita consumption. The utility function\n        is only then applied to this global per capita consumption to obtain global welfare.\n\n    <h3>Equations</h3>\n\n    First, calculate the regional utility using the regional consumption $C_{t,r}$ and population $L_{t,r}$:\n    $$ U_{t,r} = \\\\text{utility}(C_{t,r}, L_{t,r}) $$\n\n    Second, the global welfare is calculated as the sum of the regional utility values weighted by population:\n    $$ W_t = \\\\sum_r L_{t,r} \\\\cdot U_{t,r} $$\n\n    <h3>Utility function</h3>\n    :::mimosa.components.welfare.utility_fct.calc_utility\n\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n\n    m.utility = Var(m.t, m.regions, initialize=0.1)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == calc_utility(m.consumption[t, r], m.L(m.year(t), r), m.elasmu),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) * m.utility[t, r] for r in m.regions),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"cost_minimising\"\nmodel = MIMOSA(params)\n

      Cost-minimising setting

      In cost-minimising setting, the global per-capita consumption is first calculated before applying the utility function. This means that costs are weighted equally across regions, regardless of the regional per capita consumption. As a consequence, this setting leads to uniform carbon prices across regions. This is quantitatively similar to using Negishi weights.

      Difference with welfare-loss-minimising setting

      In the welfare-loss-minimising setting, the utility function is applied to the regional per capita consumption values, and the regional utilities are then summed up to get the global welfare. This means that costs (from mitigation or damages) have a larger weight in the final welfare in poorer regions than in richer regions.

      Equations

      First, calculate the global consumption \\(C_{t,r}\\) and population \\(L_{t,r}\\):

      \\[ \\widehat{C}_{t} = \\sum_r C_{t,r}, \\] \\[ \\widehat{L}_{t} = \\sum_r L_{t,r}. \\]

      These are used to calculate the global utility:

      \\[ W_t = \\widehat{L}_t \\cdot \\text{utility}\\left( \\widehat{C}_{t}, \\widehat{L}_{t} \\right) \\] Utility function

      The utility function is a concave function of per-capita consumption, given by:

      \\[ \\text{utility}(C, L) = \\left( \\left(\\frac{C}{L}\\right)^{1 - \\text{elasmu}} - 1 \\right) \\cdot \\frac{1}{1 - \\text{elasmu}}\\]

      where \\(C\\) is the consumption and \\(L\\) the population of a region. \\(\\text{elasmu}\\) is the elasticity of marginal utility. A value of \\(\\text{elasmu}\\) close to 1 approaches a logarithmic utility function:

      Source code in mimosa/components/welfare/utility_fct.py
      def calc_utility(consumption, population, elasmu):\n    \"\"\"\n    The utility function is a concave function of per-capita consumption, given by:\n\n    $$ \\\\text{utility}(C, L) = \\\\left( \\\\left(\\\\frac{C}{L}\\\\right)^{1 - \\\\text{elasmu}} - 1 \\\\right) \\\\cdot \\\\frac{1}{1 - \\\\text{elasmu}}$$\n\n    where $C$ is the consumption and $L$ the population of a region. $\\\\text{elasmu}$ is the elasticity of marginal utility. A value of $\\\\text{elasmu}$ close to 1 approaches a logarithmic utility function:\n    ``` plotly\n    {\"file_path\": \"./assets/plots/utility_fct.json\"}\n    ```\n\n    \"\"\"\n\n    # Note that the `soft_min` function is used to avoid division by zero\n    return (soft_min(consumption / population) ** (1 - elasmu) - 1) / (1 - elasmu)\n
      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      Source code in mimosa/components/welfare/cost_minimising.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    <h3>Cost-minimising setting</h3>\n\n    In cost-minimising setting, the global per-capita consumption is first calculated before\n    applying the utility function. This means that costs are weighted equally across regions,\n    regardless of the regional per capita consumption. As a consequence, this setting leads to\n    uniform carbon prices across regions. This is quantitatively similar to using Negishi weights.\n\n    ???+ info \"Difference with welfare-loss-minimising setting\"\n        In the welfare-loss-minimising setting, the utility function is applied to the regional\n        per capita consumption values, and the regional utilities are then summed up to get the\n        global welfare. This means that costs (from mitigation or damages) have a larger weight in\n        the final welfare in poorer regions than in richer regions.\n\n\n    <h3>Equations</h3>\n\n    First, calculate the global consumption $C_{t,r}$ and population $L_{t,r}$:\n\n    $$ \\\\widehat{C}_{t} = \\\\sum_r C_{t,r}, $$\n\n    $$ \\\\widehat{L}_{t} = \\\\sum_r L_{t,r}. $$\n\n    These are used to calculate the global utility:\n\n    $$ W_t = \\\\widehat{L}_t \\\\cdot \\\\text{utility}\\\\left( \\\\widehat{C}_{t}, \\\\widehat{L}_{t} \\\\right) $$\n\n    <h3>Utility function</h3>\n    :::mimosa.components.welfare.utility_fct.calc_utility\n\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n\n    m.utility = Var(m.t, m.regions, initialize=10)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == m.consumption[t, r] / m.L(m.year(t), r),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) for r in m.regions)\n                * calc_utility(\n                    sum(m.consumption[t, r] for r in m.regions),\n                    sum(m.L(m.year(t), r) for r in m.regions),\n                    m.elasmu,\n                ),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"inequal_aversion_general\"\nmodel = MIMOSA(params)\n

      General inequality aversion

      TODO

      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      • param::inequal_aversion
      Source code in mimosa/components/welfare/inequal_aversion_general.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    <h3>General inequality aversion</h3>\n\n    TODO\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n    - param::inequal_aversion\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n    m.inequal_aversion = Param(doc=\"::economics.inequal_aversion\")\n\n    m.utility = Var(m.t, m.regions, initialize=10)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == calc_regional_utility(\n                    m.consumption[t, r], m.L(m.year(t), r), m.inequal_aversion\n                ),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) for r in m.regions)\n                * calc_global_utility(\n                    sum(m.utility[t, r] for r in m.regions),\n                    sum(m.L(m.year(t), r) for r in m.regions),\n                    m.elasmu,\n                    m.inequal_aversion,\n                ),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/welfare/#optimisation-goal-and-discounting","title":"Optimisation goal and discounting","text":"

      TODO

      1. While the terms welfare and utility can be used interchangeably, we typically refer to utility as the regional utility, and welfare as the global population-weighted utility.\u00a0\u21a9

      "}]} \ No newline at end of file +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Home","text":""},{"location":"#mimosa-mathematical-integrated-model-for-optimal-and-stylised-assessment","title":"MIMOSA: Mathematical Integrated Model for Optimal and Stylised Assessment","text":"Warning

      This documentation is still under construction and will be updated regularly.

      MIMOSA is a recent simple IAM based on FAIR, with 26 regions covering the whole world. It is a relatively simple Cost-Benefit IAM but still covers the relevant technological and socio-economic dynamics. Temperature is a linear function of cumulative CO2 emissions. MIMOSA uses the DICE sea-level rise module. The mitigation costs, population, initial capital stock and baseline GDP and CO2 emissions are regional. The direct regional mitigation costs are calculated as area under the Marginal Abatement Cost (MAC) curve, and have been calibrated to the IPCC AR6 WGIII database.

      Documentation Installation Running

      "},{"location":"#general","title":"General","text":"

      The model is written in the Python optimisation package Pyomo. It is mainly an AbstractModel (object containing all the variables, parameters and constraints, without the actual data values), which is then transformed into a ConcreteModel by putting all the parameter values in it. This ConcreteModel is sent to the solver (IPOPT, an open-source large-scale nonlinear optimisation suite).

      Schematic overview of the MIMOSA model. From [1].

      "},{"location":"#how-to-cite","title":"How to cite","text":"

      When using MIMOSA, please cite [1] (global version) and [2] (regional version).

      "},{"location":"#references","title":"References","text":"

      [1] van der Wijst, KI., Hof, A.F. & van Vuuren, D.P. On the optimality of 2\u00b0C targets and a decomposition of uncertainty. Nature Communications 12, 2575 (2021). https://doi.org/10.1038/s41467-021-22826-5

      [2] van der Wijst, KI., Bosello, F., Dasgupta, S. et al. New damage curves and multimodel analysis suggest lower optimal temperature. Nature Climate Change 13, 434\u2013441 (2023). https://doi.org/10.1038/s41558-023-01636-1

      "},{"location":"extending_mimosa/","title":"Extending MIMOSA","text":"
      • Adding a variable
      • Adding a parameter

        • Either setting param directly from config
          • With string or dynamically
        • Or setting it automatically from regional param store
          • With string or dynamically
        • Or for more advanced manipulations by using instantiate_params.py
      • Adding a new component (import abstract_model etc)

      "},{"location":"installation/","title":"Installing MIMOSA","text":"

      MIMOSA is written in Python, can be installed using pip:

      pip install mimosa\n

      If you don't have Python installed yet, we highly recommend to use Anaconda to install python.

      "},{"location":"installation/#installing-the-optimisation-engine-ipopt","title":"Installing the optimisation engine IPOPT","text":"

      Since MIMOSA is an optimisation model, an optimisation engine needs to be specified. This can be installed locally (see With IPOPT installed locally), but an easier way is to use a free cloud-based optimisation service called NEOS.

      Using the NEOS serverWith IPOPT installed locally

      The MIMOSA runs can easily be sent to the NEOS server (https://neos-server.org) for remote optimisation. First, on their website, sign up for a free account. You can then run MIMOSA with NEOS enabled by simply providing it with the email address you used to sign up for NEOS:

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nmodel1 = MIMOSA(params)\nmodel1.solve(use_neos=True, neos_email=\"your.email@email.com\")\nmodel1.save(\"run1\")\n

      Depending on the MIMOSA parameters chosen and on how busy the NEOS server is, running the model might take a while (typically a couple of minutes).

      A faster way to run MIMOSA, and which doesn't require an internet connection, is to install the open-source optimisation engine IPOPT locally:

      conda install -c conda-forge ipopt\n
      However, this sometimes fails on Windows. To fix it, go to https://www.coin-or.org/download/binary/Ipopt/ and download the latest win64-version. Unzip the files. A subfolder bin should contain the file ipopt.exe. The next step is to add this folder to your PATH environment: Windows > Edit the system environment variables > Environment variables... > Select \"Path\" and click Edit... > Click New and browse to the folder you just unzipped. Make sure to select the bin subfolder as this folder contains the file ipopt.exe.

      More detailed steps on how to install IPOPT on Windows
      1. Once you've downloaded the zip file of the latest win64-version on the coin website (currently Ipopt-3.11.1-win64-intel13.1.zip), unzip this file to folder of your choice. In the unzipped folder, there should be a bin folder.
      2. The next step is to tell Windows to look for IPOPT in this bin directory. This is achieved by adding the relevant folder to the environment path of Windows. Click on Start (or press the Win key), type environment and press Enter. This should open the dialog Edit the system environment variables.
      3. Click on Environment variables, select Path and click edit.
      4. Here, you can add the folder with the IPOPT bin folder. Click on New and add the folder you unzipped IPOPT in, making sure to select the sub-folder bin:
      5. You can test if everything works by opening an Anaconda Prompt and typing ipopt. It should show something like this:

      Once IPOPT is installed, MIMOSA can be ran without NEOS:

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nmodel1 = MIMOSA(params)\nmodel1.solve()  # No NEOS required\nmodel1.save(\"run1\")\n

      Next: Running MIMOSA

      "},{"location":"parameters/","title":"Parameter reference","text":"SSP

      SSP, used for population, baseline GDP and baseline emissions

      • Type: enum

      • Default: SSP2

      • Can be false: False

      • Allowed values:

        • SSP1
        • SSP2
        • SSP3
        • SSP4
        • SSP5

      Example usage:

      params = load_params()\nparams[\"SSP\"] = \"SSP2\"\nmodel = MIMOSA(params)\n
      regionstype

      Name of the region definition. Used in the mapping of the regional parameters.

      • Type: enum

      • Default: IMAGE26

      • Can be false: False

      • Allowed values:

        • IMAGE26
        • SSP5
        • World

      Example usage:

      params = load_params()\nparams[\"regionstype\"] = \"IMAGE26\"\nmodel = MIMOSA(params)\n
      regionsmappings

      List of region types and their conversion tables. Only used for regional parameters, not for aggregating or disaggregating variables or other output.

      • Type: list

      • Default: [{'regionstype1': 'IMAGE26', 'regionstype2': 'COACCH', 'conversiontable': 'inputdata/regions/IMAGE26_COACCH.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2010', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2010.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2012', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2012.csv'}]

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regionsmappings\"] = [{'regionstype1': 'IMAGE26', 'regionstype2': 'COACCH', 'conversiontable': 'inputdata/regions/IMAGE26_COACCH.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2010', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2010.csv'}, {'regionstype1': 'IMAGE26', 'regionstype2': 'ADRICE2012', 'conversiontable': 'inputdata/regions/IMAGE26_ADRICE2012.csv'}]\nmodel = MIMOSA(params)\n
      regional_parameter_files

      Dictionary of regional parameter files. If the regionstype of the file is different from the regionstype of the model, the file is converted using the regionsmappings parameter.

      • Type: dict

      • Default: {'economics': {'filename': 'inputdata/params/economics.csv', 'regionstype': 'IMAGE26'}, 'MAC': {'filename': 'inputdata/params/mac.csv', 'regionstype': 'IMAGE26'}, 'COACCH': {'filename': 'inputdata/params/COACCH.csv', 'regionstype': 'COACCH'}, 'ADRICE2010': {'filename': 'inputdata/params/ADRICE2010.csv', 'regionstype': 'ADRICE2010'}, 'ADRICE2012': {'filename': 'inputdata/params/ADRICE2012.csv', 'regionstype': 'ADRICE2012'}}

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regional_parameter_files\"] = {'economics': {'filename': 'inputdata/params/economics.csv', 'regionstype': 'IMAGE26'}, 'MAC': {'filename': 'inputdata/params/mac.csv', 'regionstype': 'IMAGE26'}, 'COACCH': {'filename': 'inputdata/params/COACCH.csv', 'regionstype': 'COACCH'}, 'ADRICE2010': {'filename': 'inputdata/params/ADRICE2010.csv', 'regionstype': 'ADRICE2010'}, 'ADRICE2012': {'filename': 'inputdata/params/ADRICE2012.csv', 'regionstype': 'ADRICE2012'}}\nmodel = MIMOSA(params)\n
      regions

      Dictionary of all regions with optional dictionaries defining, optionally, manual values for certain parameters for that specific region.

      • Type: dict

      • Default: {'CAN': None, 'USA': None, 'MEX': None, 'RCAM': None, 'BRA': None, 'RSAM': None, 'NAF': None, 'WAF': None, 'EAF': None, 'SAF': None, 'WEU': None, 'CEU': None, 'TUR': None, 'UKR': None, 'STAN': None, 'RUS': None, 'ME': None, 'INDIA': None, 'KOR': None, 'CHN': None, 'SEAS': None, 'INDO': None, 'JAP': None, 'OCE': None, 'RSAS': None, 'RSAF': None}

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"regions\"] = {'CAN': None, 'USA': None, 'MEX': None, 'RCAM': None, 'BRA': None, 'RSAM': None, 'NAF': None, 'WAF': None, 'EAF': None, 'SAF': None, 'WEU': None, 'CEU': None, 'TUR': None, 'UKR': None, 'STAN': None, 'RUS': None, 'ME': None, 'INDIA': None, 'KOR': None, 'CHN': None, 'SEAS': None, 'INDO': None, 'JAP': None, 'OCE': None, 'RSAS': None, 'RSAF': None}\nmodel = MIMOSA(params)\n

      "},{"location":"parameters/#time_1","title":"time","text":"start

      Year in which the model starts

      • Type: int

      • Default: 2020

      • Can be false: False

      • Min: 1900

      • Max: 2100

      Example usage:

      params = load_params()\nparams[\"time\"][\"start\"] = 2020\nmodel = MIMOSA(params)\n
      end

      Last year of the model run

      • Type: int

      • Default: 2150

      • Can be false: False

      • Min: 1901

      • Max: 2300

      Example usage:

      params = load_params()\nparams[\"time\"][\"end\"] = 2150\nmodel = MIMOSA(params)\n
      dt

      Timestep in years

      • Type: float

      • Default: 5

      • Can be false: False

      • Min: 0.5

      • Max: 20

      Example usage:

      params = load_params()\nparams[\"time\"][\"dt\"] = 5\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics_1","title":"economics","text":"PRTP

      Pure rate of time preference

      • Type: float

      • Default: 0.015

      • Can be false: False

      • Min: 0

      • Max: 0.2

      Example usage:

      params = load_params()\nparams[\"economics\"][\"PRTP\"] = 0.015\nmodel = MIMOSA(params)\n
      elasmu

      Elasticity of marginal utility

      • Type: float

      • Default: 1.001

      • Can be false: False

      • Min: 0.1

      • Max: 10

      Example usage:

      params = load_params()\nparams[\"economics\"][\"elasmu\"] = 1.001\nmodel = MIMOSA(params)\n
      inequal_aversion

      Parameter of inequality aversion. Should be between 0 and elasmu. Only used when welfare_module='inequal_aversion_general'

      • Type: float

      • Default: 0.5

      • Can be false: False

      • Min: 0.0

      • Max: 3

      Example usage:

      params = load_params()\nparams[\"economics\"][\"inequal_aversion\"] = 0.5\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-gdp","title":"economics > GDP","text":"alpha

      Output elasticity of capital

      • Type: float

      • Default: 0.3

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"alpha\"] = 0.3\nmodel = MIMOSA(params)\n
      depreciation of capital

      Yearly depreciation rate of capital stock

      • Type: float

      • Default: 0.05

      • Can be false: False

      • Min: 0

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"depreciation of capital\"] = 0.05\nmodel = MIMOSA(params)\n
      savings rate

      Fraction of GDP used for investments

      • Type: float

      • Default: 0.21

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"GDP\"][\"savings rate\"] = 0.21\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-mac","title":"economics > MAC","text":"beta

      Power factor of the MAC curve

      • Type: float

      • Default: 3

      • Can be false: False

      • Min: 0.01

      • Max: 10

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"beta\"] = 3\nmodel = MIMOSA(params)\n
      rho

      Learning by doing rate (needs more explanation)

      • Type: float

      • Default: 0.82

      • Can be false: False

      • Min: 0.1

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"rho\"] = 0.82\nmodel = MIMOSA(params)\n
      gamma

      Calibration level of the MAC (carbon price for 100% reduction)

      • Type: quantity

      • Default: 2601 USD2005/tCO2

      • Can be false: False

      • Unit: currency_unit/emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"gamma\"] = \"2601 USD2005/tCO2\"\nmodel = MIMOSA(params)\n
      regional calibration factor

      Column from mac.csv to be used for the regional MACs. The MACs are calibrated from TIMER SSP2-RCP2.6 MACs at a given year and a given carbon price / abatement level.

      • Type: enum

      • Default: kappa_rel_abatement_0.75_2050

      • Can be false: False

      • Allowed values:

        • kappa_carbonprice_200_2030
        • kappa_carbonprice_200_2050
        • kappa_carbonprice_200_2070
        • kappa_carbonprice_200_2100
        • kappa_carbonprice_300_2030
        • kappa_carbonprice_300_2050
        • kappa_carbonprice_300_2070
        • kappa_carbonprice_300_2100
        • kappa_carbonprice_500_2030
        • kappa_carbonprice_500_2050
        • kappa_carbonprice_500_2070
        • kappa_carbonprice_500_2100
        • kappa_carbonprice_1000_2030
        • kappa_carbonprice_1000_2050
        • kappa_carbonprice_1000_2070
        • kappa_carbonprice_1000_2100
        • kappa_rel_abatement_0.25_2030
        • kappa_rel_abatement_0.25_2050
        • kappa_rel_abatement_0.25_2070
        • kappa_rel_abatement_0.25_2100
        • kappa_rel_abatement_0.4_2030
        • kappa_rel_abatement_0.4_2050
        • kappa_rel_abatement_0.4_2070
        • kappa_rel_abatement_0.4_2100
        • kappa_rel_abatement_0.5_2050
        • kappa_rel_abatement_0.5_2070
        • kappa_rel_abatement_0.5_2100
        • kappa_rel_abatement_0.75_2050
        • kappa_rel_abatement_0.75_2070
        • kappa_rel_abatement_0.75_2100

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"regional calibration factor\"] = \"kappa_rel_abatement_0.75_2050\"\nmodel = MIMOSA(params)\n
      rel_mitigation_costs_min_level

      Minimum level of mitigation costs (rel to GDP). By default, this is 0: no negative abatement costs are allowed. For certain burden sharing regimes, this value can become negative to allow certain (small) financial transfers.

      • Type: float

      • Default: 0

      • Can be false: False

      • Min: -2

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"economics\"][\"MAC\"][\"rel_mitigation_costs_min_level\"] = 0\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-emission-trade","title":"economics > emission trade","text":"min rel payment level

      Which percentage of the area under the MAC of a region should it pay itself (minimum)? If false: no limt

      • Type: float

      • Default: False

      • Can be false: True

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"emission trade\"][\"min rel payment level\"] = False\nmodel = MIMOSA(params)\n
      max rel payment level

      Which percentage of the area under the MAC of a region should it pay itself (maximum)? If false: no limit

      • Type: float

      • Default: False

      • Can be false: True

      • Min: 1

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"emission trade\"][\"max rel payment level\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-damages","title":"economics > damages","text":"percentage reversible

      Factor of damages that are reversible

      • Type: float

      • Default: 1

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"percentage reversible\"] = 1\nmodel = MIMOSA(params)\n
      scale factor

      Manual scaling factor to increase or decrease damages

      • Type: float

      • Default: 1

      • Can be false: False

      • Min: -inf

      • Max: inf

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"scale factor\"] = 1\nmodel = MIMOSA(params)\n
      ignore damages

      Flag to not take into account the damages in the GDP (but damages are calculated)

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"ignore damages\"] = False\nmodel = MIMOSA(params)\n
      quantile

      Damage quantile (Only used for COACCH)

      • Type: float

      • Default: 0.5

      • Can be false: False

      • Min: 0.025

      • Max: 0.975

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"quantile\"] = 0.5\nmodel = MIMOSA(params)\n
      coacch_slr_withadapt

      Flag to use the SLR-with-Adapation damage functions (Only used for COACCH)

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"coacch_slr_withadapt\"] = True\nmodel = MIMOSA(params)\n
      coacch_combined_slr_nonslr_damages

      If true, do not model SLR damages separately from non-SLR, but use the combined damage functions (Only used for COACCH)

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"damages\"][\"coacch_combined_slr_nonslr_damages\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#economics-adaptation","title":"economics > adaptation","text":"curr_level

      When adaptation level is fixed, keep it at this level (Only used for AD-RICE2010)

      • Type: float

      • Default: 0

      • Can be false: False

      • Min: 0

      • Max: 1

      Example usage:

      params = load_params()\nparams[\"economics\"][\"adaptation\"][\"curr_level\"] = 0\nmodel = MIMOSA(params)\n
      fixed

      Flag to keep adaptation at fixed value (curr_level). (Only used for AD-RICE2010) If false: the adaptation level is endogenously optimised.

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"economics\"][\"adaptation\"][\"fixed\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#emissions_1","title":"emissions","text":"carbonbudget

      Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.

      • Type: quantity

      • Default: False

      • Can be false: True

      • Unit: emissions_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"carbonbudget\"] = False\nmodel = MIMOSA(params)\n
      global min level

      Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed

      • Type: quantity

      • Default: -20 GtCO2/yr

      • Can be false: True

      • Unit: emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"global min level\"] = \"-20 GtCO2/yr\"\nmodel = MIMOSA(params)\n
      regional min level

      Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed

      • Type: quantity

      • Default: -10 GtCO2/yr

      • Can be false: True

      • Unit: emissionsrate_unit

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"regional min level\"] = \"-10 GtCO2/yr\"\nmodel = MIMOSA(params)\n
      not positive after budget year

      If true, impose net-zero emissions after budget year (2100)

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"not positive after budget year\"] = True\nmodel = MIMOSA(params)\n
      non increasing emissions after 2100

      If true, the regional emissions after 2100 are not allowed to climb.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"non increasing emissions after 2100\"] = True\nmodel = MIMOSA(params)\n
      baseline carbon intensity

      If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"baseline carbon intensity\"] = True\nmodel = MIMOSA(params)\n
      cumulative_emissions_trapz

      If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the approximation is usually still acceptable.

      • Type: bool

      • Default: True

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"cumulative_emissions_trapz\"] = True\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#emissions-inertia","title":"emissions > inertia","text":"global

      Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed

      • Type: float

      • Default: False

      • Can be false: True

      • Min: -inf

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"inertia\"][\"global\"] = False\nmodel = MIMOSA(params)\n
      regional

      Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed

      • Type: float

      • Default: -0.05

      • Can be false: True

      • Min: -inf

      • Max: 0

      Example usage:

      params = load_params()\nparams[\"emissions\"][\"inertia\"][\"regional\"] = -0.05\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#burden-sharing","title":"burden sharing","text":"regime

      Type of burden sharing to be used

      • Type: enum

      • Default: noregime

      • Can be false: False

      • Allowed values:

        • noregime
        • equal_mitigation_costs
        • equal_total_costs
        • per_cap_convergence
        • per_cap_convergence_fake

      Example usage:

      params = load_params()\nparams[\"burden sharing\"][\"regime\"] = \"noregime\"\nmodel = MIMOSA(params)\n
      percapconv_year

      Year of convergence to per capita emission allowance (only used when burden sharing - regime is per_cap_convergence) Can also be false, then always use grandfathering

      • Type: float

      • Default: 2050

      • Can be false: True

      • Min: 2020

      • Max: 2200

      Example usage:

      params = load_params()\nparams[\"burden sharing\"][\"percapconv_year\"] = 2050\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#temperature_1","title":"temperature","text":"initial

      Temperature in initial year of model run (2020 by default).

      • Type: quantity

      • Default: 1.16 delta_degC

      • Can be false: False

      • Unit: temperature_unit

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"initial\"] = \"1.16 delta_degC\"\nmodel = MIMOSA(params)\n
      TCRE

      Transient Climate Response to CO2 Emissions

      • Type: quantity

      • Default: 0.62 delta_degC/(TtCO2)

      • Can be false: False

      • Unit: (temperature_unit)/(emissions_unit)

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"TCRE\"] = \"0.62 delta_degC/(TtCO2)\"\nmodel = MIMOSA(params)\n
      target

      Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed

      • Type: quantity

      • Default: False

      • Can be false: True

      • Unit: temperature_unit

      Example usage:

      params = load_params()\nparams[\"temperature\"][\"target\"] = False\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#model_1","title":"model","text":"damage module

      Damage module to be used

      • Type: enum

      • Default: COACCH

      • Can be false: False

      • Allowed values:

        • COACCH
        • RICE2010
        • RICE2012

      Example usage:

      params = load_params()\nparams[\"model\"][\"damage module\"] = \"COACCH\"\nmodel = MIMOSA(params)\n
      emissiontrade module

      Emission trade module to be used

      • Type: enum

      • Default: notrade

      • Can be false: False

      • Allowed values:

        • notrade
        • globalcostpool
        • emissiontrade

      Example usage:

      params = load_params()\nparams[\"model\"][\"emissiontrade module\"] = \"notrade\"\nmodel = MIMOSA(params)\n
      financialtransfer module

      Financial transfer module to be used

      • Type: enum

      • Default: notransfer

      • Can be false: False

      • Allowed values:

        • notransfer
        • globaldamagepool

      Example usage:

      params = load_params()\nparams[\"model\"][\"financialtransfer module\"] = \"notransfer\"\nmodel = MIMOSA(params)\n
      welfare module

      Welfare and utility module to be used

      • Type: enum

      • Default: welfare_loss_minimising

      • Can be false: False

      • Allowed values:

        • welfare_loss_minimising
        • cost_minimising
        • inequal_aversion_general

      Example usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"welfare_loss_minimising\"\nmodel = MIMOSA(params)\n
      objective module

      Objective module to be used

      • Type: enum

      • Default: utility

      • Can be false: False

      • Allowed values:

        • utility
        • globalcosts

      Example usage:

      params = load_params()\nparams[\"model\"][\"objective module\"] = \"utility\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input_1","title":"input","text":"db_filename

      Path to IAMC-formatted CSV file for baseline data

      • Type: filepath

      • Default: inputdata/data/data_IMAGE_SSP.csv

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"db_filename\"] = \"inputdata/data/data_IMAGE_SSP.csv\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines","title":"input > baselines","text":""},{"location":"parameters/#input-baselines-ssp1","title":"input > baselines > SSP1","text":"scenario

      Scenario name of SSP1 baseline

      • Type: str

      • Default: SSP1-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP1\"][\"scenario\"] = \"SSP1-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP1 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP1\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp2","title":"input > baselines > SSP2","text":"scenario

      Scenario name of SSP2 baseline

      • Type: str

      • Default: SSP2-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP2\"][\"scenario\"] = \"SSP2-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP2 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP2\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp3","title":"input > baselines > SSP3","text":"scenario

      Scenario name of SSP3 baseline

      • Type: str

      • Default: SSP3-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP3\"][\"scenario\"] = \"SSP3-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP3 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP3\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp4","title":"input > baselines > SSP4","text":"scenario

      Scenario name of SSP4 baseline

      • Type: str

      • Default: SSP4-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP4\"][\"scenario\"] = \"SSP4-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP4 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP4\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-baselines-ssp5","title":"input > baselines > SSP5","text":"scenario

      Scenario name of SSP5 baseline

      • Type: str

      • Default: SSP5-Ref-SPA0-V17

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP5\"][\"scenario\"] = \"SSP5-Ref-SPA0-V17\"\nmodel = MIMOSA(params)\n
      model

      Model name of SSP5 baseline

      • Type: str

      • Default: IMAGE

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"baselines\"][\"SSP5\"][\"model\"] = \"IMAGE\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#input-variables","title":"input > variables","text":"GDP

      Variable name for GDP in data file

      • Type: enum

      • Default: GDP|PPP

      • Can be false: False

      • Allowed values:

        • GDP|PPP
        • GDP|MER

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"GDP\"] = \"GDP|PPP\"\nmodel = MIMOSA(params)\n
      emissions

      Variable name for emissions variable

      • Type: str

      • Default: Emissions|CO2

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"emissions\"] = \"Emissions|CO2\"\nmodel = MIMOSA(params)\n
      population

      Variable name for population variable

      • Type: str

      • Default: Population

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"input\"][\"variables\"][\"population\"] = \"Population\"\nmodel = MIMOSA(params)\n
      "},{"location":"parameters/#simulation_1","title":"simulation","text":"simulationmode

      If true, the model is run in simulation mode: then some variables will be imposed exogenously and fixed. If false, constraint_variables and deactivated_constraints are ignored.

      • Type: bool

      • Default: False

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"simulationmode\"] = False\nmodel = MIMOSA(params)\n
      constraint_variables

      Dictionary of variable names with associated path to file containing values for that variable

      • Type: dict

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"constraint_variables\"] = None\nmodel = MIMOSA(params)\n
      deactivated_constraints

      List of constraint names to be disabled

      • Type: list

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"deactivated_constraints\"] = None\nmodel = MIMOSA(params)\n
      custom_mapping

      Custom mapping of parameter values or variables

      • Type: dict

      • Default: None

      • Can be false: False

      Example usage:

      params = load_params()\nparams[\"simulation\"][\"custom_mapping\"] = None\nmodel = MIMOSA(params)\n
      "},{"location":"run/","title":"Running MIMOSA","text":""},{"location":"run/#base-run","title":"Base run","text":"

      A basic run of MIMOSA requires 4 steps: loading the parameters, building the model instance, solving the model and finally saving the output. With this code, the default parameter values are used (see Parameter reference).

      from mimosa import MIMOSA, load_params\n\nparams = load_params()  # (1)!\n\nmodel1 = MIMOSA(params) # (2)!\nmodel1.solve() # (3)!\n\nmodel1.save(\"run1\") # (4)!\n
      1. Read the default parameters
      2. Build the model using the parameters
      3. Once the model is built, send the model to the solver. Note that if you use the NEOS solver, use the syntax model1.solve(use_neos=True, neos_email=\"your.email@email.com\")
      4. Export the output to the file output/run1.csv
      "},{"location":"run/#reading-the-output","title":"Reading the output","text":"

      Once the script above has finished running, it has produced two output files in the folder output: run1.csv and run1.csv.params.json. The latter is simply a JSON file with all the input parameter used for this particular run (for reproducibility). The former is a CSV file that contains all the output data. Every variable in MIMOSA is saved in this value in a format similar to IAMC data format:

      output/run1.csv

      Variable Region Unit 2020 2025 2030 2035 2040 2045 2050 2055 2060 2065 2070 2075 2080 2085 2090 2095 2100 2105 2110 2115 2120 2125 2130 2135 2140 2145 2150 regional_emissions CAN GtCO2/yr 0.511577 0.383683 0.255789 0.155544 0.136527 0.113384 0.0944834 0.0845257 0.077836 0.0694752 0.0588413 0.0469933 0.0359533 0.0269266 0.0199594 0.014565 0.0104499 0.0517489 0.0517486 0.0517485 0.0517484 0.0517483 0.0517482 0.0517481 0.051748 0.0517478 0.0517476 regional_emissions USA GtCO2/yr 5.39382 4.04537 2.69691 1.34846 0.789513 0.649695 0.531854 0.430432 0.341586 0.262853 0.195861 0.142273 0.101621 0.072636 0.0549502 0.0495887 0.0582421 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534749 0.534748 0.534748 regional_emissions MEX GtCO2/yr 0.572878 0.429658 0.286439 0.250682 0.235195 0.210891 0.184067 0.159748 0.137097 0.114491 0.0904155 0.0650686 0.0402638 0.0171455 -0.00403092 -0.0236268 -0.0413935 6.53385e-05 6.49712e-05 6.47857e-05 6.46547e-05 6.45457e-05 6.4444e-05 6.4339e-05 6.42181e-05 6.40555e-05 6.37559e-05 ... ...

      These output files can be easily imported for plotting software (like using Plotly in Python). An easier way, however, to quickly visualise and compare MIMOSA outputs, is by using the MIMOSA Dashboard. After opening the online Dashboard, simply drag and drop all output files to the drag-and-drop input to visualise one or multiple MIMOSA output files. Also include the parameter files to directly see the difference in input parameters.

      Note: the MIMOSA Dashboard can sometimes take up to a few minutes to start, as it goes to sleep after 30 minutes of inactivity (restriction of the free plan of the hosting website).

      Open the MIMOSA Dashboard

      "},{"location":"run/#changing-parameters","title":"Changing parameters","text":"

      The default parameters from load_params() are given as a nested dictionary. Every item of this dictionary can be changed. Note that only the values can be changed, it is not possible to add or substract parameters to this dictionary (without Extending MIMOSA).

      "},{"location":"run/#example-1-carbon-budget","title":"Example 1: carbon budget","text":"
      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"emissions\"][\"carbonbudget\"] = \"500 GtCO2\" # (1)!\n\nmodel1 = MIMOSA(params)\nmodel1.solve()\n\nmodel1.save(\"run_example1\")\n
      1. Change the parameter of emissions > carbonbudget to the string \"500 GtCO2\"
      "},{"location":"run/#example-2-high-damages-high-tcre-low-discounting","title":"Example 2: high damages, high TCRE, low discounting","text":"

      Multiple parameters can also be changed at the same time. In this example, the high end of the damages and of the climate sensitivity (TCRE) are used, combined with the low end of the discount rate (PRTP).

      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"economics\"][\"damages\"][\"quantile\"] = 0.95\nparams[\"temperature\"][\"TCRE\"] = \"0.82 delta_degC/(TtCO2)\"\nparams[\"economics\"][\"PRTP\"] = 0.001\n\nmodel2 = MIMOSA(params)\nmodel2.solve()\n\nmodel2.save(\"run_example2\")\n
      "},{"location":"run/#doing-multiple-runs","title":"Doing multiple runs","text":"

      Often, MIMOSA needs to be run with multiple values of the same parameter (multiple carbon budgets, multiple discount rates, etc.). While it is possible to simply run the file multiple times, it is much easier to run MIMOSA multiple times directly in the Python script through regular Python loops:

      from mimosa import MIMOSA, load_params\n\nfor budget in [\"500 GtCO2\", \"700 GtCO2\", \"1000 GtCO2\"]:\n\n     params = load_params()\n\n     params[\"emissions\"][\"carbonbudget\"] = budget\n\n     model3 = MIMOSA(params)\n     model3.solve()\n\n     model3.save(f\"run_example3_{budget}\") # (1)!\n
      1. Don't forget to save each file to a different name, otherwise they will be overwritten at each iteration of the loop.
      "},{"location":"run/#doing-a-baseline-run","title":"Doing a baseline run","text":"

      It can be useful to do a MIMOSA run with zero mitigation: a baseline run. We distinguish two types of baseline runs: either ignoring damages (the true baseline run, in absence of climate policy and climate impacts), or with damages (a no-policy scenario, mainly to investigate the damages if no climate policy were implemented).

      Baseline ignoring damagesNo policy scenario with damages
      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"emissions\"][\"carbonbudget\"] = False\nparams[\"economics\"][\"damages\"][\"ignore damages\"] = True\n\nparams[\"model\"][\"welfare module\"] = \"cost_minimising\"\n\n# Disable some emission reduction constraints\nparams[\"emissions\"][\"non increasing emissions after 2100\"] = False\nparams[\"emissions\"][\"not positive after budget year\"] = False\nparams[\"emissions\"][\"inertia\"][\"regional\"] = False\nparams[\"emissions\"][\"inertia\"][\"global\"] = False\n\nparams[\"time\"][\"end\"] = 2150\n\nmodel = MIMOSA(params)\nmodel.solve()\nmodel.save(\"baseline_ignore_damages\")\n
      from mimosa import MIMOSA, load_params\n\nparams = load_params()\n\nparams[\"emissions\"][\"carbonbudget\"] = False\nparams[\"economics\"][\"damages\"][\"ignore damages\"] = False # (1)!\nparams[\"model\"][\"welfare module\"] = \"cost_minimising\"\n\n# Force the mitigation effort to be zero\nparams[\"simulation\"][\"simulationmode\"] = True\nparams[\"simulation\"][\"constraint_variables\"] = {\n     \"relative_abatement\": {\n          year: {region: 0.0 for region in params[\"regions\"]}\n          for year in range(2025, 2151, 5)\n     },\n}\nparams[\"economics\"][\"MAC\"][\"gamma\"] = \"0.00001 USD2005/tCO2\" # (2)!\n\n# Disable some emission reduction constraints\nparams[\"emissions\"][\"non increasing emissions after 2100\"] = False\nparams[\"emissions\"][\"not positive after budget year\"] = False\nparams[\"emissions\"][\"inertia\"][\"regional\"] = False\nparams[\"emissions\"][\"inertia\"][\"global\"] = False\n\nparams[\"time\"][\"end\"] = 2150\n\nmodel = MIMOSA(params)\nmodel.solve()\nmodel.save(\"baseline_no_policy\")\n
      1. This is default, so this line could be removed
      2. Needed for numerical stability
      "},{"location":"run/#advanced-logging","title":"Advanced: logging","text":"

      The solve status (optimal, impossible, etc), model solve time and the final maximised value can be logged to an external log file (along with the warnings or errors from the code). This can be very useful when doing many runs overnight. In this code example, the log is written to the file mainlog.log:

      import logging\nimport logging.handlers\n\nfrom mimosa import MIMOSA, load_params\n\nhandler = logging.handlers.WatchedFileHandler(\"mainlog.log\")\nhandler.setFormatter(\n    logging.Formatter(\"[%(levelname)s, %(asctime)s] %(name)s - %(message)s\")\n)\nroot = logging.getLogger()\nroot.setLevel(\"INFO\")\nroot.addHandler(handler)\n\nparams = load_params()\n\n# Make changes to the params if needed\nparams[\"emissions\"][\"carbonbudget\"] = False\n\nmodel1 = MIMOSA(params)\nmodel1.solve(verbose=False) # (1)!\nmodel1.save(\"run1\")\n
      1. By setting verbose=False, the IPOPT output is not printed. If you're doing many runs, this is probably useful. The termination status of IPOPT is logged to the log file anyway.
      "},{"location":"components/economics/","title":"Economics","text":"

      Back to general structure

      "},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--economic-module-and-production-function","title":"Economic module and production function","text":""},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--gross-and-net-gdp","title":"Gross and net GDP","text":"

      The core of the model is the economic module, detailing how GDP, investments and consumptions vary over time. We use a traditional Cobb-Douglas production function. This means that the gross GDP is calculated by:

      $$ \\text{GDP}_{\\text{gross},t,r} = \\text{TFP}_{t,r} \\cdot L^{1-\\alpha}_{t,r} \\cdot K^{\\alpha}_{t,r}, $$ with \\(\\text{TFP}\\) the total factor productivity (exogenously calibrated from the baseline SSP scenarios) \\(L\\) the labor (represented by the total population), \\(K\\) the capital stock and \\(\\alpha\\) the share of capital in the production function.

      Source code in mimosa/common/economics.py
      def calc_GDP(TFP, L, K, alpha):\n    \"\"\"\n    $$ \\\\text{GDP}_{\\\\text{gross},t,r} = \\\\text{TFP}\\\\_{t,r} \\\\cdot L^{1-\\\\alpha}\\\\_{t,r} \\\\cdot K^{\\\\alpha}\\\\_{t,r}, $$\n    with $\\\\text{TFP}$ the total factor productivity (exogenously calibrated from the baseline SSP scenarios)\n    $L$ the labor (represented by the total population), $K$ the capital stock and $\\\\alpha$ the share of capital in the production function.\n\n    \"\"\"\n    return TFP * L ** (1 - alpha) * K**alpha\n

      The net GDP is then calculated by subtracting the damages and mitigation costs from the gross GDP. (Note that in MIMOSA, the damages are expressed as a fraction of the gross GDP, whereas the mitigation costs are expressed in absolute terms.)

      \\[ \\text{GDP}_{\\text{net},t,r} = \\text{GDP}_{\\text{gross},t,r} \\cdot (1 - \\text{damage costs}_{t,r}) - \\text{mitigation costs}_{t,r}\\]"},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--investments-and-consumption","title":"Investments and consumption","text":"

      This net GDP is then split in a part of investments (\\(I_t\\)) and a part of consumption (\\(C_t\\)), according to a fixed savings rate (\\(\\text{sr}\\)):

      \\[ I_{t,r} = \\text{sr} \\cdot \\text{GDP}_{\\text{net},t,r}, \\] \\[ C_{t,r} = (1 - \\text{sr}) \\cdot \\text{GDP}_{\\text{net},t,r}. \\]"},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--capital-stock","title":"Capital stock","text":"

      The capital stock \\(K_t\\) grows over time according to the investments and the depreciation of the capital stock:

      \\[ K_{t,r} = K_{t-1,r} + \\Delta t \\cdot \\frac{\\partial K_{t,r}}{\\partial t}, \\]

      with the change in capital stock calculated by:

      \\[ \\frac{\\partial K_{t,r}}{\\partial t} = \\frac{1}{\\Delta t} \\cdot ((1 - dk)^{\\Delta t} - 1) \\cdot K_{t,r} + I_{t,r}.\\] Source code in mimosa/common/economics.py
      def calc_dKdt(K, dk, I, dt):\n    \"\"\"\n    $$ \\\\frac{\\\\partial K_{t,r}}{\\\\partial t} = \\\\frac{1}{\\\\Delta t} \\\\cdot ((1 - dk)^{\\\\Delta t}  - 1) \\\\cdot K_{t,r} + I_{t,r}.$$\n    \"\"\"\n    return ((1 - dk) ** dt - 1) / dt * K + I\n

      Since this only gives the change in capital stock, we need to add the initial capital stock to get the actual capital stock. This is calculated as a region-dependent multiple of the initial GDP:

      \\[ K_{t=0,r} = \\text{init_capitalstock_factor}_r \\cdot \\text{GDP}_{t=0,r}. \\]

      The initial capital stock factor is a calibration factor to obtain the initial capital stock. TODO: Source (IMF)

      "},{"location":"components/economics/#mimosa.components.cobbdouglas.get_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • init_capitalstock_factor
      • alpha: Output elasticity of capital. Type: float. Default: 0.3. Min: 0. Max: 1.
      • dk: Yearly depreciation rate of capital stock. Type: float. Default: 0.05. Min: 0. Max: inf.
      • sr: Fraction of GDP used for investments. Type: float. Default: 0.21. Min: 0. Max: 1.
      • ignore_damages: Flag to not take into account the damages in the GDP (but damages are calculated). Type: bool. Default: False.
      Source code in mimosa/components/cobbdouglas.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    # Economic module and production function\n\n    ## Gross and net GDP\n\n    The core of the model is the economic module, detailing how GDP, investments and\n    consumptions vary over time. We use a traditional Cobb-Douglas production function. This means\n    that the gross GDP is calculated by:\n\n    :::mimosa.common.economics.calc_GDP\n\n    The net GDP is then calculated by subtracting the damages and\n    mitigation costs from the gross GDP. *(Note that in MIMOSA, the damages are expressed as a fraction of the gross GDP,\n    whereas the mitigation costs are expressed in absolute terms.)*\n\n    $$ \\\\text{GDP}_{\\\\text{net},t,r} = \\\\text{GDP}_{\\\\text{gross},t,r} \\\\cdot (1 - \\\\text{damage costs}_{t,r}) - \\\\text{mitigation costs}_{t,r}$$\n\n    ## Investments and consumption\n\n    This net GDP is then split in a part of investments ($I_t$) and a part of consumption ($C_t$), according to a fixed savings rate ($\\\\text{sr}$):\n\n    $$ I_{t,r} = \\\\text{sr} \\\\cdot \\\\text{GDP}_{\\\\text{net},t,r}, $$\n\n    $$ C_{t,r} = (1 - \\\\text{sr}) \\\\cdot \\\\text{GDP}_{\\\\text{net},t,r}. $$\n\n    ## Capital stock\n\n    The capital stock $K_t$ grows over time according to the investments and the depreciation of the capital stock:\n\n    $$ K_{t,r} = K_{t-1,r} + \\\\Delta t \\\\cdot \\\\frac{\\\\partial K_{t,r}}{\\\\partial t}, $$\n\n    with the change in capital stock calculated by:\n\n    :::mimosa.common.economics.calc_dKdt\n\n    Since this only gives the change in capital stock, we need to add the initial capital stock to get the actual capital stock.\n    This is calculated as a region-dependent multiple of the initial GDP:\n\n    $$ K_{t=0,r} = \\\\text{init_capitalstock_factor}_r \\\\cdot \\\\text{GDP}_{t=0,r}. $$\n\n    The initial capital stock factor is a calibration factor to obtain the initial capital stock. TODO: Source (IMF)\n    ``` plotly\n    {\"file_path\": \"./assets/plots/init_capital_factor.json\"}\n    ```\n\n    ## Parameters defined in this module\n    - init_capitalstock_factor\n    - alpha: Output elasticity of capital. Type: float. Default: 0.3. Min: 0. Max: 1.\n    - dk: Yearly depreciation rate of capital stock. Type: float. Default: 0.05. Min: 0. Max: inf.\n    - sr: Fraction of GDP used for investments. Type: float. Default: 0.21. Min: 0. Max: 1.\n    - ignore_damages: Flag to not take into account the damages in the GDP (but damages are calculated). Type: bool. Default: False.\n\n\n\n    \"\"\"\n    constraints = []\n\n    m.init_capitalstock_factor = Param(\n        m.regions,\n        units=quant.unit(\"currency_unit\"),\n        doc=\"regional::economics.init_capital_factor\",\n    )\n    m.capital_stock = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.init_capitalstock_factor[r] * m.GDP(m.year(t), r),\n        units=quant.unit(\"currency_unit\"),\n    )\n\n    # Parameters\n    m.alpha = Param(doc=\"::economics.GDP.alpha\")\n    m.dk = Param(doc=\"::economics.GDP.depreciation of capital\")\n    m.sr = Param(doc=\"::economics.GDP.savings rate\")\n\n    m.GDP_gross = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.GDP(m.year(0), r),\n        units=quant.unit(\"currency_unit\"),\n    )\n    m.GDP_net = Var(\n        m.t,\n        m.regions,\n        units=quant.unit(\"currency_unit\"),\n        initialize=lambda m, t, r: m.GDP(m.year(0), r),\n    )\n    m.investments = Var(m.t, m.regions, units=quant.unit(\"currency_unit\"))\n    m.consumption = Var(m.t, m.regions, units=quant.unit(\"currency_unit\"))\n\n    m.ignore_damages = Param(doc=\"::economics.damages.ignore damages\")\n\n    # Cobb-Douglas, GDP, investments, capital and consumption\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.GDP_gross[t, r]\n                    == economics.calc_GDP(\n                        m.TFP(m.year(t), r),\n                        m.L(m.year(t), r),\n                        soft_min(m.capital_stock[t, r], scale=10),\n                        m.alpha,\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"GDP_gross\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.GDP_gross[0, r] == m.GDP(m.year(0), r), \"GDP_gross_init\"\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.GDP_net[t, r]\n                == m.GDP_gross[t, r]\n                * (1 - (m.damage_costs[t, r] if not value(m.ignore_damages) else 0))\n                - m.mitigation_costs[t, r]\n                - m.financial_transfer[t, r],\n                \"GDP_net\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.investments[t, r] == m.sr * m.GDP_net[t, r],\n                \"investments\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.consumption[t, r] == (1 - m.sr) * m.GDP_net[t, r],\n                \"consumption\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    (\n                        m.capital_stock[t, r]\n                        == m.capital_stock[t - 1, r]\n                        + m.dt\n                        * economics.calc_dKdt(\n                            m.capital_stock[t, r], m.dk, m.investments[t, r], m.dt\n                        )\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"capital_stock\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.capital_stock[0, r]\n                == m.init_capitalstock_factor[r] * m.GDP(m.year(0), r)\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/","title":"Emissions and temperature","text":"

      Back to general structure

      Baseline and mitigated emissions Temperature Carbon budget, inertia and other restrictions

      The global temperature change is calculated as a linear function of cumulative emissions, with a slope given by the Transient Climate Response to CO2 Emissions (TCRE), following [Dietz et al.] who showed that this performed better than the default two-box DICE climate module.

      \\[ \\text{temperature}_{t} = T_0 + \\text{TCRE} \\cdot \\text{cumulative emissions}_{t}, \\]

      where \\(T_0\\) is the initial temperature at the start of the run (by default in 2020), and the TCRE is the Transient Climate Response to CO2 Emissions.

      The initial temperature is set to 1.16\u00b0C in 2020 by default, following [Visser et al.]. The TCRE is calibrated on the IPCC AR5 or AR6 reports (the median value of the TCRE is the same in the AR5 and AR6 calibration), but the distribution is different.

      Calibration of the TCRE

      The TCRE is calibrated on the IPCC AR5 and AR6 reports, both using the linear relation shown in the SPM figure of the WG1 report. The default value of the TCRE is 0.62\u00b0C per 1000 GtCO2 (median value of the AR5 and AR6 calibration). The 5th and 95th percentiles differ between the two calibrations, with the AR5 calibration having a wider distribution:

      Percentile AR5 TCRE (\u00b0C per TtCO2) AR6 TCRE (\u00b0C per TtCO2) 5th 0.42 0.42 50th 0.62 0.62 default 95th 0.82 0.75 Calibrated on IPCC AR5Calibrated on IPCC AR6

      Source: IPCC AR5 WG1 Figure SPM.10

      Source: IPCC AR6 WG1 Figure SPM.10

      Source code in mimosa/components/emissions.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    === \":octicons-cloud-24: Baseline and mitigated emissions\"\n\n        :::mimosa.components.emissions._get_emissions_constraints\n\n    === \":fontawesome-solid-temperature-half: Temperature\"\n\n        :::mimosa.components.emissions._get_temperature_constraints\n\n    === \":fontawesome-solid-chart-pie: Carbon budget, inertia and other restrictions\"\n\n        :::mimosa.components.emissions._get_inertia_and_budget_constraints\n\n    \"\"\"\n    constraints = (\n        _get_emissions_constraints(m)\n        + _get_temperature_constraints(m)\n        + _get_inertia_and_budget_constraints(m)\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--baseline-emissions","title":"Baseline emissions","text":"

      In MIMOSA, emissions are represented by CO2 emissions only1. The emissions are calculated relative to baseline emissions: emissions that would occur in the absence of any climate policy.

      There are two ways to calculate baseline emissions: either directly imported exogenously from the SSP scenarios, or calculated from the baseline carbon intensity from the SSPs. The latter accounts for the fact that in the absence of climate policy, baseline emissions would go down if the GDP goes down, and vice versa. This can be chosen with the parameter baseline_carbon_intensity. If this parameter is set to true, baseline emissions are calculated as:

      \\[ \\text{baseline emissions}_{t,r} = \\text{baseline carbon intensity}_{t,r} \\cdot \\text{GDP}_{\\text{net}, t,r} \\] Baseline emissions values

      "},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--emission-reductions","title":"Emission reductions","text":"

      To calculate the actual emissions per region, the baseline emissions are reduced by a relative abatement factor, which in term is determined by the Marginal Abatement Cost curve and the carbon price (see Mitigation). The regional emissions are then calculated as:

      \\[ \\text{regional emissions}_{t,r} = (1 - \\text{relative abatement}_{t,r}) \\cdot \\text{baseline emissions}_{t,r} \\]

      In the first period, reductions are assumed to be zero:

      \\[ \\text{regional emissions}_{0,r} = \\text{baseline emissions}_{0,r}. \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--global-and-cumulative-emissions","title":"Global and cumulative emissions","text":"

      The regional emissions are aggregated to global emissions:

      \\[ \\text{global emissions}_{t} = \\sum_r \\text{regional emissions}_{t,r}, \\]

      which are used to calculate the cumulative emissions. There are two ways to calculate them: using trapezoidal integration or by simply adding up all the years. The former is more accurate, while the latter is numerically more stable. This is chosen with the parameter cumulative_emissions_trapz.

      Trapezoidal integration defaultSimple sum \\[ \\begin{aligned} \\text{cumulative emissions}_{t} & = \\text{cumulative emissions}_{t-1} \\\\ & + \\frac{\\Delta t}{2} \\cdot (\\text{global emissions}_{t} + \\text{global emissions}_{t-1}) ,\\text{for } t > 0. \\end{aligned} \\] \\[ \\text{cumulative emissions}_{t} = \\text{cumulative emissions}_{t-1} + \\Delta t \\cdot \\text{global emissions}_{t} \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_emissions_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • baseline_carbon_intensity: If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.. Type: bool. Default: True.
      • cumulative_emissions_trapz: If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the approximation is usually still acceptable.. Type: bool. Default: True.
      1. The effect of other greenhouse gases is implicitly accounted for in the TCRE which translates cumulative CO2 emissions into temperature change. This assumes a linear relation between CO2 emissions and other greenhouse gases.\u00a0\u21a9

      Source code in mimosa/components/emissions.py
      def _get_emissions_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    ## Baseline emissions\n\n    In MIMOSA, emissions are represented by CO<sub>2</sub> emissions only[^1]. The emissions are calculated\n    relative to baseline emissions: emissions that would occur in the absence of any climate policy.\n\n    There are two ways to calculate baseline emissions: either directly imported exogenously from\n    the SSP scenarios, or calculated from the baseline carbon intensity from the SSPs. The latter\n    accounts for the fact that in the absence of climate policy, baseline emissions would go down if\n    the GDP goes down, and vice versa. This can be chosen with the parameter [`baseline_carbon_intensity`](../parameters.md#emissions.baseline carbon intensity).\n    If this parameter is set to true, baseline emissions are calculated as:\n\n    $$\n    \\\\text{baseline emissions}_{t,r} = \\\\text{baseline carbon intensity}_{t,r} \\\\cdot \\\\text{GDP}_{\\\\text{net}, t,r}\n    $$\n\n    ??? info \"Baseline emissions values\"\n\n        <div style=\"overflow: scroll;\" markdown>\n        ``` plotly\n        {\"file_path\": \"./assets/plots/baseline_emissions.json\"}\n        ```\n        </div>\n\n    ## Emission reductions\n    To calculate the actual emissions per region, the baseline emissions are reduced by a relative\n    abatement factor, which in term is determined by the Marginal Abatement Cost curve and the carbon price\n    (see [Mitigation](mitigation.md)). The regional emissions are then calculated as:\n\n    $$\n    \\\\text{regional emissions}_{t,r} = (1 - \\\\text{relative abatement}_{t,r}) \\\\cdot \\\\text{baseline emissions}_{t,r}\n    $$\n\n    In the first period, reductions are assumed to be zero:\n\n    $$\n    \\\\text{regional emissions}_{0,r} = \\\\text{baseline emissions}_{0,r}.\n    $$\n\n    ## Global and cumulative emissions\n\n    The regional emissions are aggregated to global emissions:\n\n    $$\n    \\\\text{global emissions}_{t} = \\\\sum_r \\\\text{regional emissions}_{t,r},\n    $$\n\n    which are used to calculate the cumulative emissions. There are two ways to calculate them:\n    using trapezoidal integration or by simply adding up all the years. The former is more accurate,\n    while the latter is numerically more stable. This is chosen with the parameter [`cumulative_emissions_trapz`](../parameters.md#emissions.cumulative_emissions_trapz).\n\n    === \"Trapezoidal integration `default`\"\n\n        $$\n        \\\\begin{aligned}\n        \\\\text{cumulative emissions}_{t} & = \\\\text{cumulative emissions}_{t-1} \\\\\\\\ \n        & + \\\\frac{\\\\Delta t}{2} \\\\cdot (\\\\text{global emissions}_{t} + \\\\text{global emissions}_{t-1}) ,\\\\text{for } t > 0.\n        \\\\end{aligned}\n        $$\n\n    === \"Simple sum\"\n\n        $$\n        \\\\text{cumulative emissions}_{t} = \\\\text{cumulative emissions}_{t-1} + \\\\Delta t \\\\cdot \\\\text{global emissions}_{t}\n        $$\n\n\n    ## Parameters defined in this module\n    - baseline_carbon_intensity: If true, use baseline carbon intensity to calculate baseline emissions. If false, the SSP baseline emissions are used, regardless of lower GDP.. Type: bool. Default: True.\n    - cumulative_emissions_trapz: If true, calculate cumulative emissions using trapezoidal interpolation. If false, cum. emissions are simply cum_emissions[t-1] + dt * cum_emissions[t]. This is less accurate, but better for numerical stability. For small dt the  approximation is usually still acceptable.. Type: bool. Default: True.\n\n    [^1]: The effect of other greenhouse gases is implicitly accounted for in the TCRE which\n        translates cumulative CO<sub>2</sub> emissions into temperature change. This assumes a linear\n        relation between CO<sub>2</sub> emissions and other greenhouse gases.\n    \"\"\"\n\n    constraints = []\n\n    m.regional_emissions = Var(m.t, m.regions, units=quant.unit(\"emissionsrate_unit\"))\n    m.baseline = Var(\n        m.t,\n        m.regions,\n        initialize=lambda m, t, r: m.baseline_emissions(m.year(t), r),\n        units=quant.unit(\"emissionsrate_unit\"),\n    )\n    m.baseline_carbon_intensity = Param(doc=\"::emissions.baseline carbon intensity\")\n\n    m.relative_abatement = Var(\n        m.t,\n        m.regions,\n        initialize=0,\n        bounds=(0, 2.5),\n        units=quant.unit(\"fraction_of_baseline_emissions\"),\n    )\n    m.regional_emission_reduction = Var(\n        m.t, m.regions, units=quant.unit(\"emissionsrate_unit\")\n    )\n    m.cumulative_emissions = Var(m.t, units=quant.unit(\"emissions_unit\"))\n    m.global_emissions = Var(m.t, units=quant.unit(\"emissionsrate_unit\"))\n\n    m.cumulative_emissions_trapz = Param(doc=\"::emissions.cumulative_emissions_trapz\")\n\n    constraints.extend(\n        [\n            # Baseline emissions based on emissions or carbon intensity\n            RegionalConstraint(\n                lambda m, t, r: (\n                    (\n                        m.baseline[t, r]\n                        == m.carbon_intensity(m.year(t), r) * m.GDP_net[t, r]\n                    )\n                    if value(m.baseline_carbon_intensity)\n                    else (m.baseline[t, r] == m.baseline_emissions(m.year(t), r))\n                ),\n                name=\"baseline_emissions\",\n            ),\n            # Regional emissions from baseline and relative abatement\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r]\n                    == (1 - m.relative_abatement[t, r])\n                    * (\n                        m.baseline[t, r]\n                        if value(m.baseline_carbon_intensity)\n                        else m.baseline_emissions(m.year(t), r)\n                        # Note: this should simply be m.baseline[t,r], but this is numerically less stable\n                        # than m.baseline_emissions(m.year(t), r) whenever baseline intensity\n                        # is used instead of baseline emissions. In fact, m.baseline_emissions(m.year(t), r)\n                        # is just a fixed number, whereas m.baseline[t,r] is a variable depending on\n                        # GDP.\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"regional_abatement\",\n            ),\n            RegionalInitConstraint(\n                lambda m, r: m.regional_emissions[0, r]\n                == m.baseline_emissions(m.year(0), r)\n            ),\n            RegionalConstraint(\n                lambda m, t, r: m.regional_emission_reduction[t, r]\n                == m.baseline[t, r] - m.regional_emissions[t, r],\n                \"regional_emission_reduction\",\n            ),\n            # Global emissions (sum from regional emissions)\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t]\n                    == sum(m.regional_emissions[t, r] for r in m.regions)\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"global_emissions\",\n            ),\n            GlobalInitConstraint(\n                lambda m: m.global_emissions[0]\n                == sum(m.baseline_emissions(m.year(0), r) for r in m.regions),\n                \"global_emissions_init\",\n            ),\n            # Cumulative global emissions\n            GlobalConstraint(\n                lambda m, t: (\n                    m.cumulative_emissions[t]\n                    == m.cumulative_emissions[t - 1]\n                    + (\n                        (m.dt * (m.global_emissions[t] + m.global_emissions[t - 1]) / 2)\n                        if value(m.cumulative_emissions_trapz)\n                        else (m.dt * m.global_emissions[t])\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                \"cumulative_emissions\",\n            ),\n            GlobalInitConstraint(lambda m: m.cumulative_emissions[0] == 0),\n        ]\n    )\n\n    m.emission_relative_cumulative = Var(m.t, initialize=1)\n    constraints.extend(\n        [\n            GlobalConstraint(\n                lambda m, t: (\n                    (\n                        m.emission_relative_cumulative[t]\n                        == m.cumulative_emissions[t]\n                        / m.baseline_cumulative_global(m, m.year(0), m.year(t))\n                    )\n                    if t > 0\n                    else Constraint.Skip\n                ),\n                name=\"relative_cumulative_emissions\",\n            ),\n            GlobalInitConstraint(lambda m: m.emission_relative_cumulative[0] == 1),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_temperature_constraints--temperature-target","title":"Temperature target","text":"

      The usual way to specify a policy target in MIMOSA is using carbon budgets. However, it is also possible to specify a temperature target. This is done by setting the parameter temperature_target. This is an upper bound on the temperature: if the cost-optimal temperature is below this value, this constraint is not binding.

      If this parameter is set, the following constraint is active:

      \\[ \\text{temperature}_{t} \\leq \\text{temperature target} \\]"},{"location":"components/emissions/#mimosa.components.emissions._get_temperature_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • T0: Temperature in initial year of model run (2020 by default).. Type: quantity. Default: 1.16 delta_degC. Unit: temperature_unit.
      • TCRE: Transient Climate Response to CO2 Emissions. Type: quantity. Default: 0.62 delta_degC/(TtCO2). Unit: (temperature_unit)/(emissions_unit).
      • temperature_target: Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed. Type: quantity. Default: False. Can also be false. Unit: temperature_unit.
      Source code in mimosa/components/emissions.py
      def _get_temperature_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    The global temperature change is calculated as a linear function of cumulative emissions, with a slope\n    given by the Transient Climate Response to CO<sub>2</sub> Emissions (TCRE), following [Dietz et al.] who\n    showed that this performed better than the default two-box DICE climate module.\n\n    $$\n    \\\\text{temperature}_{t} = T_0 + \\\\text{TCRE} \\\\cdot \\\\text{cumulative emissions}_{t},\n    $$\n\n    where [$T_0$](../parameters.md#temperature.initial) is the initial temperature at the start of the run (by default in 2020),\n    and the [TCRE](../parameters.md#temperature.TCRE) is the Transient Climate Response to CO<sub>2</sub> Emissions.\n\n    The initial temperature is set to 1.16\u00b0C in 2020 by default, following [Visser et al.]. The TCRE\n    is calibrated on the IPCC AR5 or AR6 reports (the median value of the TCRE is the same in the AR5\n    and AR6 calibration), but the distribution is different.\n\n    ??? info \"Calibration of the TCRE\"\n\n        The TCRE is calibrated on the IPCC AR5 and AR6 reports, both using the linear relation shown in the SPM figure of the WG1 report.\n        The default value of the TCRE is 0.62\u00b0C per 1000 GtCO<sub>2</sub> (median value of the AR5 and AR6 calibration). The 5th and 95th percentiles\n        differ between the two calibrations, with the AR5 calibration having a wider distribution:\n\n        | Percentile | AR5 TCRE <br><span style=\"font-weight: normal\">(\u00b0C per TtCO<sub>2</sub>)</span> | AR6 TCRE <br><span style=\"font-weight: normal\">(\u00b0C per TtCO<sub>2</sub>)</span> |\n        |------------|----------|----------|\n        | 5th        | 0.42     | 0.42     |\n        | 50th       | 0.62     | 0.62 `default` |\n        | 95th       | 0.82     | 0.75     |\n\n        === \"Calibrated on IPCC AR5\"\n\n            <div style=\"overflow: scroll;\" markdown>\n            ``` plotly\n            {\"file_path\": \"./assets/plots/ar5_tcre.json\"}\n            ```\n            </div>\n            Source: [IPCC AR5 WG1 Figure SPM.10](https://www.ipcc.ch/report/ar5/wg1/summary-for-policymakers/figspm-10/)\n\n        === \"Calibrated on IPCC AR6\"\n\n            <div style=\"overflow: scroll;\" markdown>\n            ``` plotly\n            {\"file_path\": \"./assets/plots/ar6_tcre.json\"}\n            ```\n            </div>\n\n            Source: [IPCC AR6 WG1 Figure SPM.10](https://www.ipcc.ch/report/ar6/wg1/figures/summary-for-policymakers/figure-spm-10)\n\n    ## Temperature target\n    The usual way to specify a policy target in MIMOSA is using carbon budgets. However, it is also possible to\n    specify a temperature target. This is done by setting the parameter [`temperature_target`](../parameters.md#temperature.target).\n    This is an upper bound on the temperature: if the cost-optimal temperature is below this value, this constraint is not binding.\n\n    If this parameter is set, the following constraint is active:\n\n    $$\n    \\\\text{temperature}_{t} \\\\leq \\\\text{temperature target}\n    $$\n\n    ## Parameters defined in this module\n    - T0: Temperature in initial year of model run (2020 by default).. Type: quantity. Default: 1.16 delta_degC. Unit: temperature_unit.\n    - TCRE: Transient Climate Response to CO2 Emissions. Type: quantity. Default: 0.62 delta_degC/(TtCO2). Unit: (temperature_unit)/(emissions_unit).\n    - temperature_target: Temperature target in 2100 (and beyond). Can also be false, then no temperature target is imposed. Type: quantity. Default: False. Can also be false. Unit: temperature_unit.\n    \"\"\"\n\n    constraints = []\n\n    m.T0 = Param(units=quant.unit(\"degC_above_PI\"), doc=\"::temperature.initial\")\n    m.temperature = Var(\n        m.t, initialize=lambda m, t: m.T0, units=quant.unit(\"degC_above_PI\")\n    )\n    m.TCRE = Param(doc=\"::temperature.TCRE\")\n    m.temperature_target = Param(doc=\"::temperature.target\")\n    constraints.extend(\n        [\n            GlobalConstraint(\n                lambda m, t: m.temperature[t]\n                == m.T0 + m.TCRE * m.cumulative_emissions[t],\n                \"temperature\",\n            ),\n            GlobalInitConstraint(lambda m: m.temperature[0] == m.T0),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.temperature[t] <= m.temperature_target\n                    if (m.year(t) >= 2100 and value(m.temperature_target) is not False)\n                    else Constraint.Skip\n                ),\n                name=\"temperature_target\",\n            ),\n        ]\n    )\n\n    m.perc_reversible_damages = Param(doc=\"::economics.damages.percentage reversible\")\n\n    # m.overshoot = Var(m.t, initialize=0)\n    # m.overshootdot = DerivativeVar(m.overshoot, wrt=m.t)\n    # m.netnegative_emissions = Var(m.t)\n    # global_constraints.extend(\n    #     [\n    #         lambda m, t: m.netnegative_emissions[t]\n    #         == m.global_emissions[t] * (1 - tanh(m.global_emissions[t] * 10)) / 2\n    #         if value(m.perc_reversible_damages) < 1\n    #         else Constraint.Skip,\n    #         lambda m, t: m.overshootdot[t]\n    #         == (m.netnegative_emissions[t] if t <= value(m.year2100) and t > 0 else 0)\n    #         if value(m.perc_reversible_damages) < 1\n    #         else Constraint.Skip,\n    #     ]\n    # )\n\n    # global_constraints_init.extend([lambda m: m.overshoot[0] == 0])\n\n    return constraints\n
      "},{"location":"components/emissions/#mimosa.components.emissions._get_inertia_and_budget_constraints--parameters-defined-in-this-module","title":"Parameters defined in this module","text":"
      • budget: Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.. Type: quantity. Default: False. Can also be false. Unit: emissions_unit.
      • inertia_global: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: False. Can also be false. Min: -inf. Max: 0.
      • inertia_regional: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: -0.05. Can also be false. Min: -inf. Max: 0.
      • global_min_level: Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -20 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.
      • regional_min_level: Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -10 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.
      • no_pos_emissions_after_budget_year: If true, impose net-zero emissions after budget year (2100). Type: bool. Default: True.
      • non_increasing_emissions_after_2100: If true, the regional emissions after 2100 are not allowed to climb.. Type: bool. Default: True.
      Source code in mimosa/components/emissions.py
      def _get_inertia_and_budget_constraints(\n    m: AbstractModel,\n) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    ## Parameters defined in this module\n    - budget: Value of the carbon budget. Example: \"800 GtCO2\" (the unit is important). If set to False, no carbon budget is imposed: this is cost-benefit mode. Default: False.. Type: quantity. Default: False. Can also be false. Unit: emissions_unit.\n    - inertia_global: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: False. Can also be false. Min: -inf. Max: 0.\n    - inertia_regional: Maximum reduction speed, in % of initial emissions (should be negative) Can also be false, then no inertia limit is imposed. Type: float. Default: -0.05. Can also be false. Min: -inf. Max: 0.\n    - global_min_level: Limit on the emission level (globally), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -20 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.\n    - regional_min_level: Limit on the emission level (per region), mostly used for negative emissions. Can also be false, then no limit is imposed. Type: quantity. Default: -10 GtCO2/yr. Can also be false. Unit: emissionsrate_unit.\n    - no_pos_emissions_after_budget_year: If true, impose net-zero emissions after budget year (2100). Type: bool. Default: True.\n    - non_increasing_emissions_after_2100: If true, the regional emissions after 2100 are not allowed to climb.. Type: bool. Default: True.\n\n    \"\"\"\n\n    constraints = []\n\n    m.budget = Param(doc=\"::emissions.carbonbudget\")\n    m.inertia_global = Param(doc=\"::emissions.inertia.global\")\n    m.inertia_regional = Param(doc=\"::emissions.inertia.regional\")\n    m.global_min_level = Param(doc=\"::emissions.global min level\")\n    m.regional_min_level = Param(doc=\"::emissions.regional min level\")\n    m.no_pos_emissions_after_budget_year = Param(\n        doc=\"::emissions.not positive after budget year\"\n    )\n    m.non_increasing_emissions_after_2100 = Param(\n        doc=\"::emissions.non increasing emissions after 2100\"\n    )\n    constraints.extend(\n        [\n            # Carbon budget constraints:\n            GlobalConstraint(\n                lambda m, t: (\n                    m.cumulative_emissions[t]\n                    - (\n                        m.budget\n                        + (\n                            m.overshoot[t] * (1 - m.perc_reversible_damages)\n                            if value(m.perc_reversible_damages) < 1\n                            else 0\n                        )\n                    )\n                    <= 0\n                    if (m.year(t) >= 2100 and value(m.budget) is not False)\n                    else Constraint.Skip\n                ),\n                name=\"carbon_budget\",\n            ),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] <= 0\n                    if (\n                        m.year(t) >= 2100\n                        and value(m.no_pos_emissions_after_budget_year) is True\n                        and value(m.budget) is not False\n                    )\n                    else Constraint.Skip\n                ),\n                name=\"net_zero_after_2100\",\n            ),\n            GlobalConstraint(lambda m, t: m.cumulative_emissions[t] >= 0),\n            # Global and regional inertia constraints:\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] - m.global_emissions[t - 1]\n                    >= m.dt\n                    * m.inertia_global\n                    * sum(m.baseline_emissions(m.year(0), r) for r in m.regions)\n                    if value(m.inertia_global) is not False and t > 0\n                    else Constraint.Skip\n                ),\n                name=\"global_inertia\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] - m.regional_emissions[t - 1, r]\n                    >= m.dt * m.inertia_regional * m.baseline_emissions(m.year(0), r)\n                    if value(m.inertia_regional) is not False and t > 0\n                    else Constraint.Skip\n                ),\n                name=\"regional_inertia\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] - m.regional_emissions[t - 1, r] <= 0\n                    if m.year(t - 1) > 2100\n                    and value(m.non_increasing_emissions_after_2100)\n                    else Constraint.Skip\n                ),\n                name=\"non_increasing_emissions_after_2100\",\n            ),\n            GlobalConstraint(\n                lambda m, t: (\n                    m.global_emissions[t] >= m.global_min_level\n                    if value(m.global_min_level) is not False\n                    else Constraint.Skip\n                ),\n                \"global_min_level\",\n            ),\n            RegionalConstraint(\n                lambda m, t, r: (\n                    m.regional_emissions[t, r] >= m.regional_min_level\n                    if value(m.regional_min_level) is not False\n                    else Constraint.Skip\n                ),\n                \"regional_min_level\",\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/general/","title":"General structure","text":"

      The MIMOSA model consists of several sub-modules, called model components. Each component is made up of multiple variables (global or regional), parameters and equations (called constraints).

      "},{"location":"components/general/#economics","title":"Economics","text":"

      Cobb-Douglas production function, investments, consumption and capital stock

      Read more

      "},{"location":"components/general/#welfare","title":"Welfare","text":"

      Welfare and the utility function

      Read more

      "},{"location":"components/general/#emissions-and-temperature","title":"Emissions and temperature","text":"
      • Baseline emissions, regional mitigated emissions and cumulative emissions
      • Temperature module
      • Constraints on emissions like inertia

      Read more

      "},{"location":"components/general/#mitigation","title":"Mitigation","text":"

      Mitigation costs and Marginal Abatement Cost curve

      Read more

      "},{"location":"components/general/#sea-level-rise","title":"Sea-level rise","text":"

      Determines the level of global sea-level rise

      Read more

      "},{"location":"components/general/#damages","title":"Damages","text":"

      Temperature related damages and sea-level rise related damages

      Read more

      "},{"location":"components/general/#effort-sharing","title":"Effort-sharing","text":"

      Optional Various effort-sharing regimes to distribute the mitigation (and sometimes damage) costs

      Read more

      "},{"location":"components/general/#emission-trading","title":"Emission trading","text":"

      Optional Allows for global trade of emission reductions

      Read more

      "},{"location":"components/general/#financial-transfers","title":"Financial transfers","text":"

      Optional Financial transfer schemes like a global damage cost pool

      Read more

      "},{"location":"components/general/#mimosa.abstract_model.create_abstract_model--building-the-abstract-model","title":"Building the abstract model","text":"

      Builds the abstract model for MIMOSA by combining all components. Some components are optional. In the parameters, different variants of some components can be chosen. The components are:

      • damage_module: The damage module to use
      • emissiontrade_module: The emission trading module to use
      • financialtransfer_module: The financial transfer module to use
      • welfare_module: The welfare module to use
      • objective_module: The objective module to use
      Source code in mimosa/abstract_model.py
      def create_abstract_model(\n    damage_module: str,\n    emissiontrade_module: str,\n    financialtransfer_module: str,\n    welfare_module: str,\n    objective_module: str,\n) -> AbstractModel:\n    \"\"\"\n    ## Building the abstract model\n\n    Builds the abstract model for MIMOSA by combining all components. Some components are optional. In the\n    parameters, different variants of some components can be chosen. The components are:\n\n    - `damage_module`: The damage module to use\n    - `emissiontrade_module`: The emission trading module to use\n    - `financialtransfer_module`: The financial transfer module to use\n    - `welfare_module`: The welfare module to use\n    - `objective_module`: The objective module to use\n\n    \"\"\"\n    m = AbstractModel()\n\n    ## Constraints\n    # Each constraint will be put in this list,\n    # then added to the model at the end of this file.\n    constraints = []\n\n    ## Time and region\n    m.beginyear = Param()\n    m.dt = Param()\n    m.tf = Param()\n    m.t = Set()\n    m.year = None  # Initialised with concrete instance\n    m.year2100 = Param()\n\n    m.regions = Set(ordered=True)\n\n    ######################\n    # Create data functions\n    # Will be initialised when creating a concrete instance of the model\n    ######################\n\n    m.baseline_emissions = lambda year, region: None\n    m.population = lambda year, region: None\n    m.TFP = lambda year, region: None\n    m.GDP = lambda year, region: None\n    m.carbon_intensity = lambda year, region: None\n\n    def baseline_cumulative(year_start, year_end, region):\n        years = np.linspace(year_start, year_end, 100)\n        return np.trapz(m.baseline_emissions(years, region), x=years)\n\n    m.baseline_cumulative = baseline_cumulative\n    m.baseline_cumulative_global = lambda m, year_start, year_end: sum(\n        baseline_cumulative(year_start, year_end, r) for r in m.regions\n    )\n\n    ######################\n    # Components\n    ######################\n\n    # Emissions and temperature equations\n    constraints.extend(emissions.get_constraints(m))\n\n    # Sea level rise\n    constraints.extend(sealevelrise.get_constraints(m))\n\n    # Damage costs\n    if damage_module == \"RICE2010\":\n        constraints.extend(damages.ad_rice2010.get_constraints(m))\n    elif damage_module == \"WITCH\":\n        constraints.extend(damages.ad_witch.get_constraints(m))\n    elif damage_module == \"RICE2012\":\n        constraints.extend(damages.ad_rice2012.get_constraints(m))\n    elif damage_module == \"COACCH\":\n        constraints.extend(damages.coacch.get_constraints(m))\n    elif damage_module == \"nodamage\":\n        constraints.extend(damages.nodamage.get_constraints(m))\n    else:\n        raise NotImplementedError\n\n    # Abatement costs\n    constraints.extend(mitigation.get_constraints(m))\n\n    # Emission trading\n    if emissiontrade_module == \"notrade\":\n        constraints.extend(emissiontrade.notrade.get_constraints(m))\n    elif emissiontrade_module == \"globalcostpool\":\n        constraints.extend(emissiontrade.globalcostpool.get_constraints(m))\n    elif emissiontrade_module == \"emissiontrade\":\n        constraints.extend(emissiontrade.emissiontrade.get_constraints(m))\n    else:\n        raise NotImplementedError(\n            f\"Emission trading module `{emissiontrade_module}` not implemented\"\n        )\n\n    # Financial transfer\n    if financialtransfer_module == \"notransfer\":\n        constraints.extend(financialtransfer.notransfer.get_constraints(m))\n    elif financialtransfer_module == \"globaldamagepool\":\n        constraints.extend(financialtransfer.globaldamagepool.get_constraints(m))\n    else:\n        raise NotImplementedError(\n            f\"Financial transfer module `{financialtransfer_module}` not implemented\"\n        )\n\n    # Burden sharing regime\n    constraints.extend(burdensharing.get_constraints(m))\n\n    # Cobb-Douglas and economics\n    constraints.extend(cobbdouglas.get_constraints(m))\n\n    # Utility and welfare\n    if welfare_module == \"welfare_loss_minimising\":\n        constraints.extend(welfare.welfare_loss_minimising.get_constraints(m))\n    elif welfare_module == \"cost_minimising\":\n        constraints.extend(welfare.cost_minimising.get_constraints(m))\n    elif welfare_module == \"inequal_aversion_general\":\n        constraints.extend(welfare.inequal_aversion_general.get_constraints(m))\n    else:\n        raise NotImplementedError(f\"Welfare module `{welfare_module}` not implemented\")\n\n    # Objective of optimisation\n    if objective_module == \"utility\":\n        objective_rule, objective_constraints = objective.utility.get_constraints(m)\n    elif objective_module == \"globalcosts\":\n        objective_rule, objective_constraints = objective.globalcosts.get_constraints(m)\n    else:\n        raise NotImplementedError\n\n    constraints.extend(objective_constraints)\n\n    ######################\n    # Add constraints to abstract model\n    ######################\n\n    for constraint in constraints:\n        add_constraint(m, constraint.to_pyomo_constraint(m), constraint.name)\n\n    m.obj = objective_rule\n\n    return m\n
      "},{"location":"components/regions/","title":"Region definitions","text":"

      MIMOSA uses 26 regions, equal to the IMAGE regions. More info on the IMAGE website.

      Hover the map to see the region name:

      "},{"location":"components/welfare/","title":"Welfare","text":"

      Back to general structure

      "},{"location":"components/welfare/#welfare-and-utility","title":"Welfare and utility","text":"

      The optimisation goal of MIMOSA is to maximise discounted welfare or utility1. There are three ways to calculate welfare in MIMOSA: welfare-loss-minimising, cost-minimising, and a general inequality aversion setting which is the generalised version of the first two methods.

      The welfare module can be chosen using the parameter params[\"model\"][\"welfare module\"].

      Welfare-loss-minimising defaultCost-minimisingGeneral inequality aversion

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"welfare_loss_minimising\"\nmodel = MIMOSA(params)\n

      Welfare-loss-minimising setting

      In welfare-loss-minimising setting, the utility is first calculated regionally from the per capita consumption. These regional utilities are then summed up to get the global welfare. This means that costs are weighted differently in different regions, depending on the regional per capita consumption. As a consequence, this setting leads to differentiated carbon prices across regions: poorer regions typically will have lower carbon prices than richer regions.

      Difference with cost-minimising setting

      In the cost-minimising setting, the regional per capita consumption values are first added up to a global per capita consumption. The utility function is only then applied to this global per capita consumption to obtain global welfare.

      Equations

      First, calculate the regional utility using the regional consumption \\(C_{t,r}\\) and population \\(L_{t,r}\\): $$ U_{t,r} = \\text{utility}(C_{t,r}, L_{t,r}) $$

      Second, the global welfare is calculated as the sum of the regional utility values weighted by population: $$ W_t = \\sum_r L_{t,r} \\cdot U_{t,r} $$

      Utility function

      The utility function is a concave function of per-capita consumption, given by:

      \\[ \\text{utility}(C, L) = \\left( \\left(\\frac{C}{L}\\right)^{1 - \\text{elasmu}} - 1 \\right) \\cdot \\frac{1}{1 - \\text{elasmu}}\\]

      where \\(C\\) is the consumption and \\(L\\) the population of a region. \\(\\text{elasmu}\\) is the elasticity of marginal utility. A value of \\(\\text{elasmu}\\) close to 1 approaches a logarithmic utility function:

      Source code in mimosa/components/welfare/utility_fct.py
      def calc_utility(consumption, population, elasmu):\n    \"\"\"\n    The utility function is a concave function of per-capita consumption, given by:\n\n    $$ \\\\text{utility}(C, L) = \\\\left( \\\\left(\\\\frac{C}{L}\\\\right)^{1 - \\\\text{elasmu}} - 1 \\\\right) \\\\cdot \\\\frac{1}{1 - \\\\text{elasmu}}$$\n\n    where $C$ is the consumption and $L$ the population of a region. $\\\\text{elasmu}$ is the elasticity of marginal utility. A value of $\\\\text{elasmu}$ close to 1 approaches a logarithmic utility function:\n    ``` plotly\n    {\"file_path\": \"./assets/plots/utility_fct.json\"}\n    ```\n\n    \"\"\"\n\n    # Note that the `soft_min` function is used to avoid division by zero\n    return (soft_min(consumption / population) ** (1 - elasmu) - 1) / (1 - elasmu)\n
      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      Source code in mimosa/components/welfare/welfare_loss_minimising.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    <h3>Welfare-loss-minimising setting</h3>\n\n    In welfare-loss-minimising setting, the utility is first calculated regionally\n    from the per capita consumption. These regional utilities are then summed up to\n    get the global welfare. This means that costs are weighted differently in different\n    regions, depending on the regional per capita consumption. As a consequence, this\n    setting leads to differentiated carbon prices across regions: poorer regions typically\n    will have lower carbon prices than richer regions.\n\n    ???+ info \"Difference with cost-minimising setting\"\n        In the cost-minimising setting, the regional per capita consumption values\n        are first added up to a global per capita consumption. The utility function\n        is only then applied to this global per capita consumption to obtain global welfare.\n\n    <h3>Equations</h3>\n\n    First, calculate the regional utility using the regional consumption $C_{t,r}$ and population $L_{t,r}$:\n    $$ U_{t,r} = \\\\text{utility}(C_{t,r}, L_{t,r}) $$\n\n    Second, the global welfare is calculated as the sum of the regional utility values weighted by population:\n    $$ W_t = \\\\sum_r L_{t,r} \\\\cdot U_{t,r} $$\n\n    <h3>Utility function</h3>\n    :::mimosa.components.welfare.utility_fct.calc_utility\n\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n\n    m.utility = Var(m.t, m.regions, initialize=0.1)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == calc_utility(m.consumption[t, r], m.L(m.year(t), r), m.elasmu),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) * m.utility[t, r] for r in m.regions),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"cost_minimising\"\nmodel = MIMOSA(params)\n

      Cost-minimising setting

      In cost-minimising setting, the global per-capita consumption is first calculated before applying the utility function. This means that costs are weighted equally across regions, regardless of the regional per capita consumption. As a consequence, this setting leads to uniform carbon prices across regions. This is quantitatively similar to using Negishi weights.

      Difference with welfare-loss-minimising setting

      In the welfare-loss-minimising setting, the utility function is applied to the regional per capita consumption values, and the regional utilities are then summed up to get the global welfare. This means that costs (from mitigation or damages) have a larger weight in the final welfare in poorer regions than in richer regions.

      Equations

      First, calculate the global consumption \\(C_{t,r}\\) and population \\(L_{t,r}\\):

      \\[ \\widehat{C}_{t} = \\sum_r C_{t,r}, \\] \\[ \\widehat{L}_{t} = \\sum_r L_{t,r}. \\]

      These are used to calculate the global utility:

      \\[ W_t = \\widehat{L}_t \\cdot \\text{utility}\\left( \\widehat{C}_{t}, \\widehat{L}_{t} \\right) \\] Utility function

      The utility function is a concave function of per-capita consumption, given by:

      \\[ \\text{utility}(C, L) = \\left( \\left(\\frac{C}{L}\\right)^{1 - \\text{elasmu}} - 1 \\right) \\cdot \\frac{1}{1 - \\text{elasmu}}\\]

      where \\(C\\) is the consumption and \\(L\\) the population of a region. \\(\\text{elasmu}\\) is the elasticity of marginal utility. A value of \\(\\text{elasmu}\\) close to 1 approaches a logarithmic utility function:

      Source code in mimosa/components/welfare/utility_fct.py
      def calc_utility(consumption, population, elasmu):\n    \"\"\"\n    The utility function is a concave function of per-capita consumption, given by:\n\n    $$ \\\\text{utility}(C, L) = \\\\left( \\\\left(\\\\frac{C}{L}\\\\right)^{1 - \\\\text{elasmu}} - 1 \\\\right) \\\\cdot \\\\frac{1}{1 - \\\\text{elasmu}}$$\n\n    where $C$ is the consumption and $L$ the population of a region. $\\\\text{elasmu}$ is the elasticity of marginal utility. A value of $\\\\text{elasmu}$ close to 1 approaches a logarithmic utility function:\n    ``` plotly\n    {\"file_path\": \"./assets/plots/utility_fct.json\"}\n    ```\n\n    \"\"\"\n\n    # Note that the `soft_min` function is used to avoid division by zero\n    return (soft_min(consumption / population) ** (1 - elasmu) - 1) / (1 - elasmu)\n
      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      Source code in mimosa/components/welfare/cost_minimising.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n\n    <h3>Cost-minimising setting</h3>\n\n    In cost-minimising setting, the global per-capita consumption is first calculated before\n    applying the utility function. This means that costs are weighted equally across regions,\n    regardless of the regional per capita consumption. As a consequence, this setting leads to\n    uniform carbon prices across regions. This is quantitatively similar to using Negishi weights.\n\n    ???+ info \"Difference with welfare-loss-minimising setting\"\n        In the welfare-loss-minimising setting, the utility function is applied to the regional\n        per capita consumption values, and the regional utilities are then summed up to get the\n        global welfare. This means that costs (from mitigation or damages) have a larger weight in\n        the final welfare in poorer regions than in richer regions.\n\n\n    <h3>Equations</h3>\n\n    First, calculate the global consumption $C_{t,r}$ and population $L_{t,r}$:\n\n    $$ \\\\widehat{C}_{t} = \\\\sum_r C_{t,r}, $$\n\n    $$ \\\\widehat{L}_{t} = \\\\sum_r L_{t,r}. $$\n\n    These are used to calculate the global utility:\n\n    $$ W_t = \\\\widehat{L}_t \\\\cdot \\\\text{utility}\\\\left( \\\\widehat{C}_{t}, \\\\widehat{L}_{t} \\\\right) $$\n\n    <h3>Utility function</h3>\n    :::mimosa.components.welfare.utility_fct.calc_utility\n\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n\n    m.utility = Var(m.t, m.regions, initialize=10)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == m.consumption[t, r] / m.L(m.year(t), r),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) for r in m.regions)\n                * calc_utility(\n                    sum(m.consumption[t, r] for r in m.regions),\n                    sum(m.L(m.year(t), r) for r in m.regions),\n                    m.elasmu,\n                ),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n

      Usage:

      params = load_params()\nparams[\"model\"][\"welfare module\"] = \"inequal_aversion_general\"\nmodel = MIMOSA(params)\n

      General inequality aversion

      TODO

      Parameters defined in this module
      • elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.
      • param::inequal_aversion
      Source code in mimosa/components/welfare/inequal_aversion_general.py
      def get_constraints(m: AbstractModel) -> Sequence[GeneralConstraint]:\n    \"\"\"\n    <h3>General inequality aversion</h3>\n\n    TODO\n\n    <h3>Parameters defined in this module</h3>\n    - elasmu: Elasticity of marginal utility. Type: float. Default: 1.001. Min: 0.1. Max: 10.\n    - param::inequal_aversion\n\n    \"\"\"\n    constraints = []\n\n    # Parameters\n    m.elasmu = Param(doc=\"::economics.elasmu\")\n    m.inequal_aversion = Param(doc=\"::economics.inequal_aversion\")\n\n    m.utility = Var(m.t, m.regions, initialize=10)\n    m.yearly_welfare = Var(m.t)\n\n    constraints.extend(\n        [\n            RegionalConstraint(\n                lambda m, t, r: m.utility[t, r]\n                == calc_regional_utility(\n                    m.consumption[t, r], m.L(m.year(t), r), m.inequal_aversion\n                ),\n                \"utility\",\n            ),\n            GlobalConstraint(\n                lambda m, t: m.yearly_welfare[t]\n                == sum(m.L(m.year(t), r) for r in m.regions)\n                * calc_global_utility(\n                    sum(m.utility[t, r] for r in m.regions),\n                    sum(m.L(m.year(t), r) for r in m.regions),\n                    m.elasmu,\n                    m.inequal_aversion,\n                ),\n                \"yearly_welfare\",\n            ),\n        ]\n    )\n\n    return constraints\n
      "},{"location":"components/welfare/#optimisation-goal-and-discounting","title":"Optimisation goal and discounting","text":"

      TODO

      1. While the terms welfare and utility can be used interchangeably, we typically refer to utility as the regional utility, and welfare as the global population-weighted utility.\u00a0\u21a9

      "}]} \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index 5f8ba85..639f091 100644 Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ