{ "cells": [ { "metadata": {}, "cell_type": "markdown", "source": "# Run EnergyScope with LCA impact scores" }, { "metadata": {}, "cell_type": "markdown", "source": [ "In this notebook, we show how to use LCA data in EnergyScope. We use the core model of EnergyScope as an illustrative example.\n", "Before following this tutorial, make sure you have followed the \"Generation of LCA impact scores\" tutorial to generate the .dat and .mod files of LCA parameters and constraints to be used in EnergyScope.\n", "\n", "We show how to:\n", "- easily add the LCA .mod and .dat files to the core version\n", "- run the model\n", "- format the results\n", "- visualise the results using [_mescal_'s](https://mescal.readthedocs.io/en/latest/) visualisation features" ] }, { "metadata": {}, "cell_type": "code", "source": [ "%pip install mescal==1.2.3\n", "%pip install energyscope==2.1.2" ], "outputs": [], "execution_count": null }, { "metadata": {}, "cell_type": "markdown", "source": "Once you have generated your set of LCA metrics, you are ready to run EnergyScope with LCA variables as objective function or constraints." }, { "metadata": {}, "cell_type": "markdown", "source": "## Import packages" }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:00.651643Z", "start_time": "2026-02-20T15:11:42.216022Z" } }, "cell_type": "code", "source": [ "from energyscope.models import core, Model\n", "from energyscope.energyscope import Energyscope\n", "from mescal import Plot\n", "import pandas as pd" ], "outputs": [], "execution_count": 1 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:00.678770Z", "start_time": "2026-02-20T15:12:00.670799Z" } }, "cell_type": "code", "source": [ "INPUT_DATA_FOLDER = 'path/to/your/input/files/' # put the path of your data folder here\n", "LCA_RESULTS_FOLDER = 'path/to/your/lca/results/files/' # put the path of your LCA results folder here\n", "license_uuid = 'xxx' # put your AMPL licence UUID here" ], "outputs": [], "execution_count": 2 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:01.490182Z", "start_time": "2026-02-20T15:12:01.388010Z" } }, "cell_type": "code", "source": [ "lifetime = pd.read_csv(INPUT_DATA_FOLDER+'lifetime.csv')\n", "impact_scores_lca = pd.read_csv(LCA_RESULTS_FOLDER+'impact_scores.csv') # LCA impact scores\n", "impact_scores_direct = pd.read_csv(LCA_RESULTS_FOLDER+'impact_scores_direct_emissions.csv') # Impact scores for direct emissions" ], "outputs": [], "execution_count": 3 }, { "metadata": {}, "cell_type": "markdown", "source": "## Run EnergyScope" }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:01.591070Z", "start_time": "2026-02-20T15:12:01.583369Z" } }, "cell_type": "code", "source": [ "LCA_model = Model([\n", " ('mod', LCA_RESULTS_FOLDER+'objectives_lca.mod'),\n", " # ('mod', LCA_RESULTS_FOLDER+'objectives_lca_direct.mod'),\n", " ('dat', LCA_RESULTS_FOLDER+'techs_lca.dat'),\n", " # ('dat', LCA_RESULTS_FOLDER+'techs_lca_direct.dat'),\n", "])" ], "outputs": [], "execution_count": 5 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:01.628294Z", "start_time": "2026-02-20T15:12:01.618387Z" } }, "cell_type": "code", "source": "core = core.__add__(LCA_model) # add the LCA model to the core model", "outputs": [], "execution_count": 6 }, { "metadata": {}, "cell_type": "markdown", "source": "Make sure to replace the license UUID with your own, you can access it directly from the [AMPL portal](https://portal.ampl.com/user/ampl/license/list). If you don't have an account please create one, and favor your academic address to get access to the free academic license." }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:12:01.670934Z", "start_time": "2026-02-20T15:12:01.661769Z" } }, "cell_type": "code", "source": [ "energyscope_lca = Energyscope(\n", " model=core,\n", " solver_options={'solver': 'gurobi','gurobi_options':'outlev=1 NumericFocus=2 method=2'},\n", " notebook=True,\n", " modules=['gurobi'],\n", " license_uuid=license_uuid,\n", ")" ], "outputs": [], "execution_count": 7 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:14:55.875561Z", "start_time": "2026-02-20T15:12:01.729642Z" } }, "cell_type": "code", "source": "results_tc = energyscope_lca.calc()", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gurobi 13.0.0: Set parameter LogToConsole to value 1\r\n", " tech:outlev = 1\r\n", "Set parameter NumericFocus to value 2\r\n", " alg:numericfocus = 2\r\n", "Set parameter Method to value 2\r\n", " alg:method = 2\r\n", "Set parameter InfUnbdInfo to value 1\r\n", "Gurobi Optimizer version 13.0.0 build v13.0.0rc1 (win64 - Windows 11+.0 (26200.2))\r\n", "\r\n", "CPU model: 12th Gen Intel(R) Core(TM) i7-1255U, instruction set [SSE2|AVX|AVX2]\r\n", "Thread count: 10 physical cores, 12 logical processors, using up to 12 threads\r\n", "\r\n", "Non-default parameters:\r\n", "Method 2\r\n", "InfUnbdInfo 1\r\n", "NumericFocus 2\r\n", "\r\n", "Optimize a model with 491079 rows, 268733 columns and 1576042 nonzeros (Min)\r\n", "Model fingerprint: 0xd356ac1f\r\n", "Model has 1 linear objective coefficients\r\n", "Coefficient statistics:\r\n", " Matrix range [1e-06, 7e+04]\r\n", " Objective range [1e+00, 1e+00]\r\n", " Bounds range [2e-02, 6e+01]\r\n", " RHS range [1e+00, 4e+04]\r\n", "Presolve removed 244066 rows and 129177 columns\r\n", "Presolve time: 2.06s\r\n", "Presolved: 247013 rows, 139556 columns, 796682 nonzeros\r\n", "\r\n", "Elapsed ordering time = 5s\r\n", "Ordering time: 6.22s\r\n", "\r\n", "Barrier statistics:\r\n", " Dense cols : 98\r\n", " AA' NZ : 3.799e+06\r\n", " Factor NZ : 1.783e+07 (roughly 300 MB of memory)\r\n", " Factor Ops : 5.419e+09 (less than 1 second per iteration)\r\n", " Threads : 10\r\n", "\r\n", " Objective Residual\r\n", "Iter Primal Dual Primal Dual Compl Time\r\n", " 0 1.16221582e+07 -1.07972572e+06 4.56e+05 1.98e+00 1.00e+06 10s\r\n", " 1 1.25699879e+07 -2.23258072e+06 3.39e+05 8.36e+02 9.02e+05 11s\r\n", " 2 1.28525617e+07 -4.29550079e+06 3.27e+05 8.19e+02 8.30e+05 12s\r\n", " 3 1.45819284e+07 -5.45424209e+07 2.15e+05 6.27e+02 6.54e+05 14s\r\n", " 4 1.57985628e+07 -8.06542194e+07 1.47e+05 2.94e+02 3.34e+05 15s\r\n", " 5 1.58143484e+07 -9.28941450e+07 1.01e+05 1.07e+02 1.43e+05 16s\r\n", " 6 1.37132584e+07 -9.54890885e+07 5.11e+04 3.77e+01 5.86e+04 17s\r\n", " 7 1.21412725e+07 -9.33472784e+07 3.35e+04 2.17e+01 3.57e+04 17s\r\n", " 8 1.02479985e+07 -8.87644492e+07 1.65e+04 1.35e+01 2.09e+04 18s\r\n", " 9 8.81154076e+06 -7.87875007e+07 7.25e+03 5.73e+00 9.06e+03 19s\r\n", " 10 7.41870842e+06 -6.61055957e+07 1.66e+03 1.95e+00 2.90e+03 19s\r\n", " 11 6.33868760e+06 -4.49264671e+07 4.91e+02 5.32e-01 8.72e+02 20s\r\n", " 12 5.09632545e+06 -2.98611201e+07 1.89e+02 2.72e-01 4.45e+02 21s\r\n", " 13 3.61146627e+06 -8.63298365e+06 8.14e+01 6.63e-02 1.18e+02 22s\r\n", " 14 2.21995915e+06 -5.21091545e+06 4.02e+01 3.74e-02 6.61e+01 23s\r\n", " 15 1.65819263e+06 -2.73769548e+06 2.60e+01 1.91e-02 3.55e+01 24s\r\n", " 16 1.16413210e+06 -1.34312887e+06 1.69e+01 9.06e-03 1.82e+01 25s\r\n", " 17 5.50330444e+05 -9.12655663e+05 5.97e+00 6.30e-03 1.13e+01 26s\r\n", " 18 4.12065297e+05 -4.76476645e+05 4.11e+00 3.35e-03 6.35e+00 26s\r\n", " 19 3.51659255e+05 -3.94296399e+05 3.35e+00 2.80e-03 5.30e+00 27s\r\n", " 20 2.64045270e+05 -2.43919304e+05 2.30e+00 1.81e-03 3.51e+00 28s\r\n", " 21 1.61786892e+05 -9.42045456e+04 1.13e+00 8.03e-04 1.66e+00 29s\r\n", " 22 1.12369936e+05 -3.84244935e+04 6.24e-01 4.45e-04 9.53e-01 30s\r\n", " 23 1.03996174e+05 -1.75539668e+03 5.50e-01 2.34e-04 6.03e-01 32s\r\n", " 24 9.13755464e+04 2.91937287e+03 4.54e-01 2.00e-04 5.08e-01 33s\r\n", " 25 8.73187535e+04 1.26145454e+04 4.16e-01 1.42e-04 4.06e-01 34s\r\n", " 26 7.71796901e+04 2.05984982e+04 3.08e-01 1.03e-04 3.04e-01 34s\r\n", " 27 6.34278768e+04 2.79827910e+04 1.77e-01 6.68e-05 1.93e-01 36s\r\n", " 28 5.66737788e+04 3.38869069e+04 1.14e-01 3.72e-05 1.21e-01 37s\r\n", " 29 5.32144210e+04 3.83798497e+04 8.40e-02 1.47e-05 7.23e-02 38s\r\n", " 30 5.01388129e+04 4.05325357e+04 5.78e-02 1.01e-05 4.46e-02 39s\r\n", " 31 4.92983443e+04 4.10253007e+04 5.08e-02 8.37e-06 3.78e-02 39s\r\n", " 32 4.92060856e+04 4.12656878e+04 4.98e-02 7.40e-06 3.56e-02 40s\r\n", " 33 4.84848815e+04 4.14784610e+04 4.38e-02 6.49e-06 3.13e-02 41s\r\n", " 34 4.66655203e+04 4.18354447e+04 2.95e-02 4.88e-06 2.19e-02 42s\r\n", " 35 4.59158134e+04 4.22228092e+04 2.37e-02 3.10e-06 1.62e-02 43s\r\n", " 36 4.53685484e+04 4.23797586e+04 1.96e-02 2.42e-06 1.31e-02 44s\r\n", " 37 4.50601261e+04 4.24216492e+04 1.73e-02 2.21e-06 1.16e-02 46s\r\n", " 38 4.44990860e+04 4.25543765e+04 1.34e-02 1.57e-06 8.53e-03 47s\r\n", " 39 4.40060849e+04 4.26904328e+04 9.25e-03 9.40e-07 5.67e-03 48s\r\n", " 40 4.35846484e+04 4.27413718e+04 5.76e-03 6.72e-07 3.69e-03 49s\r\n", " 41 4.34374269e+04 4.27894049e+04 4.61e-03 4.35e-07 2.76e-03 51s\r\n", " 42 4.32781731e+04 4.28230999e+04 3.28e-03 2.66e-07 1.90e-03 52s\r\n", " 43 4.32062320e+04 4.28423280e+04 2.66e-03 1.73e-07 1.49e-03 52s\r\n", " 44 4.31751965e+04 4.28481539e+04 2.39e-03 1.48e-07 1.33e-03 53s\r\n", " 45 4.31023011e+04 4.28523670e+04 1.77e-03 1.28e-07 1.02e-03 54s\r\n", " 46 4.30142357e+04 4.28624214e+04 1.02e-03 8.28e-08 6.22e-04 54s\r\n", " 47 4.29896240e+04 4.28722208e+04 8.36e-04 3.97e-08 4.62e-04 56s\r\n", " 48 4.29437318e+04 4.28741728e+04 4.59e-04 3.22e-08 2.77e-04 57s\r\n", " 49 4.29351813e+04 4.28769598e+04 3.94e-04 2.25e-08 2.29e-04 58s\r\n", " 50 4.29330983e+04 4.28772479e+04 3.78e-04 2.15e-08 2.19e-04 59s\r\n", " 51 4.29312516e+04 4.28777019e+04 3.64e-04 2.01e-08 2.10e-04 60s\r\n", " 52 4.29174894e+04 4.28788118e+04 2.54e-04 1.62e-08 1.52e-04 61s\r\n", " 53 4.29116030e+04 4.28800171e+04 2.11e-04 1.19e-08 1.23e-04 63s\r\n", " 54 4.29086736e+04 4.28804657e+04 1.88e-04 1.04e-08 1.09e-04 64s\r\n", " 55 4.29058082e+04 4.28807984e+04 1.66e-04 9.32e-09 9.68e-05 66s\r\n", " 56 4.29038163e+04 4.28811254e+04 1.52e-04 8.27e-09 8.76e-05 67s\r\n", " 57 4.29008870e+04 4.28816871e+04 1.30e-04 5.85e-09 7.35e-05 69s\r\n", " 58 4.28992344e+04 4.28824342e+04 1.17e-04 3.49e-09 6.35e-05 70s\r\n", " 59 4.28954488e+04 4.28826129e+04 8.71e-05 3.03e-09 4.86e-05 71s\r\n", " 60 4.28921329e+04 4.28828962e+04 6.30e-05 2.01e-09 3.48e-05 73s\r\n", " 61 4.28912646e+04 4.28830338e+04 5.63e-05 1.71e-09 3.10e-05 76s\r\n", " 62 4.28905126e+04 4.28831294e+04 5.14e-05 1.50e-09 2.78e-05 78s\r\n", " 63 4.28888688e+04 4.28832359e+04 3.87e-05 1.20e-09 2.12e-05 81s\r\n", " 64 4.28874818e+04 4.28833201e+04 2.85e-05 9.81e-10 1.57e-05 83s\r\n", " 65 4.28870771e+04 4.28833635e+04 2.54e-05 8.87e-10 1.40e-05 85s\r\n", " 66 4.28864400e+04 4.28834973e+04 2.03e-05 6.29e-10 1.11e-05 88s\r\n", " 67 4.28860879e+04 4.28836333e+04 1.74e-05 3.63e-10 9.17e-06 90s\r\n", " 68 4.28852039e+04 4.28836858e+04 1.03e-05 2.58e-10 5.68e-06 92s\r\n", " 69 4.28849379e+04 4.28837337e+04 8.34e-06 1.50e-10 4.49e-06 95s\r\n", " 70 4.28844716e+04 4.28837400e+04 4.60e-06 1.39e-10 2.74e-06 97s\r\n", " 71 4.28843262e+04 4.28837646e+04 3.52e-06 8.73e-11 2.10e-06 99s\r\n", " 72 4.28840292e+04 4.28837858e+04 1.40e-06 4.50e-11 9.14e-07 100s\r\n", " 73 4.28838815e+04 4.28838115e+04 4.02e-07 5.06e-12 2.60e-07 102s\r\n", " 74 4.28838282e+04 4.28838150e+04 6.23e-08 2.20e-12 4.97e-08 103s\r\n", " 75 4.28838191e+04 4.28838175e+04 7.71e-09 3.64e-12 6.01e-09 104s\r\n", " 76 4.28838179e+04 4.28838177e+04 1.17e-09 2.73e-12 6.08e-10 105s\r\n", "\r\n", "Barrier solved model in 76 iterations and 105.20 seconds (60.13 work units)\r\n", "Optimal objective 4.28838179e+04\r\n", "\r\n", "Crossover log...\r\n", "\r\n", " 53590 DPushes remaining with DInf 0.0000000e+00 106s\r\n", " 13503 DPushes remaining with DInf 0.0000000e+00 111s\r\n", " 8328 DPushes remaining with DInf 0.0000000e+00 115s\r\n", " 3315 DPushes remaining with DInf 0.0000000e+00 120s\r\n", " 1563 DPushes remaining with DInf 0.0000000e+00 125s\r\n", " 553 DPushes remaining with DInf 0.0000000e+00 130s\r\n", " 0 DPushes remaining with DInf 0.0000000e+00 134s\r\n", "\r\n", " 3817 PPushes remaining with PInf 1.0675306e-04 134s\r\n", " 3059 PPushes remaining with PInf 7.3430441e-02 135s\r\n", " 0 PPushes remaining with PInf 0.0000000e+00 139s\r\n", "\r\n", " Push phase complete: Pinf 0.0000000e+00, Dinf 1.2346462e+02 139s\r\n", "\r\n", "Iteration Objective Primal Inf. Dual Inf. Time\r\n", " 40664 4.2883818e+04 0.000000e+00 1.234646e+02 139s\r\n", " 40765 4.2883818e+04 0.000000e+00 2.660964e-02 140s\r\n", " 41270 4.2883818e+04 0.000000e+00 3.090717e+01 146s\r\n", " 41674 4.2883818e+04 0.000000e+00 4.082870e-03 150s\r\n", "Crossover time: 45.17 seconds (16.75 work units)\r\n", " 41697 4.2883818e+04 0.000000e+00 0.000000e+00 151s\r\n", "\r\n", "Solved in 41697 iterations and 151.16 seconds (77.11 work units)\r\n", "Optimal objective 4.288381774e+04\r\n", "\r\n", "AMPL MP initial flat model has 268733 variables (0 integer, 0 binary);\r\n", "Objectives: 1 linear; \r\n", "Constraints: 491079 linear;\r\n", "\r\n", "AMPL MP final model has 268733 variables (0 integer, 0 binary);\r\n", "Objectives: 1 linear; \r\n", "Constraints: 491079 linear;\r\n", "\r\n", "\r\n", "Gurobi 13.0.0: optimal solution; objective 42883.81774\n", "41697 simplex iterations\n", "76 barrier iterations\n" ] } ], "execution_count": 8 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:18:05.809261Z", "start_time": "2026-02-20T15:18:05.789832Z" } }, "cell_type": "code", "source": "results_tc.variables['TotalLCIA']", "outputs": [ { "data": { "text/plain": [ " TotalLCIA Run\n", "TTEQ 1682.413198 0\n", "TTHH 1200.001631 0" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TotalLCIARun
TTEQ1682.4131980
TTHH1200.0016310
\n", "
" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 11 }, { "metadata": {}, "cell_type": "markdown", "source": "You might want to change the objective function with an environmental objective, such as the life-cycle greenhouse gas emissions, or the total damage on human health/ecosystem quality. Alternatively, you can also add a constraint on the total life-cycle impact, to be lower than a certain threshold." }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:19:22.795844Z", "start_time": "2026-02-20T15:19:22.788504Z" } }, "cell_type": "code", "source": [ "# To change the objective function\n", "# energyscope_lca.es_model.eval(\"\"\"\n", "# drop obj;\n", "# minimize new_obj: TotalLCIA_TTHH;\n", "# \"\"\")" ], "outputs": [], "execution_count": 12 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:20:01.704945Z", "start_time": "2026-02-20T15:20:01.694141Z" } }, "cell_type": "code", "source": [ "# To add upper limits on environmental impacts\n", "reduction_target = 0.5 # for instance, 50% reduction target of damages\n", "scenario_file_path = LCA_RESULTS_FOLDER + 'scenario.dat'\n", "with open(scenario_file_path, 'w', encoding='utf-8', newline='\\n') as f:\n", " f.write(f\"let limit_lcia['TTHH'] := {reduction_target} * {results_tc.variables['TotalLCIA'].loc['TTHH'].iloc[0]};\\n\")\n", " f.write(f\"let limit_lcia['TTEQ'] := {reduction_target} * {results_tc.variables['TotalLCIA'].loc['TTEQ'].iloc[0]};\\n\")" ], "outputs": [], "execution_count": 14 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:21:36.040537Z", "start_time": "2026-02-20T15:21:36.032563Z" } }, "cell_type": "code", "source": "core = core.__add__(Model([('dat', scenario_file_path)])) # add the scenario file to the core model", "outputs": [], "execution_count": 15 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:25:26.999072Z", "start_time": "2026-02-20T15:25:26.925190Z" } }, "cell_type": "code", "source": [ "energyscope_lca = Energyscope(\n", " model=core,\n", " solver_options={'solver': 'gurobi', 'gurobi_options':'outlev=1 NumericFocus=2 method=2'},\n", " notebook=True,\n", " modules=['gurobi'],\n", " license_uuid=license_uuid,\n", ")" ], "outputs": [], "execution_count": 19 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:28:36.227754Z", "start_time": "2026-02-20T15:25:28.108283Z" } }, "cell_type": "code", "source": "results_lca = energyscope_lca.calc()", "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Gurobi 13.0.0: Set parameter LogToConsole to value 1\r\n", " tech:outlev = 1\r\n", "Set parameter NumericFocus to value 2\r\n", " alg:numericfocus = 2\r\n", "Set parameter Method to value 2\r\n", " alg:method = 2\r\n", "Set parameter InfUnbdInfo to value 1\r\n", "Gurobi Optimizer version 13.0.0 build v13.0.0rc1 (win64 - Windows 11+.0 (26200.2))\r\n", "\r\n", "CPU model: 12th Gen Intel(R) Core(TM) i7-1255U, instruction set [SSE2|AVX|AVX2]\r\n", "Thread count: 10 physical cores, 12 logical processors, using up to 12 threads\r\n", "\r\n", "Non-default parameters:\r\n", "Method 2\r\n", "InfUnbdInfo 1\r\n", "NumericFocus 2\r\n", "\r\n", "Optimize a model with 491079 rows, 268733 columns and 1576042 nonzeros (Min)\r\n", "Model fingerprint: 0x4c617831\r\n", "Model has 1 linear objective coefficients\r\n", "Coefficient statistics:\r\n", " Matrix range [1e-06, 7e+04]\r\n", " Objective range [1e+00, 1e+00]\r\n", " Bounds range [2e-02, 8e+02]\r\n", " RHS range [1e+00, 4e+04]\r\n", "Presolve removed 243488 rows and 128315 columns\r\n", "Presolve time: 1.36s\r\n", "Presolved: 247591 rows, 140418 columns, 824522 nonzeros\r\n", "\r\n", "Elapsed ordering time = 5s\r\n", "Ordering time: 6.15s\r\n", "\r\n", "Barrier statistics:\r\n", " Dense cols : 98\r\n", " AA' NZ : 3.840e+06\r\n", " Factor NZ : 1.875e+07 (roughly 300 MB of memory)\r\n", " Factor Ops : 7.249e+09 (less than 1 second per iteration)\r\n", " Threads : 10\r\n", "\r\n", " Objective Residual\r\n", "Iter Primal Dual Primal Dual Compl Time\r\n", " 0 2.01588285e+06 -3.78949316e+05 3.23e+06 1.44e+00 1.00e+06 9s\r\n", " 1 2.02961667e+06 -1.05983728e+06 2.98e+06 8.46e+02 9.54e+05 10s\r\n", " 2 2.23051767e+06 -3.13164283e+06 2.56e+06 7.72e+02 8.64e+05 11s\r\n", " 3 2.43833112e+06 -8.41836569e+06 2.31e+06 5.48e+02 6.50e+05 12s\r\n", " 4 3.49303007e+06 -3.83871563e+07 1.74e+06 3.10e+02 4.27e+05 13s\r\n", " 5 4.01758930e+06 -4.57182269e+07 7.44e+05 1.78e+02 2.18e+05 14s\r\n", " 6 3.57671925e+06 -5.06294971e+07 4.04e+05 8.48e+01 1.03e+05 15s\r\n", " 7 2.84239390e+06 -5.64359613e+07 2.24e+05 4.62e+01 5.76e+04 16s\r\n", " 8 1.94953735e+06 -5.92023907e+07 1.24e+05 3.65e+01 4.14e+04 17s\r\n", " 9 1.43348058e+06 -6.93652223e+07 7.97e+04 1.80e+01 2.24e+04 18s\r\n", " 10 1.26019437e+06 -7.33994190e+07 6.73e+04 1.00e+01 1.48e+04 19s\r\n", " 11 1.11193558e+06 -7.29707611e+07 5.64e+04 8.98e+00 1.30e+04 19s\r\n", " 12 9.63042807e+05 -7.36628269e+07 4.56e+04 5.15e+00 8.81e+03 20s\r\n", " 13 8.86370732e+05 -7.24436364e+07 4.01e+04 3.71e+00 7.07e+03 21s\r\n", " 14 8.51428345e+05 -6.84825339e+07 3.76e+04 3.00e+00 6.19e+03 22s\r\n", " 15 7.84686759e+05 -6.46982236e+07 3.31e+04 2.47e+00 5.29e+03 24s\r\n", " 16 6.91361134e+05 -6.28136961e+07 2.69e+04 1.35e+00 3.70e+03 25s\r\n", " 17 4.49366280e+05 -6.02187500e+07 1.23e+04 9.06e-01 2.02e+03 26s\r\n", " 18 3.81110012e+05 -4.88322998e+07 8.59e+03 5.40e-01 1.32e+03 28s\r\n", " 19 3.40650916e+05 -4.18598616e+07 6.61e+03 3.19e-01 9.31e+02 29s\r\n", " 20 3.00223030e+05 -3.20743234e+07 4.58e+03 1.81e-01 5.91e+02 30s\r\n", " 21 2.82822856e+05 -3.31500836e+07 3.77e+03 1.74e-01 5.26e+02 30s\r\n", " 22 2.78521091e+05 -2.86597124e+07 3.58e+03 1.38e-01 4.56e+02 31s\r\n", " 23 2.76667981e+05 -2.65037933e+07 3.51e+03 1.19e-01 4.22e+02 32s\r\n", " 24 2.58638053e+05 -2.23392473e+07 2.84e+03 8.95e-02 3.32e+02 33s\r\n", " 25 2.25562724e+05 -1.52150571e+07 1.51e+03 4.73e-02 1.83e+02 35s\r\n", " 26 1.99570407e+05 -9.58948378e+06 7.44e+02 2.56e-02 9.42e+01 36s\r\n", " 27 1.86018668e+05 -5.70309392e+06 4.41e+02 1.31e-02 5.09e+01 37s\r\n", " 28 1.75733403e+05 -4.07464749e+06 2.49e+02 8.51e-03 3.31e+01 38s\r\n", " 29 1.71191179e+05 -2.60940412e+06 1.67e+02 5.26e-03 2.08e+01 39s\r\n", " 30 1.66183298e+05 -2.24691648e+06 7.85e+01 4.50e-03 1.74e+01 40s\r\n", " 31 1.62339436e+05 -1.84721924e+06 3.66e+01 3.70e-03 1.44e+01 41s\r\n", " 32 1.54651690e+05 -7.21601541e+05 1.51e+01 1.51e-03 6.04e+00 42s\r\n", " 33 1.45908550e+05 -3.98730974e+05 8.26e+00 8.93e-04 3.62e+00 43s\r\n", " 34 1.32958641e+05 -2.35946189e+05 4.56e+00 5.87e-04 2.38e+00 44s\r\n", " 35 1.28069610e+05 -2.00562235e+05 3.62e+00 5.22e-04 2.11e+00 45s\r\n", " 36 1.24593099e+05 -6.94358849e+04 3.07e+00 2.80e-04 1.20e+00 46s\r\n", " 37 1.20426474e+05 -2.45895484e+04 2.54e+00 1.98e-04 8.69e-01 47s\r\n", " 38 1.17969371e+05 -6.82798570e+03 2.29e+00 1.65e-04 7.38e-01 48s\r\n", " 39 1.14139346e+05 1.67815900e+04 1.94e+00 1.25e-04 5.64e-01 49s\r\n", " 40 1.08363105e+05 2.34332988e+04 1.61e+00 1.10e-04 4.93e-01 50s\r\n", " 41 1.04315530e+05 2.86214891e+04 1.45e+00 9.90e-05 4.43e-01 52s\r\n", " 42 1.01741814e+05 3.14864315e+04 1.36e+00 9.27e-05 4.14e-01 53s\r\n", " 43 9.86515393e+04 3.53800475e+04 1.26e+00 8.34e-05 3.75e-01 55s\r\n", " 44 9.74846806e+04 3.76370184e+04 1.22e+00 7.77e-05 3.55e-01 56s\r\n", " 45 9.44766076e+04 4.13981461e+04 1.12e+00 6.83e-05 3.17e-01 58s\r\n", " 46 9.19686597e+04 4.39776972e+04 1.04e+00 6.15e-05 2.90e-01 59s\r\n", " 47 8.93603861e+04 4.60022128e+04 9.51e-01 5.61e-05 2.66e-01 60s\r\n", " 48 8.76859143e+04 4.77486744e+04 8.79e-01 5.18e-05 2.45e-01 62s\r\n", " 49 8.62813695e+04 4.92868516e+04 8.24e-01 4.82e-05 2.28e-01 63s\r\n", " 50 8.56027759e+04 5.13966220e+04 7.84e-01 4.31e-05 2.07e-01 65s\r\n", " 51 8.48957004e+04 5.19816373e+04 7.54e-01 4.15e-05 2.00e-01 66s\r\n", " 52 8.32394680e+04 5.41928043e+04 6.86e-01 3.54e-05 1.74e-01 67s\r\n", " 53 8.17250808e+04 5.59114211e+04 5.84e-01 2.76e-05 1.45e-01 69s\r\n", " 54 7.87495275e+04 5.77675718e+04 4.50e-01 2.28e-05 1.18e-01 70s\r\n", " 55 7.65910015e+04 5.92651673e+04 3.59e-01 1.90e-05 9.66e-02 71s\r\n", " 56 7.36448198e+04 6.01303203e+04 2.43e-01 1.67e-05 7.76e-02 73s\r\n", " 57 7.19088527e+04 6.22074540e+04 1.87e-01 1.11e-05 5.42e-02 74s\r\n", " 58 7.05686900e+04 6.27428127e+04 1.42e-01 9.49e-06 4.46e-02 76s\r\n", " 59 7.01475919e+04 6.33239274e+04 1.29e-01 7.82e-06 3.82e-02 77s\r\n", " 60 6.93732340e+04 6.35928516e+04 1.06e-01 7.05e-06 3.31e-02 78s\r\n", " 61 6.89873744e+04 6.40345232e+04 9.49e-02 5.74e-06 2.79e-02 80s\r\n", " 62 6.84844975e+04 6.43410345e+04 8.14e-02 4.73e-06 2.34e-02 81s\r\n", " 63 6.78596306e+04 6.45634167e+04 6.38e-02 3.96e-06 1.90e-02 83s\r\n", " 64 6.75753884e+04 6.46952693e+04 5.53e-02 3.51e-06 1.68e-02 84s\r\n", " 65 6.73778881e+04 6.48756450e+04 4.98e-02 2.91e-06 1.44e-02 86s\r\n", " 66 6.71801464e+04 6.49678697e+04 4.43e-02 2.59e-06 1.28e-02 87s\r\n", " 67 6.69549892e+04 6.50665396e+04 3.79e-02 2.20e-06 1.09e-02 89s\r\n", " 68 6.67230183e+04 6.51738241e+04 3.13e-02 1.80e-06 8.99e-03 91s\r\n", " 69 6.65736783e+04 6.52317274e+04 2.75e-02 1.55e-06 7.81e-03 92s\r\n", " 70 6.64142693e+04 6.53209532e+04 2.30e-02 1.15e-06 6.16e-03 94s\r\n", " 71 6.62266310e+04 6.53731434e+04 1.77e-02 9.21e-07 4.86e-03 95s\r\n", " 72 6.60582708e+04 6.54437549e+04 1.27e-02 6.04e-07 3.38e-03 96s\r\n", " 73 6.59096102e+04 6.54840234e+04 8.30e-03 4.39e-07 2.36e-03 98s\r\n", " 74 6.58326701e+04 6.55028840e+04 6.16e-03 3.68e-07 1.87e-03 99s\r\n", " 75 6.58071568e+04 6.55173581e+04 5.42e-03 3.13e-07 1.62e-03 100s\r\n", " 76 6.57869278e+04 6.55323894e+04 4.84e-03 2.55e-07 1.39e-03 102s\r\n", " 77 6.57552578e+04 6.55482722e+04 3.93e-03 2.00e-07 1.11e-03 103s\r\n", " 78 6.57239353e+04 6.55730469e+04 3.02e-03 1.13e-07 7.49e-04 105s\r\n", " 79 6.56918208e+04 6.55807579e+04 2.13e-03 8.75e-08 5.54e-04 106s\r\n", " 80 6.56800478e+04 6.55833962e+04 1.80e-03 7.89e-08 4.85e-04 108s\r\n", " 81 6.56739060e+04 6.55857870e+04 1.65e-03 7.19e-08 4.41e-04 109s\r\n", " 82 6.56604181e+04 6.55889154e+04 1.27e-03 6.18e-08 3.62e-04 111s\r\n", " 83 6.56544422e+04 6.55930475e+04 1.11e-03 4.96e-08 3.04e-04 113s\r\n", " 84 6.56462729e+04 6.55950294e+04 8.97e-04 4.31e-08 2.55e-04 115s\r\n", " 85 6.56347720e+04 6.56000346e+04 5.94e-04 2.83e-08 1.71e-04 117s\r\n", " 86 6.56298669e+04 6.56020877e+04 4.66e-04 2.18e-08 1.35e-04 119s\r\n", " 87 6.56254123e+04 6.56038452e+04 3.62e-04 1.65e-08 1.04e-04 121s\r\n", " 88 6.56211635e+04 6.56052583e+04 2.57e-04 1.24e-08 7.63e-05 122s\r\n", " 89 6.56169905e+04 6.56067541e+04 1.58e-04 8.06e-09 4.90e-05 124s\r\n", " 90 6.56133437e+04 6.56081336e+04 7.56e-05 4.33e-09 2.52e-05 126s\r\n", " 91 6.56121677e+04 6.56085089e+04 5.07e-05 3.26e-09 1.79e-05 128s\r\n", " 92 6.56108899e+04 6.56088374e+04 2.33e-05 2.23e-09 1.06e-05 129s\r\n", " 93 6.56102570e+04 6.56092051e+04 1.11e-05 1.16e-09 5.45e-06 130s\r\n", " 94 6.56099389e+04 6.56093319e+04 5.37e-06 7.76e-10 3.29e-06 131s\r\n", " 95 6.56098815e+04 6.56094726e+04 4.28e-06 3.81e-10 2.03e-06 133s\r\n", " 96 6.56097789e+04 6.56095262e+04 2.51e-06 2.39e-10 1.26e-06 134s\r\n", " 97 6.56097299e+04 6.56095824e+04 1.63e-06 9.84e-11 6.79e-07 135s\r\n", " 98 6.56096722e+04 6.56096114e+04 6.78e-07 3.09e-11 2.65e-07 137s\r\n", " 99 6.56096412e+04 6.56096173e+04 2.01e-07 1.93e-11 1.14e-07 138s\r\n", " 100 6.56096347e+04 6.56096239e+04 1.04e-07 6.63e-12 4.82e-08 139s\r\n", " 101 6.56096282e+04 6.56096269e+04 1.05e-08 8.44e-13 5.64e-09 140s\r\n", " 102 6.56096274e+04 6.56096273e+04 1.01e-09 6.25e-13 5.81e-10 141s\r\n", "\r\n", "Barrier solved model in 102 iterations and 141.06 seconds (84.15 work units)\r\n", "Optimal objective 6.56096274e+04\r\n", "\r\n", "Crossover log...\r\n", "\r\n", " 41620 DPushes remaining with DInf 5.1780300e-05 142s\r\n", " 15480 DPushes remaining with DInf 5.1780300e-05 145s\r\n", " 2980 DPushes remaining with DInf 0.0000000e+00 150s\r\n", " 1299 DPushes remaining with DInf 0.0000000e+00 155s\r\n", " 491 DPushes remaining with DInf 0.0000000e+00 161s\r\n", " 0 DPushes remaining with DInf 0.0000000e+00 165s\r\n", "\r\n", " 3665 PPushes remaining with PInf 2.6732668e-04 165s\r\n", " 3571 PPushes remaining with PInf 3.9756959e-04 165s\r\n", " 0 PPushes remaining with PInf 0.0000000e+00 169s\r\n", "\r\n", " Push phase complete: Pinf 0.0000000e+00, Dinf 1.2544330e-01 170s\r\n", "\r\n", "Iteration Objective Primal Inf. Dual Inf. Time\r\n", " 26531 6.5609627e+04 0.000000e+00 1.254433e-01 170s\r\n", "Crossover time: 28.89 seconds (16.88 work units)\r\n", " 26545 6.5609627e+04 0.000000e+00 0.000000e+00 171s\r\n", "\r\n", "Solved in 26545 iterations and 170.62 seconds (101.29 work units)\r\n", "Optimal objective 6.560962735e+04\r\n", "\r\n", "AMPL MP initial flat model has 268733 variables (0 integer, 0 binary);\r\n", "Objectives: 1 linear; \r\n", "Constraints: 491079 linear;\r\n", "\r\n", "AMPL MP final model has 268733 variables (0 integer, 0 binary);\r\n", "Objectives: 1 linear; \r\n", "Constraints: 491079 linear;\r\n", "\r\n", "\r\n", "Gurobi 13.0.0: optimal solution; objective 65609.62735\n", "26545 simplex iterations\n", "102 barrier iterations\n" ] } ], "execution_count": 20 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:28:36.893633Z", "start_time": "2026-02-20T15:28:36.873267Z" } }, "cell_type": "code", "source": "results_lca.variables['TotalLCIA']", "outputs": [ { "data": { "text/plain": [ " TotalLCIA Run\n", "TTEQ 841.206599 0\n", "TTHH 357.779093 0" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
TotalLCIARun
TTEQ841.2065990
TTHH357.7790930
\n", "
" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 21 }, { "metadata": {}, "cell_type": "markdown", "source": "## Formatting the results" }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:52.769168Z", "start_time": "2026-02-20T15:29:52.755788Z" } }, "cell_type": "code", "source": "results = results_lca # choose among results_tc and results_lca", "outputs": [], "execution_count": 25 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:53.757002Z", "start_time": "2026-02-20T15:29:53.674711Z" } }, "cell_type": "code", "source": [ "df_annual_prod = pd.merge(results.variables['F_t'].reset_index(), results.parameters['t_op'].reset_index(), left_on=['index1', 'index2'], right_on=['index0', 'index1'], suffixes=('', '_'))\n", "df_annual_prod['Annual_Prod'] = df_annual_prod['F_t'] * df_annual_prod['t_op']\n", "df_annual_prod = df_annual_prod.groupby(['index0', 'Run'])['Annual_Prod'].sum().reset_index()\n", "df_installed_cap = results.variables['F'].reset_index()" ], "outputs": [], "execution_count": 26 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:54.277639Z", "start_time": "2026-02-20T15:29:54.265039Z" } }, "cell_type": "code", "source": [ "df_annual_res = df_annual_prod[df_annual_prod.index0.isin(list(results.sets['RESOURCES'].RESOURCES))].rename(columns={'index0':'index', 'Annual_Prod':'Annual_Res'})\n", "df_annual_prod = df_annual_prod[~df_annual_prod.index0.isin(list(results.sets['RESOURCES'].RESOURCES))].rename(columns={'index0':'index'})" ], "outputs": [], "execution_count": 27 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:54.847841Z", "start_time": "2026-02-20T15:29:54.812210Z" } }, "cell_type": "code", "source": [ "esm_results_tech = pd.merge(\n", " df_annual_prod,\n", " df_installed_cap,\n", " on=['index', 'Run']\n", ").rename(columns={'index':'Name', 'Annual_Prod': 'Production', 'F': 'Capacity'})\n", "esm_results_res = df_annual_res.rename(columns={'index': 'Name', 'Annual_Res': 'Import'})" ], "outputs": [], "execution_count": 28 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:55.391716Z", "start_time": "2026-02-20T15:29:55.375274Z" } }, "cell_type": "code", "source": [ "esm_results_tech = esm_results_tech[esm_results_tech.Capacity != 0]\n", "esm_results_tech.head()" ], "outputs": [ { "data": { "text/plain": [ " Name Run Production Capacity\n", "2 ATM_CCS 0 336.804807 2.167426\n", "4 BEV_BATT 0 0.000000 91.160423\n", "9 BOAT_FREIGHT_METHANOL 0 966.908558 30.521103\n", "14 BUS_COACH_HYDIESEL 0 551.338240 6.381230\n", "15 CAR_BEV 0 2756.691201 191.436889" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NameRunProductionCapacity
2ATM_CCS0336.8048072.167426
4BEV_BATT00.00000091.160423
9BOAT_FREIGHT_METHANOL0966.90855830.521103
14BUS_COACH_HYDIESEL0551.3382406.381230
15CAR_BEV02756.691201191.436889
\n", "
" ] }, "execution_count": 29, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 29 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:55.624055Z", "start_time": "2026-02-20T15:29:55.606652Z" } }, "cell_type": "code", "source": [ "esm_results_res = esm_results_res[esm_results_res.Import != 0]\n", "esm_results_res.head()" ], "outputs": [ { "data": { "text/plain": [ " Name Run Import\n", "7 BIODIESEL 0 849.952695\n", "29 CO2_ATM 0 336.804807\n", "31 CO2_EMISSIONS 0 176.167331\n", "64 ELEC_EXPORT 0 587.642514\n", "76 H2_RE 0 7132.203267" ], "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
NameRunImport
7BIODIESEL0849.952695
29CO2_ATM0336.804807
31CO2_EMISSIONS0176.167331
64ELEC_EXPORT0587.642514
76H2_RE07132.203267
\n", "
" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "execution_count": 30 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:29:56.603858Z", "start_time": "2026-02-20T15:29:56.590135Z" } }, "cell_type": "code", "source": [ "esm_results_tech.to_csv(LCA_RESULTS_FOLDER+'esm_results_tech.csv', index=False)\n", "esm_results_res.to_csv(LCA_RESULTS_FOLDER+'esm_results_res.csv', index=False)" ], "outputs": [], "execution_count": 31 }, { "metadata": {}, "cell_type": "markdown", "source": "## Visualise the results" }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:41:13.172101Z", "start_time": "2026-02-20T15:41:13.163264Z" } }, "cell_type": "code", "source": [ "plot = Plot(\n", " df_impact_scores=impact_scores_lca,\n", " esm_results_tech=esm_results_tech[~esm_results_tech.Name.isin(['ATM_CCS'])], # negative impacts are not displayed in the following plots\n", " esm_results_res=esm_results_res,\n", " lifetime=lifetime,\n", ")" ], "outputs": [], "execution_count": 40 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:41:14.286493Z", "start_time": "2026-02-20T15:41:14.126058Z" } }, "cell_type": "code", "source": [ "plot.plot_results(\n", " impact_categories_list=[\n", " (\n", " 'IMPACT World+ Damage 2.1 for ecoinvent v3.10',\n", " 'Ecosystem quality',\n", " 'Total ecosystem quality',\n", " ),\n", " (\n", " 'IMPACT World+ Damage 2.1 for ecoinvent v3.10',\n", " 'Human health',\n", " 'Total human health',\n", " ),\n", " ],\n", " normalized=True,\n", ")" ], "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "alignmentgroup": "True", "customdata": [ [ "95.38 %" ], [ "95.56 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "Construction", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "Construction", "offsetgroup": "Construction", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 95.38186002267805, 95.55713746859254 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "0.73 %" ], [ "1.14 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "Decommission", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "Decommission", "offsetgroup": "Decommission", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 0.7273386817996714, 1.1374531609515903 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "1.90 %" ], [ "2.31 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "Operation", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "Operation", "offsetgroup": "Operation", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 1.8954279478462646, 2.3126565973669204 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "2.00 %" ], [ "0.99 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "Resource", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "Resource", "offsetgroup": "Resource", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 1.995373347676003, 0.9927527730889489 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" } ], "layout": { "template": { "data": { "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "#C8D4E3" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" }, "bgcolor": "white", "radialaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "baxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "bgcolor": "white", "caxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "Normalized impacts" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "Impact categories" } }, "legend": { "title": { "text": "Type" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "barmode": "stack" }, "config": { "plotlyServerURL": "https://plot.ly" } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "execution_count": 41 }, { "metadata": { "ExecuteTime": { "end_time": "2026-02-20T15:41:27.708582Z", "start_time": "2026-02-20T15:41:27.576315Z" } }, "cell_type": "code", "source": [ "plot.plot_results(\n", " impact_categories_list=[\n", " (\n", " 'IMPACT World+ Damage 2.1 for ecoinvent v3.10',\n", " 'Ecosystem quality',\n", " 'Total ecosystem quality',\n", " ),\n", " (\n", " 'IMPACT World+ Damage 2.1 for ecoinvent v3.10',\n", " 'Human health',\n", " 'Total human health',\n", " ),\n", " ],\n", " normalized=True,\n", " split_by='Name',\n", " N_highest_contributors=10,\n", ")" ], "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "data": [ { "alignmentgroup": "True", "customdata": [ [ "2.74 %" ], [ "1.84 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "BUS_COACH_HYDIESEL", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "BUS_COACH_HYDIESEL", "offsetgroup": "BUS_COACH_HYDIESEL", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 2.7376309962080705, 1.8403133406245509 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "44.63 %" ], [ "49.84 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "CAR_BEV", "marker": { "color": "#EF553B", "pattern": { "shape": "" } }, "name": "CAR_BEV", "offsetgroup": "CAR_BEV", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 44.62755141074187, 49.84437371299253 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "4.15 %" ], [ "3.33 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "DEC_ADVCOGEN_H2", "marker": { "color": "#00cc96", "pattern": { "shape": "" } }, "name": "DEC_ADVCOGEN_H2", "offsetgroup": "DEC_ADVCOGEN_H2", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 4.146651380340708, 3.3296214822091064 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "1.84 %" ], [ "0.90 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "H2_RE", "marker": { "color": "#ab63fa", "pattern": { "shape": "" } }, "name": "H2_RE", "offsetgroup": "H2_RE", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 1.8435918613778937, 0.8987604444841528 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "3.74 %" ], [ "4.88 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "OTHER", "marker": { "color": "#FFA15A", "pattern": { "shape": "" } }, "name": "OTHER", "offsetgroup": "OTHER", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 3.735005516739255, 4.879784303755085 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "13.16 %" ], [ "15.02 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "PV", "marker": { "color": "#19d3f3", "pattern": { "shape": "" } }, "name": "PV", "offsetgroup": "PV", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 13.16058107402072, 15.016275132352549 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "2.73 %" ], [ "2.84 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "SYN_METHANATION", "marker": { "color": "#FF6692", "pattern": { "shape": "" } }, "name": "SYN_METHANATION", "offsetgroup": "SYN_METHANATION", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 2.7338350123180124, 2.8447377595107257 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "0.88 %" ], [ "1.09 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "TRAMWAY_TROLLEY", "marker": { "color": "#B6E880", "pattern": { "shape": "" } }, "name": "TRAMWAY_TROLLEY", "offsetgroup": "TRAMWAY_TROLLEY", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 0.8768313670662768, 1.085211962070525 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "22.02 %" ], [ "15.11 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "TRUCK_DIESEL", "marker": { "color": "#FF97FF", "pattern": { "shape": "" } }, "name": "TRUCK_DIESEL", "offsetgroup": "TRUCK_DIESEL", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 22.016495825982723, 15.110406849516492 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "1.87 %" ], [ "2.46 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "WIND_OFFSHORE", "marker": { "color": "#FECB52", "pattern": { "shape": "" } }, "name": "WIND_OFFSHORE", "offsetgroup": "WIND_OFFSHORE", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 1.8663271362930505, 2.456310682612826 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" }, { "alignmentgroup": "True", "customdata": [ [ "2.26 %" ], [ "2.69 %" ] ], "hovertemplate": "
Impact category: %{y}
Normalized impacts: %{customdata}
", "legendgroup": "WIND_ONSHORE", "marker": { "color": "#636efa", "pattern": { "shape": "" } }, "name": "WIND_ONSHORE", "offsetgroup": "WIND_ONSHORE", "orientation": "h", "showlegend": true, "textposition": "auto", "texttemplate": "%{x:.2s}", "x": [ 2.2554984189114133, 2.6942043298714533 ], "xaxis": "x", "y": [ "Total ecosystem quality", "Total human health" ], "yaxis": "y", "type": "bar", "insidetextanchor": "middle" } ], "layout": { "template": { "data": { "barpolar": [ { "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "white", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "#C8D4E3", "linecolor": "#C8D4E3", "minorgridcolor": "#C8D4E3", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "white", "showlakes": true, "showland": true, "subunitcolor": "#C8D4E3" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "white", "polar": { "angularaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" }, "bgcolor": "white", "radialaxis": { "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "yaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" }, "zaxis": { "backgroundcolor": "white", "gridcolor": "#DFE8F3", "gridwidth": 2, "linecolor": "#EBF0F8", "showbackground": true, "ticks": "", "zerolinecolor": "#EBF0F8" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "baxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" }, "bgcolor": "white", "caxis": { "gridcolor": "#DFE8F3", "linecolor": "#A2B1C6", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "#EBF0F8", "linecolor": "#EBF0F8", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "#EBF0F8", "zerolinewidth": 2 } } }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "Normalized impacts" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "Impact categories" } }, "legend": { "title": { "text": "Name" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "barmode": "stack" }, "config": { "plotlyServerURL": "https://plot.ly" } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "execution_count": 42 }, { "metadata": {}, "cell_type": "markdown", "source": "Due to IAM projections (in the present case, scenario SSP2-RCP26 run in TIAM-UCL) in the LCA database, some important changes occur in LCA datasets. For instance, diesel production has switched to biodiesel (from used cooking oil with CCS). Consequently, CO2 emissions from diesel combustion are biogenic (i.e., their characterization factor is 0) and the impact of TRUCK_DIESEL mostly comes from its construction." } ], "metadata": { "colab": { "provenance": [ { "file_id": "1iXiT1Y7Ld9Cy9BVn8DyUan3JyaPru8sB", "timestamp": 1760451064422 } ] }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }