{
"cells": [
{
"cell_type": "markdown",
"id": "503044a0",
"metadata": {},
"source": [
"(junction-example)=\n",
"# Junctions and junction gates"
]
},
{
"cell_type": "markdown",
"id": "6ebb198f",
"metadata": {},
"source": [
"This example illustrates how simple tunnel junctions can be modelled with the [](tunnel) object, and can be an illustrative guide for how to replace the old [](junction) and [](junction_gate) objects in existing SHOP datasets.\n",
"\n",
"The model setup for this example is available in the following format:\n",
"- pyshop\n",
" - [](junction_model.py)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "62421cf5",
"metadata": {},
"outputs": [],
"source": [
"#Necessary imports used in all examples\n",
"import pandas as pd\n",
"import plotly.graph_objects as go\n",
"from pyshop import ShopSession\n",
"\n",
"#Functions used in this example for building a basic SHOP model and running it\n",
"from junction_model import build_model, run_model"
]
},
{
"cell_type": "markdown",
"id": "87527778",
"metadata": {},
"source": [
"## Run a simple junction model\n",
"\n",
"First we build a new model with one [](plant) below two [reservoirs](reservoir) connected with three [tunnels](tunnel). Note that the main tunnel of the plant is explicitly modelled as a tunnel object, and the [main_loss](plant:main_loss) of the plant is therefore set to zero."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "36b8a273",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"shop = ShopSession()\n",
"build_model(shop)\n",
"shop.model.build_connection_tree()"
]
},
{
"cell_type": "markdown",
"id": "76f0f618",
"metadata": {},
"source": [
"The basic junction model is optimized and the objective function is saved for later comparison."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "209dd383",
"metadata": {},
"outputs": [],
"source": [
"run_model(shop)\n",
"objective_junction = -shop.model.objective.average_objective.grand_total.get()"
]
},
{
"cell_type": "markdown",
"id": "b43d699b",
"metadata": {},
"source": [
"The plots below show the [reservoir level](reservoir:head) of both reservoirs and the [tunnel flow](tunnel:flow) in all three tunnels. There is only equalizing flow between the two reservoirs in the beginning with no flow through the power station. Then the power station is turned on by the end of the optimization period and draws water from both reservoirs. Reservoir2 is completely drained by the end of the optimization horizon, while Reservoir1 still has water left. The market price is high compared to the water value of the reservoirs, so this behaviour is expected."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "dae009a1",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"name": "Reservoir1",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
97.0,
97.14862491645525,
97.23814424165505,
97.27774811412802,
97.2857385110585,
97.28572559817957,
97.28584434114184,
97.28565430774974,
97.28551801831301,
97.28565827615532,
97.28588484354613,
97.28599091056041,
97.2856213221365,
97.28572659507162,
97.28563085350429,
96.96998389422352,
96.57552832990888,
96.2053967480998,
95.85383002630077,
95.5167177485012,
95.19102019899212,
94.87443250971589,
94.56517488892597,
94.26185415144577,
93.9633683447406
]
},
{
"line": {
"dash": "dash"
},
"name": "Reservoir1 lrl",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0
]
},
{
"name": "Reservoir2",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
97.5,
97.38853131265856,
97.32139181875871,
97.29168891440399,
97.28569611670613,
97.28570580136532,
97.28561674414362,
97.2857592691877,
97.28586148626523,
97.28575629288352,
97.28558636734041,
97.28550681707969,
97.28578400839763,
97.28570505369629,
97.28577685987179,
97.14408211325686,
96.9497794342353,
96.73759306705558,
96.51183272624462,
96.2755725107388,
96.03108466297635,
95.78009142892994,
95.52392226651045,
95.26361755699644,
95.0
]
},
{
"line": {
"dash": "dash"
},
"name": "Reservoir2 lrl",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0
]
}
],
"layout": {
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"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"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
}
],
"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"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"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"
}
],
"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"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"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"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"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": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Reservoir level"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"name": "Tunnel1",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
-20.642349507673885,
-12.433239611082115,
-5.500537843468479,
-1.109777351454511,
0.0017934554051350915,
-0.016492078093136797,
0.026393526681374624,
0.01892908843339569,
-0.019480255874583463,
-0.03146769316774112,
-0.014731529762627815,
0.05133172554360499,
-0.01462124098893014,
0.013297439907290709,
43.83985545566247,
54.78549504369968,
51.40716414014917,
48.828711360976996,
46.82114969438574,
45.23577076515001,
43.97051239947586,
42.95244733193438,
42.12788020558088,
41.45636204238572
]
},
{
"name": "Tunnel2",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
20.642349507673927,
12.433239611082115,
5.500537843468479,
1.1097773514544826,
-0.0017934554051350915,
0.016492078093136797,
-0.026393526681403046,
-0.01892908843339569,
0.019480255874583463,
0.03146769316774112,
0.014731529762627815,
-0.05133172554360499,
0.01462124098893014,
-0.013297439907262287,
26.239767891652477,
35.98197759658544,
39.29377169994645,
41.807470520551036,
43.751891760336946,
45.27552736341488,
46.4802285271154,
47.43873378138619,
48.204575835927564,
48.81806611045186
]
},
{
"name": "Tunnel_main",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
70.07962334731495,
90.76747264028512,
90.70093584009561,
90.63618188152807,
90.5730414547227,
90.5112981285649,
90.4507409265913,
90.39118111332058,
90.33245604150841,
90.27442815283754
]
}
],
"layout": {
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"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"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
}
],
"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"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"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"
}
],
"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"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"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"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"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": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Tunnel flow"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = go.Figure()\n",
"for rsv in shop.model.reservoir:\n",
" name = rsv.get_name()\n",
" level = rsv.head.get()\n",
" lrl = rsv.lrl.get()\n",
" fig.add_trace(go.Scatter(x=level.index, y=level.values, name=name))\n",
" fig.add_trace(go.Scatter(x=level.index, y=[lrl]*len(level),name=name+\" lrl\", line={\"dash\":\"dash\"}))\n",
" \n",
"fig.update_layout(title=\"Reservoir level\")\n",
"fig.show()\n",
"\n",
"fig = go.Figure()\n",
"for t in shop.model.tunnel:\n",
" name = t.get_name()\n",
" flow = t.flow.get()\n",
" fig.add_trace(go.Scatter(x=flow.index, y=flow.values, name=name))\n",
"fig.update_layout(title=\"Tunnel flow\")\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"id": "ef830cd8",
"metadata": {},
"source": [
"## Optimizing a binary gate in the junction\n",
"\n",
"The same model is built again, but now a binary gate is added to Tunnel2. The [gate_opening_curve](tunnel:gate_opening_curve) and [initial_opening](tunnel:initial_opening) are the only required input for defining a binary gate. If the gate can be operated in a continuous fashion, the [continuous_gate](tunnel:continuous_gate) identifier can be set on the tunnel. Note that optimizing the gate position of binary gates can be a computationally heavy task, even for relatively simple systems. Continuous gates do not come with the same computational complexity, but the solution could be prone to flipping between similar states from one SHOP iteration to the next. Adding a [gate_adjustment_cost](tunnel:gate_adjustment_cost) will penalize the change of gate position from one time step to the next, and could help reduce calculation time for binary gates and the flipping of solutions for continuous gates, though its effectiveness is case-dependent. Another trick could be to set the CPLEX parameter \"MIP Emphasis switch\" (id 2058) to focus on creating a tighter best bound of the MIP solution (value 3). This is sometimes beneficial in gate optimization problems, and can be set with the generic [cplex_int_params](global_settings:cplex_int_params) attribute on the [](global_settings) object.\n",
"\n",
"The old [](junction_gate) object did not allow for optimizing the gate position but relied on gate schedules as input to decide which tunnel arms were open and closed. This can also be done for tunnels with gates by setting the [gate_opening_schedule](tunnel:gate_opening_schedule) attribute, which will avoid the computational problems that comes with optimizing the gate position."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "6f4a240e",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Improved net income when optimizing junction gate: 2591.10€\n"
]
}
],
"source": [
"shop = ShopSession()\n",
"build_model(shop)\n",
"\n",
"t2 = shop.model.tunnel[\"Tunnel2\"]\n",
"t2.gate_opening_curve.set(pd.Series([0,1], index=[0,1]))\n",
"t2.initial_opening.set(1)\n",
"\n",
"#Set mip emphasis to focus on tightening the best bound of the solution\n",
"gs = shop.model.global_settings.global_settings\n",
"gs.cplex_int_params.set(pd.Series([3],index=[2058]))\n",
"\n",
"run_model(shop)\n",
"objective_junc_gate = -shop.model.objective.average_objective.grand_total.get()\n",
"\n",
"print(f\"Improved net income when optimizing junction gate: {objective_junc_gate - objective_junction:.2f}€\")"
]
},
{
"cell_type": "markdown",
"id": "74e8abf2",
"metadata": {},
"source": [
"Allowing the gate on the tunnel between Reservoir2 and the junction to be opened and closed improved the objective function, as expected. The plant can now increase the amount of power produced by running for several additional hours in the beginning of the optimization. When Reservoir2 is completely drained, the gate is closed so that the plant can continue to drain Reservoir1. Both reservoirs are completely drained by the end of the optimization, unlike the first run without any gate control."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "d225bbcd",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"name": "Reservoir1",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
97.0,
96.70817059342107,
96.36205987042726,
96.02914044365677,
95.70669197421817,
95.39261978683274,
95.0853147435986,
94.7835039390165,
94.48617701356117,
94.19252610296908,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.9019014830794,
93.2538038525752,
92.6058038525752,
91.95780385257521,
91.3098038525752,
90.6618038525752,
90.01380385257521
]
},
{
"line": {
"dash": "dash"
},
"name": "Reservoir1 lrl",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0,
90.0
]
},
{
"name": "Reservoir2",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
97.5,
97.29346114209261,
97.06305859863782,
96.82310097073105,
96.57562141763843,
96.32218492967314,
96.06399335194645,
95.80199714874733,
95.5369505701123,
95.26945657510146,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0
]
},
{
"line": {
"dash": "dash"
},
"name": "Reservoir2 lrl",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00",
"2024-02-02T00:00:00"
],
"y": [
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0,
95.0
]
}
],
"layout": {
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"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"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
}
],
"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"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"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"
}
],
"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"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"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"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"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": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Reservoir level"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"name": "Tunnel1",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
40.53186202485119,
48.07093374914006,
46.238809273678825,
44.7845096442497,
43.62113713686537,
42.68125600474158,
41.91816730306985,
41.295406313239276,
40.7848486933465,
40.3645305402352,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
90.01355979224827,
90.0,
90.0,
90.0,
90.0,
90.0
]
},
{
"name": "Tunnel2",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
38.247936649517236,
42.667137676811144,
44.43659776051318,
45.82954686900461,
46.932682956533995,
47.81325513457382,
48.51781540724494,
49.08269974722826,
49.53592500200667,
49.899365759529175,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
},
{
"name": "Tunnel_main",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
78.7797986743684,
90.73807142595119,
90.67540703419203,
90.61405651325437,
90.55382009339937,
90.4945111393153,
90.43598271031482,
90.37810606046757,
90.32077369535315,
90.26389629976438,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
90.01355979224829,
90.0,
90.0,
90.0,
90.0,
90.0
]
}
],
"layout": {
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"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"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
}
],
"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"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"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"
}
],
"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"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"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"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"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": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Tunnel flow"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"name": "Tunnel1",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0
]
},
{
"name": "Tunnel2",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
]
},
{
"name": "Tunnel_main",
"type": "scatter",
"x": [
"2024-02-01T00:00:00",
"2024-02-01T01:00:00",
"2024-02-01T02:00:00",
"2024-02-01T03:00:00",
"2024-02-01T04:00:00",
"2024-02-01T05:00:00",
"2024-02-01T06:00:00",
"2024-02-01T07:00:00",
"2024-02-01T08:00:00",
"2024-02-01T09:00:00",
"2024-02-01T10:00:00",
"2024-02-01T11:00:00",
"2024-02-01T12:00:00",
"2024-02-01T13:00:00",
"2024-02-01T14:00:00",
"2024-02-01T15:00:00",
"2024-02-01T16:00:00",
"2024-02-01T17:00:00",
"2024-02-01T18:00:00",
"2024-02-01T19:00:00",
"2024-02-01T20:00:00",
"2024-02-01T21:00:00",
"2024-02-01T22:00:00",
"2024-02-01T23:00:00"
],
"y": [
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0
]
}
],
"layout": {
"template": {
"data": {
"bar": [
{
"error_x": {
"color": "#2a3f5f"
},
"error_y": {
"color": "#2a3f5f"
},
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "bar"
}
],
"barpolar": [
{
"marker": {
"line": {
"color": "#E5ECF6",
"width": 0.5
},
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "barpolar"
}
],
"carpet": [
{
"aaxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"baxis": {
"endlinecolor": "#2a3f5f",
"gridcolor": "white",
"linecolor": "white",
"minorgridcolor": "white",
"startlinecolor": "#2a3f5f"
},
"type": "carpet"
}
],
"choropleth": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "choropleth"
}
],
"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"
}
],
"contourcarpet": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "contourcarpet"
}
],
"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"
}
],
"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"
}
],
"histogram": [
{
"marker": {
"pattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
}
},
"type": "histogram"
}
],
"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"
}
],
"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"
}
],
"mesh3d": [
{
"colorbar": {
"outlinewidth": 0,
"ticks": ""
},
"type": "mesh3d"
}
],
"parcoords": [
{
"line": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "parcoords"
}
],
"pie": [
{
"automargin": true,
"type": "pie"
}
],
"scatter": [
{
"fillpattern": {
"fillmode": "overlay",
"size": 10,
"solidity": 0.2
},
"type": "scatter"
}
],
"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"
}
],
"scatterpolar": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolar"
}
],
"scatterpolargl": [
{
"marker": {
"colorbar": {
"outlinewidth": 0,
"ticks": ""
}
},
"type": "scatterpolargl"
}
],
"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": "#E5ECF6",
"showlakes": true,
"showland": true,
"subunitcolor": "white"
},
"hoverlabel": {
"align": "left"
},
"hovermode": "closest",
"mapbox": {
"style": "light"
},
"paper_bgcolor": "white",
"plot_bgcolor": "#E5ECF6",
"polar": {
"angularaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"radialaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"scene": {
"xaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"yaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
},
"zaxis": {
"backgroundcolor": "#E5ECF6",
"gridcolor": "white",
"gridwidth": 2,
"linecolor": "white",
"showbackground": true,
"ticks": "",
"zerolinecolor": "white"
}
},
"shapedefaults": {
"line": {
"color": "#2a3f5f"
}
},
"ternary": {
"aaxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"baxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
},
"bgcolor": "#E5ECF6",
"caxis": {
"gridcolor": "white",
"linecolor": "white",
"ticks": ""
}
},
"title": {
"x": 0.05
},
"xaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
},
"yaxis": {
"automargin": true,
"gridcolor": "white",
"linecolor": "white",
"ticks": "",
"title": {
"standoff": 15
},
"zerolinecolor": "white",
"zerolinewidth": 2
}
}
},
"title": {
"text": "Tunnel gate opening"
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig = go.Figure()\n",
"for rsv in shop.model.reservoir:\n",
" name = rsv.get_name()\n",
" level = rsv.head.get()\n",
" lrl = rsv.lrl.get()\n",
" fig.add_trace(go.Scatter(x=level.index, y=level.values, name=name))\n",
" fig.add_trace(go.Scatter(x=level.index, y=[lrl]*len(level),name=name+\" lrl\", line={\"dash\":\"dash\"}))\n",
"\n",
"fig.update_layout(title=\"Reservoir level\")\n",
"fig.show()\n",
"\n",
"fig = go.Figure()\n",
"for t in shop.model.tunnel:\n",
" name = t.get_name()\n",
" flow = t.flow.get()\n",
" fig.add_trace(go.Scatter(x=flow.index, y=flow.values, name=name))\n",
"fig.update_layout(title=\"Tunnel flow\")\n",
"fig.show()\n",
"\n",
"fig = go.Figure()\n",
"for t in shop.model.tunnel:\n",
" name = t.get_name()\n",
" flow = t.gate_opening.get()\n",
" fig.add_trace(go.Scatter(x=flow.index, y=flow.values, name=name))\n",
"fig.update_layout(title=\"Tunnel gate opening\")\n",
"fig.show()"
]
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,md:myst",
"text_representation": {
"extension": ".md",
"format_name": "myst",
"format_version": 0.13,
"jupytext_version": "1.14.6"
}
},
"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.12.9"
},
"source_map": [
13,
17,
25,
33,
39,
43,
46,
49,
53,
72,
80,
96,
100
]
},
"nbformat": 4,
"nbformat_minor": 5
}