{ "cells": [ { "cell_type": "markdown", "id": "24a20e62", "metadata": { "Collapsed": "false" }, "source": [ "(individual-water-values)=\n", "# Individual water values\n", "\n", "The model setup for the three examples are available in the following formats:\n", "\n", "- pyshop\n", " - [](ind_wv.py)\n", "- YAML\n", " - [](model.yaml)\n", " - [](constant_energy_values.yaml)\n", " - [](constant_mixed_values.yaml)\n", " - [](water_value_tables.yaml)\n", "- ASCII\n", " - [](model.ascii)\n", " - [](constant_energy_values.ascii)\n", " - [](constant_mixed_values.ascii)\n", " - [](water_value_tables.ascii)\n", " \n", "\n", "The examples show how to use [constant water values](water-value-descriptions) (in €/Mm$^3$ and €/MWh) and water value tables to specify the end value of the end [](reservoir) contents in SHOP. A simple case with three reservoirs and two [plants](plant) is used to illustrate some of the relevant input and output for individual water values." ] }, { "cell_type": "code", "execution_count": 1, "id": "1492eff9", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "#Necessary imports used in all examples\n", "import pandas as pd\n", "import plotly.graph_objs as go\n", "from pyshop import ShopSession\n", "pd.options.plotting.backend = \"plotly\"\n", "\n", "#Functions used in this example for building a tunnel model, adding a gate to a tunnel and running the optimization\n", "from ind_wv import build_model, run_model" ] }, { "cell_type": "markdown", "id": "5b91e29d", "metadata": { "Collapsed": "false" }, "source": [ "## Constant water values in €/MWh\n", "The first example will use water (or energy) values specified in €/MWh for all of the three reservoirs (see figure below). The values are set with the attribute called [energy_value_input](reservoir:energy_value_input) in the API." ] }, { "cell_type": "code", "execution_count": 2, "id": "e723b6f2", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "image/svg+xml": [ "\n", "\n", "\n", "\n", "\n", "\n", "%3\n", "\n", "\n", "\n", "reservoir_Reservoir1\n", "\n", "Reservoir1\n", "\n", "\n", "\n", "gate_Flow_gate\n", "\n", "Flow_gate\n", "\n", "\n", "\n", "reservoir_Reservoir1->gate_Flow_gate\n", "\n", "\n", "\n", "\n", "reservoir_Reservoir2\n", "\n", "Reservoir2\n", "\n", "\n", "\n", "gate_Flow_gate->reservoir_Reservoir2\n", "\n", "\n", "\n", "\n", "plant_Plant1\n", "\n", "Plant1\n", "\n", "\n", "\n", "reservoir_Reservoir2->plant_Plant1\n", "\n", "\n", "\n", "\n", "reservoir_Reservoir3\n", "\n", "Reservoir3\n", "\n", "\n", "\n", "plant_Plant2\n", "\n", "Plant2\n", "\n", "\n", "\n", "reservoir_Reservoir3->plant_Plant2\n", "\n", "\n", "\n", "\n", "plant_Plant1->reservoir_Reservoir3\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#Create a standard ShopSession\n", "shop=ShopSession()\n", "#Build a simple model with three reservoirs and two plants.\n", "build_model(shop)\n", "#Display topology to the screen\n", "display(shop.model.build_connection_tree())\n", "\n", "#The three reservoir objects\n", "rsv1 = shop.model.reservoir.Reservoir1\n", "rsv2 = shop.model.reservoir.Reservoir2\n", "rsv3 = shop.model.reservoir.Reservoir3\n", "\n", "#In the first run we define the end value of the water in terms of €/MWh with the energy_value_input attribute\n", "rsv1.energy_value_input.set(31.0)\n", "rsv2.energy_value_input.set(30.0)\n", "rsv3.energy_value_input.set(20.0)\n", "\n", "#Optimize model by calling \"run_model\"\n", "run_model(shop)" ] }, { "cell_type": "markdown", "id": "f862d35b", "metadata": { "Collapsed": "false" }, "source": [ "The energy_value_input must be converted from €/MWh to €/Mm$^3$ by SHOP before it can be added to the objective function. This requires reservoir specific conversion factors that depend on the best point operation of the downstream plant. Note that energy_value_input is a local value relative to the downstream plant, which means that the *global* water value for each reservoir must be calculated after the conversion factors have been found. The global water value is calculated by summing up the local water values (in €/Mm$^3$) from the bottom of the watercourse and up. The calculated reservoir output attributes [energy_conversion_factor](reservoir:energy_conversion_factor) and [calc_global_water_value](reservoir:calc_global_water_value) that SHOP has used can be inspected after the first iteration of the optimization:" ] }, { "cell_type": "code", "execution_count": 3, "id": "80a9394c", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reservoir1 has an energy conversion factor of 583.001 MWh/Mm3\n", "Reservoir2 has an energy conversion factor of 583.001 MWh/Mm3\n", "Reservoir3 has an energy conversion factor of 205.225 MWh/Mm3\n", "\n", "Reservoir1 has a calculated global water value of 22177.52 €/Mm3\n", "Reservoir2 has a calculated global water value of 21594.52 €/Mm3\n", "Reservoir3 has a calculated global water value of 4104.50 €/Mm3\n", "\n", "Reservoir1 has a total value of 142379.66 € at 6.42 Mm3 and an average water value of 22177.52 €/Mm3\n", "Reservoir2 has a total value of 564889.09 € at 26.16 Mm3 and an average water value of 21594.52 €/Mm3\n", "Reservoir3 has a total value of 32520.56 € at 7.92 Mm3 and an average water value of 4104.50 €/Mm3\n", "\n" ] } ], "source": [ "#Print out the energy conversion factors for all reservoirs used in the conversion from €/MWh -> €/Mm3\n", "for rsv in shop.model.reservoir:\n", " print(f\"{rsv.get_name()} has an energy conversion factor of {rsv.energy_conversion_factor.get():.3f} MWh/Mm3\")\n", "print(\"\")\n", "\n", "#Print out the calculated global water value for all reservoirs.\n", "for rsv in shop.model.reservoir:\n", " print(f\"{rsv.get_name()} has a calculated global water value of {rsv.calc_global_water_value.get():.2f} €/Mm3\")\n", "print(\"\")\n", "\n", "#Optimization results for the total reservoir end values\n", "for rsv in shop.model.reservoir:\n", " end_val = -rsv.end_value.get().iloc[-1]\n", " end_vol = rsv.storage.get().iloc[-1]\n", " avrg_wv = end_val/(end_vol+10**(-10))\n", "\n", " print(f\"{rsv.get_name()} has a total value of {end_val:.2f} € at {end_vol:.2f} Mm3 and an average water value of {avrg_wv:.2f} €/Mm3\")\n", "print(\"\")" ] }, { "cell_type": "markdown", "id": "ec1a53a8", "metadata": { "Collapsed": "false" }, "source": [ "The energy_conversion_factor for Reservoir1 and Reservoir2 are identical since they are referred to the same downstream plant. Since there are no reservoirs below Reservoir3, the calc_global_water_value attribute is simply the product of the energy_value_input and energy_conversion_factor. Since the energy_value_input is relative to the downstream *plant* and not the first downstream reservoir, the global water value for both Reservoir1 and Reservoir2 is found by adding their respective local water values (energy_value_input$\\cdot$energy_conversion_factor) to the global water value of Reservoir3.\n", "\n", "The average water value, calculated by dividing the optimized end reservoir value by the end volume of each reservoir, gives the same result as the calculated global water value - as it should in a constant water value case!\n", "\n", "The storage volume, global output water value ([water_value_global_result](reservoir:water_value_global_result)), and local output energy value ([energy_value_local_result](reservoir:energy_value_local_result)) from the optimization results are shown in the plots below. The water_value_global_result is the dual value of the reservoir balance constraints, and are directly extracted from the optimization problem. These values are usually negative due to the way the constraints are modelled in SHOP. The energy_value_local_result attribute is found by first calculating the local output water value of the reservoir relative to the reservoir below the plant, and then converting it to €/MWh with the energy_conversion_factor. \n", "\n", "These output time series are strongly related to the water value input given to SHOP. A good consistency check is to look at the (negative of the) final values of the water_value_global_result and energy_value_local_results time series. These should be identical to the global water value and energy_value_input, respectively. This identity may not hold if penalties are present in the SHOP run since the dual values of the problem are influenced by penalty values." ] }, { "cell_type": "code", "execution_count": 4, "id": "c14582dd", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "variable=Reservoir1
index=%{x}
value=%{y}", "legendgroup": "Reservoir1", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir1", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 26.63738107081012, 26.67348995501472, 26.702485886439305, 26.72734586106976, 26.757091710062337, 26.81407393722432, 26.92009526197749, 27.110488723566583, 27.308882280343273, 27.468459924019626, 27.611999513560164, 27.732990324556702, 27.840764662048883, 27.944724255451685, 28.041284433677347, 28.137672235781523, 28.244081187434666, 28.366418119929588, 28.456452842305087, 28.518586805952772, 28.572475061376544, 28.623723920189573, 28.658823444484963, 28.69309884931954, 28.72176305880548, 28.74961945733776, 28.776584485841035, 28.80202517079721, 28.829338765852672, 28.85972343871691, 28.906056557358976, 28.966848050902758, 29.03052512661602, 29.091618858646132, 29.14890360528809, 29.20111211666762, 29.253168562664147, 29.304380053385636, 29.355439288640483, 29.40660638070363, 29.458072389303616, 29.510254199512225, 29.561556407913603, 29.611682293510874, 29.661053563695113, 29.696655016591, 29.73065145346918, 29.75859938193853, 29.78741364174873, 29.8151574757122, 29.840621637327036, 29.865106398906242, 29.88926256253574, 29.918226618472115, 29.964340089237833, 30.022713674891016, 30.082352884205672, 30.14178430456098, 30.200667917659842, 30.259060393218398, 30.316810611993503, 30.37461750048482, 30.432481058692304, 30.492269986985775, 30.55636597216381, 30.632761644118887, 30.705386198849304, 30.76968197202428, 30.832599208020373, 30.891752943913612, 30.947878630824704, 31.0, 31.0 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir2
index=%{x}
value=%{y}", "legendgroup": "Reservoir2", "line": { "color": "#EF553B", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir2", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 28.612067152176333, 28.612868770623123, 28.609958579710863, 28.60426222753918, 28.601340121757996, 28.585864372986737, 28.586096243164622, 28.59105509903212, 28.59681810177762, 28.6019413555384, 28.606995952917877, 28.611637533779216, 28.613922948329066, 28.616464847469405, 28.61590080388197, 28.615345829568657, 28.618554549667856, 28.624699347083425, 28.6266419626344, 28.617205034434004, 28.637095916228542, 28.65599992857347, 28.691099452868865, 28.72537485770343, 28.754039067189375, 28.781895465721657, 28.80886049422493, 28.8343011791811, 28.861614774236568, 28.891999447100797, 28.906852509199343, 28.931028567278815, 28.95706830289958, 28.981368625430683, 29.00503957322579, 29.024451962505328, 29.043823136885052, 29.062895068755974, 29.081925538747434, 29.101011587154105, 29.120224712620168, 29.139720964052238, 29.15890488654934, 29.209030772146612, 29.25840204233084, 29.294003495226733, 29.327999932104913, 29.355947860574265, 29.384762120384465, 29.412505954347935, 29.437970115962774, 29.462454877541976, 29.486611041171482, 29.515575097107853, 29.56168856787357, 29.586478808432148, 29.611808758426868, 29.63705266952208, 29.66206608813939, 29.68687304827199, 29.711409307229832, 29.735971794903467, 29.760560515223354, 29.786609689793444, 29.815860245052455, 29.809951166967043, 29.807883674066023, 29.837236924457763, 29.865963036225676, 29.89175294391361, 29.947878630824704, 29.999999999999996, 29.999999999999996 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir3
index=%{x}
value=%{y}", "legendgroup": "Reservoir3", "line": { "color": "#00cc96", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir3", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 32.393278719574944, 32.290701008006735, 32.208329692585586, 32.137707756643536, 32.053206083841275, 31.891331614688003, 31.590147429405846, 31.049279828050505, 30.485685646388184, 30.032359273492872, 29.624593624156265, 29.280884290949402, 28.974720166821754, 28.679392924739236, 28.405085857955232, 28.131268475315746, 27.82898312390181, 27.48144974390318, 27.225680118604664, 27.049170654464803, 26.896085505379265, 26.750498324459038, 26.650787991152864, 26.553418807129276, 26.471989843655365, 26.392855700440556, 26.316253751165014, 26.24398213986999, 26.166389986658746, 26.080073550196694, 25.948450948590068, 25.77575515840167, 25.594862038885374, 25.421307653009006, 25.258573789924192, 25.110260438801227, 24.96237907330564, 24.816898047238997, 24.67184954678718, 24.526494647929116, 24.38029059033975, 24.23205309160243, 24.086314355772455, 23.943917304515935, 23.803663956225844, 23.70252774980441, 23.605951054809434, 23.526556894380263, 23.444701669635165, 23.365887298579665, 23.29354899505711, 23.22399296012519, 23.155370402547906, 23.073089638654665, 22.942091010261375, 22.77626398557664, 22.60684159144861, 22.43800948185605, 22.27073357694787, 22.104852890032696, 21.94079671895446, 21.776579561184658, 21.61220141672343, 21.442353702606603, 21.260270549800808, 21.043246585325353, 20.836935568189094, 20.654284859891725, 20.475550284486197, 20.307507017786037, 20.148065798530617, 20.0, 20.0 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "variable" }, "tracegroupgap": 0 }, "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 local energy value" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "index" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "pd.DataFrame([rsv.storage.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir storage\")\n", "pd.DataFrame([-rsv.water_value_global_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir global water value\")\n", "pd.DataFrame([-rsv.energy_value_local_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir local energy value\")" ] }, { "cell_type": "markdown", "id": "dcd6803e", "metadata": { "Collapsed": "false" }, "source": [ "## Mix of constant water values in €/MWh and €/Mm$^3$\n", "It is possible to define constant water values in €/MWh for some reservoirs and €/Mm$^3$ for the rest. Constant water values in €/Mm$^3$ are used directly by SHOP since they are assumed to be *global*. The example below is identical to the previous one except that the energy_value_input of Reservoir3 has been changed to a constant global water value with the [water_value_input](reservoir:water_value_input) attribute. \n", "\n", "Caution is advised when having both definitions in the system, as it is possible to create cases where the global water value is not increasing upwards in the system. In our example, setting a high water_value_input for Reservoir2 could make it higher than the calculated global water value of Reservoir1. This can happen because the energy_value_input is a local value relative to the reservoir below the downstream plant, and so the global water value of Reservoir2 is skipped when converting the energy_value_input into a global water value for Reservoir1." ] }, { "cell_type": "code", "execution_count": 5, "id": "72cd59d2", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reservoir1 has an energy conversion factor of 583.001 MWh/Mm3\n", "Reservoir2 has an energy conversion factor of 583.001 MWh/Mm3\n", "Reservoir3 has an energy conversion factor of 205.225 MWh/Mm3\n", "\n", "Reservoir1 has a calculated global water value of 23073.02 €/Mm3\n", "Reservoir2 has a calculated global water value of 22490.02 €/Mm3\n", "Reservoir3 has a calculated global water value of 0.00 €/Mm3\n", "\n", "Reservoir1 has a total value of 206272.79 € at 8.94 Mm3 and an average water value of 23073.02 €/Mm3\n", "Reservoir2 has a total value of 593532.33 € at 26.39 Mm3 and an average water value of 22490.02 €/Mm3\n", "Reservoir3 has a total value of 95154.34 € at 19.03 Mm3 and an average water value of 5000.00 €/Mm3\n", "\n" ] } ], "source": [ "#Create the same basic model as before\n", "shop=ShopSession()\n", "build_model(shop)\n", "\n", "#The three reservoir objects\n", "rsv1 = shop.model.reservoir.Reservoir1\n", "rsv2 = shop.model.reservoir.Reservoir2\n", "rsv3 = shop.model.reservoir.Reservoir3\n", "\n", "#We keep the energy_value_input for rsv1 and rsv2 unchanged, but define a global water value of 4000 €/Mm3 for rsv3 which is slightly higher than in the previous example.\n", "rsv1.energy_value_input.set(31.0)\n", "rsv2.energy_value_input.set(30.0)\n", "rsv3.water_value_input.set([pd.Series([5000.0], index=[0], name=0)])\n", "\n", "#Optimize model by calling \"run_model\"\n", "run_model(shop)\n", "\n", "#The energy_conversion_factors\n", "for rsv in shop.model.reservoir:\n", " print(f\"{rsv.get_name()} has an energy conversion factor of {rsv.energy_conversion_factor.get():.3f} MWh/Mm3\")\n", "print(\"\")\n", "\n", "#The calculated global water values\n", "for rsv in shop.model.reservoir:\n", " print(f\"{rsv.get_name()} has a calculated global water value of {rsv.calc_global_water_value.get():.2f} €/Mm3\")\n", "print(\"\")\n", "\n", "#Optimization results\n", "for rsv in shop.model.reservoir:\n", " end_val = -rsv.end_value.get().iloc[-1]\n", " end_vol = rsv.storage.get().iloc[-1]\n", " avrg_wv = end_val/(end_vol+10**(-10))\n", " print(f\"{rsv.get_name()} has a total value of {end_val:.2f} € at {end_vol:.2f} Mm3 and an average water value of {avrg_wv:.2f} €/Mm3\")\n", "print(\"\")" ] }, { "cell_type": "markdown", "id": "e88ec0ec", "metadata": { "Collapsed": "false" }, "source": [ "Note that all of the energy conversion factors are identical to the first example since they are not influenced by the water value function of the reservoirs. The calc_global_water_value attribute is not calculated for Reservoir3 since it already has a global water value given in €/Mm$^3$. The calculated global water values of Reservoir1 and Reservoir2 are higher compared to the last example since the water value for Reservoir3 is higher, but their relative difference is the same as before.\n", "\n", "The final value of the local energy value time series for Reservoir1 and Reservoir2 are still the same as their energy_value_input, while the water_value_input defined for Reservoir3 is found in the final value of the global output water value time series." ] }, { "cell_type": "code", "execution_count": 6, "id": "1e349e01", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "variable=Reservoir1
index=%{x}
value=%{y}", "legendgroup": "Reservoir1", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir1", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 27.133293989592698, 27.1632286498786, 27.189152273824934, 27.214014825139657, 27.240633866196806, 27.28465265911109, 27.385835959084666, 27.576152301010815, 27.77446436559978, 27.93397709892861, 28.07745887505712, 28.198401468044505, 28.301044663363783, 28.399926931918138, 28.492072136913713, 28.584133852886442, 28.685258507913982, 28.807595440408903, 28.890214905055018, 28.946945997681922, 28.993574484584485, 29.034017499624667, 29.06378483446066, 29.091502586825406, 29.11711190475995, 29.142182237426095, 29.166457171798484, 29.190453833892512, 29.21506132682269, 29.241050209964808, 29.27811828322891, 29.329513775943212, 29.386598956905203, 29.442423699501067, 29.489042373953087, 29.53164156282298, 29.574218609986268, 29.61524888521128, 29.656210956067028, 29.697314249543947, 29.73871342703901, 29.78191993125671, 29.823300871462738, 29.8612376461883, 29.898669049867863, 29.928896415098738, 29.955743622293536, 29.98100365900719, 30.007002693757588, 30.03209282048206, 30.03787067627032, 30.04360942119045, 30.049297056291422, 30.075298453882603, 30.11292247519574, 30.160440615161917, 30.211717034276763, 30.26285299068146, 30.31355593146974, 30.363874472909306, 30.411128559697804, 30.458479657746945, 30.50592853981628, 30.55665119117886, 30.612593134938663, 30.685040258388756, 30.750157540268106, 30.80634279577921, 30.86134714172712, 30.911793559120127, 30.95763046133262, 31.0, 31.0 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir2
index=%{x}
value=%{y}", "legendgroup": "Reservoir2", "line": { "color": "#EF553B", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir2", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 28.6537747698176, 28.649830862927136, 28.675754486873473, 28.700617038188195, 28.72723607924534, 28.698778140244123, 28.69414520443903, 28.698980001188072, 28.704612755307622, 28.709632008639534, 28.714593747408028, 28.71915766951366, 28.71628525170271, 28.71372416828077, 28.70872058225216, 28.703815000787504, 28.701713322900364, 28.707828735796422, 28.702339075658834, 28.721487724031153, 28.734114353864655, 28.774557368904826, 28.804324703740825, 28.832042456105572, 28.857651774040107, 28.882722106706268, 28.90699704107865, 28.93099370317268, 28.955601196102855, 28.981590079244974, 29.01865815250907, 29.03506461702028, 29.054472240439488, 29.073464711730455, 29.086481869686548, 29.12908105855644, 29.17165810571973, 29.21268838094474, 29.253650451800493, 29.294753745277397, 29.336152922772467, 29.379359426990167, 29.42074036719619, 29.45867714192176, 29.49610854560132, 29.5263359108322, 29.553183118027, 29.57844315474065, 29.604442189491042, 29.629532316215524, 29.635310172003777, 29.641048916923907, 29.64673655202488, 29.672737949616064, 29.7103619709292, 29.72429163950298, 29.741253562554057, 29.758196791897202, 29.775024369188024, 29.791752269984435, 29.80578732878788, 29.81988895355619, 29.83405792098079, 29.851035671285505, 29.872126869476723, 29.8622567736615, 29.85267064484675, 29.873908048989527, 29.894716057069726, 29.911793559120127, 29.957630461332617, 29.999999999999996, 29.999999999999996 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir3
index=%{x}
value=%{y}", "legendgroup": "Reservoir3", "line": { "color": "#00cc96", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir3", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 35.34800834648485, 35.262970300687, 35.18932676174788, 35.118697505990184, 35.04307843395487, 34.91803034281039, 34.630589963833316, 34.08994144314791, 33.526578763574655, 33.073436787263525, 32.665835373616694, 32.32226301758716, 32.03067538435425, 31.74977174951729, 31.488006688961203, 31.2264788030809, 30.939205022006036, 30.5916716420074, 30.35696719735138, 30.19580614835694, 30.06334446792251, 29.9484544062902, 29.86389169674594, 29.78515141800235, 29.712400756041625, 29.64118123736095, 29.57222127719495, 29.504051829783233, 29.434147141011746, 29.360318214484224, 29.255015649438754, 29.109011912583252, 28.946844973434448, 28.788258673400335, 28.655824868064897, 28.534809572101274, 28.41385717604841, 28.29729883229711, 28.18093424274985, 28.064168469570923, 27.946562152405647, 27.823821601841935, 27.70626709296198, 27.598496730588618, 27.49216202059096, 27.406292461882057, 27.33002521805264, 27.2582667902504, 27.184409025148412, 27.11313327572979, 27.096719608080235, 27.08041704614436, 27.064259676407133, 26.990395198973655, 26.883513302971906, 26.748524306134183, 26.60285883221895, 26.457592383188736, 26.313556040044745, 26.17061169424122, 26.036372816696723, 25.901858350655598, 25.767066100871183, 25.622973764149712, 25.46405452036907, 25.258247548015614, 25.07326310704319, 24.913652665979757, 24.757396939503334, 24.614089325131513, 24.483876369569337, 24.363513461314557, 24.363513461314557 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "variable" }, "tracegroupgap": 0 }, "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 local energy value" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "index" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "pd.DataFrame([rsv.storage.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir storage\")\n", "pd.DataFrame([-rsv.water_value_global_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir global water value\")\n", "pd.DataFrame([-rsv.energy_value_local_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir local energy value\")" ] }, { "cell_type": "markdown", "id": "62dff385", "metadata": { "Collapsed": "false" }, "source": [ "## Water value tables\n", "An example of how to specify water values as piece-wise constant functions is shown below. The water value tables are based on the original water values calculated in the first example. The marginal water values in the water value table are spread around the original water value in a uniform way for each volume segment.\n", "\n", "It is possible to have reservoirs with constant water values in €/Mm$^3$ and reservoirs with water value tables in the same system, but it is not advisable to mix water value tables and constant end values in €/MWh. This is because the conversion from local energy values to global water values requires a constant water value for all reservoirs of the system. If reservoirs with water value tables and constant local energy values are mixed, the start volume is used to find an approximation of the global water value of the reservoirs with water value tables." ] }, { "cell_type": "code", "execution_count": 7, "id": "e74e9040", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dx": 2.0, "name": "Water value table", "type": "bar", "x0": 1.0, "y": [ 24395.272, 23902.438222222223, 23409.604444444445, 22916.770666666667, 22423.93688888889, 21931.10311111111, 21438.269333333334, 20945.435555555556, 20452.601777777778, 19959.768 ] }, { "mode": "lines", "name": "Original water value", "type": "scatter", "x": [ 0, 20.0 ], "y": [ 22177.52, 22177.52 ] } ], "layout": { "bargap": 0, "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": "Reservoir1" }, "xaxis": { "title": { "text": "End volume" } }, "yaxis": { "range": [ 17963.7912, 26834.7992 ], "title": { "text": "Marginal water value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dx": 3.9, "name": "Water value table", "type": "bar", "x0": 1.95, "y": [ 23753.972, 23274.09377777778, 22794.215555555555, 22314.337333333333, 21834.45911111111, 21354.58088888889, 20874.702666666668, 20394.824444444446, 19914.94622222222, 19435.068 ] }, { "mode": "lines", "name": "Original water value", "type": "scatter", "x": [ 0, 39.0 ], "y": [ 21594.52, 21594.52 ] } ], "layout": { "bargap": 0, "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": "Reservoir2" }, "xaxis": { "title": { "text": "End volume" } }, "yaxis": { "range": [ 17491.5612, 26129.369200000005 ], "title": { "text": "Marginal water value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n" ] }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "dx": 9.75, "name": "Water value table", "type": "bar", "x0": 4.875, "y": [ 4514.95, 4423.738888888889, 4332.527777777777, 4241.316666666667, 4150.105555555556, 4058.8944444444446, 3967.6833333333334, 3876.472222222222, 3785.261111111111, 3694.05 ] }, { "mode": "lines", "name": "Original water value", "type": "scatter", "x": [ 0, 97.5 ], "y": [ 4104.5, 4104.5 ] } ], "layout": { "bargap": 0, "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": "Reservoir3" }, "xaxis": { "title": { "text": "End volume" } }, "yaxis": { "range": [ 3324.6450000000004, 4966.445000000001 ], "title": { "text": "Marginal water value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stdout", "output_type": "stream", "text": [ "\n", "Reservoir1:\n", "Vol WV\n", "0.0 24395.272\n", "2.0 23902.438222222223\n", "4.0 23409.604444444445\n", "6.0 22916.770666666667\n", "8.0 22423.93688888889\n", "10.0 21931.10311111111\n", "12.0 21438.269333333334\n", "14.0 20945.435555555556\n", "16.0 20452.601777777778\n", "18.0 19959.768\n", "\n", "Reservoir2:\n", "Vol WV\n", "0.0 23753.972\n", "3.9 23274.09377777778\n", "7.8 22794.215555555555\n", "11.7 22314.337333333333\n", "15.6 21834.45911111111\n", "19.5 21354.58088888889\n", "23.4 20874.702666666668\n", "27.3 20394.824444444446\n", "31.2 19914.94622222222\n", "35.1 19435.068\n", "\n", "Reservoir3:\n", "Vol WV\n", "0.0 4514.95\n", "9.75 4423.738888888889\n", "19.5 4332.527777777777\n", "29.25 4241.316666666667\n", "39.0 4150.105555555556\n", "48.75 4058.8944444444446\n", "58.5 3967.6833333333334\n", "68.25 3876.472222222222\n", "78.0 3785.261111111111\n", "87.75 3694.05\n", "\n" ] } ], "source": [ "\n", "#Create the same basic model as before\n", "shop=ShopSession()\n", "build_model(shop)\n", "\n", "#The three reservoir objects\n", "rsv1 = shop.model.reservoir.Reservoir1\n", "rsv2 = shop.model.reservoir.Reservoir2\n", "rsv3 = shop.model.reservoir.Reservoir3\n", "\n", "reservoirs = [rsv1,rsv2,rsv3]\n", "\n", "#Create a water value table with n segments that has the same total value at vmax as in the first example\n", "wv_orig = [22177.52,21594.52,4104.50] \n", "n = 10\n", "\n", "for wv,rsv in zip(wv_orig,reservoirs):\n", " vmax = rsv.max_vol.get()\n", " delta = 0.1*wv\n", " #The volume segments are vmax/n long, the marginal water value is decreasing from wv+delta to wv-delta from the first to the last segment\n", " wv_list = [wv+delta*(1-2*i/(n-1)) for i in range(n)]\n", " vol_list = [i*vmax/n for i in range(n)]\n", " rsv.water_value_input.set([pd.Series(wv_list, index=vol_list, name=0)])\n", " \n", "#Plot the water value tables\n", "for i, rsv in enumerate(reservoirs):\n", " wv_table = rsv.water_value_input.get()[0]\n", " vols = list(wv_table.index)\n", " wvs = list(wv_table.values)\n", " \n", " dv = vols[1]-vols[0]\n", " fig = go.Figure(layout={'bargap':0,'title':f\"Reservoir{i+1}\",'xaxis_title':\"End volume\",'yaxis_title':\"Marginal water value\"})\n", " fig.add_trace(go.Bar(name='Water value table', x0=0.5*dv,dx=dv, y=wvs))\n", " fig.add_trace(go.Scatter(name=\"Original water value\",x=[0,vols[-1]+dv],y=[wv_orig[i],wv_orig[i]],mode='lines')) \n", " fig.update_yaxes(range=[min(wvs)*0.9, max(wvs)*1.1])\n", " fig.show()\n", " print(\"\")\n", " \n", "#Print the water value tables\n", "for rsv in reservoirs:\n", " wv_table = rsv.water_value_input.get()[0]\n", " print(f\"{rsv.get_name()}:\")\n", " print(\"Vol WV\")\n", " for vol,wv in wv_table.items():\n", " print(vol,wv) \n", " print(\"\")" ] }, { "cell_type": "code", "execution_count": 8, "id": "562422e1", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reservoir1 has a total value of 234096.04 € at 10.00 Mm3 and an average water value of 23409.60 €/Mm3\n", "Reservoir2 has a total value of 517177.26 € at 22.90 Mm3 and an average water value of 22580.26 €/Mm3\n", "Reservoir3 has a total value of 71174.88 € at 15.89 Mm3 and an average water value of 4479.71 €/Mm3\n", "\n" ] } ], "source": [ "#Optimize model by calling \"run_model\"\n", "run_model(shop)\n", "\n", "for rsv in shop.model.reservoir:\n", " end_val = -rsv.end_value.get().iloc[-1]\n", " end_vol = rsv.storage.get().iloc[-1]\n", " avrg_wv = end_val/(end_vol+10**(-10))\n", "\n", " print(f\"{rsv.get_name()} has a total value of {end_val:.2f} € at {end_vol:.2f} Mm3 and an average water value of {avrg_wv:.2f} €/Mm3\")\n", "print(\"\")" ] }, { "cell_type": "markdown", "id": "a64ad023", "metadata": { "Collapsed": "false" }, "source": [ "The results from this SHOP run is not directly comparable to the others even though the water value tables are based on the global water values calulated from the first example. The average water values calculated above are no longer the same as the marginal water values seen in the local water value plot below because of the piece-wise water value definition. The final value of the water_value_global_result are related to the marginal values specified in the water value tables, and it is often equal to the marginal water value in the segment where the final optimized volume lies. However, if the final volume exactly fills a whole number of segments in the table, the marginal value will likely be somewhere between the marginal water value in the last full and first empty segments." ] }, { "cell_type": "code", "execution_count": 9, "id": "7ff553fc", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "variable=Reservoir1
index=%{x}
value=%{y}", "legendgroup": "Reservoir1", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir1", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 26.77760967394344, 26.809149336767387, 26.83735846453945, 26.86219933285266, 26.89191336038776, 26.948888376313477, 27.052543578511003, 27.242792198368793, 27.441027714095057, 27.600475255639665, 27.743894986589094, 27.864782308793206, 27.97245638490963, 28.076302549652347, 28.171212427194853, 28.266142867255834, 28.37255181890899, 28.494888751403906, 28.56967601041378, 28.63177226616955, 28.685588546892728, 28.721773048801964, 28.75679776285776, 28.78615397182826, 28.81449423380596, 28.842229671628058, 28.866605845962912, 28.89070217220693, 28.916651977740603, 28.94535701292776, 28.980788569671223, 29.040426823955368, 29.10291840898477, 29.164012141014883, 29.217440986546613, 29.269593761131095, 29.321593976217624, 29.36939307778699, 29.41680122908787, 29.464637243515227, 29.516043008903146, 29.56816322889943, 29.619403482195658, 29.655273672467626, 29.690620146079745, 29.725577254208876, 29.755112219643426, 29.77444602831098, 29.794331496359636, 29.794331496359636, 29.794331496359636, 29.794331496359636, 29.794331496359636, 29.822689544830226, 29.85789954026316, 29.912411942209243, 29.9720511515239, 30.03148257187923, 30.09036618497807, 30.145597757518136, 30.199711897657018, 30.253916943989204, 30.307664541717656, 30.366340365857166, 30.42694296034699, 30.503338632302036, 30.573444851823744, 30.635389584627216, 30.694877674698706, 30.752930131960166, 30.805540535977507, 30.856373169114423, 30.856373169114423 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir2
index=%{x}
value=%{y}", "legendgroup": "Reservoir2", "line": { "color": "#EF553B", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir2", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 27.877069893178913, 27.873301769997312, 27.869604973952953, 27.86388970558563, 27.860935981606765, 27.842020764116736, 27.839887795837324, 27.844704060614568, 27.85031136007076, 27.85530638598083, 27.86024280510718, 27.864782308793206, 27.866974505199916, 27.869415978799275, 27.867220053166765, 27.865232054001233, 27.86847301740469, 27.874661247709998, 27.861395089068058, 27.851956784947784, 27.870177307428982, 27.87403759107744, 27.909062305133236, 27.938418514103734, 27.966758776081434, 27.994494213903533, 28.018870388238387, 28.0429667144824, 28.068916520016074, 28.097621555203236, 28.133053111946698, 28.156064624199715, 28.18090770882253, 28.205197572737017, 28.225050916608648, 28.244444932105996, 28.263797109739322, 28.27949326244013, 28.29490912974275, 28.310700638807376, 28.32989025253805, 28.34936213542486, 28.40060238872109, 28.436472578993058, 28.471819052605177, 28.506776160734308, 28.536311126168858, 28.555644934836412, 28.575530402885068, 28.575530402885068, 28.575530402885068, 28.575530402885068, 28.575530402885068, 28.60388845135566, 28.63909844678859, 28.66006357316408, 28.685430369794222, 28.710710994236734, 28.735760782931624, 28.75744290194215, 28.77837874274479, 28.799375078957002, 28.819883559702923, 28.844855847611807, 28.870650413961528, 28.864829070740782, 28.860323194458744, 28.88736289724196, 28.91269654706705, 28.937420970009455, 28.9900313740268, 29.04086400716372, 29.04086400716372 ], "yaxis": "y" }, { "hovertemplate": "variable=Reservoir3
index=%{x}
value=%{y}", "legendgroup": "Reservoir3", "line": { "color": "#00cc96", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "Reservoir3", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-01-23T00:00:00", "2018-01-23T01:00:00", "2018-01-23T02:00:00", "2018-01-23T03:00:00", "2018-01-23T04:00:00", "2018-01-23T05:00:00", "2018-01-23T06:00:00", "2018-01-23T07:00:00", "2018-01-23T08:00:00", "2018-01-23T09:00:00", "2018-01-23T10:00:00", "2018-01-23T11:00:00", "2018-01-23T12:00:00", "2018-01-23T13:00:00", "2018-01-23T14:00:00", "2018-01-23T15:00:00", "2018-01-23T16:00:00", "2018-01-23T17:00:00", "2018-01-23T18:00:00", "2018-01-23T19:00:00", "2018-01-23T20:00:00", "2018-01-23T21:00:00", "2018-01-23T22:00:00", "2018-01-23T23:00:00", "2018-01-24T00:00:00", "2018-01-24T01:00:00", "2018-01-24T02:00:00", "2018-01-24T03:00:00", "2018-01-24T04:00:00", "2018-01-24T05:00:00", "2018-01-24T06:00:00", "2018-01-24T07:00:00", "2018-01-24T08:00:00", "2018-01-24T09:00:00", "2018-01-24T10:00:00", "2018-01-24T11:00:00", "2018-01-24T12:00:00", "2018-01-24T13:00:00", "2018-01-24T14:00:00", "2018-01-24T15:00:00", "2018-01-24T16:00:00", "2018-01-24T17:00:00", "2018-01-24T18:00:00", "2018-01-24T19:00:00", "2018-01-24T20:00:00", "2018-01-24T21:00:00", "2018-01-24T22:00:00", "2018-01-24T23:00:00", "2018-01-25T00:00:00", "2018-01-25T01:00:00", "2018-01-25T02:00:00", "2018-01-25T03:00:00", "2018-01-25T04:00:00", "2018-01-25T05:00:00", "2018-01-25T06:00:00", "2018-01-25T07:00:00", "2018-01-25T08:00:00", "2018-01-25T09:00:00", "2018-01-25T10:00:00", "2018-01-25T11:00:00", "2018-01-25T12:00:00", "2018-01-25T13:00:00", "2018-01-25T14:00:00", "2018-01-25T15:00:00", "2018-01-25T16:00:00", "2018-01-25T17:00:00", "2018-01-25T18:00:00", "2018-01-25T19:00:00", "2018-01-25T20:00:00", "2018-01-25T21:00:00", "2018-01-25T22:00:00", "2018-01-25T23:00:00", "2018-01-26T00:00:00" ], "xaxis": "x", "y": [ 33.14246979332362, 33.05287227439222, 32.97273610192571, 32.9021684429945, 32.81775716823024, 32.65590318467575, 32.361440653700946, 31.8209845171046, 31.25783929667837, 30.804882516453628, 30.39745736005273, 30.054042016641823, 29.74816271390123, 29.453157698678776, 29.183538787488803, 28.913861462527898, 28.611576111113962, 28.264042731115328, 28.051587928019686, 27.87518558403449, 27.722304899867773, 27.619512374375876, 27.52001456115579, 27.436619773339878, 27.356111076298898, 27.27732055690725, 27.2080729953961, 27.139620423189584, 27.065902507892012, 26.984357567225896, 26.883703999880805, 26.714284318792696, 26.536758927859406, 26.363204541983038, 26.21142447934465, 26.06326946468132, 25.915547839321555, 25.779760689925855, 25.64508414764975, 25.5091921366228, 25.363159217271797, 25.21509668331598, 25.069533948850943, 24.967634316318232, 24.867222452174396, 24.76791669310938, 24.68401409594366, 24.629090830029973, 24.572600416359585, 24.572600416359585, 24.572600416359585, 24.572600416359585, 24.572600416359585, 24.492041191649932, 24.39201703318044, 24.237158815683827, 24.067736421555793, 23.898904311963168, 23.731628407055055, 23.5747271778348, 23.421000337994627, 23.267015252864347, 23.114329682575494, 22.94764406220279, 22.775484894319362, 22.558460929843996, 22.359303971005605, 22.18333207171677, 22.01433897543272, 21.849424208666452, 21.699969165464353, 21.55556439375703, 21.55556439375703 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "variable" }, "tracegroupgap": 0 }, "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 local energy value" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "index" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "value" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "pd.DataFrame([rsv.storage.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir storage\")\n", "pd.DataFrame([-rsv.water_value_global_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir global water value\")\n", "pd.DataFrame([-rsv.energy_value_local_result.get().rename(rsv.get_name()) for rsv in shop.model.reservoir]).transpose().plot(title=\"Reservoir local energy value\")" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.13.8" } }, "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.13.14" }, "source_map": [ 14, 37, 50, 55, 79, 83, 106, 116, 124, 131, 170, 176, 184, 191, 242, 257, 261 ] }, "nbformat": 4, "nbformat_minor": 5 }