{
"cells": [
{
"cell_type": "markdown",
"id": "c647e756",
"metadata": {},
"source": [
"(battery_reserves)=\n",
"# Reserves on batteries"
]
},
{
"cell_type": "markdown",
"id": "6978fc95",
"metadata": {},
"source": [
"This example illustrates how [batteries](battery) can be used together with the [reserve](reserves) functionality in SHOP.\n",
"\n",
"The model setup for this example is available in the following format:\n",
"- pyshop\n",
" - [](battery.py)"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "b0c5e19e",
"metadata": {},
"outputs": [],
"source": [
"#Necessary imports used in all examples\n",
"import numpy as np\n",
"import pandas as pd\n",
"import plotly.graph_objs as go\n",
"from plotly.subplots import make_subplots\n",
"from pyshop import ShopSession\n",
"\n",
"#Functions used in this example for building a basic SHOP model and running it\n",
"from battery import build_model, run_model\n"
]
},
{
"cell_type": "markdown",
"id": "8dad3a89",
"metadata": {},
"source": [
"## Create SHOP session and import basic model\n",
"\n",
"Our example model consists of two [reservoirs](reservoir) and two [plants](plant) with one [generator](generator) each."
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "169e5da6",
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\n",
"\n",
"\n",
"\n",
"\n"
],
"text/plain": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Create a standard ShopSession\n",
"shop=ShopSession()\n",
"#Build a basic SHOP model\n",
"build_model(shop)\n",
"#Display topology to the screen\n",
"display(shop.model.build_connection_tree())"
]
},
{
"cell_type": "markdown",
"id": "95922bec",
"metadata": {},
"source": [
"## Add reserve group and reserve obligations\n",
"We add a [reserve group](reserve_group), and connect both generators to it. We also specify the different types of reserve obligations."
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "f54c55ae",
"metadata": {},
"outputs": [],
"source": [
"#Add reserve group\n",
"RG = shop.model.reserve_group.add_object('RG')\n",
"\n",
"#Add reserve obligations\n",
"RG.fcr_n_up_obligation.set(5)\n",
"RG.fcr_n_down_obligation.set(2)\n",
"RG.frr_up_obligation.set(2)\n",
"RG.frr_down_obligation.set(1)\n",
"\n",
"#Connect the generators to the reserve group\n",
"for i, gen in enumerate(shop.model.generator):\n",
" gen.connect_to(RG)"
]
},
{
"cell_type": "markdown",
"id": "003eccec",
"metadata": {},
"source": [
"## Run SHOP\n",
"We run the model without any battery for later comparison."
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "2559f682",
"metadata": {},
"outputs": [],
"source": [
"#Run SHOP\n",
"run_model(shop)"
]
},
{
"cell_type": "markdown",
"id": "62cb64ae",
"metadata": {},
"source": [
"## Reserve capacity without battery\n",
"The plot below shows the production of each generator with the added reserve obligations, compared to the [market](market) price. We see that the generator at plant 1 remains turned on during periods when the price is low. This is due to the down delivery obligations and the fcr-up obligation."
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "bff18d90",
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
" \n",
" "
]
},
"metadata": {},
"output_type": "display_data"
},
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"marker": {
"color": "black"
},
"name": "Price",
"type": "scatter",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
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,
38.782,
43.082,
39.242,
38.622,
29.732,
25.392,
25.392,
25.392
],
"yaxis": "y2"
},
{
"marker": {
"color": "skyblue"
},
"name": "Production Plant1_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.0,
33.931744151582926,
33.61823050315124,
33.30552935820525,
23.54229347489313,
19.316788659822127,
0.0,
31.859804849788958,
17.826777461959637,
0.0,
30.706528248379872,
31.169721940813275,
17.84247122857589,
17.84906917126931,
17.855848025860443,
17.86281272304178,
0.0,
15.314960617500178,
14.99992610920317,
0.0,
17.863541704493986,
17.87072837419155,
17.878145559557236,
17.88579867830947
],
"yaxis": "y"
},
{
"marker": {
"color": "steelblue"
},
"name": "Production Plant2_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
24.299895942754393,
30.38063961981819,
30.617958273522902,
30.85481493784018,
31.091202386080127,
31.205377193940727,
25.382914973046503,
0.0,
0.0,
26.60115495224372,
0.0,
33.03330744449035,
0.0,
0.0,
0.0,
0.0,
29.897674218394286,
35.451782014476585,
35.479896587983305,
29.7863875679559,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
}
],
"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 and production"
},
"xaxis": {
"anchor": "y",
"domain": [
0.0,
0.94
],
"tickformat": "%H:%M"
},
"yaxis": {
"anchor": "x",
"domain": [
0.0,
1.0
],
"title": {
"text": "Production"
}
},
"yaxis2": {
"anchor": "x",
"overlaying": "y",
"side": "right",
"title": {
"text": "Price"
}
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"colors=[\"skyblue\", \"steelblue\"]\n",
"\n",
"#Get market price data\n",
"price=shop.model.market.Day_ahead.sale_price.get()\n",
"\n",
"#Plot production and price\n",
"fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n",
"fig.update_layout(barmode=\"stack\", title=\"Price and production\")\n",
"fig.add_trace(go.Scatter(x=price.index, y=price.values, name=\"Price\", marker=dict(color=\"black\")), secondary_y=True)\n",
"fig.update_yaxes(title_text=\"Price\", secondary_y=True)\n",
"fig.update_yaxes(title_text=\"Production\", secondary_y=False)\n",
"fig.update_xaxes(tickformat=\"%H:%M\")\n",
"for i, gen in enumerate(shop.model.generator):\n",
" data=gen.production.get()\n",
" fig.add_trace(go.Bar(x=data.index, y=data.values, name=f'Production {gen.get_name()}', marker=dict(color=colors[i])), secondary_y=False)\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"id": "6397901d",
"metadata": {},
"source": [
"The plot below shows the delivery to the different reserve markets from our two generators."
]
},
{
"cell_type": "code",
"execution_count": 6,
"id": "fc39b8a9",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"marker": {
"color": "skyblue"
},
"name": "Plant1_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.0,
2.0,
2.0,
2.0,
2.0,
2.0,
0.0,
2.0,
2.0,
0.0,
2.0,
2.0,
2.0,
2.0,
2.0,
2.0,
0.0,
2.0,
2.0,
0.0,
2.0,
2.0,
2.0,
2.0
],
"yaxis": "y"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x2",
"y": [
0.0,
1.0,
0.0,
1.0,
1.0,
1.0,
0.0,
1.0,
1.0,
0.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0
],
"yaxis": "y2"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x3",
"y": [
0.0,
3.8725889358213443,
3.859921279645171,
3.847276318480869,
3.8346544331711563,
3.828557420671693,
0.0,
5.0,
5.0,
0.0,
5.0,
3.7308823097387744,
5.0,
5.0,
5.0,
5.0,
0.0,
3.6014699875160687,
3.5999632890062685,
0.0,
5.0,
5.0,
5.0,
5.0
],
"yaxis": "y3"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x4",
"y": [
0.0,
2.0,
0.3333333333333335,
2.0,
2.0,
2.0,
0.0,
2.0,
2.0,
0.0,
2.0,
2.0,
2.0,
2.0,
2.0,
2.0,
0.0,
0.3333333333333335,
0.0,
0.0,
2.0,
2.0,
2.0,
2.0
],
"yaxis": "y4"
},
{
"marker": {
"color": "steelblue"
},
"name": "Plant2_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
2.0,
0.0,
0.0,
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
2.0,
0.0,
0.0,
2.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x2",
"y": [
1.0,
0.0,
1.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y2"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x3",
"y": [
5.0,
1.1274110641786557,
1.140078720354829,
1.1527236815191308,
1.1653455668288437,
1.171442579328307,
5.0,
0.0,
0.0,
5.0,
0.0,
1.2691176902612256,
0.0,
0.0,
0.0,
0.0,
5.0,
1.3985300124839313,
1.4000367109937315,
5.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y3"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x4",
"y": [
2.0,
0.0,
1.6666666666666665,
0.0,
0.0,
0.0,
2.0,
0.0,
0.0,
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
2.0,
1.6666666666666665,
2.0,
2.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y4"
}
],
"layout": {
"annotations": [
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FRR up delivery",
"x": 0.225,
"xanchor": "center",
"xref": "paper",
"y": 1.0,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FRR down delivery",
"x": 0.775,
"xanchor": "center",
"xref": "paper",
"y": 1.0,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FCR-n up delivery",
"x": 0.225,
"xanchor": "center",
"xref": "paper",
"y": 0.375,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FCR-n down delivery",
"x": 0.775,
"xanchor": "center",
"xref": "paper",
"y": 0.375,
"yanchor": "bottom",
"yref": "paper"
}
],
"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
}
}
},
"xaxis": {
"anchor": "y",
"domain": [
0.0,
0.45
],
"tickformat": "%H:%M"
},
"xaxis2": {
"anchor": "y2",
"domain": [
0.55,
1.0
],
"tickformat": "%H:%M"
},
"xaxis3": {
"anchor": "y3",
"domain": [
0.0,
0.45
],
"tickformat": "%H:%M"
},
"xaxis4": {
"anchor": "y4",
"domain": [
0.55,
1.0
],
"tickformat": "%H:%M"
},
"yaxis": {
"anchor": "x",
"domain": [
0.625,
1.0
],
"title": {
"text": "Production"
}
},
"yaxis2": {
"anchor": "x2",
"domain": [
0.625,
1.0
]
},
"yaxis3": {
"anchor": "x3",
"domain": [
0.0,
0.375
],
"title": {
"text": "Production"
}
},
"yaxis4": {
"anchor": "x4",
"domain": [
0.0,
0.375
]
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Plot reserve market deliveries\n",
"fig = make_subplots(rows=2, cols=2, start_cell=\"top-left\", subplot_titles=(\"FRR up delivery\", \"FRR down delivery\", \"FCR-n up delivery\", \"FCR-n down delivery\"))\n",
"fig.update_layout(barmode=\"stack\")\n",
"fig.update_yaxes(title_text=\"Production\", row=1, col=1)\n",
"fig.update_yaxes(title_text=\"Production\", row=2, col=1)\n",
"fig.update_xaxes(tickformat=\"%H:%M\")\n",
"for i, gen in enumerate(shop.model.generator):\n",
" fig.add_trace(go.Bar(x=gen.frr_up_delivery.get().index, y=gen.frr_up_delivery.get().values, name=gen.get_name(), marker=dict(color=colors[i])), row=1, col=1)\n",
" fig.add_trace(go.Bar(x=gen.frr_down_delivery.get().index, y=gen.frr_down_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=1, col=2)\n",
" fig.add_trace(go.Bar(x=gen.fcr_n_up_delivery.get().index, y=gen.fcr_n_up_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=2, col=1)\n",
" fig.add_trace(go.Bar(x=gen.fcr_n_down_delivery.get().index, y=gen.fcr_n_down_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=2, col=2)\n",
"fig.show()"
]
},
{
"cell_type": "markdown",
"id": "86e36de3",
"metadata": {},
"source": [
"## Add battery and rerun model\n",
"We will now add a [battery](battery) to our model and connect it to the reserve group. We then rerun shop."
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "2b3493ba",
"metadata": {},
"outputs": [],
"source": [
"#Create a standard ShopSession\n",
"shop2=ShopSession()\n",
"#Build a basic SHOP model\n",
"build_model(shop2)\n",
"\n",
"#Add reserve group \n",
"RG = shop2.model.reserve_group.add_object('RG')\n",
"\n",
"#Add reserve obligations\n",
"RG.fcr_n_up_obligation.set(5)\n",
"RG.fcr_n_down_obligation.set(2)\n",
"RG.frr_up_obligation.set(2)\n",
"RG.frr_down_obligation.set(1)\n",
"\n",
"#Connect the generators to the reserve group\n",
"for i, gen in enumerate(shop2.model.generator):\n",
" gen.connect_to(RG)\n",
"\n",
"#Add battery\n",
"battery = shop2.model.battery.add_object('Battery')\n",
"battery.charge_efficiency.set(0.95)\n",
"battery.discharge_efficiency.set(0.95)\n",
"battery.max_charge_power.set(6.0)\n",
"battery.max_discharge_power.set(6.0)\n",
"battery.max_energy.set(12.0)\n",
"battery.initial_energy.set(0.5)\n",
"battery.connect_to(shop2.model.busbar.Busbar)\n",
"shop2.model.battery.Battery.connect_to(RG)\n",
"\n",
"#Run SHOP\n",
"run_model(shop2)"
]
},
{
"cell_type": "markdown",
"id": "7e46825c",
"metadata": {},
"source": [
"## Reserve capacity with battery\n",
"The first plot below shows the [generator production](generator:production) and the [battery net discharge](battery:net_power_discharge) with the added reserve obligations. In contrast to the above example, we see that both generators can now be turned off during low price periods."
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "f3045c5e",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"marker": {
"color": "black"
},
"name": "Price",
"type": "scatter",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
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,
38.782,
43.082,
39.242,
38.622,
29.732,
25.392,
25.392,
25.392
],
"yaxis": "y2"
},
{
"marker": {
"color": "indianred"
},
"name": "Battery discharge",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.0,
1.6868048474362674,
1.6813910048009397,
2.521804147762792,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.6823418881758982,
0.0,
0.0,
0.0,
0.0,
0.24145541014608796,
4.701140771290633,
0.24246050728326907,
0.22994331128001022,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
},
{
"marker": {
"color": "darkseagreen"
},
"name": "Battery charge",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
-6.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-0.0,
-1.8640907348209397,
-0.0,
-0.0,
-1.0,
-1.0,
-1.0,
-3.0,
-0.0,
-0.0,
-0.0,
-0.0,
-1.0,
-1.0,
-1.0,
-1.0
],
"yaxis": "y"
},
{
"marker": {
"color": "skyblue"
},
"name": "Production Plant1_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.0,
38.546491616452144,
38.154699214397034,
28.892453586248063,
19.392835523436574,
19.36370651364227,
0.0,
37.769366887907324,
0.0,
0.0,
38.092510980053305,
37.700829548962936,
0.0,
0.0,
0.0,
0.0,
0.0,
33.85357280761154,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
},
{
"marker": {
"color": "steelblue"
},
"name": "Production Plant2_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
30.22213227219286,
30.286451823505743,
30.578846042549472,
30.871293751415323,
31.05263819993891,
31.11114079708714,
31.169645534897075,
30.935639427157636,
31.228152413486217,
30.9941377433349,
30.760157320011558,
31.05263819993891,
0.0,
0.0,
0.0,
0.0,
32.51584559751307,
32.281642435335264,
32.53465029818786,
32.300444382823144,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
}
],
"layout": {
"barmode": "relative",
"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 and production"
},
"xaxis": {
"anchor": "y",
"domain": [
0.0,
0.94
],
"tickformat": "%H:%M"
},
"yaxis": {
"anchor": "x",
"domain": [
0.0,
1.0
],
"title": {
"text": "Production"
}
},
"yaxis2": {
"anchor": "x",
"overlaying": "y",
"side": "right",
"title": {
"text": "Price"
}
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Get battery net discharge\n",
"battery_discharge=shop2.model.battery.Battery.power_discharge.get()\n",
"battery_charge=shop2.model.battery.Battery.power_charge.get()\n",
"#Get price data\n",
"price=shop2.model.market.Day_ahead.sale_price.get()\n",
"\n",
"#Plot price and production\n",
"fig = make_subplots(specs=[[{\"secondary_y\": True}]])\n",
"fig.update_layout(barmode=\"relative\", title=\"Price and production\")\n",
"fig.update_yaxes(title_text=\"Price\", secondary_y=True)\n",
"fig.update_yaxes(title_text=\"Production\", secondary_y=False)\n",
"fig.update_xaxes(tickformat=\"%H:%M\")\n",
"fig.add_trace(go.Scatter(x=price.index, y=price.values, name=\"Price\", marker=dict(color=\"black\")), secondary_y=True)\n",
"fig.add_trace(go.Bar(x=battery_discharge.index, y=battery_discharge.values, name=f'Battery discharge', marker=dict(color=\"indianred\")), secondary_y=False)\n",
"fig.add_trace(go.Bar(x=battery_charge.index, y=-battery_charge.values, name=f'Battery charge', marker=dict(color=\"darkseagreen\")), secondary_y=False)\n",
"for i, gen in enumerate(shop2.model.generator):\n",
" fig.add_trace(go.Bar(x=gen.production.get().index, y=gen.production.get().values, name=f'Production {gen.get_name()}', marker=dict(color=colors[i])), secondary_y=False)\n",
"fig.show()\n",
"\n"
]
},
{
"cell_type": "markdown",
"id": "7778120a",
"metadata": {},
"source": [
"From the reserve market delivery plots we see that the battery now delivers most of the reserves."
]
},
{
"cell_type": "code",
"execution_count": 9,
"id": "decd573f",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.plotly.v1+json": {
"config": {
"plotlyServerURL": "https://plot.ly"
},
"data": [
{
"marker": {
"color": "indianred"
},
"name": "Battery",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.8810486861299012,
0.4355791815905974,
0.4565998374390716,
0.0,
2.0,
0.0,
0.830465573275557,
0.8429609341730675,
0.8273411484032529,
2.0,
0.0,
0.4809443904209303,
2.0,
2.0,
2.0,
2.0,
2.0,
0.0,
0.7575394927167309,
2.0,
2.0,
2.0,
2.0,
2.0
],
"yaxis": "y"
},
{
"marker": {
"color": "indianred"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x2",
"y": [
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0
],
"yaxis": "y2"
},
{
"marker": {
"color": "indianred"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x3",
"y": [
5.0,
3.8776159709731353,
3.8620091577599887,
2.179729835890844,
3.8367137214031715,
5.0,
5.0,
5.0,
5.0,
3.8398374446979595,
5.0,
3.8367137214031715,
5.0,
5.0,
5.0,
5.0,
3.758544589853912,
1.2988592287093672,
5.0,
3.77005668871999,
5.0,
5.0,
5.0,
5.0
],
"yaxis": "y3"
},
{
"marker": {
"color": "indianred"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x4",
"y": [
0.0,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
0.3333333333333335,
2.0,
2.0,
2.0,
2.0,
0.3333333333333335,
0.0,
0.3333333333333335,
0.3333333333333335,
2.0,
2.0,
2.0,
2.0
],
"yaxis": "y4"
},
{
"marker": {
"color": "skyblue"
},
"name": "Plant1_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
0.0,
1.5644208184094026,
1.5434001625609284,
2.0,
0.0,
0.8335897642689503,
0.0,
0.0,
0.0,
0.0,
1.540064099325285,
1.5190556095790697,
0.0,
0.0,
0.0,
0.0,
0.0,
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x2",
"y": [
0.0,
1.0,
0.0,
1.0,
0.0,
1.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y2"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x3",
"y": [
0.0,
0.0,
0.0,
1.6666666666666665,
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,
2.4722022561742643,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y3"
},
{
"marker": {
"color": "skyblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x4",
"y": [
0.0,
1.6666666666666665,
0.0,
1.6666666666666665,
1.6666666666666665,
1.6666666666666665,
0.0,
1.6666666666666665,
0.0,
0.0,
1.6666666666666665,
1.6666666666666665,
0.0,
0.0,
0.0,
0.0,
0.0,
2.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y4"
},
{
"marker": {
"color": "steelblue"
},
"name": "Plant2_G1",
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x",
"y": [
1.1189513138700988,
0.0,
0.0,
0.0,
0.0,
1.1664102357310497,
1.169534426724443,
1.1570390658269325,
1.172658851596747,
0.0,
0.459935900674715,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.242460507283269,
0.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x2",
"y": [
1.0,
0.0,
1.0,
0.0,
1.0,
0.0,
1.0,
0.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y2"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x3",
"y": [
0.0,
1.1223840290268647,
1.1379908422400113,
1.1536034974424894,
1.1632862785968285,
0.0,
0.0,
0.0,
0.0,
1.1601625553020405,
0.0,
1.1632862785968285,
0.0,
0.0,
0.0,
0.0,
1.241455410146088,
1.2289385151163685,
0.0,
1.2299433112800102,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y3"
},
{
"marker": {
"color": "steelblue"
},
"showlegend": false,
"type": "bar",
"x": [
"2018-02-27T00:00:00",
"2018-02-27T01:00:00",
"2018-02-27T02:00:00",
"2018-02-27T03:00:00",
"2018-02-27T04:00:00",
"2018-02-27T05:00:00",
"2018-02-27T06:00:00",
"2018-02-27T07:00:00",
"2018-02-27T08:00:00",
"2018-02-27T09:00:00",
"2018-02-27T10:00:00",
"2018-02-27T11:00:00",
"2018-02-27T12:00:00",
"2018-02-27T13:00:00",
"2018-02-27T14:00:00",
"2018-02-27T15:00:00",
"2018-02-27T16:00:00",
"2018-02-27T17:00:00",
"2018-02-27T18:00:00",
"2018-02-27T19:00:00",
"2018-02-27T20:00:00",
"2018-02-27T21:00:00",
"2018-02-27T22:00:00",
"2018-02-27T23:00:00"
],
"xaxis": "x4",
"y": [
2.0,
0.0,
1.6666666666666665,
0.0,
0.0,
0.0,
1.6666666666666665,
0.0,
1.6666666666666665,
1.6666666666666665,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.6666666666666665,
0.0,
1.6666666666666665,
1.6666666666666665,
0.0,
0.0,
0.0,
0.0
],
"yaxis": "y4"
}
],
"layout": {
"annotations": [
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FRR up delivery",
"x": 0.225,
"xanchor": "center",
"xref": "paper",
"y": 1.0,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FRR down delivery",
"x": 0.775,
"xanchor": "center",
"xref": "paper",
"y": 1.0,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FCR-n up delivery",
"x": 0.225,
"xanchor": "center",
"xref": "paper",
"y": 0.375,
"yanchor": "bottom",
"yref": "paper"
},
{
"font": {
"size": 16
},
"showarrow": false,
"text": "FCR-n down delivery",
"x": 0.775,
"xanchor": "center",
"xref": "paper",
"y": 0.375,
"yanchor": "bottom",
"yref": "paper"
}
],
"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
}
}
},
"xaxis": {
"anchor": "y",
"domain": [
0.0,
0.45
],
"tickformat": "%H:%M"
},
"xaxis2": {
"anchor": "y2",
"domain": [
0.55,
1.0
],
"tickformat": "%H:%M"
},
"xaxis3": {
"anchor": "y3",
"domain": [
0.0,
0.45
],
"tickformat": "%H:%M"
},
"xaxis4": {
"anchor": "y4",
"domain": [
0.55,
1.0
],
"tickformat": "%H:%M"
},
"yaxis": {
"anchor": "x",
"domain": [
0.625,
1.0
],
"title": {
"text": "Production"
}
},
"yaxis2": {
"anchor": "x2",
"domain": [
0.625,
1.0
]
},
"yaxis3": {
"anchor": "x3",
"domain": [
0.0,
0.375
],
"title": {
"text": "Production"
}
},
"yaxis4": {
"anchor": "x4",
"domain": [
0.0,
0.375
]
}
}
},
"text/html": [
""
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#Plot reserve market deliveries\n",
"fig = make_subplots(rows=2, cols=2, start_cell=\"top-left\", subplot_titles=(\"FRR up delivery\", \"FRR down delivery\", \"FCR-n up delivery\", \"FCR-n down delivery\"))\n",
"fig.update_layout(barmode=\"stack\")\n",
"fig.update_yaxes(title_text=\"Production\", row=1, col=1)\n",
"fig.update_yaxes(title_text=\"Production\", row=2, col=1)\n",
"fig.update_xaxes(tickformat=\"%H:%M\")\n",
"fig.add_trace(go.Bar(x=shop2.model.battery.Battery.frr_up_delivery.get().index, y=shop2.model.battery.Battery.frr_up_delivery.get().values, name=\"Battery\", marker=dict(color=\"indianred\")), row=1, col=1)\n",
"fig.add_trace(go.Bar(x=shop2.model.battery.Battery.frr_down_delivery.get().index, y=shop2.model.battery.Battery.frr_down_delivery.get().values, showlegend=False, marker=dict(color=\"indianred\")), row=1, col=2)\n",
"fig.add_trace(go.Bar(x=shop2.model.battery.Battery.fcr_n_up_delivery.get().index, y=shop2.model.battery.Battery.fcr_n_up_delivery.get().values, showlegend=False, marker=dict(color=\"indianred\")), row=2, col=1)\n",
"fig.add_trace(go.Bar(x=shop2.model.battery.Battery.fcr_n_down_delivery.get().index, y=shop2.model.battery.Battery.fcr_n_down_delivery.get().values, showlegend=False, marker=dict(color=\"indianred\")), row=2, col=2)\n",
"for i, gen in enumerate(shop2.model.generator):\n",
" fig.add_trace(go.Bar(x=gen.frr_up_delivery.get().index, y=gen.frr_up_delivery.get().values, name=gen.get_name(), marker=dict(color=colors[i])), row=1, col=1)\n",
" fig.add_trace(go.Bar(x=gen.frr_down_delivery.get().index, y=gen.frr_down_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=1, col=2)\n",
" fig.add_trace(go.Bar(x=gen.fcr_n_up_delivery.get().index, y=gen.fcr_n_up_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=2, col=1)\n",
" fig.add_trace(go.Bar(x=gen.fcr_n_down_delivery.get().index, y=gen.fcr_n_down_delivery.get().values, showlegend=False, marker=dict(color=colors[i])), row=2, col=2)\n",
"fig.show()"
]
}
],
"metadata": {
"jupytext": {
"text_representation": {
"extension": ".md",
"format_name": "myst",
"format_version": 0.13,
"jupytext_version": "1.15.2"
}
},
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
},
"source_map": [
12,
16,
24,
35,
41,
48,
53,
66,
71,
74,
79,
97,
101,
114,
119,
151,
156,
178,
182
]
},
"nbformat": 4,
"nbformat_minor": 5
}