{ "cells": [ { "cell_type": "markdown", "id": "9a5f105d", "metadata": {}, "source": [ "# Basic example\n", "\n", "This example contains the most commonly used objects, attributes, functions and commands for a basic SHOP model, in addition to examples of how to review and plot input data and results.\n", "\n", "It is not dependent on any other data sources such as ASCII files or spreadsheets, as all input data remain intact in the notebook (or Python code) itself, and is fully dependent on the API and pyshop for interacting with SHOP.\n", "\n", "The example watercourse consist of a simple SHOP model with two reservoirs and two plants which is optimized over the span of three days.\n", "\n", "We will show how to import all necessary packages, settings and data, create a SHOP instance and add all needed objects and populate them with data, before we run SHOP with a selection of commands and review the results in the end.\n", "\n", "While the model in this example is quite simple, it can serve as a good reference when designing your own models. It illustrates an intuitive way of designing models in pyshop by incrementally initializing new objects like reservoirs, plants, generators and markets, setting their key attributes before connecting them together into the a desired topology. The model is then optimized, before the results are retrieved and presented through plots.\n", "\n", "## Imports and settings\n", "\n", "The first thing we do is to import the needed packages. You can import whichever packages you like, however we use the following ones for this example:\n", "\n", "- Pandas for structuring our data into dataframes\n", "- pyshop in order to create a SHOP session\n", "- Plotly backend for dynamic graph plotting" ] }, { "cell_type": "code", "execution_count": 1, "id": "4a5ae9a9", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "import pandas as pd\n", "from pyshop import ShopSession\n", "import plotly.graph_objs as go\n", "import plotly.express as px\n", "from plotly.subplots import make_subplots\n", "pd.options.plotting.backend = \"plotly\"" ] }, { "cell_type": "markdown", "id": "a93474c1", "metadata": {}, "source": [ "## Instancing SHOP\n", "\n", "In order to have SHOP receive our inputs, run the model we create and give us results, we need to create an active, running SHOP session.\n", "\n", "You may create multiple SHOP sessions simultaneously if needed." ] }, { "cell_type": "code", "execution_count": 2, "id": "f32efc86", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Creating a new SHOP session to the instance 'shop'\n", "shop = ShopSession()" ] }, { "cell_type": "markdown", "id": "7197c890", "metadata": {}, "source": [ "We can also check the current versions of SHOP and its solvers." ] }, { "cell_type": "code", "execution_count": 3, "id": "ff6208c9", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/plain": [ "'16.7.2 Cplex 20.1.0 Gurobi 7.5 OSI/CBC 2.9 2025-04-11'" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# Writing out the current version of SHOP and its solvers\n", "shop.shop_api.GetVersionString()" ] }, { "cell_type": "markdown", "id": "253535ae", "metadata": {}, "source": [ "## Setting time resolutions for the model\n", "\n", "We set the time resolution for the model ourselves, as we generate all input as we go. The start and end time are important, in addition to the resolution of the time steps." ] }, { "cell_type": "code", "execution_count": 4, "id": "b8baa4fd", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the start time of the model\n", "starttime = pd.Timestamp('2018-01-23 00:00:00')\n", "\n", "# Setting the end time of the model\n", "endtime = pd.Timestamp('2018-01-26')\n", "\n", "# Setting the start and end time to the shop instance, and defining the time unit\n", "shop.set_time_resolution(starttime=starttime, endtime=endtime, timeunit=\"hour\", timeresolution=pd.Series(index=[starttime],data=[1]))" ] }, { "cell_type": "markdown", "id": "6d641581", "metadata": {}, "source": [ "## Adding topology parameters\n", "\n", "In this example we define the entire topology and generate all its parameters via Python and the API. Below are simple examples on how to define the most common topology objects needed in order to run SHOP.\n", "\n", "### Reservoirs\n", "\n", "First, we start of by creating our reservoir objects. It is possible to just execute the function, or we can instance them. The latter is preferred, as the syntax for adding attributes to objects become shorter, in addition to it being handy." ] }, { "cell_type": "code", "execution_count": 5, "id": "75cc8774", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Add reservoir objects to the model and instancing them\n", "rsv1 = shop.model.reservoir.add_object('Reservoir1')\n", "rsv2 = shop.model.reservoir.add_object('Reservoir2')\n", "# Alternatively, only the right hand side can be executed, however it is often nice to refer to instances later on" ] }, { "cell_type": "markdown", "id": "2018a499", "metadata": {}, "source": [ "We can then verify that all reservoir objects are correctly added to the model instance:" ] }, { "cell_type": "code", "execution_count": 6, "id": "50b625b1", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/plain": [ "['Reservoir1', 'Reservoir2']" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shop.model.reservoir.get_object_names()" ] }, { "cell_type": "markdown", "id": "cc4450d7", "metadata": {}, "source": [ "Next, it is time to set the different parameters to the newly created objects, either via the instance, or directly through the function. Below are examples of both." ] }, { "cell_type": "code", "execution_count": 7, "id": "20388ab3", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the maximum volume in Mm3 via the instance\n", "rsv1.max_vol.set(39)\n", "rsv2.max_vol.set(97.5)\n", "\n", "# Setting the LRL (Lowest Regulated Level) of the reservoir in masl via the instance\n", "rsv1.lrl.set(860)\n", "rsv2.lrl.set(650)\n", "\n", "# Setting the HRL (Highest Regulated Level) of the reservoir in masl by command\n", "shop.model.reservoir.Reservoir1.hrl.set(905)\n", "shop.model.reservoir.Reservoir2.hrl.set(679)" ] }, { "cell_type": "markdown", "id": "990f49e2", "metadata": {}, "source": [ "We can then verify that these values have been stored correctly onto the object. We can either make a call to the instance, or execute the function directly." ] }, { "cell_type": "code", "execution_count": 8, "id": "e3eb4b6f", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "HRL of Reservoir 1: 905.0\n", "HRL of Reservoir 2: 679.0\n" ] } ], "source": [ "# Using the instanced rsv1 to retrieve the HRL of the reservoir objects\n", "print(\"HRL of Reservoir 1: \",rsv1.hrl.get())\n", "print(\"HRL of Reservoir 2: \",rsv2.hrl.get())" ] }, { "cell_type": "code", "execution_count": 9, "id": "00d22c74", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "LRL of Reservoir 1: 860.0\n", "LRL of Reservoir 2: 650.0\n" ] } ], "source": [ "# Using the function directly to retrieve the LRL of Reservoir1\n", "print(\"LRL of Reservoir 1: \",shop.model.reservoir.Reservoir1.lrl.get())\n", "print(\"LRL of Reservoir 2: \",shop.model.reservoir.Reservoir2.lrl.get())" ] }, { "cell_type": "markdown", "id": "4a3db058", "metadata": {}, "source": [ "We continue the process of setting all relevant attributes to the {ref}`reservoir` objects.\n", "!!!Ref. til I/O." ] }, { "cell_type": "code", "execution_count": 10, "id": "bdf96e3d", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the stage storage curve, the relation between the reservoir volume (in Mm3) and the height of the reservoir (in masl)\n", "rsv1.vol_head.set(\n", " pd.Series([860, 862, 864, 866, 870, 872, 874, 876, 878, 880, 882, 884, 886, 888, 890, 894, 896, 898, 902, 904, 905, 907],\n", " index=[0, 0.91, 1.87, 2.88, 5.07, 6.27, 7.56, 8.91, 10.34, 11.87, 13.53, 15.27, 17.11, 19.05, 21.1, 25.65, 27.96, 30.36, 35.18, 37.68, 39, 41.66], name=0))\n", "rsv2.vol_head.set(\n", " pd.Series([650, 651.28, 652.55, 653.83, 656.38, 657.66, 658.94, 660.21, 661.49, 662.77, 664.04, 665.32, 666.6, 667.87, 669.15, 671.70, 672.98, 674.26, 676.81, 678.09, 679, 680],\n", " index=[0, 2.275, 4.675, 7.2, 12.675, 15.675, 18.9, 22.275, 25.85, 29.675, 33.825, 38.175, 42.775, 47.625, 52.75, 64.125, 69.9, 75.9, 87.95, 94.2, 97.5, 104.15], name=0))" ] }, { "cell_type": "code", "execution_count": 11, "id": "0709e232", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the overflow description, the (linear) relation between spillage (in m3/s) and masl.\n", "rsv1.flow_descr.set(pd.Series([0, 132], index=[906, 907], name=0))\n", "rsv2.flow_descr.set(pd.Series([0, 132], index=[679, 680], name=0))\n", "\n", "# Inflow to the reservoir is an example of an attribute that can be set as a time series,using indexes that relate values to points in time\n", "rsv2.inflow.set(pd.Series([60], [starttime]))" ] }, { "cell_type": "markdown", "id": "23c7dfa2", "metadata": {}, "source": [ "In order to let the model know which initial conditions are set, i.e. the initial start reservoir levels, we need to define them." ] }, { "cell_type": "code", "execution_count": 12, "id": "20ba1b46", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the initial start reservoir height in masl\n", "rsv1.start_head.set(900)\n", "rsv2.start_head.set(670)" ] }, { "cell_type": "markdown", "id": "2695aa66", "metadata": {}, "source": [ "We also define the endpoint descriptions (water values) for the reservoirs. The model needs these in order to compare the value of the water remaining in the reservoirs at the end of the period compared to the value of selling the water in the market given the market price." ] }, { "cell_type": "code", "execution_count": 13, "id": "94e784c4", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the endpoint description (water value) to 'rsv1' in NOK/MWh\n", "rsv1.energy_value_input.set(30)\n", "# Setting the endpoint description (water value) to 'rsv2' in NOK/MWh\n", "rsv2.energy_value_input.set(10)" ] }, { "cell_type": "markdown", "id": "441cb17e", "metadata": {}, "source": [ "Now let's review some of the input graphically. Data such as time series, XY-curves and DataFrames can be plotted with a single line of code using .plot()." ] }, { "cell_type": "code", "execution_count": 14, "id": "95afb45f", "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": "=0.0
Mm3=%{x}
masl=%{y}", "legendgroup": "0.0", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "0.0", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ 0.0, 0.91, 1.87, 2.88, 5.07, 6.27, 7.56, 8.91, 10.34, 11.87, 13.53, 15.27, 17.11, 19.05, 21.1, 25.65, 27.96, 30.36, 35.18, 37.68, 39.0, 41.66 ], "xaxis": "x", "y": [ 860.0, 862.0, 864.0, 866.0, 870.0, 872.0, 874.0, 876.0, 878.0, 880.0, 882.0, 884.0, 886.0, 888.0, 890.0, 894.0, 896.0, 898.0, 902.0, 904.0, 905.0, 907.0 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "" }, "tracegroupgap": 0 }, "showlegend": false, "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": "Volume/head relation of Reservoir1" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ], "title": { "text": "Mm3" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "masl" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting the volume/head relation of Reservoir1\n", "rsv1.vol_head.get().plot(title=\"Volume/head relation of Reservoir1\", labels=dict(index=\"Mm3\", value=\"masl\", variable=\"\")).update_layout(showlegend=False)" ] }, { "cell_type": "markdown", "id": "9c801a18", "metadata": {}, "source": [ "Or they can be plotted in any style and design imaginable using your favorite plotting tools and packages." ] }, { "cell_type": "code", "execution_count": 15, "id": "418077fd", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(116,169,207)" }, "name": "Reservoir volume and height", "type": "scatter", "x": [ 0.0, 2.275, 4.675, 7.2, 12.675, 15.675, 18.9, 22.275, 25.85, 29.675, 33.825, 38.175, 42.775, 47.625, 52.75, 64.125, 69.9, 75.9, 87.95, 94.2, 97.5, 104.15 ], "y": [ 650.0, 651.28, 652.55, 653.83, 656.38, 657.66, 658.94, 660.21, 661.49, 662.77, 664.04, 665.32, 666.6, 667.87, 669.15, 671.7, 672.98, 674.26, 676.81, 678.09, 679.0, 680.0 ] }, { "marker": { "color": "rgb(5,112,176)", "line": { "color": "rgb(5,112,176)", "width": 4 }, "size": 3 }, "mode": "markers", "name": "Start point", "type": "scatter", "x": [ 56.541666666666664 ], "y": [ 670.0 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Reservoir volume and height in Reservoir2 " }, "xaxis": { "title": { "text": "Volume (Mm3)" } }, "yaxis": { "title": { "text": "Height (meter)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting the volume/head relation of Reservoir2, including the initial starting point\n", "\n", "from scipy.interpolate import interp1d\n", "\n", "vol_height=shop.model.reservoir.Reservoir2.vol_head.get()\n", "start_height=shop.model.reservoir.Reservoir2.start_head.get()\n", "\n", "interplation_function = interp1d(vol_height.values, vol_height.index)\n", "start_volume=float(interplation_function(start_height))\n", "\n", "fig = go.Figure()\n", "colorscale = px.colors.sequential.PuBu_r\n", "fig.add_trace(go.Scatter(x=vol_height.index, y=vol_height.values, name=\"Reservoir volume and height\", marker_color=colorscale[4]))\n", "fig.add_trace(go.Scatter(x=[start_volume], y=[start_height], name=\"Start point\",marker_color=colorscale[2], mode='markers', marker=dict(color='rgba(0,0,0, 0.0)', size=3, line=dict(color=colorscale[2], width=4))))\n", "fig.update_layout(title=\"Reservoir volume and height in Reservoir2 \", xaxis_title=\"Volume (Mm3)\", yaxis_title=\"Height (meter)\")\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "eb4b7c53", "metadata": {}, "source": [ "### Plants\n", "\n", "The next objects to add to our model are the {ref}`plant` objects. We instance them the same way as we instanced the {ref}`reservoir` objects." ] }, { "cell_type": "code", "execution_count": 16, "id": "fec91d10", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Add a plant objects to the model and instancing them\n", "plant1 = shop.model.plant.add_object('Plant1')\n", "plant2 = shop.model.plant.add_object('Plant2')\n", "# Alternatively, only the right hand side can be executed, however it is often nice to refer to instances later on" ] }, { "cell_type": "markdown", "id": "4c45a1cb", "metadata": {}, "source": [ "Next we verify that our objects are correctly added to the shop instance." ] }, { "cell_type": "code", "execution_count": 17, "id": "d8010920", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/plain": [ "['Plant1', 'Plant2']" ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shop.model.plant.get_object_names()" ] }, { "cell_type": "markdown", "id": "7df950ce", "metadata": {}, "source": [ "The {ref}`plant` objects need attributes as well." ] }, { "cell_type": "code", "execution_count": 18, "id": "0b66f19f", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the outlet line / tailrace height in masl\n", "plant1.outlet_line.set(672)\n", "plant2.outlet_line.set(586)\n", "\n", "# Setting the main loss in the plant\n", "plant1.main_loss.set([0])\n", "plant2.main_loss.set([0])\n", "\n", "# Setting the penstock loss in the plant. The number of penstocks are populated equal to the number of losses defined.\n", "plant1.penstock_loss.set([0.001])\n", "plant2.penstock_loss.set([0.0001,0.0002])" ] }, { "cell_type": "markdown", "id": "d13276da", "metadata": {}, "source": [ "### Generators\n", "\n", "A {ref}`plant` needs at least one {ref}`generator`. We add two generators to plant 1, and four generators to plant 2" ] }, { "cell_type": "code", "execution_count": 19, "id": "4a4ef07d", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Add a generator object to the model\n", "p1g1 = shop.model.generator.add_object('Plant1_Generator1')\n", "p1g2 = shop.model.generator.add_object('Plant1_Generator2')\n", "\n", "p2g1 = shop.model.generator.add_object('Plant2_Generator1')\n", "p2g2 = shop.model.generator.add_object('Plant2_Generator2')\n", "p2g3 = shop.model.generator.add_object('Plant2_Generator3')\n", "p2g4 = shop.model.generator.add_object('Plant2_Generator4')" ] }, { "cell_type": "markdown", "id": "388f25a4", "metadata": {}, "source": [ "The connection between the {ref}`generator` and its {ref}`plant` must be set before defining the generator's parameters, whereas other connections in the model can be set after its objects and parameters have been set." ] }, { "cell_type": "code", "execution_count": 20, "id": "e216c28d", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Connecting the generator to the correct plant\n", "p1g1.connect_to(plant1)\n", "p1g2.connect_to(plant1)\n", "\n", "p2g1.connect_to(plant2)\n", "p2g2.connect_to(plant2)\n", "p2g3.connect_to(plant2)\n", "p2g4.connect_to(plant2)" ] }, { "cell_type": "markdown", "id": "04449df6", "metadata": {}, "source": [ "We control the {ref}`generator` objects in the model after adding and connecting them." ] }, { "cell_type": "code", "execution_count": 21, "id": "c48730bd", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/plain": [ "['Plant1_Generator1',\n", " 'Plant1_Generator2',\n", " 'Plant2_Generator1',\n", " 'Plant2_Generator2',\n", " 'Plant2_Generator3',\n", " 'Plant2_Generator4']" ] }, "execution_count": 21, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shop.model.generator.get_object_names()" ] }, { "cell_type": "markdown", "id": "545b7ffb", "metadata": {}, "source": [ "Then we move on to the {ref}`generator` attributes. Certain generators are identical, so in order to preserve consistency, we make use of the .get()-function, so that if we change parameters on one of the duplicate generators, all of them will receive the change(s)." ] }, { "cell_type": "code", "execution_count": 22, "id": "82cbe03e", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting the number of penstocks\n", "p1g1.penstock.set(1)\n", "p1g2.penstock.set(p1g1.penstock.get())\n", "\n", "p2g1.penstock.set(1)\n", "p2g2.penstock.set(2)\n", "p2g3.penstock.set(p2g2.penstock.get())\n", "p2g4.penstock.set(p2g2.penstock.get())\n", "\n", "# Setting the minimum production in MW\n", "p1g1.p_min.set(60)\n", "p1g2.p_min.set(p1g1.p_min.get())\n", "\n", "p2g1.p_min.set(100)\n", "p2g2.p_min.set(30)\n", "p2g3.p_min.set(p2g2.p_min.get())\n", "p2g4.p_min.set(p2g2.p_min.get())\n", "\n", "# Setting the maximum production in MW\n", "p1g1.p_max.set(120)\n", "p1g2.p_max.set(p1g1.p_max.get())\n", "\n", "p2g1.p_max.set(180)\n", "p2g2.p_max.set(55)\n", "p2g3.p_max.set(p2g2.p_max.get())\n", "p2g4.p_max.set(p2g2.p_max.get())\n", "\n", "# Setting the nominal production in MW\n", "p1g1.p_nom.set(120)\n", "p1g2.p_nom.set(p1g1.p_nom.get())\n", "\n", "p2g1.p_nom.set(180)\n", "p2g2.p_nom.set(55)\n", "p2g3.p_nom.set(p2g2.p_nom.get())\n", "p2g4.p_nom.set(p2g2.p_nom.get())\n", "\n", "# Setting the start cost in a monetary unit (i.e. $ or NOK, the model only compares costs to each other, so you just need to be sure all costs are in the same unit)\n", "p1g1.startcost.set(500)\n", "p1g2.startcost.set(p1g1.startcost.get())\n", "\n", "p2g1.startcost.set(600)\n", "p2g2.startcost.set(200)\n", "p2g3.startcost.set(p2g2.startcost.get())\n", "p2g4.startcost.set(p2g2.startcost.get())\n", "\n", "# Setting generator efficiency curves, which is the releation between the efficiency factor (%) and production (MW)\n", "p1g1.gen_eff_curve.set(pd.Series([100, 100], index=[60, 120]))\n", "p1g2.gen_eff_curve.set(p1g1.gen_eff_curve.get())\n", "\n", "p2g1.gen_eff_curve.set(pd.Series([100, 100], index=[100, 180]))\n", "p2g2.gen_eff_curve.set(pd.Series([100, 100], index=[30, 60]))\n", "p2g3.gen_eff_curve.set(p2g2.gen_eff_curve.get())\n", "p2g4.gen_eff_curve.set(p2g2.gen_eff_curve.get())\n", "\n", "# Setting turbine efficiency curves, which is the relation between the efficiency factor (%) and release (m3/s) for different head levels (masl)\n", "p1g1.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", "p1g2.turb_eff_curves.set(p1g1.turb_eff_curves.get())\n", "\n", "p2g1.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", "\n", "p2g2.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", "p2g3.turb_eff_curves.set(p2g2.turb_eff_curves.get())\n", "p2g4.turb_eff_curves.set(p2g2.turb_eff_curves.get())" ] }, { "cell_type": "markdown", "id": "69591fba", "metadata": {}, "source": [ "Now we can plot some of the {ref}`generator` data, to ensure that we have the correct data." ] }, { "cell_type": "code", "execution_count": 23, "id": "84819efc", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "width": 2 }, "marker": { "color": "rgb(33,102,172)" }, "mode": "lines+markers", "name": "Net Head=170.0", "type": "scatter", "x": [ 28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.1, 51.43, 53.76, 56.1, 58.83 ], "y": [ 85.8733, 87.0319, 88.0879, 89.0544, 89.9446, 90.7717, 91.5488, 92.2643, 92.8213, 93.109, 93.217, 93.039, 92.657, 92.1746 ] }, { "line": { "width": 2 }, "marker": { "color": "rgb(67,147,195)" }, "mode": "lines+markers", "name": "Net Head=200.0", "type": "scatter", "x": [ 28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.1, 51.43, 53.76, 56.1, 58.83 ], "y": [ 86.7321, 87.9022, 88.9688, 89.945, 90.8441, 91.6794, 92.4643, 93.187, 93.7495, 94.0401, 94.1492, 93.9694, 93.5836, 93.0964 ] }, { "line": { "width": 2 }, "marker": { "color": "rgb(146,197,222)" }, "mode": "lines+markers", "name": "Net Head=230.0", "type": "scatter", "x": [ 28.12, 30.45, 32.78, 35.11, 37.45, 39.78, 42.11, 44.44, 46.77, 49.1, 51.43, 53.76, 56.1, 58.83 ], "y": [ 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 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Turbine efficiency curves of G1 in Plant1" }, "xaxis": { "title": { "text": "Discharge (m3/s)" } }, "yaxis": { "title": { "text": "Efficiency (%)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting the turbine efficiency curves of G1 (G2 is the same as G1) in Plant1\n", "turb_eff_curves=shop.model.generator.Plant1_Generator1.turb_eff_curves.get()\n", "\n", "fig = go.Figure()\n", "colorscale = px.colors.sequential.RdBu_r\n", "color = 0\n", "for curve in turb_eff_curves:\n", " color+=1\n", " curve_name=\"Net Head=\"+str(curve.name)\n", " fig.add_trace(go.Scatter(x=curve.index, y=curve.values, marker_color = colorscale[color], name=curve_name, mode=\"lines+markers\", line=dict(width=2)))\n", "\n", "fig.update_layout(title=\"Turbine efficiency curves of G1 in Plant1\", xaxis_title=\"Discharge (m3/s)\", yaxis_title=\"Efficiency (%)\")\n", "\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 24, "id": "9e75cca8", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "width": 2 }, "marker": { "color": "rgb(209,229,240)" }, "mode": "lines+markers", "name": "G1 Net Head=60.0", "type": "scatter", "x": [ 126.54, 137.03, 147.51, 158.0, 168.53, 179.01, 189.5, 199.98, 210.47, 220.95, 231.44, 241.92, 252.45, 264.74 ], "y": [ 92.7201, 93.2583, 93.7305, 94.1368, 94.4785, 94.7525, 94.9606, 95.1028, 95.179, 95.1892, 95.1335, 95.0118, 94.8232, 94.5191 ] }, { "line": { "width": 2 }, "marker": { "color": "rgb(247,247,247)" }, "mode": "lines+markers", "name": "G2 Net Head=60.0", "type": "scatter", "x": [ 40.82, 44.2, 47.58, 50.97, 54.36, 57.75, 61.13, 64.51, 67.89, 71.27, 74.66, 78.04, 81.44, 85.4 ], "y": [ 83.87, 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 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Turbine efficiency curves of G1 and G2 in Plant2" }, "xaxis": { "title": { "text": "Discharge (m3/s)" } }, "yaxis": { "title": { "text": "Efficiency (%)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plot the turbine efficiency curves of G1 and G2 (G3, G4 are the same as G2) in Plant2\n", "turb_eff_curves_G1=shop.model.generator.Plant2_Generator1.turb_eff_curves.get()\n", "turb_eff_curves_G2=shop.model.generator.Plant2_Generator2.turb_eff_curves.get()\n", "\n", "fig = go.Figure()\n", "\n", "for curve in turb_eff_curves_G1:\n", " color+=1\n", " curve_name=\"G1 Net Head=\"+str(curve.name)\n", " fig.add_trace(go.Scatter(x=curve.index, y=curve.values, marker_color = colorscale[color], name=curve_name, mode=\"lines+markers\", line=dict(width=2)))\n", "\n", "for curve in turb_eff_curves_G2:\n", " color+=1\n", " curve_name=\"G2 Net Head=\"+str(curve.name)\n", " fig.add_trace(go.Scatter(x=curve.index, y=curve.values, marker_color = colorscale[color], name=curve_name, mode=\"lines+markers\", line=dict(width=2)))\n", "\n", "fig.update_layout(title=\"Turbine efficiency curves of G1 and G2 in Plant2\", xaxis_title=\"Discharge (m3/s)\", yaxis_title=\"Efficiency (%)\")\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "66f18594", "metadata": {}, "source": [ "### Gates\n", "\n", "Water routes such as spillways, bypasses and gates between objects, can be defined and applied with certain attributes as well." ] }, { "cell_type": "code", "execution_count": 25, "id": "6331e115", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Adding a spillway between Reservoir 1 and Reservoir 2\n", "s_rsv1_rsv2 = shop.model.gate.add_object('s_Reservoir1_Reservoir2')\n", "\n", "# Adding a bypass between Reservoir 1 and Reservoir 2\n", "b_rsv1_rsv2 = shop.model.gate.add_object('b_Reservoir1_Reservoir2')\n", "\n", "# Adding a spillway between Reservoir 1 and Reservoir 2\n", "s_rsv2_ocean = shop.model.gate.add_object('s_Reservoir2_Ocean')\n", "\n", "# Adding a bypass between Reservoir 1 and Reservoir 2\n", "b_rsv2_ocean = shop.model.gate.add_object('b_Reservoir2_Ocean')" ] }, { "cell_type": "markdown", "id": "7e3744ed", "metadata": {}, "source": [ "And we do a quick control of the content on {ref}`gate` objects afterwards." ] }, { "cell_type": "code", "execution_count": 26, "id": "8a03aeaf", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "text/plain": [ "['s_Reservoir1_Reservoir2',\n", " 'b_Reservoir1_Reservoir2',\n", " 's_Reservoir2_Ocean',\n", " 'b_Reservoir2_Ocean']" ] }, "execution_count": 26, "metadata": {}, "output_type": "execute_result" } ], "source": [ "shop.model.gate.get_object_names()" ] }, { "cell_type": "markdown", "id": "e1b4a169", "metadata": {}, "source": [ "## Connecting the topology objects\n", "\n", "After adding the objects and defining parameters to them, we need to connect them together in order for the model to know which parts that can interact with each other. This means for instance that we need to connect a certain reservoir to a certain plant. In this example, _Reservoir1_ should connect to _Plant1_, Plant1 should then further be connected to _Reservoir2_, whereas Reservoir2 again connects to _Plant2_. Additionally, we need to correcrtly connect the gates, spillways and bypasses. We always connect objects from the top to the bottom, starting with the uppermost object relative to elevation. Note that it is necessary to specify the keyword argument \"connection_type\" when connecting a bypass or spill gate to the upper reservoir, but it is not needed when the bypass or spill gate is connected to the downstream reservoir." ] }, { "cell_type": "code", "execution_count": 27, "id": "bb7ac3c8", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Connecting Reservoir 1 to Plant1\n", "rsv1.connect_to(plant1)\n", "\n", "# Connecting Reservoir 1 to the bypass between Reservoir1 and Reservoir2\n", "rsv1.connect_to(b_rsv1_rsv2,connection_type=\"bypass\")\n", "\n", "# Connecting Reservoir 1 to the spillway between Reservoir1 and Reservoir2\n", "rsv1.connect_to(s_rsv1_rsv2,connection_type=\"spill\")\n", "\n", "# Connecting Plant1 to Reservoir2\n", "plant1.connect_to(rsv2)\n", "\n", "# Connecting the bypass between Reservoir1 and Reservoir2 to Reservoir2\n", "b_rsv1_rsv2.connect_to(rsv2)\n", "\n", "# Connecting the spillway between Reservoir1 and Reservoir2 to Reservoir2\n", "s_rsv1_rsv2.connect_to(rsv2)\n", "\n", "# Connecting Reservoir2 to Plant 2\n", "rsv2.connect_to(plant2)\n", "\n", "# Connecting Reservoir2 to the bypass between Reservoir2 and Ocean\n", "rsv2.connect_to(b_rsv2_ocean,connection_type=\"bypass\")\n", "\n", "# Connecting Reservoir2 to the spillway between Reservoir2 and Ocean\n", "rsv2.connect_to(s_rsv2_ocean,connection_type=\"spill\")" ] }, { "cell_type": "markdown", "id": "b176d61e", "metadata": {}, "source": [ "We can then verify if the topology is correctly set up, by graphing out the topology tree." ] }, { "cell_type": "code", "execution_count": 28, "id": "323b5431", "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", "plant_Plant1\n", "\n", "Plant1\n", "\n", "\n", "\n", "reservoir_Reservoir1->plant_Plant1\n", "\n", "\n", "\n", "\n", "gate_s_Reservoir1_Reservoir2\n", "\n", "s_Reservoir1_Reservoir2\n", "\n", "\n", "\n", "reservoir_Reservoir1->gate_s_Reservoir1_Reservoir2\n", "\n", "\n", "\n", "\n", "gate_b_Reservoir1_Reservoir2\n", "\n", "b_Reservoir1_Reservoir2\n", "\n", "\n", "\n", "reservoir_Reservoir1->gate_b_Reservoir1_Reservoir2\n", "\n", "\n", "\n", "\n", "reservoir_Reservoir2\n", "\n", "Reservoir2\n", "\n", "\n", "\n", "plant_Plant2\n", "\n", "Plant2\n", "\n", "\n", "\n", "reservoir_Reservoir2->plant_Plant2\n", "\n", "\n", "\n", "\n", "gate_s_Reservoir2_Ocean\n", "\n", "s_Reservoir2_Ocean\n", "\n", "\n", "\n", "reservoir_Reservoir2->gate_s_Reservoir2_Ocean\n", "\n", "\n", "\n", "\n", "gate_b_Reservoir2_Ocean\n", "\n", "b_Reservoir2_Ocean\n", "\n", "\n", "\n", "reservoir_Reservoir2->gate_b_Reservoir2_Ocean\n", "\n", "\n", "\n", "\n", "plant_Plant1->reservoir_Reservoir2\n", "\n", "\n", "\n", "\n", "gate_s_Reservoir1_Reservoir2->reservoir_Reservoir2\n", "\n", "\n", "\n", "\n", "gate_b_Reservoir1_Reservoir2->reservoir_Reservoir2\n", "\n", "\n", "\n", "\n" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Print out the topology\n", "dot = shop.model.build_connection_tree()\n", "display(dot)" ] }, { "cell_type": "markdown", "id": "c5c88649", "metadata": {}, "source": [ "## Adding a market and a load\n", "\n", "Lastly, we need to add a {ref}`market` and/or a load for the model to optimize against, with certain parameters. This gives SHOP the solution space it needs to make its decisions on where and when to produce or not, while maximizing profit and fulfilling load requirements." ] }, { "cell_type": "code", "execution_count": 29, "id": "8342fa75", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Adding a market named \"Day_ahead\"\n", "shop.model.market.add_object('Day_ahead')\n", "\n", "# Instancing the market Day_ahead to 'da'\n", "da = shop.model.market.Day_ahead\n", "\n", "# Setting a sale price to the market, which is the income value (in monetary units) per produced MW\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", "\n", "# Setting a buy price to the market, which is the cost to buy production in the market (in monetary units) in stead of producing it yourself per MW. This is normally used when you have a load to cover or if you have pumps\n", "da.buy_price.set(da.sale_price.get()+0.002)\n", "\n", "# Setting the amount of volume able to buy in the market in MW\n", "da.max_buy.set(pd.Series([9999], [starttime]))\n", "\n", "# Setting the amount of volume able to sell (produce) in the market in MW\n", "da.max_sale.set(pd.Series([9999], [starttime]))\n", "\n", "# Setting the load that needs to be fullfilled, either by power production or by buying from the market, depending on the above parameters\n", "da.load.set(pd.Series([0], [starttime]))" ] }, { "cell_type": "markdown", "id": "6205dbef", "metadata": {}, "source": [ "Now we can compare the {ref}`market` price to the (constant) evalutation value of the water in the reservoirs. Endpoint descriptions are usually more complex, depending on reservoir levels and/or other reservoirs." ] }, { "cell_type": "code", "execution_count": 30, "id": "665bd568", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(33,102,172)" }, "name": "Market price", "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" ], "y": [ 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 ] }, { "line": { "dash": "dot" }, "marker": { "color": "rgb(67,147,195)" }, "name": "Water value of Reservoir1", "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" ], "y": [ 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0, 30.0 ] }, { "line": { "dash": "dot" }, "marker": { "color": "rgb(146,197,222)" }, "name": "Water value of Reservoir2", "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" ], "y": [ 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Market price and water value of reservoirs" }, "xaxis": { "title": { "text": "Time (Hour)" } }, "yaxis": { "title": { "text": "Price (€/MWh)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plot market price and water value of reservoirs\n", "spot_price=shop.model.market.Day_ahead.sale_price.get()\n", "\n", "fig = go.Figure()\n", "colorscale = px.colors.sequential.RdBu_r\n", "color = 1\n", "fig.add_trace(go.Scatter(x=spot_price.index, marker_color = colorscale[color], y=spot_price.values, name=\"Market price\"))\n", "\n", "for rsv in shop.model.reservoir:\n", " color+=1\n", " end_water_value=rsv.energy_value_input.get()\n", " water_value=pd.Series([end_water_value]*len(spot_price),index=spot_price.index)\n", " curve_name=\"Water value of \"+rsv.get_name()\n", " fig.add_trace(go.Scatter(x=water_value.index, y=water_value.values, marker_color = colorscale[color], name=curve_name, line=dict(dash=\"dot\")))\n", "\n", "fig.update_layout(title=\"Market price and water value of reservoirs\", xaxis_title=\"Time (Hour)\", yaxis_title=\"Price (€/MWh)\")\n", "\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "28dab258", "metadata": {}, "source": [ "## Running SHOP\n", "\n", "Once the model is fully defined, we can prepare for a call to the optimizer. It is possible to define certain criteria depending on the solver used, if not, default values will be effective.\n", "\n", "In order to find an optimal solution, it is normal to run SHOP with multiple iterations, both full and incremental." ] }, { "cell_type": "code", "execution_count": 31, "id": "606658ed", "metadata": { "Collapsed": "false" }, "outputs": [], "source": [ "# Setting a full flag, telling SHOP the upcomming iterations should be full\n", "shop.set_code(['full'], [])\n", "\n", "# Starting SHOP and running five (full) iterations\n", "shop.start_sim([], ['5'])\n", "\n", "# Setting an incremental flag, telling SHOP the next iterations should be incremental\n", "shop.set_code(['incremental'], [])\n", "\n", "# Running three more (incremental) iterations\n", "shop.start_sim([], ['3'])" ] }, { "cell_type": "markdown", "id": "c1a05de0", "metadata": {}, "source": [ "## Results\n", "\n", "After the optimization has completed, we can review the result from SHOP by plotting the graphs we want." ] }, { "cell_type": "code", "execution_count": 32, "id": "8f181fae", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(33,102,172)" }, "name": "P1", "type": "bar", "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" ], "y": [ 223.81687613576187, 215.76380545751798, 207.06604963965773, 206.75164075036253, 206.43729107320283, 222.05826181109137, 228.98431813568126, 228.57736191832706, 228.17009727914657, 227.7629210082412, 227.35583310561083, 226.94883357125542, 226.54034939509634, 226.11767850190154, 225.69510299696094, 225.27262288027475, 224.85023815184294, 224.4279488116655, 224.00156155881504, 209.0642681789125, 200.63709408121844, 200.3053147820754, 199.97360193094684, 103.87249606368194, 103.78919199307127, 0.0, 0.0, 0.0, 0.0, 103.70589622846235, 199.14461051318762, 206.79471266518544, 206.4317606227594, 206.06888489693276, 197.77142721505996, 197.42979658843183, 197.0623200069732, 196.6949252601378, 196.32761234792565, 195.9603812703366, 195.59323202737068, 195.21054165854764, 194.8227537569928, 101.25631068812855, 101.15892883847434, 101.06155841106231, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.96419940589239, 193.65993831995056, 193.2617438122284, 192.85336749906773, 192.44509276613033, 192.03691961341625, 191.62884804092542, 191.20815597569083, 190.7768532871812, 190.34566419029656, 189.91458809306837, 197.04497287679334, 189.01359856819164, 188.5621162686483, 188.1107587865314, 97.85191918807347, 0.0, 0.0 ] }, { "marker": { "color": "rgb(67,147,195)" }, "name": "P2", "type": "bar", "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" ], "y": [ 249.5594036568051, 198.30025542425216, 0.0, 0.0, 122.2859746411937, 269.4689065777136, 337.08373924663624, 340.3344285091763, 339.731528532081, 339.1141612578784, 338.4378030697583, 337.7589138717136, 337.0773402770827, 332.73703289052537, 332.06990527320573, 331.3967623103256, 334.29812636233316, 333.5441371050339, 317.6105570122454, 303.5768939689196, 258.3517988741842, 237.6747873922844, 236.518340354363, 177.00527032938285, 170.54833632795942, 0.0, 0.0, 0.0, 0.0, 170.70773094112812, 235.67601658119537, 295.87603333132313, 297.0814353387196, 295.7842934967386, 274.324181313751, 251.43117881273454, 250.61324786733502, 245.8040299831489, 245.02787569038318, 246.19651894694445, 247.28731542089898, 268.2498905888243, 245.31430836881026, 240.10200309205524, 226.33978311767044, 224.48762665435527, 223.24104977473598, 115.20096480752686, 163.70092585116308, 100.0064707205602, 0.0, 0.0, 0.0, 163.51031306223555, 221.65074699100307, 272.81950252201233, 273.9726884582874, 272.1975857124141, 270.4183654974181, 268.6391452824222, 266.73505638682565, 264.8223946557055, 262.887521028002, 267.55123208592687, 268.862443914021, 277.28287203584983, 272.8574933778215, 264.12204694431, 258.5257021563912, 255.8921289999849, 252.7455209807297, 241.44551377485476 ] }, { "line": { "color": "black" }, "name": "Price", "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" ], "xaxis": "x", "y": [ 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 ], "yaxis": "y2" } ], "layout": { "barmode": "stack", "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": "Price vs. production" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 0.94 ], "title": { "text": "Time [Hours]" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "title": { "text": "Production [MWh]" } }, "yaxis2": { "anchor": "x", "overlaying": "y", "side": "right", "title": { "text": "Price [EUR/MWh]" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting price vs. production\n", "\n", "# Defining a plot instance\n", "fig = go.Figure()\n", "colorscale = px.colors.sequential.RdBu_r\n", "# Preparing for secondary y axis by calling make_subplots function\n", "fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n", "# Adding plant production as traces of bar type\n", "fig.add_trace(go.Bar(x=shop.model.plant.Plant1.production.get().index, y=shop.model.plant.Plant1.production.get().values, name=\"P1\", marker_color=colorscale[1]))\n", "fig.add_trace(go.Bar(x=shop.model.plant.Plant2.production.get().index, y=shop.model.plant.Plant2.production.get().values, name=\"P2\", marker_color=colorscale[2]))\n", "# Stacking bars\n", "fig.update_layout(barmode='stack')\n", "# Adding price as trace of scatter type\n", "fig.add_trace(go.Scatter(x=shop.model.market.Day_ahead.sale_price.get().index, y=shop.model.market.Day_ahead.sale_price.get().values, name=\"Price\", line_color='black'),secondary_y=True)\n", "# Updating titles\n", "fig.update_layout(title_text=\"Price vs. production\")\n", "fig.update_yaxes(title_text=\"Production [MWh]\", secondary_y=False)\n", "fig.update_yaxes(title_text=\"Price [EUR/MWh]\", secondary_y=True)\n", "fig.update_xaxes(title_text=\"Time [Hours]\")\n", "# Show plot\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 33, "id": "9a3c4266", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(33,102,172)" }, "name": "G1 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 56.36333333333332, 53.89666666666666, 51.42999999999999, 51.42999999999999, 51.42999999999999, 56.36333333333332, 58.83, 58.82999999999999, 58.83, 58.83, 58.83, 58.83, 58.83, 58.83, 58.83, 58.82999999999999, 58.83, 58.82999999999999, 58.830000000000005, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0, 0.0, 0.0, 51.42999999999999, 51.42999999999999, 53.89666666666666, 53.89666666666666, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0 ], "yaxis": "y" }, { "marker": { "color": "rgb(67,147,195)" }, "name": "G2 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 56.36333333333332, 53.89666666666666, 51.42999999999999, 51.42999999999999, 51.42999999999999, 56.36333333333332, 58.83, 58.82999999999999, 58.83, 58.83, 58.83, 58.83, 58.83, 58.83, 58.83, 58.82999999999999, 58.83, 58.82999999999999, 58.830000000000005, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 51.42999999999999, 53.89666666666666, 53.89666666666666, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 51.42999999999999, 53.89666666666665, 51.42999999999999, 51.42999999999999, 51.42999999999999, 0.0, 0.0, 0.0 ], "yaxis": "y" }, { "marker": { "color": "rgb(146,197,222)" }, "name": "G1 production", "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" ], "xaxis": "x", "y": [ 111.90843806788094, 107.88190272875899, 103.53302481982887, 103.37582037518126, 103.21864553660141, 111.02913090554568, 114.49215906784063, 114.28868095916353, 114.08504863957329, 113.8814605041206, 113.67791655280541, 113.47441678562771, 113.27017469754817, 113.05883925095077, 112.84755149848047, 112.63631144013738, 112.42511907592147, 112.21397440583274, 112.00078077940752, 104.53213408945625, 100.31854704060922, 100.1526573910377, 99.98680096547342, 103.87249606368194, 103.78919199307127, 0.0, 0.0, 0.0, 0.0, 103.70589622846235, 99.57230525659381, 103.39735633259272, 103.2158803113797, 103.03444244846638, 98.88571360752998, 98.71489829421591, 98.5311600034866, 98.3474626300689, 98.16380617396283, 97.9801906351683, 97.79661601368534, 97.60527082927382, 97.4113768784964, 101.25631068812855, 101.15892883847434, 101.06155841106231, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 100.96419940589239, 96.82996915997528, 96.6308719061142, 96.42668374953386, 96.22254638306516, 96.01845980670812, 95.81442402046271, 95.60407798784541, 95.3884266435906, 95.17283209514828, 94.95729404653419, 98.52248643839667, 94.50679928409582, 94.28105813432416, 94.0553793932657, 97.85191918807347, 0.0, 0.0 ], "yaxis": "y2" }, { "marker": { "color": "rgb(209,229,240)" }, "name": "G2 production", "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" ], "xaxis": "x", "y": [ 111.90843806788094, 107.88190272875899, 103.53302481982887, 103.37582037518126, 103.21864553660141, 111.02913090554568, 114.49215906784063, 114.28868095916353, 114.08504863957329, 113.8814605041206, 113.67791655280541, 113.47441678562771, 113.27017469754817, 113.05883925095077, 112.84755149848047, 112.63631144013738, 112.42511907592147, 112.21397440583274, 112.00078077940752, 104.53213408945625, 100.31854704060922, 100.1526573910377, 99.98680096547342, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 99.57230525659381, 103.39735633259272, 103.2158803113797, 103.03444244846638, 98.88571360752998, 98.71489829421591, 98.5311600034866, 98.3474626300689, 98.16380617396283, 97.9801906351683, 97.79661601368534, 97.60527082927382, 97.4113768784964, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 96.82996915997528, 96.6308719061142, 96.42668374953386, 96.22254638306516, 96.01845980670812, 95.81442402046271, 95.60407798784541, 95.3884266435906, 95.17283209514828, 94.95729404653419, 98.52248643839667, 94.50679928409582, 94.28105813432416, 94.0553793932657, 0.0, 0.0, 0.0 ], "yaxis": "y2" } ], "layout": { "barmode": "stack", "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": "Unit discharge and production in Plant1" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 0.94 ], "title": { "text": "Time (Hour)" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "dtick": 20, "range": [ 0, 120 ], "tick0": 20, "title": { "text": "Discharge (m3/s)" } }, "yaxis2": { "anchor": "x", "dtick": 40, "overlaying": "y", "range": [ 0, 240 ], "side": "right", "tick0": 40, "title": { "text": "Production (MW)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting discharge and production results from Plant 1\n", "\n", "# Retrieving discharge results on generators\n", "G1_discharge=shop.model.generator.Plant1_Generator1.discharge.get()\n", "G2_discharge=shop.model.generator.Plant1_Generator2.discharge.get()\n", "\n", "# Retrieving production results on generators\n", "G1_production=shop.model.generator.Plant1_Generator1.production.get()\n", "G2_production=shop.model.generator.Plant1_Generator2.production.get()\n", "\n", "# Preparing for secondary y axis by calling make_subplots function\n", "coloraxis = px.colors.sequential.RdBu_r\n", "#coloraxis=[\"rgb(0, 200, 30)\",\"rgb(0, 200, 60)\",\"rgb(0, 200, 90)\",\"rgb(0, 200, 120)\",\"rgb(0, 200, 150)\",\"rgb(0, 200, 180)\",\"rgb(0, 200, 210)\",\"rgb(0, 200, 255)\"]\n", "#print(coloraxis)\n", "fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n", "fig.add_trace(go.Bar(x=G1_discharge.index, y=G1_discharge.values, name=\"G1 Discharge\", marker_color=coloraxis[1]), secondary_y=False)\n", "fig.add_trace(go.Bar(x=G2_discharge.index, y=G2_discharge.values, name=\"G2 Discharge\", marker_color=coloraxis[2]), secondary_y=False)\n", "fig.add_trace(go.Scatter(x=G1_production.index, y=G1_production.values, name=\"G1 production\", marker_color=coloraxis[3]), secondary_y=True)\n", "fig.add_trace(go.Scatter(x=G2_production.index, y=G2_production.values, name=\"G2 production\", marker_color=coloraxis[4]), secondary_y=True)\n", "fig.update_layout(title_text=\"Unit discharge and production in Plant1\", barmode=\"stack\")\n", "fig.update_xaxes(title_text=\"Time (Hour)\")\n", "fig.update_yaxes(title_text=\"Discharge (m3/s)\", secondary_y=False, range=[0, 120], tick0=20, dtick=20)\n", "fig.update_yaxes(title_text=\"Production (MW)\", secondary_y=True, range=[0, 240], tick0=40, dtick=40)\n", "\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 34, "id": "12ce131a", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(33,102,172)" }, "name": "G1 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 191.70464241801392, 191.77595661759545, 0.0, 0.0, 162.40939047860067, 220.95, 248.8893644699968, 249.92656093952394, 251.0143896018982, 252.14131520671316, 253.41331351956822, 254.71524787171708, 256.04046058020714, 257.3937308721223, 258.7824290741247, 260.204721766274, 261.65494407574204, 263.1341798591746, 250.1433333333333, 235.54666666666665, 220.95, 194.9668179016663, 194.07315359082716, 177.02896420747314, 168.09082619470254, 0.0, 0.0, 0.0, 0.0, 167.95175986057265, 194.53466306106372, 231.1422246340444, 235.54666666666665, 235.54666666666665, 220.95, 220.95, 220.95, 220.95, 220.95, 220.95, 220.95, 220.95, 220.95, 220.20486967959278, 198.62622696393635, 197.17661798212433, 196.70536530050143, 174.33686487150558, 174.5100436295509, 151.8331916800269, 0.0, 0.0, 0.0, 174.7031694679658, 198.90753559056049, 230.11354484333236, 235.54666666666665, 235.54666666666665, 235.54666666666665, 235.54666666666665, 235.54666666666665, 235.54666666666665, 235.54666666666665, 250.1433333333333, 250.1433333333333, 264.73999999999995, 264.73999999999995, 250.14333333333335, 250.1433333333333, 250.1433333333333, 250.1433333333333, 239.3624283784118 ], "yaxis": "y" }, { "marker": { "color": "rgb(67,147,195)" }, "name": "G2 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 74.66, 74.42605559386494, 0.0, 0.0, 0.0, 74.66, 81.82, 85.4, 85.4, 85.4, 85.4, 85.4, 85.4, 81.82, 81.82, 81.82, 85.4, 85.4, 78.23999999999998, 74.66, 78.06617658378822, 74.66, 74.66, 74.66, 74.66, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 74.66, 74.66, 66.49887254030922, 78.24, 78.24, 74.66, 74.66, 78.24, 78.24, 66.88784281085704, 78.24, 74.66, 74.66, 74.66, 74.66, 0.0, 74.66, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 78.23999999999998, 85.39999999999998, 81.82, 81.82, 78.23999999999998, 78.23999999999998, 78.23999999999998, 74.66 ], "yaxis": "y" }, { "marker": { "color": "rgb(146,197,222)" }, "name": "G3 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 74.66, 0.0, 0.0, 0.0, 0.0, 74.66, 81.82, 85.4, 85.4, 85.4, 85.4, 85.4, 85.4, 81.82, 81.82, 81.82, 85.4, 85.4, 78.23999999999998, 74.66, 77.41055843156248, 74.66, 74.66, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 74.66, 66.49887254030922, 78.24, 78.24, 74.66, 74.66, 74.66, 78.24, 66.88784281085704, 78.24, 74.66, 74.66, 74.66, 74.66, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 78.23999999999998, 85.39999999999998, 81.82, 81.82, 78.23999999999998, 78.23999999999998, 78.23999999999998, 74.66 ], "yaxis": "y" }, { "marker": { "color": "rgb(209,229,240)" }, "name": "G4 Discharge", "type": "bar", "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" ], "xaxis": "x", "y": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 81.82, 85.4, 85.4, 85.4, 85.4, 85.4, 85.4, 81.82, 81.82, 81.82, 85.4, 85.4, 78.23999999999998, 74.66, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 66.49887254030922, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 66.88784281085704, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 74.66, 78.23999999999998, 81.82, 81.82, 81.82, 78.23999999999998, 78.23999999999998, 78.23999999999998, 74.66 ], "yaxis": "y" }, { "marker": { "color": "rgb(247,247,247)" }, "name": "G1 production", "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" ], "xaxis": "x", "y": [ 143.49350629423645, 143.3007339754215, 0.0, 0.0, 122.2859746411937, 163.33901637477143, 179.99866168501475, 179.99857762740675, 179.99850274599302, 179.9984277237426, 179.99821033293807, 179.99806277451242, 179.99789287172524, 179.99979506817007, 179.99979177900065, 179.99983519105143, 179.99986636389644, 179.97516872524136, 172.4067523174611, 163.60649879943566, 154.40662850566872, 137.60320120303996, 136.6891038408901, 124.98815365177472, 118.63028235157094, 0.0, 0.0, 0.0, 0.0, 118.71291857297263, 136.33147617127426, 158.392176514472, 160.20638615719224, 159.52738431501336, 150.5254154861114, 149.93990845920806, 149.4521803158632, 148.96445217251858, 148.49299906066173, 147.99338071065372, 147.46894338600438, 146.9356076035028, 146.29244912113523, 145.33404280464222, 132.01193902977448, 130.56630422376733, 129.72375742845367, 115.20096480752686, 115.06109738261571, 100.0064707205602, 0.0, 0.0, 0.0, 114.96171173267685, 129.35539487144706, 146.1675608404933, 148.10988198591687, 147.1806867387232, 146.2493361612265, 145.31798558372978, 144.3212712492296, 143.32006937842092, 142.30724046867917, 147.96590985014615, 146.75098826408873, 151.57862954469365, 150.13984183105478, 142.7244248939347, 141.3108390816981, 139.92480940334084, 138.26877334820577, 131.8663886083895 ], "yaxis": "y2" }, { "marker": { "color": "rgb(253,219,199)" }, "name": "G2 production", "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" ], "xaxis": "x", "y": [ 53.03294868128433, 54.99952144883066, 0.0, 0.0, 0.0, 53.06494510147107, 52.361692520540494, 53.44528362725653, 53.24434192869598, 53.03857784471192, 52.81319757894008, 52.586950365733735, 52.35981580178582, 50.912412607451785, 50.69003783140171, 50.465642373091384, 51.43275333281223, 51.1896561265975, 48.40126823159476, 46.656798389827976, 52.189961755243274, 50.03579309462222, 49.91461825673644, 52.01711667760813, 51.918053976388485, 0.0, 0.0, 0.0, 0.0, 51.994812368155486, 49.672270204960554, 45.82795227228371, 45.62501639384245, 45.41896972724175, 41.26625527587988, 50.745635176763244, 50.58053377573591, 48.41978890531517, 48.26743831486072, 50.241427626444796, 49.9091860174473, 40.438094328440506, 49.51092962383751, 47.38398014370651, 47.16392204394798, 46.96066121529397, 46.75864617314115, 0.0, 48.63982846854736, 0.0, 0.0, 0.0, 0.0, 48.54860132955871, 46.147676059778014, 42.21731389383966, 41.95426882412351, 41.67229965789696, 41.389676445397214, 41.107053232897464, 40.80459504586535, 40.500775092428206, 40.193426853107624, 39.86177407859358, 40.70381854997743, 42.445509861921934, 40.90588384892225, 40.465874016791766, 39.0716210248977, 38.655773198881356, 38.15891587750797, 36.526375055488415 ], "yaxis": "y2" }, { "marker": { "color": "rgb(244,165,130)" }, "name": "G3 production", "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" ], "xaxis": "x", "y": [ 53.03294868128433, 0.0, 0.0, 0.0, 0.0, 53.06494510147107, 52.361692520540494, 53.44528362725653, 53.24434192869598, 53.03857784471192, 52.81319757894008, 52.586950365733735, 52.35981580178582, 50.912412607451785, 50.69003783140171, 50.465642373091384, 51.43275333281223, 51.1896561265975, 48.40126823159476, 46.656798389827976, 51.75520861327224, 50.03579309462222, 49.91461825673644, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 49.672270204960554, 45.82795227228371, 45.62501639384245, 45.41896972724175, 41.26625527587988, 50.745635176763244, 50.58053377573591, 48.41978890531517, 48.26743831486072, 47.96171060984594, 49.9091860174473, 40.438094328440506, 49.51092962383751, 47.38398014370651, 47.16392204394798, 46.96066121529397, 46.75864617314115, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 46.147676059778014, 42.21731389383966, 41.95426882412351, 41.67229965789696, 41.389676445397214, 41.107053232897464, 40.80459504586535, 40.500775092428206, 40.193426853107624, 39.86177407859358, 40.70381854997743, 42.445509861921934, 40.90588384892225, 40.465874016791766, 39.0716210248977, 38.655773198881356, 38.15891587750797, 36.526375055488415 ], "yaxis": "y2" }, { "marker": { "color": "rgb(214,96,77)" }, "name": "G4 production", "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" ], "xaxis": "x", "y": [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 52.361692520540494, 53.44528362725653, 53.24434192869598, 53.03857784471192, 52.81319757894008, 52.586950365733735, 52.35981580178582, 50.912412607451785, 50.69003783140171, 50.465642373091384, 51.43275333281223, 51.1896561265975, 48.40126823159476, 46.656798389827976, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 45.82795227228371, 45.62501639384245, 45.41896972724175, 41.26625527587988, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 40.438094328440506, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 42.21731389383966, 41.95426882412351, 41.67229965789696, 41.389676445397214, 41.107053232897464, 40.80459504586535, 40.500775092428206, 40.193426853107624, 39.86177407859358, 40.70381854997743, 40.81322276731233, 40.90588384892225, 40.465874016791766, 39.0716210248977, 38.655773198881356, 38.15891587750797, 36.526375055488415 ], "yaxis": "y2" } ], "layout": { "barmode": "stack", "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": "Unit discharge and production in Plant2" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 0.94 ], "title": { "text": "Time (Hour)" } }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "dtick": 60, "range": [ 0, 540 ], "tick0": 60, "title": { "text": "Discharge (m3/s)" } }, "yaxis2": { "anchor": "x", "dtick": 40, "overlaying": "y", "range": [ 0, 360 ], "side": "right", "tick0": 40, "title": { "text": "Production (MW)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting discharge and production results from Plant 2\n", "\n", "# Retrieving discharge results on generators\n", "G1_discharge=shop.model.generator.Plant2_Generator1.discharge.get()\n", "G2_discharge=shop.model.generator.Plant2_Generator2.discharge.get()\n", "G3_discharge=shop.model.generator.Plant2_Generator3.discharge.get()\n", "G4_discharge=shop.model.generator.Plant2_Generator4.discharge.get()\n", "\n", "# Retrieving discharge results on generators\n", "G1_production=shop.model.generator.Plant2_Generator1.production.get()\n", "G2_production=shop.model.generator.Plant2_Generator2.production.get()\n", "G3_production=shop.model.generator.Plant2_Generator3.production.get()\n", "G4_production=shop.model.generator.Plant2_Generator4.production.get()\n", "\n", "fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n", "colorscale = px.colors.sequential.RdBu_r\n", "fig.add_trace(go.Bar(x=G1_discharge.index, y=G1_discharge.values, name=\"G1 Discharge\", marker_color=colorscale[1]), secondary_y=False)\n", "fig.add_trace(go.Bar(x=G2_discharge.index, y=G2_discharge.values, name=\"G2 Discharge\", marker_color=colorscale[2]), secondary_y=False)\n", "fig.add_trace(go.Bar(x=G3_discharge.index, y=G3_discharge.values, name=\"G3 Discharge\", marker_color=colorscale[3]), secondary_y=False)\n", "fig.add_trace(go.Bar(x=G4_discharge.index, y=G4_discharge.values, name=\"G4 Discharge\", marker_color=colorscale[4]), secondary_y=False)\n", "fig.add_trace(go.Scatter(x=G1_production.index, y=G1_production.values, name=\"G1 production\", marker_color=colorscale[5]), secondary_y=True)\n", "fig.add_trace(go.Scatter(x=G2_production.index, y=G2_production.values, name=\"G2 production\", marker_color=colorscale[6]), secondary_y=True)\n", "fig.add_trace(go.Scatter(x=G3_production.index, y=G3_production.values, name=\"G3 production\", marker_color=colorscale[7]), secondary_y=True)\n", "fig.add_trace(go.Scatter(x=G4_production.index, y=G4_production.values, name=\"G4 production\", marker_color=colorscale[8]), secondary_y=True)\n", "fig.update_layout(title_text=\"Unit discharge and production in Plant2\", barmode=\"stack\")\n", "fig.update_xaxes(title_text=\"Time (Hour)\")\n", "fig.update_yaxes(title_text=\"Discharge (m3/s)\", secondary_y=False, range=[0, 540], tick0=60, dtick=60)\n", "fig.update_yaxes(title_text=\"Production (MW)\", secondary_y=True, range=[0, 360], tick0=40, dtick=40)\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 35, "id": "42e0a0d6", "metadata": { "Collapsed": "false" }, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "marker": { "color": "rgb(33,102,172)" }, "name": "Reservoir1 storage", "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" ], "y": [ 32.769999999999996, 32.364183999999995, 31.976127999999996, 31.605831999999996, 31.235535999999996, 30.865239999999996, 30.459423999999995, 30.035847999999994, 29.612271999999994, 29.188695999999993, 28.765119999999992, 28.341543999999992, 27.91796799999999, 27.49439199999999, 27.07081599999999, 26.64723999999999, 26.22366399999999, 25.800087999999988, 25.376511999999988, 24.952935999999987, 24.564879999999988, 24.19458399999999, 23.82428799999999, 23.45399199999999, 23.268843999999987, 23.083695999999986, 23.083695999999986, 23.083695999999986, 23.083695999999986, 23.083695999999986, 22.898547999999984, 22.528251999999984, 22.140195999999985, 21.752139999999986, 21.364083999999988, 20.993787999999988, 20.623491999999988, 20.25319599999999, 19.88289999999999, 19.51260399999999, 19.14230799999999, 18.77201199999999, 18.40171599999999, 18.03141999999999, 17.84627199999999, 17.661123999999987, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.475975999999985, 17.290827999999983, 16.920531999999984, 16.550235999999984, 16.179939999999984, 15.809643999999984, 15.439347999999985, 15.069051999999985, 14.698755999999985, 14.328459999999986, 13.958163999999986, 13.587867999999986, 13.199811999999985, 12.829515999999986, 12.459219999999986, 12.088923999999986, 11.903775999999986, 11.903775999999986, 11.903775999999986 ] }, { "marker": { "color": "rgb(67,147,195)" }, "name": "Reservoir2 storage", "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" ], "y": [ 56.541666666666664, 55.93579395396181, 55.581522710000556, 56.16781871000055, 56.75411471000055, 56.75573690427759, 56.04458090427759, 54.9044991921856, 53.72201957280331, 52.53562377023648, 51.34517103549231, 50.15013910682186, 48.95042021448368, 47.74593055639493, 46.57523312525529, 45.39953638058844, 44.21871938222985, 42.99401758355718, 41.76399053606415, 40.658058536064146, 39.607818536064144, 38.83897829000888, 38.18584174556288, 37.535922392635904, 37.030990121489, 36.55823514718807, 36.77423514718807, 36.99023514718807, 37.206235147188075, 37.422235147188076, 36.94998081169001, 36.29840002467018, 35.26401601598762, 34.21377601598762, 33.16353601598762, 32.23622419255228, 31.463772192552277, 30.691320192552276, 29.944644192552275, 29.197968192552274, 28.438404192552273, 27.665952192552272, 26.734439490195015, 25.961987490195014, 25.03284595934848, 24.181387542278312, 23.335147717542664, 22.30545640246086, 21.89384368892344, 21.212831531857056, 20.882232041808958, 21.09823204180896, 21.31423204180896, 21.53023204180896, 20.848524631724285, 19.99605350359827, 18.947612742162274, 17.879612742162276, 16.81161274216228, 15.74361274216228, 14.675612742162281, 13.607612742162281, 12.539612742162282, 11.471612742162282, 10.351064742162283, 9.191852742162283, 7.933412742162282, 6.682988742162282, 5.485112742162282, 4.325900742162282, 2.9815407421622817, 1.4520327421622823, 0.0 ] } ], "layout": { "template": { "data": { "bar": [ { "error_x": { "color": "#2a3f5f" }, "error_y": { "color": "#2a3f5f" }, "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "bar" } ], "barpolar": [ { "marker": { "line": { "color": "#E5ECF6", "width": 0.5 }, "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "barpolar" } ], "carpet": [ { "aaxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "baxis": { "endlinecolor": "#2a3f5f", "gridcolor": "white", "linecolor": "white", "minorgridcolor": "white", "startlinecolor": "#2a3f5f" }, "type": "carpet" } ], "choropleth": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "choropleth" } ], "contour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "fillpattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 }, "type": "scatter" } ], "scatter3d": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatter3d" } ], "scattercarpet": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattercarpet" } ], "scattergeo": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergeo" } ], "scattergl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattergl" } ], "scattermapbox": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scattermapbox" } ], "scatterpolar": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolar" } ], "scatterpolargl": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterpolargl" } ], "scatterternary": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "scatterternary" } ], "surface": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "type": "surface" } ], "table": [ { "cells": { "fill": { "color": "#EBF0F8" }, "line": { "color": "white" } }, "header": { "fill": { "color": "#C8D4E3" }, "line": { "color": "white" } }, "type": "table" } ] }, "layout": { "annotationdefaults": { "arrowcolor": "#2a3f5f", "arrowhead": 0, "arrowwidth": 1 }, "autotypenumbers": "strict", "coloraxis": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "colorscale": { "diverging": [ [ 0, "#8e0152" ], [ 0.1, "#c51b7d" ], [ 0.2, "#de77ae" ], [ 0.3, "#f1b6da" ], [ 0.4, "#fde0ef" ], [ 0.5, "#f7f7f7" ], [ 0.6, "#e6f5d0" ], [ 0.7, "#b8e186" ], [ 0.8, "#7fbc41" ], [ 0.9, "#4d9221" ], [ 1, "#276419" ] ], "sequential": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ], "sequentialminus": [ [ 0.0, "#0d0887" ], [ 0.1111111111111111, "#46039f" ], [ 0.2222222222222222, "#7201a8" ], [ 0.3333333333333333, "#9c179e" ], [ 0.4444444444444444, "#bd3786" ], [ 0.5555555555555556, "#d8576b" ], [ 0.6666666666666666, "#ed7953" ], [ 0.7777777777777778, "#fb9f3a" ], [ 0.8888888888888888, "#fdca26" ], [ 1.0, "#f0f921" ] ] }, "colorway": [ "#636efa", "#EF553B", "#00cc96", "#ab63fa", "#FFA15A", "#19d3f3", "#FF6692", "#B6E880", "#FF97FF", "#FECB52" ], "font": { "color": "#2a3f5f" }, "geo": { "bgcolor": "white", "lakecolor": "white", "landcolor": "#E5ECF6", "showlakes": true, "showland": true, "subunitcolor": "white" }, "hoverlabel": { "align": "left" }, "hovermode": "closest", "mapbox": { "style": "light" }, "paper_bgcolor": "white", "plot_bgcolor": "#E5ECF6", "polar": { "angularaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "radialaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "scene": { "xaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "yaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" }, "zaxis": { "backgroundcolor": "#E5ECF6", "gridcolor": "white", "gridwidth": 2, "linecolor": "white", "showbackground": true, "ticks": "", "zerolinecolor": "white" } }, "shapedefaults": { "line": { "color": "#2a3f5f" } }, "ternary": { "aaxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "baxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" }, "bgcolor": "#E5ECF6", "caxis": { "gridcolor": "white", "linecolor": "white", "ticks": "" } }, "title": { "x": 0.05 }, "xaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 }, "yaxis": { "automargin": true, "gridcolor": "white", "linecolor": "white", "ticks": "", "title": { "standoff": 15 }, "zerolinecolor": "white", "zerolinewidth": 2 } } }, "title": { "text": "Reservoir trajectories " }, "xaxis": { "title": { "text": "Time (Hour)" } }, "yaxis": { "title": { "text": "Volume (Mm3)" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Plotting reservoir trajectories\n", "water_storage_rsv1=shop.model.reservoir.Reservoir1.storage.get()\n", "water_storage_rsv2=shop.model.reservoir.Reservoir2.storage.get()\n", "fig = go.Figure()\n", "colorscale = px.colors.sequential.RdBu_r\n", "fig.add_trace(go.Scatter(x=water_storage_rsv1.index, y=water_storage_rsv1.values, name=\"Reservoir1 storage\", marker_color=colorscale[1]))\n", "fig.add_trace(go.Scatter(x=water_storage_rsv2.index, y=water_storage_rsv2.values, name=\"Reservoir2 storage\", marker_color=colorscale[2]))\n", "fig.update_layout(title=\"Reservoir trajectories \", xaxis_title=\"Time (Hour)\", yaxis_title=\"Volume (Mm3)\")\n", "fig.show()" ] }, { "cell_type": "markdown", "id": "2edb5fe5", "metadata": {}, "source": [ "Lastly, we can inspect individual values describing our model run." ] }, { "cell_type": "code", "execution_count": 36, "id": "2a59c8b3", "metadata": { "Collapsed": "false" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Income from fixed load: -0.0\n", "Sum of selling vs. buying in the market: -981080.9266530586\n", "End reservoir value: -232626.78135419625\n", "Sum of startup costs: 6000.0\n", "Sum of load penalties: 0.0\n", "Total objective value: -1207707.7080072549\n", "Grand total objective value (excluding major penalties): -1207707.7080072549\n" ] } ], "source": [ "print(\"Income from fixed load:\",shop.model.objective.scen_1.load_value.get())\n", "print(\"Sum of selling vs. buying in the market:\", shop.model.objective.scen_1.market_sale_buy.get())\n", "print(\"End reservoir value:\", shop.model.objective.scen_1.rsv_end_value.get())\n", "print(\"Sum of startup costs:\", shop.model.objective.scen_1.startup_costs.get())\n", "print(\"Sum of load penalties:\", shop.model.objective.scen_1.load_penalty.get())\n", "print(\"Total objective value:\", shop.model.objective.scen_1.total.get())\n", "print(\"Grand total objective value (excluding major penalties):\", shop.model.objective.scen_1.grand_total.get())" ] } ], "metadata": { "jupytext": { "text_representation": { "extension": ".md", "format_name": "myst", "format_version": 0.13, "jupytext_version": "1.13.8" } }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.12.9" }, "source_map": [ 12, 34, 43, 51, 56, 60, 65, 71, 82, 92, 99, 103, 107, 111, 125, 129, 137, 143, 148, 160, 169, 173, 179, 183, 190, 194, 199, 203, 223, 229, 236, 240, 244, 248, 262, 268, 279, 283, 294, 298, 302, 306, 384, 388, 407, 429, 435, 449, 453, 457, 463, 492, 496, 502, 508, 532, 536, 557, 565, 579, 585, 611, 641, 675, 687, 691 ] }, "nbformat": 4, "nbformat_minor": 5 }