{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# The sensitivity analysis in pyPowsybl "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In this notebook, you will learn how to run a sensitivity analysis on a network using pypowsybl.\n",
    "\n",
    "This type of analysis allows to study the sensitivity of state variables to small fluctuations in a variable. As an example, we can examine the impact of varying the active power of a generator in the active power flow on the branches surrounding this generator. \n",
    "\n",
    "It is also possible to calculate Power Transfer Distribution Factors (PTDF). In this case, zones are defined and the effect of the variation of the net position of a zone on a branch between this zone and another one.\n",
    "\n",
    "The first step is to install pypowsybl and import the library."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "pip install pypowsybl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pypowsybl as pp"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We will consider the six buses example network in this notebook. It is available directly in the pyPowsybl library."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "n6 = pp.network.create_metrix_tutorial_six_buses_network()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "By drawing the network area diagram, you can get a better understanding of the substations and branches in the network."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n",
       "<svg width=\"600.55\" height=\"600.00\" viewBox=\"-609.07 -539.59 1217.70 1216.58\" xmlns=\"http://www.w3.org/2000/svg\">\n",
       "    <style><![CDATA[\n",
       ".nad-branch-edges .nad-edge-path, .nad-3wt-edges .nad-edge-path {stroke: var(--nad-vl-color, lightgrey); stroke-width: 5; fill: none}\n",
       ".nad-branch-edges .nad-winding, .nad-3wt-nodes .nad-winding {stroke: var(--nad-vl-color, lightgrey); stroke-width: 5; fill: none}\n",
       ".nad-text-edges {stroke: black; stroke-width: 3; stroke-dasharray: 6,7}\n",
       ".nad-disconnected .nad-edge-path {stroke-dasharray: 10,10}\n",
       ".nad-vl-nodes .nad-busnode {fill: var(--nad-vl-color, lightgrey)}\n",
       ".nad-vl-nodes circle.nad-unknown-busnode {stroke: var(--nad-vl-color, #808080); stroke-width: 5; stroke-dasharray: 5,5; fill: none}\n",
       ".nad-hvdc-edge polyline.nad-hvdc {stroke: grey; stroke-width: 40}\n",
       ".nad-branch-edges .nad-tie-line-edge .nad-edge-path {stroke-width: 7}\n",
       ".nad-pst-arrow {stroke: #6a6a6a; stroke-width: 4; stroke-linecap: round; fill: none}\n",
       ".nad-state-out .nad-arrow-in {visibility: hidden}\n",
       ".nad-state-in .nad-arrow-out {visibility: hidden}\n",
       ".nad-active path {stroke: none; fill: #546e7a}\n",
       ".nad-reactive path {stroke: none; fill: #0277bd}\n",
       ".nad-current path {stroke: none; fill: #bd4802}\n",
       ".nad-text-background {flood-color: #90a4aeaa}\n",
       ".nad-text-nodes {font: 25px serif; fill: black; dominant-baseline: central}\n",
       ".nad-text-nodes foreignObject {overflow: visible; color: black}\n",
       ".nad-label-box {background-color: #6c6c6c20; width: max-content; padding: 10px; border-radius: 10px;}\n",
       ".nad-legend-square {width: 20px; height: 20px; background: var(--nad-vl-color, black);}\n",
       ".nad-edge-infos text, .nad-edge-label text {font: 20px serif; dominant-baseline:middle; stroke: #FFFFFFAA; stroke-width: 10; stroke-linejoin:round; paint-order: stroke}\n",
       ".nad-edge-infos .nad-state-in text {fill: #b71c1c}\n",
       ".nad-edge-infos .nad-state-out text {fill: #2e7d32}\n",
       ".nad-disconnected {--nad-vl-color: #808080}\n",
       ".nad-vl0to30-line {--nad-vl-color: #afb42b}\n",
       ".nad-vl0to30-0 {--nad-vl-color: #827717}\n",
       ".nad-vl0to30-1 {--nad-vl-color: #d4e157}\n",
       ".nad-vl0to30-2 {--nad-vl-color: #e6ee9c}\n",
       ".nad-vl0to30-3 {--nad-vl-color: #c0ca33}\n",
       ".nad-vl0to30-4 {--nad-vl-color: #f0fc83}\n",
       ".nad-vl0to30-5 {--nad-vl-color: #9e9d24}\n",
       ".nad-vl0to30-6 {--nad-vl-color: #cddc39}\n",
       ".nad-vl0to30-7 {--nad-vl-color: #dce775}\n",
       ".nad-vl0to30-8 {--nad-vl-color: #ddfc88}\n",
       ".nad-vl30to50-line {--nad-vl-color: #ef9a9a}\n",
       ".nad-vl30to50-0 {--nad-vl-color: #c2185b}\n",
       ".nad-vl30to50-1 {--nad-vl-color: #f06292}\n",
       ".nad-vl30to50-2 {--nad-vl-color: #d81b60}\n",
       ".nad-vl30to50-3 {--nad-vl-color: #ec407a}\n",
       ".nad-vl30to50-4 {--nad-vl-color: #880e4f}\n",
       ".nad-vl30to50-5 {--nad-vl-color: #ad1457}\n",
       ".nad-vl30to50-6 {--nad-vl-color: #e91e63}\n",
       ".nad-vl30to50-7 {--nad-vl-color: #f48fb1}\n",
       ".nad-vl30to50-8 {--nad-vl-color: #f8bbd0}\n",
       ".nad-vl50to70-line {--nad-vl-color: #9c27b0}\n",
       ".nad-vl50to70-0 {--nad-vl-color: #7b1fa2}\n",
       ".nad-vl50to70-1 {--nad-vl-color: #ba68c8}\n",
       ".nad-vl50to70-2 {--nad-vl-color: #512da8}\n",
       ".nad-vl50to70-3 {--nad-vl-color: #ab47bc}\n",
       ".nad-vl50to70-4 {--nad-vl-color: #e1bee7}\n",
       ".nad-vl50to70-5 {--nad-vl-color: #6a1b9a}\n",
       ".nad-vl50to70-6 {--nad-vl-color: #4a148c}\n",
       ".nad-vl50to70-7 {--nad-vl-color: #ce93d8}\n",
       ".nad-vl50to70-8 {--nad-vl-color: #9575cd}\n",
       ".nad-vl70to120-line {--nad-vl-color: #e65100}\n",
       ".nad-vl70to120-0 {--nad-vl-color: #fb8c00}\n",
       ".nad-vl70to120-1 {--nad-vl-color: #ffb74d}\n",
       ".nad-vl70to120-2 {--nad-vl-color: #f57c00}\n",
       ".nad-vl70to120-3 {--nad-vl-color: #ffa726}\n",
       ".nad-vl70to120-4 {--nad-vl-color: #ffe0b2}\n",
       ".nad-vl70to120-5 {--nad-vl-color: #ef6c00}\n",
       ".nad-vl70to120-6 {--nad-vl-color: #ff9800}\n",
       ".nad-vl70to120-7 {--nad-vl-color: #ffcc80}\n",
       ".nad-vl70to120-8 {--nad-vl-color: #fff3e0}\n",
       ".nad-vl120to180-line {--nad-vl-color: #00ACC1}\n",
       ".nad-vl120to180-0 {--nad-vl-color: #4fc3f7}\n",
       ".nad-vl120to180-1 {--nad-vl-color: #01579b}\n",
       ".nad-vl120to180-2 {--nad-vl-color: #b3e5fc}\n",
       ".nad-vl120to180-3 {--nad-vl-color: #039be5}\n",
       ".nad-vl120to180-4 {--nad-vl-color: #81d4fa}\n",
       ".nad-vl120to180-5 {--nad-vl-color: #0288d1}\n",
       ".nad-vl120to180-6 {--nad-vl-color: #29b6f6}\n",
       ".nad-vl120to180-7 {--nad-vl-color: #0277bd}\n",
       ".nad-vl120to180-8 {--nad-vl-color: #03a9f4}\n",
       ".nad-vl180to300-line {--nad-vl-color: #2e7d32}\n",
       ".nad-vl180to300-0 {--nad-vl-color: #81c784}\n",
       ".nad-vl180to300-1 {--nad-vl-color: #558b2f}\n",
       ".nad-vl180to300-2 {--nad-vl-color: #c8e6c9}\n",
       ".nad-vl180to300-3 {--nad-vl-color: #43a047}\n",
       ".nad-vl180to300-4 {--nad-vl-color: #a5d6a7}\n",
       ".nad-vl180to300-5 {--nad-vl-color: #388e3c}\n",
       ".nad-vl180to300-6 {--nad-vl-color: #66bb6a}\n",
       ".nad-vl180to300-7 {--nad-vl-color: #1b5e20}\n",
       ".nad-vl180to300-8 {--nad-vl-color: #4caf50}\n",
       ".nad-vl300to500-line {--nad-vl-color: #d32f2f}\n",
       ".nad-vl300to500-0 {--nad-vl-color: #ef5350}\n",
       ".nad-vl300to500-1 {--nad-vl-color: #ef9a9a}\n",
       ".nad-vl300to500-2 {--nad-vl-color: #b71c1c}\n",
       ".nad-vl300to500-3 {--nad-vl-color: #e57373}\n",
       ".nad-vl300to500-4 {--nad-vl-color: #e53935}\n",
       ".nad-vl300to500-5 {--nad-vl-color: #ff8a80}\n",
       ".nad-vl300to500-6 {--nad-vl-color: #f44336}\n",
       ".nad-vl300to500-7 {--nad-vl-color: #ffcdd2}\n",
       ".nad-vl300to500-8 {--nad-vl-color: #c62828}\n",
       ".nad-branch-edges .nad-overload .nad-edge-path {animation: line-blink 3s infinite}\n",
       ".nad-vl-nodes .nad-overvoltage {animation: node-over-blink 3s infinite}\n",
       ".nad-vl-nodes .nad-undervoltage {animation: node-under-blink 3s infinite}\n",
       "\n",
       "@keyframes line-blink {\n",
       "  0%, 80%, 100% {stroke: var(--nad-vl-color, black); stroke-width: 5}\n",
       "  40% {stroke: #FFEB3B; stroke-width: 15}\n",
       "}\n",
       "@keyframes node-over-blink {\n",
       "  0%, 80%, 100% {stroke: white; stroke-width: 0}\n",
       "  40% {stroke: #ff5722; stroke-width: 15}\n",
       "}\n",
       "@keyframes node-under-blink {\n",
       "  0%, 80%, 100% {stroke: white; stroke-width: 0}\n",
       "  40% {stroke: #00BCD4; stroke-width: 15}\n",
       "}\n",
       "]]></style>\n",
       "    <metadata>\n",
       "        <nad:nad xmlns:nad=\"http://www.powsybl.org/schema/nad-metadata/1_0\">\n",
       "            <nad:busNodes>\n",
       "                <nad:busNode svgId=\"1\" equipmentId=\"NE_poste_0\"/>\n",
       "                <nad:busNode svgId=\"3\" equipmentId=\"NO_poste_0\"/>\n",
       "                <nad:busNode svgId=\"5\" equipmentId=\"N_poste_0\"/>\n",
       "                <nad:busNode svgId=\"7\" equipmentId=\"SE_poste_0\"/>\n",
       "                <nad:busNode svgId=\"9\" equipmentId=\"SO_poste_0\"/>\n",
       "                <nad:busNode svgId=\"11\" equipmentId=\"S_poste_0\"/>\n",
       "            </nad:busNodes>\n",
       "            <nad:nodes>\n",
       "                <nad:node svgId=\"0\" equipmentId=\"NE_poste\" x=\"-34.89\" y=\"-232.08\"/>\n",
       "                <nad:node svgId=\"2\" equipmentId=\"NO_poste\" x=\"-301.17\" y=\"22.83\"/>\n",
       "                <nad:node svgId=\"4\" equipmentId=\"N_poste\" x=\"-409.07\" y=\"-324.59\"/>\n",
       "                <nad:node svgId=\"6\" equipmentId=\"SE_poste\" x=\"265.98\" y=\"89.88\"/>\n",
       "                <nad:node svgId=\"8\" equipmentId=\"SO_poste\" x=\"-17.44\" y=\"321.85\"/>\n",
       "                <nad:node svgId=\"10\" equipmentId=\"S_poste\" x=\"308.62\" y=\"476.99\"/>\n",
       "            </nad:nodes>\n",
       "            <nad:edges>\n",
       "                <nad:edge svgId=\"12\" equipmentId=\"NE_N_1\" node1=\"0\" node2=\"4\"/>\n",
       "                <nad:edge svgId=\"13\" equipmentId=\"NE_N_2\" node1=\"0\" node2=\"4\"/>\n",
       "                <nad:edge svgId=\"14\" equipmentId=\"SE_NE_1\" node1=\"6\" node2=\"0\"/>\n",
       "                <nad:edge svgId=\"15\" equipmentId=\"SE_NE_2\" node1=\"6\" node2=\"0\"/>\n",
       "                <nad:edge svgId=\"16\" equipmentId=\"NE_NO_1\" node1=\"0\" node2=\"2\"/>\n",
       "                <nad:edge svgId=\"17\" equipmentId=\"NO_N_1\" node1=\"2\" node2=\"4\"/>\n",
       "                <nad:edge svgId=\"18\" equipmentId=\"NO_N_2\" node1=\"2\" node2=\"4\"/>\n",
       "                <nad:edge svgId=\"19\" equipmentId=\"SO_NO_1\" node1=\"8\" node2=\"2\"/>\n",
       "                <nad:edge svgId=\"20\" equipmentId=\"SO_NO_2\" node1=\"8\" node2=\"2\"/>\n",
       "                <nad:edge svgId=\"21\" equipmentId=\"S_SE_1\" node1=\"10\" node2=\"6\"/>\n",
       "                <nad:edge svgId=\"22\" equipmentId=\"S_SE_2\" node1=\"10\" node2=\"6\"/>\n",
       "                <nad:edge svgId=\"23\" equipmentId=\"HVDC1\" node1=\"8\" node2=\"6\"/>\n",
       "                <nad:edge svgId=\"24\" equipmentId=\"HVDC2\" node1=\"8\" node2=\"6\"/>\n",
       "                <nad:edge svgId=\"25\" equipmentId=\"S_SO_1\" node1=\"10\" node2=\"8\"/>\n",
       "                <nad:edge svgId=\"26\" equipmentId=\"S_SO_2\" node1=\"10\" node2=\"8\"/>\n",
       "            </nad:edges>\n",
       "        </nad:nad>\n",
       "    </metadata>\n",
       "    <g class=\"nad-vl-nodes\">\n",
       "        <g transform=\"translate(-34.89,-232.08)\" id=\"0\">\n",
       "            <circle r=\"27.50\" id=\"1\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "        <g transform=\"translate(-301.17,22.83)\" id=\"2\">\n",
       "            <circle r=\"27.50\" id=\"3\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "        <g transform=\"translate(-409.07,-324.59)\" id=\"4\">\n",
       "            <circle r=\"27.50\" id=\"5\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "        <g transform=\"translate(265.98,89.88)\" id=\"6\">\n",
       "            <circle r=\"27.50\" id=\"7\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "        <g transform=\"translate(-17.44,321.85)\" id=\"8\">\n",
       "            <circle r=\"27.50\" id=\"9\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "        <g transform=\"translate(308.62,476.99)\" id=\"10\">\n",
       "            <circle r=\"27.50\" id=\"11\" class=\"nad-vl300to500-0 nad-busnode\"/>\n",
       "        </g>\n",
       "    </g>\n",
       "    <g class=\"nad-branch-edges\">\n",
       "        <g id=\"12\">\n",
       "            <g id=\"12.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-54.71,-251.14 -92.55,-287.53 -212.38,-317.16\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-121.67,-294.73)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-76.11)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-346.11)\" x=\"-19.00\" style=\"text-anchor:end\">-48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"12.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-382.65,-332.22 -332.22,-346.79 -212.38,-317.16\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-303.09,-339.59)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(103.89)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(13.89)\" x=\"19.00\">48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"13\">\n",
       "            <g id=\"13.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-61.31,-224.44 -111.75,-209.87 -231.58,-239.50\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-140.87,-217.07)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-76.11)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-346.11)\" x=\"-19.00\" style=\"text-anchor:end\">-48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"13.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-389.25,-305.52 -351.42,-269.13 -231.58,-239.50\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-322.29,-261.93)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(103.89)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(13.89)\" x=\"19.00\">48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"14\">\n",
       "            <g id=\"14.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"259.76,63.09 247.90,11.95 144.77,-98.41\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(227.42,-9.97)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-43.06)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-313.06)\" x=\"-19.00\" style=\"text-anchor:end\">-96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"14.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-8.58,-224.06 41.64,-208.77 144.77,-98.41\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(62.12,-186.85)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(136.94)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(46.94)\" x=\"19.00\">96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"15\">\n",
       "            <g id=\"15.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"239.67,81.87 189.45,66.57 86.32,-43.79\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(168.97,44.65)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-43.06)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-313.06)\" x=\"-19.00\" style=\"text-anchor:end\">-96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"15.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-28.68,-205.29 -16.81,-154.14 86.32,-43.79\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(3.67,-132.23)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(136.94)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(46.94)\" x=\"19.00\">96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"16\">\n",
       "            <g id=\"16.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-54.76,-213.06 -146.36,-125.37\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-78.23,-190.59)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-133.75)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-43.75)\" x=\"-19.00\" style=\"text-anchor:end\">-96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"16.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-281.31,3.81 -189.70,-83.88\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-257.83,-18.66)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(46.25)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-43.75)\" x=\"19.00\">96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g class=\"nad-glued-center\">\n",
       "                <circle class=\"nad-vl300to500-line nad-winding\" cx=\"-160.81\" cy=\"-111.54\" r=\"20.00\"/>\n",
       "                <circle class=\"nad-vl300to500-line nad-winding\" cx=\"-175.26\" cy=\"-97.71\" r=\"20.00\"/>\n",
       "                <path d=\"M60.00,0 0,60.00 M52.00,0 60.00,0 60.00,8.00\" transform=\"matrix(-0.72,0.69,-0.69,-0.72,-125.62,-103.70)\" class=\"nad-pst-arrow\"/>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"17\">\n",
       "            <g id=\"17.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-295.11,-4.00 -283.52,-55.20 -316.92,-162.74\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-292.42,-83.85)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-17.25)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-287.25)\" x=\"-19.00\" style=\"text-anchor:end\">48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"17.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-388.88,-305.92 -350.32,-270.29 -316.92,-162.74\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-341.43,-241.64)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(162.75)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(72.75)\" x=\"19.00\">-48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"18\">\n",
       "            <g id=\"18.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-321.37,4.16 -359.92,-31.47 -393.32,-139.02\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-368.82,-60.12)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-17.25)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-287.25)\" x=\"-19.00\" style=\"text-anchor:end\">48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"18.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-415.14,-297.76 -426.72,-246.56 -393.32,-139.02\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-417.83,-217.91)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(162.75)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(72.75)\" x=\"19.00\">-48</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"19\">\n",
       "            <g id=\"19.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-23.86,295.11 -36.11,244.06 -130.29,144.81\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-56.76,222.30)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-43.50)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-313.50)\" x=\"-19.00\" style=\"text-anchor:end\">96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"19.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-274.81,30.64 -224.47,45.55 -130.29,144.81\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-203.82,67.31)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(136.50)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(46.50)\" x=\"19.00\">-96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"20\">\n",
       "            <g id=\"20.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-43.81,314.04 -94.14,299.13 -188.32,199.87\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(-114.79,277.37)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-43.50)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-313.50)\" x=\"-19.00\" style=\"text-anchor:end\">96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"20.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-294.75,49.57 -282.50,100.62 -188.32,199.87\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(-261.85,122.38)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(136.50)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(46.50)\" x=\"19.00\">-96</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"21\">\n",
       "            <g id=\"21.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"319.68,451.82 340.80,403.75 327.06,279.06\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(337.51,373.93)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-6.29)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-276.29)\" x=\"-19.00\" style=\"text-anchor:end\">144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"21.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"282.25,112.05 313.33,154.36 327.06,279.06\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(316.61,184.18)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(173.71)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(83.71)\" x=\"19.00\">-144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"22\">\n",
       "            <g id=\"22.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"292.35,454.83 261.28,412.51 247.54,287.82\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(257.99,382.69)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-6.29)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-276.29)\" x=\"-19.00\" style=\"text-anchor:end\">144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"22.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"254.92,115.06 233.81,163.12 247.54,287.82\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(237.09,192.94)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(173.71)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(83.71)\" x=\"19.00\">-144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"23\" class=\"nad-hvdc-edge\">\n",
       "            <g id=\"23.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"9.70,317.41 61.51,308.93 149.61,236.82\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(84.72,289.92)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(50.70)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-39.30)\" x=\"19.00\">0</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"23.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"256.26,115.60 237.70,164.71 149.61,236.82\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(214.49,183.72)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-129.30)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-39.30)\" x=\"-19.00\" style=\"text-anchor:end\">0</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g class=\"nad-glued-center\">\n",
       "                <polyline points=\"122.52,258.99 176.69,214.65\" class=\"nad-hvdc\"/>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"24\" class=\"nad-hvdc-edge\">\n",
       "            <g id=\"24.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"-7.72,296.13 10.84,247.02 98.93,174.91\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(34.05,228.02)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(50.70)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-39.30)\" x=\"19.00\">0</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"24.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"238.84,94.32 187.03,102.81 98.93,174.91\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(163.82,121.81)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(-129.30)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-39.30)\" x=\"-19.00\" style=\"text-anchor:end\">0</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g class=\"nad-glued-center\">\n",
       "                <polyline points=\"71.85,197.08 126.02,152.74\" class=\"nad-hvdc\"/>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"25\">\n",
       "            <g id=\"25.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"293.03,454.34 263.25,411.11 162.78,363.30\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(236.16,398.22)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-64.56)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-334.56)\" x=\"-19.00\" style=\"text-anchor:end\">-144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"25.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"9.97,319.67 62.31,315.50 162.78,363.30\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(89.40,328.39)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(115.44)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(25.44)\" x=\"19.00\">144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "        <g id=\"26\">\n",
       "            <g id=\"26.1\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-1\" points=\"281.21,479.18 228.88,483.35 128.41,435.54\"/>\n",
       "                <g class=\"nad-glued-1 nad-edge-infos\" transform=\"translate(201.79,470.46)\">\n",
       "                    <g class=\"nad-active nad-state-in\">\n",
       "                        <g transform=\"rotate(-64.56)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(-334.56)\" x=\"-19.00\" style=\"text-anchor:end\">-144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "            <g id=\"26.2\" class=\"nad-vl300to500-line\">\n",
       "                <polyline class=\"nad-edge-path nad-stretchable nad-glued-2\" points=\"-1.84,344.50 27.94,387.74 128.41,435.54\"/>\n",
       "                <g class=\"nad-glued-2 nad-edge-infos\" transform=\"translate(55.03,400.63)\">\n",
       "                    <g class=\"nad-active nad-state-out\">\n",
       "                        <g transform=\"rotate(115.44)\">\n",
       "                            <path class=\"nad-arrow-in\" transform=\"scale(10.00)\" d=\"M-1 -1 H1 L0 1z\"/>\n",
       "                            <path class=\"nad-arrow-out\" transform=\"scale(10.00)\" d=\"M-1 1 H1 L0 -1z\"/>\n",
       "                        </g>\n",
       "                        <text transform=\"rotate(25.44)\" x=\"19.00\">144</text>\n",
       "                    </g>\n",
       "                </g>\n",
       "            </g>\n",
       "        </g>\n",
       "    </g>\n",
       "    <g class=\"nad-text-edges\">\n",
       "        <polyline id=\"0-textedge\" points=\"-5.22,-236.53 65.11,-247.08\"/>\n",
       "        <polyline id=\"2-textedge\" points=\"-271.50,18.38 -201.17,7.83\"/>\n",
       "        <polyline id=\"4-textedge\" points=\"-379.41,-329.04 -309.07,-339.59\"/>\n",
       "        <polyline id=\"6-textedge\" points=\"295.65,85.43 365.98,74.88\"/>\n",
       "        <polyline id=\"8-textedge\" points=\"12.23,317.40 82.56,306.85\"/>\n",
       "        <polyline id=\"10-textedge\" points=\"338.29,472.54 408.62,461.99\"/>\n",
       "    </g>\n",
       "    <g class=\"nad-text-nodes\">\n",
       "        <foreignObject id=\"0-textnode\" y=\"-272.08\" x=\"65.11\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>NE_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / -0.0°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "        <foreignObject id=\"2-textnode\" y=\"-17.17\" x=\"-201.17\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>NO_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / 0.0°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "        <foreignObject id=\"4-textnode\" y=\"-364.59\" x=\"-309.07\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>N_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / -0.0°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "        <foreignObject id=\"6-textnode\" y=\"49.88\" x=\"365.98\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>SE_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / -0.1°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "        <foreignObject id=\"8-textnode\" y=\"281.85\" x=\"82.56\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>SO_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / 0.0°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "        <foreignObject id=\"10-textnode\" y=\"436.99\" x=\"408.62\" height=\"1\" width=\"1\">\n",
       "            <div xmlns=\"http://www.w3.org/1999/xhtml\" class=\"nad-label-box\">\n",
       "                <div>S_poste</div>\n",
       "                <table>\n",
       "                    <tr>\n",
       "                        <td>\n",
       "                            <div class=\"nad-vl300to500-0 nad-legend-square\"/>\n",
       "                        </td>\n",
       "                        <td>380.0 kV / -0.0°</td>\n",
       "                    </tr>\n",
       "                </table>\n",
       "            </div>\n",
       "        </foreignObject>\n",
       "    </g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<pypowsybl.network.impl.svg.Svg at 0x7f4d4c64d520>"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n6.get_network_area_diagram()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 1 - The sensitivity analysis"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To perform a sensitivity analysis, the first thing to do is define the “factors” you want to compute. \n",
    "What we call a factor is the impact of a small variation of a variable, typically the active power injection of a generator, a load or a phase shifter, on a function, typically the active power flow on a branch.\n",
    "\n",
    "To make the definition of those factors easier, `pypowsybl` provides a method to define the variables (injection, phase shifter) through their ids (variables_ids) and the functions through the branch ids (branches_ids). We obtain a matrix of sensitivities as a result.\n",
    "First, let's create the analysis:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "analysis = pp.sensitivity.create_dc_analysis()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now let's create the factors. We are going to study the impact on the active power flow of `S_SO_1` and `S_SO_2` of a variation of the active power injection of the generator `SE_G`.\n",
    "`S_SO_1` and `S_SO_2` are the two lines connecting the substations `S` and `SO` and `SE_G` is the generator in the substation `SE`.\n",
    "To define these factors, you just need to give their IDs to the creation function like this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "analysis.add_branch_flow_factor_matrix(branches_ids=['S_SO_1', 'S_SO_2'], variables_ids=['SE_G'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now you can run the analysis with:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "result = analysis.run(n6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's examine the results of the sensitivity analysis. First, we can have a look at the reference matrix. It contains the flows on the previously defined branches according to the load flow."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>S_SO_1</th>\n",
       "      <th>S_SO_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>reference_values</th>\n",
       "      <td>-120.433341</td>\n",
       "      <td>-120.433341</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      S_SO_1      S_SO_2\n",
       "reference_values -120.433341 -120.433341"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.get_reference_matrix()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, we can look at the sensitivity matrix, which shows how the active power flow of the two lines changes when the generator's active power changes."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>S_SO_1</th>\n",
       "      <th>S_SO_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>SE_G</th>\n",
       "      <td>0.26087</td>\n",
       "      <td>0.26087</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       S_SO_1   S_SO_2\n",
       "SE_G  0.26087  0.26087"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result.get_sensitivity_matrix()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "An increase of 1 MW on generator `SE_G` has the effect of increasing the active power flow from side 1 to side 2 by 0.26 MW on the lines `S_SO_1` and `S_SO_2`."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2 - Zone to zone sensitivity: PTDF computation"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This zone-to-zone sensitivity feature is also known as Power Transfer Distribution Factor, or PTDF for short.\n",
    "\n",
    "Now, imagine that the node `SE`, is in Italy and the other nodes are in France. \n",
    "We can update the `TSO` and `country` field of the substations."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "n6b = pp.network.create_metrix_tutorial_six_buses_network()\n",
    "n6b.update_substations(id=['SE'], TSO=['Terna'], country=['IT'])\n",
    "n6b.update_substations(id=['NO', 'S', 'SO', 'N'], TSO=['RTE', 'RTE', 'RTE', 'RTE'], country=['FR', 'FR', 'FR', 'FR'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can run a load flow:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[ComponentResult(connected_component_num=0, synchronous_component_num=0, status=CONVERGED, status_text=Converged, iteration_count=0, reference_bus_id='NE_poste_0', slack_bus_results=[SlackBusResult(id='NE_poste_0', active_power_mismatch=4.440892098500626e-14)], distributed_active_power=nan)]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pp.loadflow.run_dc(n6b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the dataframe with the substation information, the `TSO` and `country` columns are now filled."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>name</th>\n",
       "      <th>TSO</th>\n",
       "      <th>geo_tags</th>\n",
       "      <th>country</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>id</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>NO</th>\n",
       "      <td></td>\n",
       "      <td>RTE</td>\n",
       "      <td></td>\n",
       "      <td>FR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>S</th>\n",
       "      <td></td>\n",
       "      <td>RTE</td>\n",
       "      <td></td>\n",
       "      <td>FR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SO</th>\n",
       "      <td></td>\n",
       "      <td>RTE</td>\n",
       "      <td></td>\n",
       "      <td>FR</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>SE</th>\n",
       "      <td></td>\n",
       "      <td>Terna</td>\n",
       "      <td></td>\n",
       "      <td>IT</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>N</th>\n",
       "      <td></td>\n",
       "      <td>RTE</td>\n",
       "      <td></td>\n",
       "      <td>FR</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   name    TSO geo_tags country\n",
       "id                             \n",
       "NO         RTE               FR\n",
       "S          RTE               FR\n",
       "SO         RTE               FR\n",
       "SE       Terna               IT\n",
       "N          RTE               FR"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "n6b.get_substations()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can create two zones for the sensitivity analysis: one for France and one for Italy:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "<enum 'ZoneKeyType'>\n",
      "<enum 'ZoneKeyType'>\n",
      "True\n",
      "<enum 'ZoneKeyType'>\n",
      "<enum 'ZoneKeyType'>\n",
      "True\n"
     ]
    }
   ],
   "source": [
    "zone_fr = pp.sensitivity.create_country_zone(n6b, 'FR')\n",
    "zone_it = pp.sensitivity.create_country_zone(n6b, 'IT')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can examine the shift keys for the zone representing France. They're linked to the active power setpoint of the generators:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'SO_G1': 480.0, 'SO_G2': 480.0, 'N_G': 0.0}"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "zone_fr.shift_keys_by_injections_ids"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let's create the analysis and set the zones to the two we previously declared."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "params = pp.loadflow.Parameters(distributed_slack=False)\n",
    "sa = pp.sensitivity.create_dc_analysis()\n",
    "sa.set_zones([zone_fr, zone_it])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "And we can create the factor matrix again. This time, we're looking at how changing the net position of the two zones, `FR` and `IT`, affects the active power flow of the lines `S_SE_1` and `S_SE_2`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "sa.add_branch_flow_factor_matrix(branches_ids=['S_SE_1', 'S_SE_2'], variables_ids=['FR', 'IT'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can run the analysis and get the sensitivity matrix."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>S_SE_1</th>\n",
       "      <th>S_SE_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>FR</th>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>IT</th>\n",
       "      <td>-0.1</td>\n",
       "      <td>-0.1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    S_SE_1  S_SE_2\n",
       "FR     0.2     0.2\n",
       "IT    -0.1    -0.1"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ptdf_results = sa.run(n6b, params)\n",
    "m1 = ptdf_results.get_branch_flows_sensitivity_matrix()\n",
    "m1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Transferring 1 MW of active power from the zone `FR` to the zone `IT` will cause a 0.3 MW shift on border line `S_SE_1`.\n",
    "\n",
    "Let’s obtain that directly. After running a sensitivity analysis to figure out the best zones, we can request a `FR` zone to slack sensitivity, a `FR` to `IT` zone to zone sensitivity, an `IT` to `FR` zone to zone sensitivity, and an `IT` zone to slack sensitivity on all the border lines `S_SE_1`, `S_SE_2`, `SE_NE_1` and `SE_NE_2`."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [],
   "source": [
    "sa = pp.sensitivity.create_dc_analysis()\n",
    "sa.set_zones([zone_fr, zone_it])\n",
    "sa.add_branch_flow_factor_matrix(branches_ids=['S_SE_1', 'S_SE_2', 'SE_NE_1', 'SE_NE_2'], variables_ids=['FR', ('FR', 'IT'), ('IT', 'FR'), 'IT'])\n",
    "ptdf_result = sa.run(n6b, params)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>S_SE_1</th>\n",
       "      <th>S_SE_2</th>\n",
       "      <th>SE_NE_1</th>\n",
       "      <th>SE_NE_2</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>FR</th>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>FR -&gt; IT</th>\n",
       "      <td>0.3</td>\n",
       "      <td>0.3</td>\n",
       "      <td>-0.2</td>\n",
       "      <td>-0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>IT -&gt; FR</th>\n",
       "      <td>-0.3</td>\n",
       "      <td>-0.3</td>\n",
       "      <td>0.2</td>\n",
       "      <td>0.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>IT</th>\n",
       "      <td>-0.1</td>\n",
       "      <td>-0.1</td>\n",
       "      <td>0.4</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          S_SE_1  S_SE_2  SE_NE_1  SE_NE_2\n",
       "FR           0.2     0.2      0.2      0.2\n",
       "FR -> IT     0.3     0.3     -0.2     -0.2\n",
       "IT -> FR    -0.3    -0.3      0.2      0.2\n",
       "IT          -0.1    -0.1      0.4      0.4"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m2 = ptdf_result.get_branch_flows_sensitivity_matrix()\n",
    "m2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We can see that:\n",
    "- an increase of 1 MW on the `FR` zone net position leads to an increase of 0.2 MW on the flow of all the border lines.\n",
    "- moving the flow of 1 MW from `FR` to `IT` leads to an increase of 0.3 MW on the flow of lines `S_SE_1` and `S_SE_2` and a decrease of 0.2 MW on the flow of lines `SE_NE_1` and `SE_NE_2`.\n",
    "- moving the flow of 1 MW from `IT` to `FR` leads to a decrease of 0.3 MW on the flow of lines `S_SE_1` and `S_SE_2` and an increase of 0.2 MW on the flow of lines `SE_NE_1` and `SE_NE_2`.\n",
    "- an increase of 1 MW on the `IT` zone net position leads to a decrease of 0.1 MW on the flow of lines `S_SE_1` and `S_SE_2` and an increase of 0.4 MW on the flow of lines `SE_NE_1` and `SE_NE_2`."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "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.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}