{ "cells": [ { "cell_type": "markdown", "id": "d2e0196a", "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", " - [](ind-wv-model-yaml)\n", " - [](constant-energy-values-yaml)\n", " - [](constant-mixed-values-yaml)\n", " - [](water-value-tables-yaml)\n", "- ASCII\n", " - [](ind-wv-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": "e0123667", "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": "68aff75f", "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": "214da77e", "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": "3ad8e3e2", "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": "ff28a8a9", "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 134395.76 € at 6.06 Mm3 and an average water value of 22177.52 €/Mm3\n", "Reservoir2 has a total value of 561147.79 € at 25.99 Mm3 and an average water value of 21594.52 €/Mm3\n", "Reservoir3 has a total value of 34585.74 € at 8.43 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": "96ad1291", "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": "d0812113", "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.608245099707084, 26.644354755643647, 26.673351584825035, 26.698212302416565, 26.727950980433803, 26.784932449489226, 26.890946651990436, 27.081327190686658, 27.279706462320664, 27.439272096085663, 27.582800309169745, 27.7037809648079, 27.8138343577488, 27.91777644045638, 28.015039198040842, 28.112128325281798, 28.220777245850577, 28.343114178345495, 28.433148900720997, 28.495277039685625, 28.549164018462534, 28.60040672968538, 28.64624909580974, 28.680519961998556, 28.709205555995066, 28.73705494679801, 28.764013221867984, 28.789446724485444, 28.81675353681146, 28.84715244609398, 28.893480951804843, 28.954272445348654, 29.017949521061915, 29.079043253092053, 29.13632799973401, 29.188532761160598, 29.240585457717863, 29.291793251457662, 29.3428487942051, 29.394012181466966, 29.445474461351637, 29.497652491286445, 29.54895009032978, 29.59907147248761, 29.648438303125356, 29.69401612531002, 29.728011855508676, 29.7559588242085, 29.784776637098545, 29.81251978988475, 29.837983381654738, 29.862477839795392, 29.886633687367013, 29.915601289410436, 29.961714734595898, 30.02008832024906, 30.07972752956372, 30.139158949919047, 30.19804256301789, 30.25643503857644, 30.31418525735155, 30.371992145842864, 30.429855704050347, 30.48964463234382, 30.553740617521854, 30.63013628947693, 30.702760844207347, 30.767056617382323, 30.82997385337844, 30.88912758927168, 30.945253276182775, 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.679457036941525, 28.681690230376052, 28.67878084921242, 28.673085155716983, 28.670155788851222, 28.654679082608496, 28.654903545866368, 28.659848979902893, 28.66559717925427, 28.67070800759971, 28.67575085601346, 28.68038196857911, 28.684946154877146, 28.68747027059635, 28.68760854521188, 28.687754635391812, 28.693203046965067, 28.69934753204105, 28.701289908613294, 28.691846959051677, 28.711736470545684, 28.730634246199195, 28.776476612323556, 28.810747478512372, 28.839433072508882, 28.867282463311827, 28.8942407383818, 28.91967424099926, 28.946981053325278, 28.977379962607795, 28.992228325010014, 29.01635090499028, 29.042333304911022, 29.066576791329986, 29.09024342166973, 29.109647848854834, 29.12901107617897, 29.148075183818662, 29.167097848563433, 29.186176072999668, 29.20538132880191, 29.22486960374902, 29.244044793787687, 29.294166175945517, 29.343533006583257, 29.38911082876793, 29.42310655896658, 29.451053527666406, 29.479871340556453, 29.507614493342654, 29.533078085112642, 29.557572543253297, 29.58172839082491, 29.61069599286834, 29.656809438053802, 29.681595367735476, 29.706920913975512, 29.732160437245387, 29.757169509062727, 29.7819721592272, 29.806504156191725, 29.831062378259936, 29.855646829363437, 29.8816916753663, 29.876251348695163, 29.87033707444342, 29.868264846335002, 29.862834996705324, 29.89156114725244, 29.917351092778635, 29.945253276182772, 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.47604785813743, 32.37346795424175, 32.29109408848318, 32.22047004194568, 32.135988740369385, 31.974116424836705, 31.67295247236769, 31.132121582220883, 30.56856798163101, 30.115275726356604, 29.707542395129376, 29.363861911150224, 29.051223471971966, 28.75594597407522, 28.479643027761615, 28.203833328572298, 27.895184698690738, 27.547651318692107, 27.29188169339359, 27.115388775947764, 26.96230725354624, 26.816737536630974, 26.68650905924948, 26.589152768559636, 26.507663056208962, 26.428548820472724, 26.351966056274435, 26.279714848486332, 26.20214196357651, 26.11578508445774, 25.984175587214125, 25.811479797025648, 25.630586677509356, 25.457032291632913, 25.294298428548096, 25.14599573024921, 24.99812501611848, 24.852654492395775, 24.707616481577425, 24.5622721072771, 24.416078642180224, 24.267851882402105, 24.122126240784567, 23.979741982848093, 23.83950124637166, 23.71002428243461, 23.613449594966863, 23.534058161040168, 23.452192842745855, 23.373380406771066, 23.30104372205734, 23.231460141242856, 23.162838481519255, 23.08054764388504, 22.94954908815984, 22.783722063475167, 22.614299669347137, 22.445467559754512, 22.2781916548464, 22.112310967931226, 21.948254796852986, 21.784037639083184, 21.619659494621956, 21.44981178050513, 21.267728627699334, 21.05070466322388, 20.84439364608762, 20.66174293779025, 20.483008362384652, 20.314965095684492, 20.155523876429072, 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": "63a265b2", "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": "e0dc4d28", "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 589400.87 € at 26.21 Mm3 and an average water value of 22490.02 €/Mm3\n", "Reservoir3 has a total value of 95886.18 € at 19.18 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": "01c4add9", "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": "363aa05e", "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.110075938603696, 27.140010601295124, 27.165934227624177, 27.190796781580833, 27.217415826123364, 27.261425937017254, 27.362606684342776, 27.55292220522522, 27.751233096749402, 27.91074452832502, 28.054224704202234, 28.17516549810728, 28.27780760505487, 28.3766887020194, 28.46672562026734, 28.558787104901683, 28.662151728844854, 28.784488661339825, 28.867108125985933, 28.923837723511856, 28.97046254805026, 29.010900648247453, 29.045060045873083, 29.072788949133017, 29.098409973227245, 29.123491805540038, 29.147777913783795, 29.171785662063478, 29.19640454072311, 29.222405467415552, 29.259487506353185, 29.310890504463515, 29.367978630535422, 29.423806246310033, 29.470431826067035, 29.513015921514324, 29.554659414490107, 29.59568011302259, 29.636632472071728, 29.6777258351718, 29.71911485445448, 29.761136899984486, 29.80250727923521, 29.840431817041242, 29.877851041167265, 29.912448282886015, 29.939304891965236, 29.964573758061853, 29.990581863202035, 29.990581863202035, 29.990581863202035, 29.990581863202035, 29.990581863202035, 30.01645758206611, 30.053931118808645, 30.101345574032024, 30.152539178699424, 30.20359161909364, 30.2542108097354, 30.304445283276007, 30.351590415045113, 30.398831066831317, 30.4461679605344, 30.50138616931403, 30.565686047647034, 30.65103325510503, 30.72779618393045, 30.79248165100638, 30.85584845328819, 30.91177323768554, 30.9576138928838, 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.66469550716961, 28.660751602684673, 28.686675229013726, 28.71153778297038, 28.738156827512913, 28.7096902064913, 28.705054718038152, 28.709888693743487, 28.71552027479826, 28.720538226376952, 28.725498364894165, 28.730060487917445, 28.727186981734814, 28.724624726723043, 28.7175128539468, 28.71260704114376, 28.712745332172247, 28.71886074506836, 28.713371084930767, 28.732518238202097, 28.74514120567144, 28.78557930586863, 28.81973870349426, 28.847467606754197, 28.87308863084842, 28.898170463161215, 28.92245657140497, 28.946464319684654, 28.971083198344285, 28.99708412503673, 29.034166163974366, 29.049184956376234, 29.06859562248788, 29.087591062343982, 29.100615212970617, 29.110415254304215, 29.152058747279995, 29.193079445812476, 29.234031804861615, 29.275125167961694, 29.31651418724437, 29.358536232774373, 29.3999066120251, 29.437831149831137, 29.475250373957152, 29.509847615675902, 29.536704224755123, 29.561973090851744, 29.587981195991922, 29.587981195991922, 29.587981195991922, 29.587981195991922, 29.587981195991922, 29.613856914855994, 29.651330451598536, 29.665158697500825, 29.682040116912084, 29.698902132693746, 29.715648240759567, 29.732294335251584, 29.746222675456153, 29.760216092277478, 29.77427531154659, 29.795750890622703, 29.825202369013546, 29.828237859479792, 29.830302391770203, 29.86004235881241, 29.88921512383933, 29.911773237685534, 29.9576138928838, 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.413965924238596, 35.328927871607156, 35.255284325899225, 35.184655062636374, 35.10903598069981, 34.98401255334109, 34.69657942589786, 34.15593323762416, 33.592573890480125, 33.139435612174886, 32.73183874450388, 32.3882714992872, 32.096686957888316, 31.815786651290537, 31.560010787982325, 31.29848355928552, 31.004846499743014, 30.657313119744245, 30.422608675088224, 30.261451873359817, 30.129000596928243, 30.01412449732654, 29.917084865275573, 29.838312909194517, 29.765528992507193, 29.694276805759852, 29.625285102985927, 29.55708416206286, 29.48714712883937, 29.41328398912972, 29.307941750556168, 29.161916692456177, 28.999741386872298, 28.841146924744326, 28.708693502896292, 28.587721084157604, 28.469420718326347, 28.35288957993533, 28.236552579578913, 28.119815016502667, 28.00223755667274, 27.882861803008932, 27.765337295571847, 27.65760169570168, 27.551301585242545, 27.4530181306231, 27.3767241780263, 27.30494066781237, 27.231057135649237, 27.231057135649237, 27.231057135649237, 27.231057135649237, 27.231057135649237, 27.157549684928266, 27.05109528379983, 26.916400833411686, 26.770970617846043, 26.62594142015779, 26.482142993486786, 26.339437466823828, 26.2055081074713, 26.071307395930003, 25.93683328143518, 25.779970015835044, 25.59730764565098, 25.35485425993647, 25.136786996279994, 24.953029249937778, 24.773017551691073, 24.614147054034017, 24.483923437032136, 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": "9e2f7a19", "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": "23f82039", "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": "3e785aef", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reservoir1 has a total value of 234360.10 € at 10.01 Mm3 and an average water value of 23407.83 €/Mm3\n", "Reservoir2 has a total value of 527770.07 € at 23.40 Mm3 and an average water value of 22554.28 €/Mm3\n", "Reservoir3 has a total value of 65958.83 € at 14.71 Mm3 and an average water value of 4484.20 €/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": "88e0cbb6", "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": "211deaa0", "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": [ 25.881979725200676, 25.91355237861006, 25.941752542303515, 25.96658504544623, 25.996288755610696, 26.05326018621781, 26.159174112479047, 26.34934701247153, 26.54750098796193, 26.70688218627753, 26.85024143761171, 26.971077026559424, 27.07870706168169, 27.182510324386477, 27.27738753896605, 27.372284872450305, 27.478693824103456, 27.601030756598423, 27.691065478973957, 27.753158638765687, 27.80697243139511, 27.85426948640678, 27.8892968905143, 27.920062818581936, 27.948407588213563, 27.976147614550182, 28.001763050680868, 28.02586492440125, 28.051820231785722, 28.08053084856987, 28.115966154740853, 28.176757648284635, 28.239249233314037, 28.300342965344175, 28.35377373011018, 28.405928258777, 28.45793029600446, 28.509087680540695, 28.560088320310207, 28.611197523607732, 28.662606205112862, 28.71473265821587, 28.765984784356423, 28.812655129438614, 28.84802631648805, 28.88300831924854, 28.91373727202731, 28.933103905529045, 28.953023660927755, 28.953023660927755, 28.953023660927755, 28.953023660927755, 28.953023660927755, 28.981419229150408, 29.024785720472952, 29.079626816262525, 29.139266025577182, 29.198697445932513, 29.25758105903135, 29.3159735345899, 29.37036094647099, 29.42482682286892, 29.479371474644125, 29.538047298783614, 29.59979954904155, 29.676195220996593, 29.74630144051827, 29.808246173321717, 29.867734263393206, 29.925786720654642, 29.978924596751675, 30.02975182813939, 30.02975182813939 ], "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.015055770887773, 26.97903518759334, 26.975331408379915, 26.96960967194521, 26.96524997036181, 26.94633605795975, 26.946468509375325, 26.951220789729497, 26.956758738659445, 26.961697194341216, 26.966581895582262, 26.971077026559424, 26.973232574365237, 26.9756382514268, 26.973416465998614, 26.971402149191764, 26.974650338121403, 26.980846701750938, 26.979060428246196, 26.96623531285714, 26.984456330971792, 26.99943188800128, 27.0344592921088, 27.06522522017644, 27.093569989808067, 27.121310016144687, 27.146925452275372, 27.171027325995755, 27.196982633380223, 27.225693250164376, 27.261128556335358, 27.2852963775596, 27.308443615542156, 27.33273667730377, 27.351414796168775, 27.370813498243464, 27.390170420399297, 27.409227729458202, 27.46022836922771, 27.51133757252524, 27.56274625403037, 27.614872707133376, 27.66612483327393, 27.712795178356117, 27.748166365405556, 27.783148368166046, 27.813877320944815, 27.83324395444655, 27.85316370984526, 27.85316370984526, 27.85316370984526, 27.85316370984526, 27.85316370984526, 27.881559278067915, 27.924925769390452, 27.946213912943836, 27.970928229348797, 27.996203117751865, 28.021247224039957, 28.046084611812667, 28.06728815281843, 28.08853974283701, 28.10983969665145, 28.134806325996706, 28.161260346258317, 28.15542536948188, 28.150907069083736, 28.17794094565286, 28.203268894945715, 28.227987755673556, 28.281125631770585, 28.331952863158303, 28.331952863158303 ], "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.33850866905329, 33.24881743083833, 33.16870672342535, 33.09816282817629, 33.01378086288233, 32.851937064460536, 32.551057975604664, 32.01081694314888, 31.447903361306345, 30.995135048179375, 30.5878817015883, 30.24461332142954, 29.938859129849117, 29.643975990252837, 29.374449867640084, 29.10486659146949, 28.802581240055556, 28.455047860056787, 28.199278234758168, 28.02288468575276, 27.870011069734744, 27.7356501285458, 27.63614467345709, 27.548745171507125, 27.468223669173643, 27.389420114781622, 27.316652072318195, 27.248183740903293, 27.174450196009946, 27.09288939920595, 26.992225180529392, 26.81952939034099, 26.6420039994077, 26.468449613531256, 26.316664098753755, 26.168504101113093, 26.020777299435885, 25.87544997761092, 25.730567934553918, 25.585377485449246, 25.439336282025298, 25.291256041130104, 25.14565957842262, 25.013078987742954, 24.912596917944743, 24.813220438491328, 24.725925975525552, 24.67090946119263, 24.614321644404377, 24.614321644404377, 24.614321644404377, 24.614321644404377, 24.614321644404377, 24.533655834005614, 24.410460793876346, 24.2546688266111, 24.085246432483068, 23.916414322890443, 23.74913841798233, 23.583257731067157, 23.42875458393948, 23.27402853569606, 23.119078703248103, 22.952393082875464, 22.776967985834126, 22.559944021358756, 22.36078706252045, 22.184815163231683, 22.015822066947635, 21.85090730018143, 21.699953820236065, 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\")" ] }, { "cell_type": "markdown", "id": "c42f2641", "metadata": { "Collapsed": "false" }, "source": [ "(ind-wv-py)=\n", "## ind_wv.py" ] }, { "cell_type": "code", "execution_count": 10, "id": "20953fad", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "import pandas as pd\n", " \n", "def build_model(shop):\n", "\n", " starttime = pd.Timestamp('2018-01-23 00:00:00')\n", " endtime = pd.Timestamp('2018-01-26')\n", " shop.set_time_resolution(starttime=starttime, endtime=endtime, timeunit=\"hour\", timeresolution=pd.Series(index=[starttime],data=[1]))\n", " \n", " rsv1 = shop.model.reservoir.add_object('Reservoir1')\n", " rsv1.max_vol.set(20)\n", " rsv1.lrl.set(1000)\n", " rsv1.hrl.set(1010)\n", " rsv1.vol_head.set(pd.Series([1000, 1010, 1011], index=[0, 20, 22], name=0))\n", " rsv1.flow_descr.set(pd.Series([0, 1000], index=[1010, 1011], name=0))\n", "\n", " gate = shop.model.gate.add_object('Flow_gate') \n", " gate.max_discharge.set(50) \n", " \n", " rsv2 = shop.model.reservoir.add_object('Reservoir2')\n", " rsv2.max_vol.set(39)\n", " rsv2.lrl.set(860)\n", " rsv2.hrl.set(905)\n", " rsv2.vol_head.set(pd.Series([860, 906, 907], index=[0, 39, 41.66], name=0)) \n", "\n", " rsv3 = shop.model.reservoir.add_object('Reservoir3')\n", " rsv3.max_vol.set(97.5) \n", " rsv3.lrl.set(650) \n", " rsv3.hrl.set(679) \n", " rsv3.vol_head.set(pd.Series([650, 679, 680], index=[0, 97.5, 104.15], name=0))\n", " \n", " plant1 = shop.model.plant.add_object('Plant1')\n", " plant1.outlet_line.set(672)\n", " plant1.main_loss.set([0])\n", " plant1.penstock_loss.set([0.001])\n", " plant1.mip_flag.set(1)\n", " for gen_no in range(2):\n", " gen=shop.model.generator.add_object(f\"{plant1.get_name()}_G{str(gen_no+1)}\")\n", " gen.connect_to(plant1)\n", " gen.penstock.set(1)\n", " gen.p_min.set(60)\n", " gen.p_max.set(120)\n", " gen.p_nom.set(120)\n", " gen.startcost.set(300)\n", " gen.gen_eff_curve.set(pd.Series([100, 100], index=[60, 120]))\n", " gen.turb_eff_curves.set([pd.Series([85.8733, 87.0319, 88.0879, 89.0544, 89.9446, 90.7717, 91.5488, 92.2643, 92.8213, 93.1090, 93.2170, 93.0390, 92.6570, 92.1746],\n", " index=[28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.10, 51.43, 53.76, 56.10, 58.83],\n", " name=170),\n", " pd.Series([86.7321, 87.9022, 88.9688, 89.9450, 90.8441, 91.6794, 92.4643, 93.1870, 93.7495, 94.0401, 94.1492, 93.9694, 93.5836, 93.0964],\n", " index=[28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.10, 51.43, 53.76, 56.10, 58.83],\n", " name=200),\n", " pd.Series([87.5908, 88.7725, 89.8497, 90.8355, 91.7435, 92.5871, 93.3798, 94.1096, 94.6777, 94.9712, 95.0813, 94.8998, 94.5101, 94.0181],\n", " index=[28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.10, 51.43, 53.76, 56.10, 58.83],\n", " name=230)])\n", "\n", " plant2 = shop.model.plant.add_object('Plant2')\n", " plant2.outlet_line.set(586)\n", " plant2.main_loss.set([0])\n", " plant2.penstock_loss.set([0.0001,0.0002])\n", " plant2.mip_flag.set(1)\n", " for gen_no in range(4):\n", " gen=shop.model.generator.add_object(f\"{plant2.get_name()}_G{str(gen_no+1)}\")\n", " gen.connect_to(plant2)\n", " if gen_no == 0:\n", " gen.penstock.set(1)\n", " gen.p_min.set(100)\n", " gen.p_max.set(180)\n", " gen.p_nom.set(180)\n", " gen.startcost.set(300)\n", " gen.gen_eff_curve.set(pd.Series([100, 100], index=[100, 180]))\n", " gen.turb_eff_curves.set([pd.Series([92.7201, 93.2583, 93.7305, 94.1368, 94.4785, 94.7525, 94.9606, 95.1028, 95.1790, 95.1892, 95.1335, 95.0118, 94.8232, 94.5191],\n", " index=[126.54, 137.03, 147.51, 158.00, 168.53, 179.01, 189.50, 199.98, 210.47, 220.95, 231.44, 241.92, 252.45, 264.74],\n", " name=60)])\n", " else:\n", " gen.penstock.set(2)\n", " gen.p_min.set(30)\n", " gen.p_max.set(55)\n", " gen.p_nom.set(55)\n", " gen.startcost.set(300)\n", " gen.gen_eff_curve.set(pd.Series([100, 100], index=[30, 55]))\n", " gen.turb_eff_curves.set([pd.Series([83.8700, 85.1937, 86.3825, 87.4362, 88.3587, 89.1419, 89.7901, 90.3033, 90.6815, 90.9248, 91.0331, 91.0063, 90.8436, 90.4817],\n", " index=[40.82, 44.20, 47.58, 50.97, 54.36, 57.75, 61.13, 64.51, 67.89, 71.27, 74.66, 78.04, 81.44, 85.40],\n", " name=60)])\n", " \n", " rsv1.connect_to(gate)\n", " gate.connect_to(rsv2) \n", " rsv2.connect_to(plant1)\n", " plant1.connect_to(rsv3)\n", " rsv3.connect_to(plant2)\n", " \n", " rsv1.start_head.set(1006)\n", " rsv2.start_head.set(900)\n", " rsv3.start_head.set(670) \n", " rsv3.inflow.set(pd.Series([60], [starttime]))\n", " \n", " da = shop.model.market.add_object('Day_ahead')\n", " da.sale_price.set(pd.DataFrame([32.992,31.122,29.312,28.072,30.012,33.362,42.682,74.822,77.732,62.332,55.892,46.962,42.582,40.942,39.212,39.142,41.672,46.922,37.102,32.992,31.272,29.752,28.782,28.082,27.242,26.622,25.732,25.392,25.992,27.402,28.942,32.182,33.082,32.342,30.912,30.162,30.062,29.562,29.462,29.512,29.672,30.072,29.552,28.862,28.412,28.072,27.162,25.502,26.192,25.222,24.052,23.892,23.682,26.092,28.202,30.902,31.572,31.462,31.172,30.912,30.572,30.602,30.632,31.062,32.082,36.262,34.472,32.182,31.492,30.732,29.712,28.982], \n", " index=[starttime + pd.Timedelta(hours=i) for i in range(0,72)]))\n", " da.max_sale.set(pd.Series([9999], [starttime]))\n", " da.buy_price.set(da.sale_price.get()+0.002)\n", " da.max_buy.set(pd.Series([9999], [starttime]))\n", " \n", " settings = shop.model.global_settings.global_settings\n", " settings.mipgap_rel.set(0)\n", " settings.mipgap_abs.set(0)\n", " \n", "\n", "def run_model(shop):\n", " shop.start_sim([], ['3'])\n", " shop.set_code(['incremental'], [])\n", " shop.start_sim([], ['3'])\n", "\n", "\n" ] } ], "source": [ "with open('ind_wv.py', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "8afd173b", "metadata": { "Collapsed": "false" }, "source": [ "(ind-wv-model-yaml)=\n", "## model.yaml" ] }, { "cell_type": "code", "execution_count": 11, "id": "4a9dc83a", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "time:\n", " starttime: 2018-01-23 00:00:00\n", " endtime: 2018-01-26 00:00:00\n", " timeunit: hour\n", " timeresolution:\n", " 2018-01-23 00:00:00: 1\n", "model:\n", " reservoir:\n", " Reservoir1:\n", " start_head: 1006\n", " max_vol: 20\n", " lrl: 1000\n", " hrl: 1010\n", " vol_head:\n", " ref: 0\n", " x:\n", " - 0\n", " - 20\n", " - 22\n", " y:\n", " - 1000\n", " - 1010\n", " - 1011\n", " flow_descr:\n", " ref: 0\n", " x:\n", " - 1010\n", " - 1011\n", " y:\n", " - 0\n", " - 1000\n", " Reservoir2:\n", " start_head: 900\n", " max_vol: 39\n", " lrl: 860\n", " hrl: 905\n", " vol_head:\n", " ref: 0\n", " x:\n", " - 0\n", " - 39\n", " - 41.66\n", " y:\n", " - 860\n", " - 906\n", " - 907\n", " Reservoir3:\n", " start_head: 670\n", " max_vol: 97.5\n", " lrl: 650\n", " hrl: 679\n", " vol_head:\n", " ref: 0\n", " x:\n", " - 0\n", " - 97.5\n", " - 104.15\n", " y:\n", " - 650\n", " - 679\n", " - 680\n", " inflow:\n", " 2018-01-23 00:00:00: 60\n", " gate:\n", " Flow_gate:\n", " max_discharge: 50\n", " plant:\n", " Plant1:\n", " equal_distribution: -1\n", " outlet_line: 672\n", " main_loss:\n", " - 0\n", " penstock_loss:\n", " - 0.001\n", " mip_flag:\n", " 2018-01-23 00:00:00: 1\n", " Plant2:\n", " equal_distribution: -1\n", " outlet_line: 586\n", " main_loss:\n", " - 0\n", " penstock_loss:\n", " - 0.0001\n", " - 0.0002\n", " mip_flag:\n", " 2018-01-23 00:00:00: 1\n", " generator:\n", " Plant1_G1:\n", " initial_state: -1\n", " penstock: 1\n", " p_min: 60\n", " p_max: 120\n", " p_nom: 120\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 60\n", " - 120\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 170\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 85.8733\n", " - 87.0319\n", " - 88.0879\n", " - 89.0544\n", " - 89.9446\n", " - 90.7717\n", " - 91.5488\n", " - 92.2643\n", " - 92.8213\n", " - 93.109\n", " - 93.217\n", " - 93.039\n", " - 92.657\n", " - 92.1746\n", " - ref: 200\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 86.7321\n", " - 87.9022\n", " - 88.9688\n", " - 89.945\n", " - 90.8441\n", " - 91.6794\n", " - 92.4643\n", " - 93.187\n", " - 93.7495\n", " - 94.0401\n", " - 94.1492\n", " - 93.9694\n", " - 93.5836\n", " - 93.0964\n", " - ref: 230\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 87.5908\n", " - 88.7725\n", " - 89.8497\n", " - 90.8355\n", " - 91.7435\n", " - 92.5871\n", " - 93.3798\n", " - 94.1096\n", " - 94.6777\n", " - 94.9712\n", " - 95.0813\n", " - 94.8998\n", " - 94.5101\n", " - 94.0181\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " Plant1_G2:\n", " initial_state: -1\n", " penstock: 1\n", " p_min: 60\n", " p_max: 120\n", " p_nom: 120\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 60\n", " - 120\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 170\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 85.8733\n", " - 87.0319\n", " - 88.0879\n", " - 89.0544\n", " - 89.9446\n", " - 90.7717\n", " - 91.5488\n", " - 92.2643\n", " - 92.8213\n", " - 93.109\n", " - 93.217\n", " - 93.039\n", " - 92.657\n", " - 92.1746\n", " - ref: 200\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 86.7321\n", " - 87.9022\n", " - 88.9688\n", " - 89.945\n", " - 90.8441\n", " - 91.6794\n", " - 92.4643\n", " - 93.187\n", " - 93.7495\n", " - 94.0401\n", " - 94.1492\n", " - 93.9694\n", " - 93.5836\n", " - 93.0964\n", " - ref: 230\n", " x:\n", " - 28.12\n", " - 30.45\n", " - 32.78\n", " - 35.11\n", " - 37.45\n", " - 39.78\n", " - 42.11\n", " - 44.44\n", " - 46.77\n", " - 49.1\n", " - 51.43\n", " - 53.76\n", " - 56.1\n", " - 58.83\n", " y:\n", " - 87.5908\n", " - 88.7725\n", " - 89.8497\n", " - 90.8355\n", " - 91.7435\n", " - 92.5871\n", " - 93.3798\n", " - 94.1096\n", " - 94.6777\n", " - 94.9712\n", " - 95.0813\n", " - 94.8998\n", " - 94.5101\n", " - 94.0181\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " Plant2_G1:\n", " initial_state: -1\n", " penstock: 1\n", " p_min: 100\n", " p_max: 180\n", " p_nom: 180\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 100\n", " - 180\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 60\n", " x:\n", " - 126.54\n", " - 137.03\n", " - 147.51\n", " - 158\n", " - 168.53\n", " - 179.01\n", " - 189.5\n", " - 199.98\n", " - 210.47\n", " - 220.95\n", " - 231.44\n", " - 241.92\n", " - 252.45\n", " - 264.74\n", " y:\n", " - 92.7201\n", " - 93.2583\n", " - 93.7305\n", " - 94.1368\n", " - 94.4785\n", " - 94.7525\n", " - 94.9606\n", " - 95.1028\n", " - 95.179\n", " - 95.1892\n", " - 95.1335\n", " - 95.0118\n", " - 94.8232\n", " - 94.5191\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " Plant2_G2:\n", " initial_state: -1\n", " penstock: 2\n", " p_min: 30\n", " p_max: 55\n", " p_nom: 55\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 30\n", " - 55\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 60\n", " x:\n", " - 40.82\n", " - 44.2\n", " - 47.58\n", " - 50.97\n", " - 54.36\n", " - 57.75\n", " - 61.13\n", " - 64.51\n", " - 67.89\n", " - 71.27\n", " - 74.66\n", " - 78.04\n", " - 81.44\n", " - 85.4\n", " y:\n", " - 83.87\n", " - 85.1937\n", " - 86.3825\n", " - 87.4362\n", " - 88.3587\n", " - 89.1419\n", " - 89.7901\n", " - 90.3033\n", " - 90.6815\n", " - 90.9248\n", " - 91.0331\n", " - 91.0063\n", " - 90.8436\n", " - 90.4817\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " Plant2_G3:\n", " initial_state: -1\n", " penstock: 2\n", " p_min: 30\n", " p_max: 55\n", " p_nom: 55\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 30\n", " - 55\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 60\n", " x:\n", " - 40.82\n", " - 44.2\n", " - 47.58\n", " - 50.97\n", " - 54.36\n", " - 57.75\n", " - 61.13\n", " - 64.51\n", " - 67.89\n", " - 71.27\n", " - 74.66\n", " - 78.04\n", " - 81.44\n", " - 85.4\n", " y:\n", " - 83.87\n", " - 85.1937\n", " - 86.3825\n", " - 87.4362\n", " - 88.3587\n", " - 89.1419\n", " - 89.7901\n", " - 90.3033\n", " - 90.6815\n", " - 90.9248\n", " - 91.0331\n", " - 91.0063\n", " - 90.8436\n", " - 90.4817\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " Plant2_G4:\n", " initial_state: -1\n", " penstock: 2\n", " p_min: 30\n", " p_max: 55\n", " p_nom: 55\n", " gen_eff_curve:\n", " ref: 0\n", " x:\n", " - 30\n", " - 55\n", " y:\n", " - 100\n", " - 100\n", " turb_eff_curves:\n", " - ref: 60\n", " x:\n", " - 40.82\n", " - 44.2\n", " - 47.58\n", " - 50.97\n", " - 54.36\n", " - 57.75\n", " - 61.13\n", " - 64.51\n", " - 67.89\n", " - 71.27\n", " - 74.66\n", " - 78.04\n", " - 81.44\n", " - 85.4\n", " y:\n", " - 83.87\n", " - 85.1937\n", " - 86.3825\n", " - 87.4362\n", " - 88.3587\n", " - 89.1419\n", " - 89.7901\n", " - 90.3033\n", " - 90.6815\n", " - 90.9248\n", " - 91.0331\n", " - 91.0063\n", " - 90.8436\n", " - 90.4817\n", " startcost:\n", " 2018-01-23 00:00:00: 300\n", " market:\n", " Day_ahead:\n", " market_type: ENERGY\n", " max_buy:\n", " 2018-01-23 00:00:00: 9999\n", " max_sale:\n", " 2018-01-23 00:00:00: 9999\n", " buy_price:\n", " 2018-01-23 00:00:00: 32.994\n", " 2018-01-23 01:00:00: 31.124\n", " 2018-01-23 02:00:00: 29.314\n", " 2018-01-23 03:00:00: 28.074\n", " 2018-01-23 04:00:00: 30.014\n", " 2018-01-23 05:00:00: 33.364\n", " 2018-01-23 06:00:00: 42.684\n", " 2018-01-23 07:00:00: 74.824\n", " 2018-01-23 08:00:00: 77.734\n", " 2018-01-23 09:00:00: 62.334\n", " 2018-01-23 10:00:00: 55.894\n", " 2018-01-23 11:00:00: 46.964\n", " 2018-01-23 12:00:00: 42.584\n", " 2018-01-23 13:00:00: 40.944\n", " 2018-01-23 14:00:00: 39.214\n", " 2018-01-23 15:00:00: 39.144\n", " 2018-01-23 16:00:00: 41.674\n", " 2018-01-23 17:00:00: 46.924\n", " 2018-01-23 18:00:00: 37.104\n", " 2018-01-23 19:00:00: 32.994\n", " 2018-01-23 20:00:00: 31.274\n", " 2018-01-23 21:00:00: 29.754\n", " 2018-01-23 22:00:00: 28.784\n", " 2018-01-23 23:00:00: 28.084\n", " 2018-01-24 00:00:00: 27.244\n", " 2018-01-24 01:00:00: 26.624\n", " 2018-01-24 02:00:00: 25.734\n", " 2018-01-24 03:00:00: 25.394\n", " 2018-01-24 04:00:00: 25.994\n", " 2018-01-24 05:00:00: 27.404\n", " 2018-01-24 06:00:00: 28.944\n", " 2018-01-24 07:00:00: 32.184\n", " 2018-01-24 08:00:00: 33.084\n", " 2018-01-24 09:00:00: 32.344\n", " 2018-01-24 10:00:00: 30.914\n", " 2018-01-24 11:00:00: 30.164\n", " 2018-01-24 12:00:00: 30.064\n", " 2018-01-24 13:00:00: 29.564\n", " 2018-01-24 14:00:00: 29.464\n", " 2018-01-24 15:00:00: 29.514\n", " 2018-01-24 16:00:00: 29.674\n", " 2018-01-24 17:00:00: 30.074\n", " 2018-01-24 18:00:00: 29.554\n", " 2018-01-24 19:00:00: 28.864\n", " 2018-01-24 20:00:00: 28.414\n", " 2018-01-24 21:00:00: 28.074\n", " 2018-01-24 22:00:00: 27.164\n", " 2018-01-24 23:00:00: 25.504\n", " 2018-01-25 00:00:00: 26.194\n", " 2018-01-25 01:00:00: 25.224\n", " 2018-01-25 02:00:00: 24.054\n", " 2018-01-25 03:00:00: 23.894\n", " 2018-01-25 04:00:00: 23.684\n", " 2018-01-25 05:00:00: 26.094\n", " 2018-01-25 06:00:00: 28.204\n", " 2018-01-25 07:00:00: 30.904\n", " 2018-01-25 08:00:00: 31.574\n", " 2018-01-25 09:00:00: 31.464\n", " 2018-01-25 10:00:00: 31.174\n", " 2018-01-25 11:00:00: 30.914\n", " 2018-01-25 12:00:00: 30.574\n", " 2018-01-25 13:00:00: 30.604\n", " 2018-01-25 14:00:00: 30.634\n", " 2018-01-25 15:00:00: 31.064\n", " 2018-01-25 16:00:00: 32.084\n", " 2018-01-25 17:00:00: 36.264\n", " 2018-01-25 18:00:00: 34.474\n", " 2018-01-25 19:00:00: 32.184\n", " 2018-01-25 20:00:00: 31.494\n", " 2018-01-25 21:00:00: 30.734\n", " 2018-01-25 22:00:00: 29.714\n", " 2018-01-25 23:00:00: 28.984\n", " sale_price:\n", " 2018-01-23 00:00:00: 32.992\n", " 2018-01-23 01:00:00: 31.122\n", " 2018-01-23 02:00:00: 29.312\n", " 2018-01-23 03:00:00: 28.072\n", " 2018-01-23 04:00:00: 30.012\n", " 2018-01-23 05:00:00: 33.362\n", " 2018-01-23 06:00:00: 42.682\n", " 2018-01-23 07:00:00: 74.822\n", " 2018-01-23 08:00:00: 77.732\n", " 2018-01-23 09:00:00: 62.332\n", " 2018-01-23 10:00:00: 55.892\n", " 2018-01-23 11:00:00: 46.962\n", " 2018-01-23 12:00:00: 42.582\n", " 2018-01-23 13:00:00: 40.942\n", " 2018-01-23 14:00:00: 39.212\n", " 2018-01-23 15:00:00: 39.142\n", " 2018-01-23 16:00:00: 41.672\n", " 2018-01-23 17:00:00: 46.922\n", " 2018-01-23 18:00:00: 37.102\n", " 2018-01-23 19:00:00: 32.992\n", " 2018-01-23 20:00:00: 31.272\n", " 2018-01-23 21:00:00: 29.752\n", " 2018-01-23 22:00:00: 28.782\n", " 2018-01-23 23:00:00: 28.082\n", " 2018-01-24 00:00:00: 27.242\n", " 2018-01-24 01:00:00: 26.622\n", " 2018-01-24 02:00:00: 25.732\n", " 2018-01-24 03:00:00: 25.392\n", " 2018-01-24 04:00:00: 25.992\n", " 2018-01-24 05:00:00: 27.402\n", " 2018-01-24 06:00:00: 28.942\n", " 2018-01-24 07:00:00: 32.182\n", " 2018-01-24 08:00:00: 33.082\n", " 2018-01-24 09:00:00: 32.342\n", " 2018-01-24 10:00:00: 30.912\n", " 2018-01-24 11:00:00: 30.162\n", " 2018-01-24 12:00:00: 30.062\n", " 2018-01-24 13:00:00: 29.562\n", " 2018-01-24 14:00:00: 29.462\n", " 2018-01-24 15:00:00: 29.512\n", " 2018-01-24 16:00:00: 29.672\n", " 2018-01-24 17:00:00: 30.072\n", " 2018-01-24 18:00:00: 29.552\n", " 2018-01-24 19:00:00: 28.862\n", " 2018-01-24 20:00:00: 28.412\n", " 2018-01-24 21:00:00: 28.072\n", " 2018-01-24 22:00:00: 27.162\n", " 2018-01-24 23:00:00: 25.502\n", " 2018-01-25 00:00:00: 26.192\n", " 2018-01-25 01:00:00: 25.222\n", " 2018-01-25 02:00:00: 24.052\n", " 2018-01-25 03:00:00: 23.892\n", " 2018-01-25 04:00:00: 23.682\n", " 2018-01-25 05:00:00: 26.092\n", " 2018-01-25 06:00:00: 28.202\n", " 2018-01-25 07:00:00: 30.902\n", " 2018-01-25 08:00:00: 31.572\n", " 2018-01-25 09:00:00: 31.462\n", " 2018-01-25 10:00:00: 31.172\n", " 2018-01-25 11:00:00: 30.912\n", " 2018-01-25 12:00:00: 30.572\n", " 2018-01-25 13:00:00: 30.602\n", " 2018-01-25 14:00:00: 30.632\n", " 2018-01-25 15:00:00: 31.062\n", " 2018-01-25 16:00:00: 32.082\n", " 2018-01-25 17:00:00: 36.262\n", " 2018-01-25 18:00:00: 34.472\n", " 2018-01-25 19:00:00: 32.182\n", " 2018-01-25 20:00:00: 31.492\n", " 2018-01-25 21:00:00: 30.732\n", " 2018-01-25 22:00:00: 29.712\n", " 2018-01-25 23:00:00: 28.982\n", "connections:\n", " - from: Reservoir1\n", " to: Flow_gate\n", " from_type: reservoir\n", " to_type: gate\n", " connection_type: connection_standard\n", " order: 0\n", " - from: Flow_gate\n", " to: Reservoir2\n", " from_type: gate\n", " to_type: reservoir\n", " connection_type: connection_standard\n", " order: 0\n", " - from: Plant1\n", " to: Reservoir3\n", " from_type: plant\n", " to_type: reservoir\n", " connection_type: connection_standard\n", " order: 0\n", " - from: Reservoir2\n", " to: Plant1\n", " from_type: reservoir\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 0\n", " - from: Plant1_G1\n", " to: Plant1\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 1\n", " - from: Plant1_G2\n", " to: Plant1\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 2\n", " - from: Reservoir3\n", " to: Plant2\n", " from_type: reservoir\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 0\n", " - from: Plant2_G1\n", " to: Plant2\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 1\n", " - from: Plant2_G2\n", " to: Plant2\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 2\n", " - from: Plant2_G3\n", " to: Plant2\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 3\n", " - from: Plant2_G4\n", " to: Plant2\n", " from_type: generator\n", " to_type: plant\n", " connection_type: connection_standard\n", " order: 4\n" ] } ], "source": [ "with open('model.yaml', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "83c2d548", "metadata": { "Collapsed": "false" }, "source": [ "(constant-energy-values-yaml)=\n", "## constant_energy_values.yaml" ] }, { "cell_type": "code", "execution_count": 12, "id": "d6e5e5d5", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "model:\n", " reservoir:\n", " Reservoir1:\n", " energy_value_input: 31\n", " Reservoir2: \n", " energy_value_input: 30\n", " Reservoir3:\n", " energy_value_input: 20\n" ] } ], "source": [ "with open('constant_energy_values.yaml', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "3531686c", "metadata": { "Collapsed": "false" }, "source": [ "(constant-mixed-values-yaml)=\n", "## constant_mixed_values.yaml" ] }, { "cell_type": "code", "execution_count": 13, "id": "0ef75a26", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "model:\n", " reservoir:\n", " Reservoir1:\n", " energy_value_input: 31\n", " Reservoir2:\n", " energy_value_input: 30\n", " Reservoir3: \n", " water_value_input:\n", " - ref: 0\n", " x:\n", " - 0\n", " y:\n", " - 5000\n" ] } ], "source": [ "with open('constant_mixed_values.yaml', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "78302100", "metadata": { "Collapsed": "false" }, "source": [ "(water-value-tables-yaml)=\n", "## water_value_tables.yaml" ] }, { "cell_type": "code", "execution_count": 14, "id": "c3740314", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "model:\n", " reservoir:\n", " Reservoir1: \n", " water_value_input:\n", " - ref: 0\n", " x:\n", " - 0\n", " - 2\n", " - 4\n", " - 6\n", " - 8\n", " - 10\n", " - 12\n", " - 14\n", " - 16\n", " - 18\n", " y:\n", " - 24395.272\n", " - 23902.438222222\n", " - 23409.604444444\n", " - 22916.770666667\n", " - 22423.936888889\n", " - 21931.103111111\n", " - 21438.269333333\n", " - 20945.435555556\n", " - 20452.601777778\n", " - 19959.768\n", " Reservoir2: \n", " water_value_input:\n", " - ref: 0\n", " x:\n", " - 0\n", " - 3.9\n", " - 7.8\n", " - 11.7\n", " - 15.6\n", " - 19.5\n", " - 23.4\n", " - 27.3\n", " - 31.2\n", " - 35.1\n", " y:\n", " - 23753.972\n", " - 23274.093777778\n", " - 22794.215555556\n", " - 22314.337333333\n", " - 21834.459111111\n", " - 21354.580888889\n", " - 20874.702666667\n", " - 20394.824444444\n", " - 19914.946222222\n", " - 19435.068\n", " Reservoir3: \n", " water_value_input:\n", " - ref: 0\n", " x:\n", " - 0\n", " - 9.75\n", " - 19.5\n", " - 29.25\n", " - 39\n", " - 48.75\n", " - 58.5\n", " - 68.25\n", " - 78\n", " - 87.75\n", " y:\n", " - 4514.95\n", " - 4423.7388888889\n", " - 4332.5277777778\n", " - 4241.3166666667\n", " - 4150.1055555556\n", " - 4058.8944444444\n", " - 3967.6833333333\n", " - 3876.4722222222\n", " - 3785.2611111111\n", " - 3694.05\n" ] } ], "source": [ "with open('water_value_tables.yaml', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "931f6602", "metadata": { "Collapsed": "false" }, "source": [ "(ind-wv-model-ascii)=\n", "## model.ascii" ] }, { "cell_type": "code", "execution_count": 15, "id": "6396acd8", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "#;\n", "# Name of the datafile is: model.ascii;\n", "#;\n", "\n", "SIZE\n", "#Num_reservoirs;Num_plants;Num_gates;Num_junctions\n", "3 2 1 0\n", "\n", "OPTIMIZATION time\n", "#Start_time; End_time;\n", "20180123000000 20180126000000\n", "\n", "#;N_full_iterations;Accuracy;\n", "OPTIMIZATION 1000 1.00\n", "#Time resolution in the optimization;\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NO_UNIT 73\n", "# Time; f(t);\n", "20180123000000000 1.00000000000000000\n", "\n", "RESERVOIR attributes Reservoir1\n", "#ID;Water_course;Type;Maxvol;Lrl;Hrl;\n", "0 0 0 20.000 1000.000 1010.000\n", "\n", "RESERVOIR vol_head Reservoir1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 3 MM3 METER\n", "# x_value; y_value;\n", "0.0000000000 1000.0000000000\n", "20.0000000000 1010.0000000000\n", "22.0000000000 1011.0000000000\n", "\n", "RESERVOIR flow_descr Reservoir1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 METER M3/S\n", "# x_value; y_value;\n", "1010.0000000000 0.0000000000\n", "1011.0000000000 1000.0000000000\n", "\n", "RESERVOIR attributes Reservoir2\n", "#ID;Water_course;Type;Maxvol;Lrl;Hrl;\n", "0 0 0 39.000 860.000 905.000\n", "\n", "RESERVOIR vol_head Reservoir2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 3 MM3 METER\n", "# x_value; y_value;\n", "0.0000000000 860.0000000000\n", "39.0000000000 906.0000000000\n", "41.6600000000 907.0000000000\n", "\n", "RESERVOIR attributes Reservoir3\n", "#ID;Water_course;Type;Maxvol;Lrl;Hrl;\n", "0 0 0 97.500 650.000 679.000\n", "\n", "RESERVOIR vol_head Reservoir3\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 3 MM3 METER\n", "# x_value; y_value;\n", "0.0000000000 650.0000000000\n", "97.5000000000 679.0000000000\n", "104.1500000000 680.0000000000\n", "\n", "RESERVOIR inflow Reservoir3\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 M3/S 73\n", "# Time; f(t);\n", "20180123000000000 60.00000000000000000\n", "\n", "PLANT attributes Plant1\n", "#Id;Water_course;Type;Future_use;Prod_area;Num_gen;Num_pump;\n", "0 0 6 0 1 2 0\n", "#Num_main_seg;Num_penstock;Time_delay;Read_prod_factor;Outlet_line;\n", "1 1 0 0.000000 672.000000\n", "0.000000\n", "0.001000\n", "\n", "PLANT mip_flag Plant1\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NO_UNIT 73\n", "# Time; f(t);\n", "20180123000000000 1.00000000000000000\n", "\n", "GENERATOR attributes Plant1 1\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 1 120.00 60.00 120.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant1 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "60.0000000000 100.0000000000\n", "120.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant1 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 170.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 85.8733000000\n", "30.4500000000 87.0319000000\n", "32.7800000000 88.0879000000\n", "35.1100000000 89.0544000000\n", "37.4500000000 89.9446000000\n", "39.7800000000 90.7717000000\n", "42.1100000000 91.5488000000\n", "44.4400000000 92.2643000000\n", "46.7700000000 92.8213000000\n", "49.1000000000 93.1090000000\n", "51.4300000000 93.2170000000\n", "53.7600000000 93.0390000000\n", "56.1000000000 92.6570000000\n", "58.8300000000 92.1746000000\n", "\n", "GENERATOR turb_eff_curves Plant1 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 200.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 86.7321000000\n", "30.4500000000 87.9022000000\n", "32.7800000000 88.9688000000\n", "35.1100000000 89.9450000000\n", "37.4500000000 90.8441000000\n", "39.7800000000 91.6794000000\n", "42.1100000000 92.4643000000\n", "44.4400000000 93.1870000000\n", "46.7700000000 93.7495000000\n", "49.1000000000 94.0401000000\n", "51.4300000000 94.1492000000\n", "53.7600000000 93.9694000000\n", "56.1000000000 93.5836000000\n", "58.8300000000 93.0964000000\n", "\n", "GENERATOR turb_eff_curves Plant1 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 230.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 87.5908000000\n", "30.4500000000 88.7725000000\n", "32.7800000000 89.8497000000\n", "35.1100000000 90.8355000000\n", "37.4500000000 91.7435000000\n", "39.7800000000 92.5871000000\n", "42.1100000000 93.3798000000\n", "44.4400000000 94.1096000000\n", "46.7700000000 94.6777000000\n", "49.1000000000 94.9712000000\n", "51.4300000000 95.0813000000\n", "53.7600000000 94.8998000000\n", "56.1000000000 94.5101000000\n", "58.8300000000 94.0181000000\n", "\n", "GENERATOR startcost Plant1 1\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "GENERATOR attributes Plant1 2\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 1 120.00 60.00 120.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant1 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "60.0000000000 100.0000000000\n", "120.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant1 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 170.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 85.8733000000\n", "30.4500000000 87.0319000000\n", "32.7800000000 88.0879000000\n", "35.1100000000 89.0544000000\n", "37.4500000000 89.9446000000\n", "39.7800000000 90.7717000000\n", "42.1100000000 91.5488000000\n", "44.4400000000 92.2643000000\n", "46.7700000000 92.8213000000\n", "49.1000000000 93.1090000000\n", "51.4300000000 93.2170000000\n", "53.7600000000 93.0390000000\n", "56.1000000000 92.6570000000\n", "58.8300000000 92.1746000000\n", "\n", "GENERATOR turb_eff_curves Plant1 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 200.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 86.7321000000\n", "30.4500000000 87.9022000000\n", "32.7800000000 88.9688000000\n", "35.1100000000 89.9450000000\n", "37.4500000000 90.8441000000\n", "39.7800000000 91.6794000000\n", "42.1100000000 92.4643000000\n", "44.4400000000 93.1870000000\n", "46.7700000000 93.7495000000\n", "49.1000000000 94.0401000000\n", "51.4300000000 94.1492000000\n", "53.7600000000 93.9694000000\n", "56.1000000000 93.5836000000\n", "58.8300000000 93.0964000000\n", "\n", "GENERATOR turb_eff_curves Plant1 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 230.00 14 M3/S %\n", "# x_value; y_value;\n", "28.1200000000 87.5908000000\n", "30.4500000000 88.7725000000\n", "32.7800000000 89.8497000000\n", "35.1100000000 90.8355000000\n", "37.4500000000 91.7435000000\n", "39.7800000000 92.5871000000\n", "42.1100000000 93.3798000000\n", "44.4400000000 94.1096000000\n", "46.7700000000 94.6777000000\n", "49.1000000000 94.9712000000\n", "51.4300000000 95.0813000000\n", "53.7600000000 94.8998000000\n", "56.1000000000 94.5101000000\n", "58.8300000000 94.0181000000\n", "\n", "GENERATOR startcost Plant1 2\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "PLANT attributes Plant2\n", "#Id;Water_course;Type;Future_use;Prod_area;Num_gen;Num_pump;\n", "0 0 6 0 1 4 0\n", "#Num_main_seg;Num_penstock;Time_delay;Read_prod_factor;Outlet_line;\n", "1 2 0 0.000000 586.000000\n", "0.000000\n", "0.000100 0.000200\n", "\n", "PLANT mip_flag Plant2\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NO_UNIT 73\n", "# Time; f(t);\n", "20180123000000000 1.00000000000000000\n", "\n", "GENERATOR attributes Plant2 1\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 1 180.00 100.00 180.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant2 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "100.0000000000 100.0000000000\n", "180.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant2 1\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 60.00 14 M3/S %\n", "# x_value; y_value;\n", "126.5400000000 92.7201000000\n", "137.0300000000 93.2583000000\n", "147.5100000000 93.7305000000\n", "158.0000000000 94.1368000000\n", "168.5300000000 94.4785000000\n", "179.0100000000 94.7525000000\n", "189.5000000000 94.9606000000\n", "199.9800000000 95.1028000000\n", "210.4700000000 95.1790000000\n", "220.9500000000 95.1892000000\n", "231.4400000000 95.1335000000\n", "241.9200000000 95.0118000000\n", "252.4500000000 94.8232000000\n", "264.7400000000 94.5191000000\n", "\n", "GENERATOR startcost Plant2 1\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "GENERATOR attributes Plant2 2\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 2 55.00 30.00 55.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant2 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "30.0000000000 100.0000000000\n", "55.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant2 2\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 60.00 14 M3/S %\n", "# x_value; y_value;\n", "40.8200000000 83.8700000000\n", "44.2000000000 85.1937000000\n", "47.5800000000 86.3825000000\n", "50.9700000000 87.4362000000\n", "54.3600000000 88.3587000000\n", "57.7500000000 89.1419000000\n", "61.1300000000 89.7901000000\n", "64.5100000000 90.3033000000\n", "67.8900000000 90.6815000000\n", "71.2700000000 90.9248000000\n", "74.6600000000 91.0331000000\n", "78.0400000000 91.0063000000\n", "81.4400000000 90.8436000000\n", "85.4000000000 90.4817000000\n", "\n", "GENERATOR startcost Plant2 2\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "GENERATOR attributes Plant2 3\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 2 55.00 30.00 55.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant2 3\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "30.0000000000 100.0000000000\n", "55.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant2 3\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 60.00 14 M3/S %\n", "# x_value; y_value;\n", "40.8200000000 83.8700000000\n", "44.2000000000 85.1937000000\n", "47.5800000000 86.3825000000\n", "50.9700000000 87.4362000000\n", "54.3600000000 88.3587000000\n", "57.7500000000 89.1419000000\n", "61.1300000000 89.7901000000\n", "64.5100000000 90.3033000000\n", "67.8900000000 90.6815000000\n", "71.2700000000 90.9248000000\n", "74.6600000000 91.0331000000\n", "78.0400000000 91.0063000000\n", "81.4400000000 90.8436000000\n", "85.4000000000 90.4817000000\n", "\n", "GENERATOR startcost Plant2 3\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "GENERATOR attributes Plant2 4\n", "#Id Type Penstock Nom_prod Min_prod Max_prod Start_cost\n", "0 7 2 55.00 30.00 55.00 300.00\n", "\n", "GENERATOR gen_eff_curve Plant2 4\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 0.00 2 MW %\n", "# x_value; y_value;\n", "30.0000000000 100.0000000000\n", "55.0000000000 100.0000000000\n", "\n", "GENERATOR turb_eff_curves Plant2 4\n", "#Id;Number;Reference;Pts;X_unit;Y_unit\n", "0 0 60.00 14 M3/S %\n", "# x_value; y_value;\n", "40.8200000000 83.8700000000\n", "44.2000000000 85.1937000000\n", "47.5800000000 86.3825000000\n", "50.9700000000 87.4362000000\n", "54.3600000000 88.3587000000\n", "57.7500000000 89.1419000000\n", "61.1300000000 89.7901000000\n", "64.5100000000 90.3033000000\n", "67.8900000000 90.6815000000\n", "71.2700000000 90.9248000000\n", "74.6600000000 91.0331000000\n", "78.0400000000 91.0063000000\n", "81.4400000000 90.8436000000\n", "85.4000000000 90.4817000000\n", "\n", "GENERATOR startcost Plant2 4\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK 73\n", "# Time; f(t);\n", "20180123000000000 300.00000000000000000\n", "\n", "GATE attributes Flow_gate\n", "#Id;Water_course;Type;Time_delay;Num_parallell_gates;Gate_slack;\n", "0 0 0 0 1 0\n", "\n", "GATE max_flow Flow_gate\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts\n", "0 0 20180123000000000 HOUR 0 -1 M3/S 1\n", "# Time; f(t)\n", "20180123000000000 50.000000\n", "\n", "#Write connection data for the hydro power system\n", "#; From_type/To_type; From_name; To_name;\n", "CONNECT RESERVOIR/GATE Reservoir1 Flow_gate\n", "CONNECT RESERVOIR/PLANT Reservoir2 Plant1\n", "CONNECT RESERVOIR/PLANT Reservoir3 Plant2\n", "CONNECT GATE/RESERVOIR Flow_gate Reservoir2\n", "CONNECT PLANT/RESERVOIR Plant1 Reservoir3\n", "\n", "#Initial reservoir volumes;\n", "STARTRES 3 Meter\n", "#Name; Volume (Meter);\n", "Reservoir1 1006\n", "Reservoir2 900\n", "Reservoir3 670\n", "\n", "\n", "MULTI_MARKET price_buy 1 0\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK/MWH 73\n", "# Time; f(t);\n", "20180123000000000 32.99399999999999977\n", "20180123010000000 31.12399999999999878\n", "20180123020000000 29.31400000000000006\n", "20180123030000000 28.07399999999999807\n", "20180123040000000 30.01399999999999935\n", "20180123050000000 33.36400000000000432\n", "20180123060000000 42.68400000000000460\n", "20180123070000000 74.82399999999999807\n", "20180123080000000 77.73399999999999466\n", "20180123090000000 62.33400000000000318\n", "20180123100000000 55.89400000000000546\n", "20180123110000000 46.96400000000000574\n", "20180123120000000 42.58400000000000318\n", "20180123130000000 40.94400000000000261\n", "20180123140000000 39.21400000000000574\n", "20180123150000000 39.14400000000000546\n", "20180123160000000 41.67399999999999949\n", "20180123170000000 46.92399999999999949\n", "20180123180000000 37.10399999999999920\n", "20180123190000000 32.99399999999999977\n", "20180123200000000 31.27399999999999736\n", "20180123210000000 29.75399999999999778\n", "20180123220000000 28.78399999999999892\n", "20180123230000000 28.08399999999999963\n", "20180124000000000 27.24399999999999977\n", "20180124010000000 26.62399999999999878\n", "20180124020000000 25.73399999999999821\n", "20180124030000000 25.39399999999999835\n", "20180124040000000 25.99399999999999977\n", "20180124050000000 27.40399999999999991\n", "20180124060000000 28.94399999999999906\n", "20180124070000000 32.18400000000000460\n", "20180124080000000 33.08400000000000318\n", "20180124090000000 32.34400000000000119\n", "20180124100000000 30.91399999999999793\n", "20180124110000000 30.16399999999999793\n", "20180124120000000 30.06400000000000006\n", "20180124130000000 29.56400000000000006\n", "20180124140000000 29.46399999999999864\n", "20180124150000000 29.51399999999999935\n", "20180124160000000 29.67399999999999949\n", "20180124170000000 30.07399999999999807\n", "20180124180000000 29.55399999999999849\n", "20180124190000000 28.86399999999999721\n", "20180124200000000 28.41399999999999793\n", "20180124210000000 28.07399999999999807\n", "20180124220000000 27.16399999999999793\n", "20180124230000000 25.50399999999999778\n", "20180125000000000 26.19399999999999906\n", "20180125010000000 25.22400000000000020\n", "20180125020000000 24.05399999999999849\n", "20180125030000000 23.89399999999999835\n", "20180125040000000 23.68399999999999750\n", "20180125050000000 26.09399999999999764\n", "20180125060000000 28.20400000000000063\n", "20180125070000000 30.90399999999999991\n", "20180125080000000 31.57399999999999807\n", "20180125090000000 31.46399999999999864\n", "20180125100000000 31.17399999999999949\n", "20180125110000000 30.91399999999999793\n", "20180125120000000 30.57399999999999807\n", "20180125130000000 30.60399999999999920\n", "20180125140000000 30.63400000000000034\n", "20180125150000000 31.06400000000000006\n", "20180125160000000 32.08400000000000318\n", "20180125170000000 36.26400000000000290\n", "20180125180000000 34.47400000000000375\n", "20180125190000000 32.18400000000000460\n", "20180125200000000 31.49399999999999977\n", "20180125210000000 30.73399999999999821\n", "20180125220000000 29.71399999999999864\n", "20180125230000000 28.98399999999999821\n", "20180126000000000 28.98399999999999821\n", "\n", "MULTI_MARKET price_sale 1 0\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 NOK/MWH 73\n", "# Time; f(t);\n", "20180123000000000 32.99199999999999733\n", "20180123010000000 31.12199999999999989\n", "20180123020000000 29.31200000000000117\n", "20180123030000000 28.07199999999999918\n", "20180123040000000 30.01200000000000045\n", "20180123050000000 33.36200000000000188\n", "20180123060000000 42.68200000000000216\n", "20180123070000000 74.82200000000000273\n", "20180123080000000 77.73199999999999932\n", "20180123090000000 62.33200000000000074\n", "20180123100000000 55.89200000000000301\n", "20180123110000000 46.96200000000000330\n", "20180123120000000 42.58200000000000074\n", "20180123130000000 40.94200000000000017\n", "20180123140000000 39.21200000000000330\n", "20180123150000000 39.14200000000000301\n", "20180123160000000 41.67199999999999704\n", "20180123170000000 46.92199999999999704\n", "20180123180000000 37.10199999999999676\n", "20180123190000000 32.99199999999999733\n", "20180123200000000 31.27199999999999847\n", "20180123210000000 29.75199999999999889\n", "20180123220000000 28.78200000000000003\n", "20180123230000000 28.08200000000000074\n", "20180124000000000 27.24200000000000088\n", "20180124010000000 26.62199999999999989\n", "20180124020000000 25.73199999999999932\n", "20180124030000000 25.39199999999999946\n", "20180124040000000 25.99200000000000088\n", "20180124050000000 27.40200000000000102\n", "20180124060000000 28.94200000000000017\n", "20180124070000000 32.18200000000000216\n", "20180124080000000 33.08200000000000074\n", "20180124090000000 32.34199999999999875\n", "20180124100000000 30.91199999999999903\n", "20180124110000000 30.16199999999999903\n", "20180124120000000 30.06200000000000117\n", "20180124130000000 29.56200000000000117\n", "20180124140000000 29.46199999999999974\n", "20180124150000000 29.51200000000000045\n", "20180124160000000 29.67200000000000060\n", "20180124170000000 30.07199999999999918\n", "20180124180000000 29.55199999999999960\n", "20180124190000000 28.86199999999999832\n", "20180124200000000 28.41199999999999903\n", "20180124210000000 28.07199999999999918\n", "20180124220000000 27.16199999999999903\n", "20180124230000000 25.50199999999999889\n", "20180125000000000 26.19200000000000017\n", "20180125010000000 25.22200000000000131\n", "20180125020000000 24.05199999999999960\n", "20180125030000000 23.89199999999999946\n", "20180125040000000 23.68199999999999861\n", "20180125050000000 26.09199999999999875\n", "20180125060000000 28.20200000000000173\n", "20180125070000000 30.90200000000000102\n", "20180125080000000 31.57199999999999918\n", "20180125090000000 31.46199999999999974\n", "20180125100000000 31.17200000000000060\n", "20180125110000000 30.91199999999999903\n", "20180125120000000 30.57199999999999918\n", "20180125130000000 30.60200000000000031\n", "20180125140000000 30.63200000000000145\n", "20180125150000000 31.06200000000000117\n", "20180125160000000 32.08200000000000074\n", "20180125170000000 36.26200000000000045\n", "20180125180000000 34.47200000000000131\n", "20180125190000000 32.18200000000000216\n", "20180125200000000 31.49200000000000088\n", "20180125210000000 30.73199999999999932\n", "20180125220000000 29.71199999999999974\n", "20180125230000000 28.98199999999999932\n", "20180126000000000 28.98199999999999932\n", "\n", "MULTI_MARKET max_buy 1 0\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 MW 73\n", "# Time; f(t);\n", "20180123000000000 9999.00000000000000000\n", "\n", "MULTI_MARKET max_sale 1 0\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts;\n", "0 0 20180123000000000 HOUR 0 -1 MW 73\n", "# Time; f(t);\n", "20180123000000000 9999.00000000000000000\n", "\n", "#Num_areas;Type\n", "NETWORK 1 load\n", "#Load for area: 1\n", "#Id;Number;Start_Time;Time_unit;Period;Data_type;Y_unit;Pts\n", "0 0 20180123000000000 HOUR 0 -1 MW 1\n", "# Time; f(t)\n", "20180123000000000 0.000000\n" ] } ], "source": [ "with open('model.ascii', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "e6d80c64", "metadata": { "Collapsed": "false" }, "source": [ "(constant-energy-values-ascii)=\n", "## constant_energy_values.ascii" ] }, { "cell_type": "code", "execution_count": 16, "id": "9b6d203e", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "RESERVOIR energy_value_input Reservoir1\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tKroner\n", "0\t31.0\n", "\n", "RESERVOIR energy_value_input Reservoir2\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tKroner\n", "0\t30.0\n", "\n", "RESERVOIR energy_value_input Reservoir3\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tKroner\n", "0\t20.0\n" ] } ], "source": [ "with open('constant_energy_values.ascii', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "449f87e6", "metadata": { "Collapsed": "false" }, "source": [ "(constant-mixed-values-ascii)=\n", "## constant_mixed_values.ascii" ] }, { "cell_type": "code", "execution_count": 17, "id": "810857f6", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "RESERVOIR energy_value_input Reservoir1\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tKroner\n", "0\t31.0\n", "\n", "RESERVOIR energy_value_input Reservoir2\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tKroner\n", "0\t30.0\n", "\n", "RESERVOIR water_value_input Reservoir3\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\t NOK/Mm3\n", "0\t5000.0\n" ] } ], "source": [ "with open('constant_mixed_values.ascii', 'r') as f:\n", " print(f.read())" ] }, { "cell_type": "markdown", "id": "aa868e19", "metadata": { "Collapsed": "false" }, "source": [ "(water-value-tables-ascii)=\n", "## water_value_tables.ascii" ] }, { "cell_type": "code", "execution_count": 18, "id": "224791c0", "metadata": { "Collapsed": "false", "tags": [ "remove-input" ] }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "RESERVOIR water_value_input Reservoir1\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tNOK/Mm3\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", "RESERVOIR water_value_input Reservoir2\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\tNOK/Mm3\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", "RESERVOIR water_value_input Reservoir3\n", "#\tNumber\tRef\tNpkt\tx_unit\ty_unit\n", "0\t1\t0\t1\tMm3\t NOK/Mm3\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" ] } ], "source": [ "with open('water_value_tables.ascii', 'r') as f:\n", " print(f.read())" ] } ], "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.12.9" }, "source_map": [ 14, 37, 50, 55, 79, 83, 106, 116, 124, 131, 170, 176, 184, 191, 242, 257, 261, 269, 274, 282, 287, 295, 300, 308, 313, 321, 326, 334, 339, 347, 352, 360, 365, 373, 378 ] }, "nbformat": 4, "nbformat_minor": 5 }