{ "cells": [ { "cell_type": "markdown", "id": "3d4298c9-a204-48a4-b408-90d0403d4950", "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/W2D3_FutureClimate-IPCCII&IIISocio-EconomicBasis/W2D3_Tutorial5.ipynb)   \"Open" ] }, { "cell_type": "markdown", "id": "c55c3b25-2613-4f34-8d4a-ccc417f24708", "metadata": { "execution": {} }, "source": [ "# Tutorial 5: Mapping the Narrative Space\n", "**Week 2, Day 3: The Socioeconomics of Climate Change**\n", "\n", "**Content creators:** Paul Heubel, Maximilian Puelma Touzel\n", "\n", "**Content reviewers:** Jenna Pearson, Chi Zhang, Ohad Zivan\n", "\n", "**Content editors:** Paul Heubel, Jenna Pearson, Chi Zhang, Ohad Zivan\n", "\n", "**Production editors:** Wesley Banfield, Jenna Pearson, Konstantine Tsafatinos, Chi Zhang, Ohad Zivan\n", "\n", "**Our 2024 Sponsors:** CMIP, NFDI4Earth" ] }, { "cell_type": "markdown", "id": "5c8af3c8-42a4-45ba-a16f-be86198e23e8", "metadata": { "execution": {} }, "source": [ "### Tutorial objectives\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "id": "1af3e766-b9c3-4bf8-815c-4087e7811925", "metadata": { "execution": {} }, "outputs": [], "source": [ "# import\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "#import dicelib # https://github.com/mptouzel/PyDICE" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Figure settings\n" ] }, { "cell_type": "code", "execution_count": null, "id": "e7392de8-f946-453b-bedf-8a07c705ee7f", "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": "6c10210c-a3d9-4996-a3d3-4bafa4b72637", "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/W2D3_FutureClimate-IPCCII&IIISocio-EconomicBasis\" # 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: Mapping the Narrative Space\n" ] }, { "cell_type": "code", "execution_count": null, "id": "80412217-b5a7-4fed-b29e-b8751eb8c847", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @title Video 1: Mapping the Narrative Space\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', '9ytkpO_pbWE')\n", " # , ('Bilibili', 'BV1bj411Z739')\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": "code", "execution_count": null, "id": "2dc2f6c1-637b-4506-a667-45750dd7fbe5", "metadata": { "cellView": "form", "execution": {}, "tags": [ "remove-input" ] }, "outputs": [], "source": [ "# @markdown\n", "from ipywidgets import widgets\n", "from IPython.display import IFrame\n", "\n", "# TODO update\n", "link_id = \"cyavb\"\n", "\n", "download_link = f\"https://osf.io/download/{link_id}/\"\n", "render_link = f\"https://mfr.ca-1.osf.io/render?url=https://osf.io/{link_id}/?direct%26mode=render%26action=download%26mode=render\"\n", "# @markdown\n", "out = widgets.Output()\n", "with out:\n", " print(f\"If you want to download the slides: {download_link}\")\n", " display(IFrame(src=f\"{render_link}\", width=730, height=410))\n", "display(out)" ] }, { "cell_type": "markdown", "id": "c7ce6e92-a46d-437a-9e03-c5b80eb63474", "metadata": { "execution": {} }, "source": [ "# Section 1: Background on IAM Economics\n", "\n", "The last tutorial gave us a glimpse of Integrated Assessment Models (IAMs), a class of models economists use to inform policy decisions. Recall that IAMs couple a climate model to an economic model, allowing us to evaluate the two-way coupling between economic productivity and climate change severity. \n", "\n", "Let's begin with a brief description of IAMs:\n", "\n", "- IAMs resolve the spatially, in contrast, the toy model En-ROADs for example, which we applied in Tutorial 1 to 3, aggregates all variables and is non-spatial.\n", "- Like En-ROADS, the world models used in IAMs usually have *exogeneous* (externally set) times series for variables, in addition to fixed world system parameters. These exogenous variables are assumed to be under our society's control (e.g. mitigation). \n", "- IAMs come equipped with an objective function (a formula that calculates the quantity to be optimized). This function returns the value of a projected future obtained from running the world model under a given climate policy. This value is defined by the time series of these exogenous variables. In this sense, the objective function is what defines \"good\" in \"good climate policy\". \n", "- The computation in an IAM is then an optimization of this objective as a function of the time series of these exogenous variables over some fixed time window.\n", "\n", "In En-ROADS, there are exogenous parameters, in particular:\n", " - **$\\mu(t)$**: time-dependent mitigation rate (i.e. emissions reduction), which limits warming-caused damages\n", " - **$S(t)$**: savings rate, which drives capital investment \n", "\n", "Most IAMs are based on *Neo-classical economics* (also referred to as \"establishment economics\"). This is an approach to economics that makes particular assumptions. For example, it is assumed that production, consumption, and valuation of goods and services are driven solely by the supply and demand model. To understand this approach and how it is used, it is important to begin with a brief overview of some fundamental concepts. One such concept is **utility** (i.e. economic value), which is not only central to economics but also to decision theory as a whole, which is a research field that mathematically formalizes the activity of *planning* (planning here means selecting strategies based on how they are expected to play out given a model that takes those strategies and projects forward into the future)." ] }, { "cell_type": "markdown", "id": "28c0a077-c9a0-42d9-ada6-e8b835668c3b", "metadata": { "execution": {} }, "source": [ "# Summary" ] }, { "cell_type": "markdown", "id": "9e904e57-b6b9-4ee8-aefb-140dce3c93c2", "metadata": { "execution": {} }, "source": [ "# Resources" ] } ], "metadata": { "colab": { "collapsed_sections": [], "include_colab_link": true, "name": "W2D3_Tutorial5", "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 }