{ "cells": [ { "cell_type": "markdown", "id": "ed664fc2", "metadata": { "execution": {} }, "source": [ "[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/neuromatch/climate-course-content/blob/main/tutorials/W2D2_TheSocioeconomicsofClimateChange/instructor/W2D2_Tutorial3.ipynb)   \"Open" ] }, { "cell_type": "markdown", "id": "53e42e1c", "metadata": { "execution": {}, "vscode": { "languageId": "plaintext" } }, "source": [ "# Tutorial 3: The Temporal Dimension of Actions\n", "**Week 2, Day 2: The Socioeconomics of Climate Change**\n", "\n", "**Content creators:** Paul Heubel, Maximilian Puelma Touzel\n", "\n", "**Content reviewers:** Mujeeb Abdulfatai, Nkongho Ayuketang Arreyndip, Jeffrey N. A. Aryee, Jenna Pearson, Abel Shibu, Ohad Zivan\n", "\n", "**Content editors:** Paul Heubel, Jenna Pearson, Chi Zhang, Ohad Zivan\n", "\n", "**Production editors:** Wesley Banfield, Paul Heubel, Jenna Pearson, Konstantine Tsafatinos, Chi Zhang, Ohad Zivan\n", "\n", "**Our 2024 Sponsors:** CMIP, NFDI4Earth" ] }, { "cell_type": "markdown", "id": "87ef2f44-fb74-4664-8472-4c97158a8d17", "metadata": { "execution": {} }, "source": [ "# Tutorial Objectives\n", "\n", "*Estimated timing of tutorial:* 20 minutes\n", "\n", "The last tutorials covered the necessity for an energy transition to tackle the climate emergency and many solutions at once. As emissions accumulate, it becomes substantially harder to succeed the longer we take to make big changes. This tutorial explores the temporal dimension of action, here policies, by using the Climate Solution Simulator named [En-ROADS](https://www.climateinteractive.org/en-roads/).\n", "\n", "After finishing this tutorial you can\n", "\n", "* exemplify along the carbon price, why policy-making has to consider the temporal dimension and the needs of the most vulnerable parts of society" ] }, { "cell_type": "code", "execution_count": null, "id": "062c4b1a-6239-4644-a0dd-03fe1342fe99", "metadata": { "execution": {} }, "outputs": [], "source": [ "# import\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Install and import feedback gadget\n" ] }, { "cell_type": "code", "execution_count": null, "id": "33ac31c0-ac52-447a-82d7-aec0b98dc6e6", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Install and import feedback gadget\n", "\n", "!pip3 install vibecheck datatops --quiet\n", "\n", "from vibecheck import DatatopsContentReviewContainer\n", "def content_review(notebook_section: str):\n", " return DatatopsContentReviewContainer(\n", " \"\", # No text prompt\n", " notebook_section,\n", " {\n", " \"url\": \"https://pmyvdlilci.execute-api.us-east-1.amazonaws.com/klab\",\n", " \"name\": \"comptools_4clim\",\n", " \"user_key\": \"l5jpxuee\",\n", " },\n", " ).render()\n", "\n", "\n", "feedback_prefix = \"W2D2_T3\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Figure settings\n" ] }, { "cell_type": "code", "execution_count": null, "id": "8b4722fe-cbd5-484a-be6d-96ed7aafbf62", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Figure settings\n", "import ipywidgets as widgets # interactive display\n", "\n", "%config InlineBackend.figure_format = 'retina'\n", "plt.style.use(\n", " \"https://raw.githubusercontent.com/neuromatch/climate-course-content/main/cma.mplstyle\"\n", ")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Helper functions\n" ] }, { "cell_type": "code", "execution_count": null, "id": "053ee0ea-d704-45c8-8b4b-aad17216710d", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Helper functions\n", "\n", "def pooch_load(filelocation=None, filename=None, processor=None):\n", " shared_location = \"/home/jovyan/shared/Data/tutorials/W2D2_TheSocioeconomicsofClimateChange\" # this is different for each day\n", " user_temp_cache = tempfile.gettempdir()\n", "\n", " if os.path.exists(os.path.join(shared_location, filename)):\n", " file = os.path.join(shared_location, filename)\n", " else:\n", " file = pooch.retrieve(\n", " filelocation,\n", " known_hash=None,\n", " fname=os.path.join(user_temp_cache, filename),\n", " processor=processor,\n", " )\n", "\n", " return file" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Video 1: The IPCC's Transition Narratives and Project Modelling\n" ] }, { "cell_type": "code", "execution_count": null, "id": "5b50c362", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @title Video 1: The IPCC's Transition Narratives and Project Modelling\n", "\n", "from ipywidgets import widgets\n", "from IPython.display import YouTubeVideo\n", "from IPython.display import IFrame\n", "from IPython.display import display\n", "\n", "\n", "class PlayVideo(IFrame):\n", " def __init__(self, id, source, page=1, width=400, height=300, **kwargs):\n", " self.id = id\n", " if source == 'Bilibili':\n", " src = f'https://player.bilibili.com/player.html?bvid={id}&page={page}'\n", " elif source == 'Osf':\n", " src = f'https://mfr.ca-1.osf.io/render?url=https://osf.io/download/{id}/?direct%26mode=render'\n", " super(PlayVideo, self).__init__(src, width, height, **kwargs)\n", "\n", "\n", "def display_videos(video_ids, W=400, H=300, fs=1):\n", " tab_contents = []\n", " for i, video_id in enumerate(video_ids):\n", " out = widgets.Output()\n", " with out:\n", " if video_ids[i][0] == 'Youtube':\n", " video = YouTubeVideo(id=video_ids[i][1], width=W,\n", " height=H, fs=fs, rel=0)\n", " print(f'Video available at https://youtube.com/watch?v={video.id}')\n", " else:\n", " video = PlayVideo(id=video_ids[i][1], source=video_ids[i][0], width=W,\n", " height=H, fs=fs, autoplay=False)\n", " if video_ids[i][0] == 'Bilibili':\n", " print(f'Video available at https://www.bilibili.com/video/{video.id}')\n", " elif video_ids[i][0] == 'Osf':\n", " print(f'Video available at https://osf.io/{video.id}')\n", " display(video)\n", " tab_contents.append(out)\n", " return tab_contents\n", "\n", "\n", "video_ids = [('Youtube', 's9Yx24f_lqg'),\n", " ('Bilibili', 'BV1dPGDexE7x')\n", " ]\n", "tab_contents = display_videos(video_ids, W=730, H=410)\n", "tabs = widgets.Tab()\n", "tabs.children = tab_contents\n", "for i in range(len(tab_contents)):\n", " tabs.set_title(i, video_ids[i][0])\n", "display(tabs)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Submit your feedback\n" ] }, { "cell_type": "code", "execution_count": null, "id": "74b1c5e6-ed8f-4ca8-bbab-a0a6c417dced", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Submit your feedback\n", "content_review(f\"{feedback_prefix}_Orienting_inside_a_Climate_Solution_Simulator_Video\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "703ee8f2", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @markdown\n", "from ipywidgets import widgets\n", "from IPython.display import IFrame\n", "\n", "link_id = \"mtyrb\"\n", "\n", "print(f\"If you want to download the slides: https://osf.io/download/{link_id}/\")\n", "IFrame(src=f\"https://mfr.ca-1.osf.io/render?url=https://osf.io/{link_id}/?direct%26mode=render%26action=download%26mode=render\", width=854, height=480)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Submit your feedback\n" ] }, { "cell_type": "code", "execution_count": null, "id": "9fd96992-bab2-4494-aeb5-997cc8689746", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Submit your feedback\n", "content_review(f\"{feedback_prefix}_Orienting_inside_a_Climate_Solution_Simulator_Slides\")" ] }, { "cell_type": "markdown", "id": "29cf9a43-2478-4d14-9faf-193e54378a04", "metadata": { "execution": {} }, "source": [ "# Section 1: When and How Do You Introduce a Carbon Price?\n", "\n", "You might have recognized that a high ***carbon price*** by default has a strong impact on the temperature increase within the En-ROADS model as it both reduces the carbon intensity of the energy supply and reduces the energy demand. However, the carbon price itself could be introduced now or in 50 years and at different amounts, depending on for example the social cost of such a policy, which makes energy supply more expensive depending on its emissions. Energy producers could pass additional costs to their customers, so policy could be designed to minimize the impacts on the poorest, e.g. by introducing a [Carbon fee and dividend](https://en.wikipedia.org/wiki/Carbon_fee_and_dividend). \n", "\n", "To account for their temporal evolution, many variables in En-ROADS allow for modifications of the timing when something is introduced, stopped, in or de-creased, and so on." ] }, { "cell_type": "markdown", "id": "d29fb31c-84ab-4705-8678-87f8274f6500", "metadata": { "execution": {} }, "source": [ "## Exercise 1: Implications of Actions and Their Timing\n", "*Estimated timing:* 10 minutes\n", "\n", "1. **Open En-ROADS** [here](https://en-roads.climateinteractive.org/). *(Note the control panel is available in various languages - check the left of the panel of the simulator that should by default show \"English\".)*\n", " \n", "2. **Develop a scenario**: Click on the ellipsis of the 'Carbon price' slider, and a widget-info box opens that allows for finetuning of your carbon price policy.\n", " 1. Click on the title of the top right graph *Greenhouse Gas Net Emissions*, select the 'Financial' toggle, and select the 'Market price of electricity'.\n", " 2. Turn the most upper knobs/ vary the sliders of the 'Carbon price' and slide through different carbon prices.\n", " 3. Move the sliders to answer the following question. Use the following [cheatsheet](https://img.climateinteractive.org/2019/09/EnROADS-one-page-guide-to-control-panel-v11-dec-2021.pdf) if needed.\n", "\n", "\n", "3. **Answer the following questions**:\n", " * What do you observe in the 'Market price of electricity' graph after varying the carbon price?\n", " * Now, select a high carbon price and increase the 'Year the carbon price starts to phase in'. How does the carbon price change the temporal evolution of the 'Market price of electricity'. \n", " * How could this be of consequence for a low-income household?\n", "\n", "*Be warned that a reset of all your previous changes might be necessary before. If you would like to save your previous scenario, export it via a click on the* ***Share your scenario*** *button in the top right of the Panel, and select 'Copy Scenario Link'*.\n", "\n", "*Note that your changes are reflected in the light blue graph, while the baseline scenario remains a black line.*" ] }, { "cell_type": "code", "execution_count": null, "id": "c97e6d3d-1718-479b-a19a-ffc6a082347b", "metadata": { "execution": {} }, "outputs": [], "source": [ "# to_remove explanation\n", "\n", "'''\n", "3. The earlier the carbon price starts to phase in the more effective it is regarding the temperature increase.\n", "However, the earlier the larger the disturbance of the market price of electricity, emphasized by a strong increase in the price at first\n", "and a strong drop in the price after the first few years.\n", "This might lead to economic disruptions as energy supply becomes very expensive, therefore low-income households,\n", "which usually spend large parts of their income on energy, would need compensation like a 'carbon dividend' to avoid precariat.\n", "In summary, actions and their temporal implementation always need to be evaluated in various aspects to be a successful and\n", "societal least disruptive action against climate change.\n", "'''" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Submit your feedback\n" ] }, { "cell_type": "code", "execution_count": null, "id": "867fc0d6-6802-4d3d-888b-be960ffd54e8", "metadata": { "cellView": "form", "execution": {}, "tags": [ "hide-input" ] }, "outputs": [], "source": [ "# @title Submit your feedback\n", "content_review(f\"{feedback_prefix}_Exercise_1\")" ] }, { "cell_type": "markdown", "id": "3562deb9", "metadata": { "execution": {} }, "source": [ "# Summary\n", "\n", "In this tutorial, we discussed the temporal dimension of the carbon price implementation in order to understand why no policy might be a silver bullet to solve all problems but comes with various ethical and political implications. " ] }, { "cell_type": "markdown", "id": "6d0c2c37-0e64-4734-8776-1f455a20987f", "metadata": { "execution": {} }, "source": [ "# Resources\n", "\n", "This tutorial is inspired by teaching material from [Climate Interactive](https://climateinteractive.org/) and other documents. \n", "A few important resources are linked below:\n", "\n", "- [En-ROADS documentation](https://docs.climateinteractive.org/projects/en-roads/en/latest/index.html)\n", "- [En-ROADS User Guide PDF](https://docs.climateinteractive.org/projects/en-roads/en/latest/en-roads-user-guide.pdf)\n", "- [Guided Assignment - Simulating Climate Futures in En-ROADS: Short Version](https://www.climateinteractive.org/guided-assignment/)" ] } ], "metadata": { "colab": { "collapsed_sections": [], "include_colab_link": true, "name": "W2D2_Tutorial3", "toc_visible": true }, "kernel": { "display_name": "Python 3", "language": "python", "name": "python3" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.19" } }, "nbformat": 4, "nbformat_minor": 5 }