{ "cells": [ { "cell_type": "markdown", "id": "1588fa71", "metadata": {}, "source": [ "(frr-forbidden-zones)=\n", "# FRR delivery across needle combinations\n", "\n", "This example demonstrates how the [frr_mip_flag](generator:frr_mip_flag) can be used to avoid FRR-delivery in forbidden zones for Pelton generators. General modeling of pelton units and forbidden zones is explained in the [pelton units and forbidden zones](pelton) example. This example demonstrates the functionality for FRR-up reserves, but the functionality can be used for FRR-down reserves as well. \n", "\n", "The model setup for this example is available in the following format:\n", "- pyshop\n", " - [frr_forbidden_zones.py](frr_forbidden_zones.py)" ] }, { "cell_type": "code", "execution_count": 1, "id": "eff97980", "metadata": {}, "outputs": [], "source": [ "#Necessary imports \n", "from pyshop import ShopSession\n", "\n", "#Functions used in this example for building a SHOP model, running it, and plotting the results\n", "from forbidden_zone_pelton import build_model, run_model, plot_production_and_frr_delivery" ] }, { "cell_type": "markdown", "id": "2ddd18a3", "metadata": {}, "source": [ "## Create SHOP session and import basic model\n", "\n", "Our example model has a pelton [generator](generator) with two [needle_combinations](needle_combination). The first needle combination has a minimum production of 5 MW, and a maximum production of 20 MW. The second needle combination must produce between 25 MW and 40 MW. This means that there is a forbidden zone between 20 MW and 25 MW." ] }, { "cell_type": "code", "execution_count": 2, "id": "58531f11", "metadata": {}, "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" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#Create a standard ShopSession\n", "shop=ShopSession()\n", "#Build SHOP model\n", "build_model(shop)\n", "#Display topology to the screen\n", "display(shop.model.build_connection_tree())\n", "\n", "# Get needle combination production limits\n", "p1min = shop.model.needle_combination.N1.p_min.get()\n", "p1max = shop.model.needle_combination.N1.p_max.get()\n", "p2min = shop.model.needle_combination.N2.p_min.get()\n", "p2max = shop.model.needle_combination.N2.p_max.get()" ] }, { "cell_type": "markdown", "id": "75d5de2e", "metadata": {}, "source": [ "## Add FRR up requirement \n", "\n", "We start by adding a reserve obligation for FRR up, run the model, and plot the resulting production and reserve delivery. The default behaviour is that the reserves must be delivered by the current running needle combination." ] }, { "cell_type": "code", "execution_count": 3, "id": "8f2bbca1", "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "width": 0 }, "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "fill": "tonexty", "line": { "color": "grey", "shape": "hv", "width": 0 }, "name": "Forbidden zone", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "fill": "tozeroy", "line": { "color": "grey", "width": 0 }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dash" }, "mode": "lines", "name": "pmin1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dot" }, "mode": "lines", "name": "pmax1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "line": { "color": "midnightblue", "dash": "dash" }, "mode": "lines", "name": "pmin2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "line": { "color": "midnightblue", "dash": "dot" }, "mode": "lines", "name": "pmax2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T00:00:00" ], "y": [ 4.999994065827692, 14.999994065827693 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T01:00:00", "2024-01-01T01:00:00" ], "y": [ 29.217073008462815, 39.21707300846282 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T02:00:00", "2024-01-01T02:00:00" ], "y": [ 29.09437938555082, 39.09437938555082 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T03:00:00", "2024-01-01T03:00:00" ], "y": [ 4.999993747358395, 14.999993747358396 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T04:00:00", "2024-01-01T04:00:00" ], "y": [ 4.999993721676034, 14.999993721676034 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T05:00:00", "2024-01-01T05:00:00" ], "y": [ 28.93015907886596, 38.930159078865955 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T06:00:00", "2024-01-01T06:00:00" ], "y": [ 4.9999935407579645, 14.999993540757965 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T07:00:00", "2024-01-01T07:00:00" ], "y": [ 4.9999935139372145, 14.999993513937214 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T08:00:00", "2024-01-01T08:00:00" ], "y": [ 29.99978653018196, 39.999786530181964 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T09:00:00", "2024-01-01T09:00:00" ], "y": [ 9.93810032950182, 19.93810032950182 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T10:00:00", "2024-01-01T10:00:00" ], "y": [ 28.595966029823625, 38.59596602982363 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T11:00:00", "2024-01-01T11:00:00" ], "y": [ 28.47327240691163, 38.47327240691163 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T12:00:00", "2024-01-01T12:00:00" ], "y": [ 28.350578783999634, 38.35057878399964 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T13:00:00", "2024-01-01T13:00:00" ], "y": [ 29.999660486940357, 39.99966048694036 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T14:00:00", "2024-01-01T14:00:00" ], "y": [ 4.999992605236594, 14.999992605236594 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T15:00:00", "2024-01-01T15:00:00" ], "y": [ 4.999992575463481, 14.99999257546348 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T16:00:00", "2024-01-01T16:00:00" ], "y": [ 4.9999925454287855, 14.999992545428785 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T17:00:00", "2024-01-01T17:00:00" ], "y": [ 28.03186631177108, 38.03186631177108 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T18:00:00", "2024-01-01T18:00:00" ], "y": [ 9.943305719254026, 19.943305719254028 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T19:00:00", "2024-01-01T19:00:00" ], "y": [ 9.943609926337425, 19.943609926337423 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T20:00:00", "2024-01-01T20:00:00" ], "y": [ 29.999512490377793, 39.999512490377796 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T21:00:00", "2024-01-01T21:00:00" ], "y": [ 29.99944851281334, 39.999448512813345 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T22:00:00", "2024-01-01T22:00:00" ], "y": [ 29.999374828542575, 39.99937482854257 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T23:00:00", "2024-01-01T23:00:00" ], "y": [ 29.882617847768653, 39.88261784776866 ] }, { "marker": { "line": { "color": "indianred", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "Production", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 4.999994065827692, 29.217073008462815, 29.09437938555082, 4.999993747358395, 4.999993721676034, 28.93015907886596, 4.9999935407579645, 4.9999935139372145, 29.99978653018196, 9.93810032950182, 28.595966029823625, 28.47327240691163, 28.350578783999634, 29.999660486940357, 4.999992605236594, 4.999992575463481, 4.9999925454287855, 28.03186631177108, 9.943305719254026, 9.943609926337425, 29.999512490377793, 29.99944851281334, 29.999374828542575, 29.882617847768653 ] }, { "marker": { "line": { "color": "seagreen", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "FRR up delivery", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 14.999994065827693, 39.21707300846282, 39.09437938555082, 14.999993747358396, 14.999993721676034, 38.930159078865955, 14.999993540757965, 14.999993513937214, 39.999786530181964, 19.93810032950182, 38.59596602982363, 38.47327240691163, 38.35057878399964, 39.99966048694036, 14.999992605236594, 14.99999257546348, 14.999992545428785, 38.03186631177108, 19.943305719254028, 19.943609926337423, 39.999512490377796, 39.999448512813345, 39.99937482854257, 39.88261784776866 ] } ], "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": "Production and FRR up delivery" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ] }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "range": [ 0, 41.0 ], "title": { "text": "Production [MW]" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "#Add reserve group\n", "RG = shop.model.reserve_group.add_object('RG')\n", "\n", "# #Add reserve obligation\n", "RG.frr_up_obligation.set(10)\n", "\n", "# Connect the generator to the reserve group\n", "gen = shop.model.generator.pelton\n", "gen.connect_to(RG)\n", "\n", "# Run model\n", "run_model(shop)\n", "\n", "# Get the generator production and frr up delivery\n", "p = gen.production.get()\n", "frr = gen.frr_up_delivery.get() \n", "\n", "# Plot results\n", "plot_production_and_frr_delivery(p,frr, p1min, p1max, p2min, p2max)" ] }, { "cell_type": "markdown", "id": "a325d23d", "metadata": {}, "source": [ "## Allow FRR delivery in forbidden zone\n", "\n", "We now set the attribute [p_frr_max](generator:p_frr_max) to the maximum production of the second needle combination. This means that the model can deliver reserves up to this limit for both needle combinations. Consequently, the reserves can be delivered in the forbidden zone." ] }, { "cell_type": "code", "execution_count": 4, "id": "2f9e5c0a", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "width": 0 }, "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "fill": "tonexty", "line": { "color": "grey", "shape": "hv", "width": 0 }, "name": "Forbidden zone", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "fill": "tozeroy", "line": { "color": "grey", "width": 0 }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dash" }, "mode": "lines", "name": "pmin1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dot" }, "mode": "lines", "name": "pmax1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "line": { "color": "midnightblue", "dash": "dash" }, "mode": "lines", "name": "pmin2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "line": { "color": "midnightblue", "dash": "dot" }, "mode": "lines", "name": "pmax2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T00:00:00" ], "y": [ 4.999994065827692, 14.999994065827693 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T01:00:00", "2024-01-01T01:00:00" ], "y": [ 29.217073008462815, 39.21707300846282 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T02:00:00", "2024-01-01T02:00:00" ], "y": [ 29.09437938555082, 39.09437938555082 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T03:00:00", "2024-01-01T03:00:00" ], "y": [ 4.999993747358395, 14.999993747358396 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T04:00:00", "2024-01-01T04:00:00" ], "y": [ 4.999993721676034, 14.999993721676034 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T05:00:00", "2024-01-01T05:00:00" ], "y": [ 28.93015907886596, 38.930159078865955 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T06:00:00", "2024-01-01T06:00:00" ], "y": [ 4.9999935407579645, 14.999993540757965 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T07:00:00", "2024-01-01T07:00:00" ], "y": [ 4.999993513934033, 14.999993513934033 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T08:00:00", "2024-01-01T08:00:00" ], "y": [ 30.000000301833516, 40.000000301833516 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T09:00:00", "2024-01-01T09:00:00" ], "y": [ 13.351958534980712, 23.35195853498071 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T10:00:00", "2024-01-01T10:00:00" ], "y": [ 15.586438214388128, 25.586438214388128 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T11:00:00", "2024-01-01T11:00:00" ], "y": [ 15.565317151347712, 25.565317151347713 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T12:00:00", "2024-01-01T12:00:00" ], "y": [ 28.454545110266533, 38.45454511026654 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T13:00:00", "2024-01-01T13:00:00" ], "y": [ 30.000001208895792, 40.000001208895796 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T14:00:00", "2024-01-01T14:00:00" ], "y": [ 4.999992794690543, 14.999992794690543 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T15:00:00", "2024-01-01T15:00:00" ], "y": [ 4.999992767485452, 14.999992767485452 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T16:00:00", "2024-01-01T16:00:00" ], "y": [ 4.999992739939068, 14.999992739939067 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T17:00:00", "2024-01-01T17:00:00" ], "y": [ 28.13663749876633, 38.13663749876633 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T18:00:00", "2024-01-01T18:00:00" ], "y": [ 13.068212099636092, 23.068212099636092 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T19:00:00", "2024-01-01T19:00:00" ], "y": [ 13.043552702636092, 23.04355270263609 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T20:00:00", "2024-01-01T20:00:00" ], "y": [ 30.000002492531582, 40.00000249253158 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T21:00:00", "2024-01-01T21:00:00" ], "y": [ 30.000003000703817, 40.00000300070381 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T22:00:00", "2024-01-01T22:00:00" ], "y": [ 30.00000311670071, 40.00000311670071 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T23:00:00", "2024-01-01T23:00:00" ], "y": [ 30.000004464110578, 40.000004464110575 ] }, { "marker": { "line": { "color": "indianred", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "Production", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 4.999994065827692, 29.217073008462815, 29.09437938555082, 4.999993747358395, 4.999993721676034, 28.93015907886596, 4.9999935407579645, 4.999993513934033, 30.000000301833516, 13.351958534980712, 15.586438214388128, 15.565317151347712, 28.454545110266533, 30.000001208895792, 4.999992794690543, 4.999992767485452, 4.999992739939068, 28.13663749876633, 13.068212099636092, 13.043552702636092, 30.000002492531582, 30.000003000703817, 30.00000311670071, 30.000004464110578 ] }, { "marker": { "line": { "color": "seagreen", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "FRR up delivery", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 14.999994065827693, 39.21707300846282, 39.09437938555082, 14.999993747358396, 14.999993721676034, 38.930159078865955, 14.999993540757965, 14.999993513934033, 40.000000301833516, 23.35195853498071, 25.586438214388128, 25.565317151347713, 38.45454511026654, 40.000001208895796, 14.999992794690543, 14.999992767485452, 14.999992739939067, 38.13663749876633, 23.068212099636092, 23.04355270263609, 40.00000249253158, 40.00000300070381, 40.00000311670071, 40.000004464110575 ] } ], "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": "Production and FRR up delivery" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ] }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "range": [ 0, 41.0 ], "title": { "text": "Production [MW]" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Create a standard ShopSession\n", "shop2=ShopSession()\n", "\n", "# Build SHOP model\n", "build_model(shop2)\n", "\n", "# Add reserve group\n", "RG = shop2.model.reserve_group.add_object('RG')\n", "\n", "# Add reserve obligation\n", "RG.frr_up_obligation.set(10)\n", "\n", "# Connect the generator to the reserve group\n", "gen = shop2.model.generator.pelton\n", "gen.connect_to(RG)\n", "\n", "# Set the maximum limit for production + frr up delivery\n", "gen.p_frr_max.set(p2max)\n", "\n", "# Run model\n", "run_model(shop2)\n", "\n", "# Get the generator production and frr up delivery\n", "p = gen.production.get()\n", "frr = gen.frr_up_delivery.get()\n", "\n", "# Plot the results\n", "plot_production_and_frr_delivery(p,frr, p1min, p1max, p2min, p2max)" ] }, { "cell_type": "markdown", "id": "5633ce96", "metadata": {}, "source": [ "## With FRR requirement across needle combinations, avoiding the forbidden zone\n", "\n", "By setting the attribute [frr_mip_flag](generator:frr_mip_flag) to 1, we allow reserve delivery across needle combinations, but the model is forced to avoid the forbidden zone. Note that if the [frr_mip_flag](generator:frr_mip_flag) is active, the [p_frr_max](generator:p_frr_max) limit will be ignored." ] }, { "cell_type": "code", "execution_count": 5, "id": "92e1716b", "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "width": 0 }, "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "fill": "tonexty", "line": { "color": "grey", "shape": "hv", "width": 0 }, "name": "Forbidden zone", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "fill": "tozeroy", "line": { "color": "grey", "width": 0 }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dash" }, "mode": "lines", "name": "pmin1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0 ] }, { "line": { "color": "steelblue", "dash": "dot" }, "mode": "lines", "name": "pmax1", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0, 20.0 ] }, { "line": { "color": "midnightblue", "dash": "dash" }, "mode": "lines", "name": "pmin2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0, 25.0 ] }, { "line": { "color": "midnightblue", "dash": "dot" }, "mode": "lines", "name": "pmax2", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0, 40.0 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T00:00:00" ], "y": [ 4.999994065827692, 14.999994065827693 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T01:00:00", "2024-01-01T01:00:00" ], "y": [ 29.217073008462815, 39.21707300846282 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T02:00:00", "2024-01-01T02:00:00" ], "y": [ 29.09437938555082, 39.09437938555082 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T03:00:00", "2024-01-01T03:00:00" ], "y": [ 4.999993747358395, 14.999993747358396 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T04:00:00", "2024-01-01T04:00:00" ], "y": [ 4.999993721676034, 14.999993721676034 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T05:00:00", "2024-01-01T05:00:00" ], "y": [ 28.93015907886596, 38.930159078865955 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T06:00:00", "2024-01-01T06:00:00" ], "y": [ 4.9999935407579645, 14.999993540757965 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T07:00:00", "2024-01-01T07:00:00" ], "y": [ 4.999993513930858, 14.999993513930857 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T08:00:00", "2024-01-01T08:00:00" ], "y": [ 29.99978697670027, 39.99978697670027 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T09:00:00", "2024-01-01T09:00:00" ], "y": [ 13.351959030458417, 24.999978008533468 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T10:00:00", "2024-01-01T10:00:00" ], "y": [ 15.572183333979934, 25.572183333979936 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T11:00:00", "2024-01-01T11:00:00" ], "y": [ 15.551067895175521, 25.55106789517552 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T12:00:00", "2024-01-01T12:00:00" ], "y": [ 28.45467309710794, 38.45467309710794 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T13:00:00", "2024-01-01T13:00:00" ], "y": [ 29.99969096811384, 39.99969096811384 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T14:00:00", "2024-01-01T14:00:00" ], "y": [ 4.999992826067977, 14.999992826067977 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T15:00:00", "2024-01-01T15:00:00" ], "y": [ 4.99999280034856, 14.99999280034856 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T16:00:00", "2024-01-01T16:00:00" ], "y": [ 4.999992774221312, 14.999992774221312 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T17:00:00", "2024-01-01T17:00:00" ], "y": [ 28.136768098128044, 38.136768098128044 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T18:00:00", "2024-01-01T18:00:00" ], "y": [ 13.068271595828689, 24.999973039801684 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T19:00:00", "2024-01-01T19:00:00" ], "y": [ 13.043612198828686, 24.99997252881896 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T20:00:00", "2024-01-01T20:00:00" ], "y": [ 29.999548060018732, 39.99954806001873 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T21:00:00", "2024-01-01T21:00:00" ], "y": [ 29.999489363899198, 39.9994893638992 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T22:00:00", "2024-01-01T22:00:00" ], "y": [ 29.999422289948775, 39.999422289948775 ] }, { "line": { "color": "grey" }, "mode": "lines", "showlegend": false, "type": "scatter", "x": [ "2024-01-01T23:00:00", "2024-01-01T23:00:00" ], "y": [ 29.99934545388682, 39.99934545388682 ] }, { "marker": { "line": { "color": "indianred", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "Production", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 4.999994065827692, 29.217073008462815, 29.09437938555082, 4.999993747358395, 4.999993721676034, 28.93015907886596, 4.9999935407579645, 4.999993513930858, 29.99978697670027, 13.351959030458417, 15.572183333979934, 15.551067895175521, 28.45467309710794, 29.99969096811384, 4.999992826067977, 4.99999280034856, 4.999992774221312, 28.136768098128044, 13.068271595828689, 13.043612198828686, 29.999548060018732, 29.999489363899198, 29.999422289948775, 29.99934545388682 ] }, { "marker": { "line": { "color": "seagreen", "width": 5 }, "size": 10, "symbol": "line-ew" }, "mode": "markers", "name": "FRR up delivery", "type": "scatter", "x": [ "2024-01-01T00:00:00", "2024-01-01T01:00:00", "2024-01-01T02:00:00", "2024-01-01T03:00:00", "2024-01-01T04:00:00", "2024-01-01T05:00:00", "2024-01-01T06:00:00", "2024-01-01T07:00:00", "2024-01-01T08:00:00", "2024-01-01T09:00:00", "2024-01-01T10:00:00", "2024-01-01T11:00:00", "2024-01-01T12:00:00", "2024-01-01T13:00:00", "2024-01-01T14:00:00", "2024-01-01T15:00:00", "2024-01-01T16:00:00", "2024-01-01T17:00:00", "2024-01-01T18:00:00", "2024-01-01T19:00:00", "2024-01-01T20:00:00", "2024-01-01T21:00:00", "2024-01-01T22:00:00", "2024-01-01T23:00:00" ], "y": [ 14.999994065827693, 39.21707300846282, 39.09437938555082, 14.999993747358396, 14.999993721676034, 38.930159078865955, 14.999993540757965, 14.999993513930857, 39.99978697670027, 24.999978008533468, 25.572183333979936, 25.55106789517552, 38.45467309710794, 39.99969096811384, 14.999992826067977, 14.99999280034856, 14.999992774221312, 38.136768098128044, 24.999973039801684, 24.99997252881896, 39.99954806001873, 39.9994893638992, 39.999422289948775, 39.99934545388682 ] } ], "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": "Production and FRR up delivery" }, "xaxis": { "anchor": "y", "domain": [ 0.0, 1.0 ] }, "yaxis": { "anchor": "x", "domain": [ 0.0, 1.0 ], "range": [ 0, 41.0 ], "title": { "text": "Production [MW]" } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "# Create a standard ShopSession\n", "shop3=ShopSession()\n", "\n", "# Build SHOP model\n", "build_model(shop3)\n", "\n", "# Add reserve group\n", "RG = shop3.model.reserve_group.add_object('RG')\n", "\n", "# Add reserve obligation\n", "RG.frr_up_obligation.set(10)\n", "\n", "# Connect the generator to the reserve group\n", "gen = shop3.model.generator.pelton\n", "gen.connect_to(RG)\n", "\n", "# Turn on FRR MIP flag to avoid forbidden zones\n", "gen.frr_mip_flag.set(1)\n", "\n", "# Run model\n", "run_model(shop3)\n", "\n", "# Get the generator production and frr up delivery\n", "p = gen.production.get()\n", "frr = gen.frr_up_delivery.get()\n", "\n", "# Plot the results\n", "plot_production_and_frr_delivery(p,frr, p1min, p1max, p2min, p2max)" ] }, { "cell_type": "markdown", "id": "b2318e4e", "metadata": {}, "source": [ "## Binary variable options\n", "\n", "The constraints for avoiding the forbidden zone can be turned on by setting the [generator](generator) [frr_mip_flag](generator:frr_mip_flag) to 1. Alternatively, the constraints can be turned on for all generators by turning on [frr_mip](global_settings:frr_mip) on the [global_settings](global_settings) object. This setting is overruled by the individual generator frr_mip_flags. \n", "\n", "If [universal mip](global_settings:universal_mip) is turned off, frr mip will be turned off for all generators. This applies also if the generator [frr_mip_flag](generator:frr_mip_flag) is active. \n", "\n", "The default setting is to use binary variables for the constraints in incremental iterations. The binary variables can be turned off for incremental iterations through the [binary_reserve_limits](global_settings:binary_reserve_limits) attribute on the [global_settings](global_settings) object. However, this is not recommended, as not using binary variables might cause unwanted behaviour." ] } ], "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.13.12" }, "source_map": [ 12, 23, 29, 36, 49, 56, 76, 83, 112, 119, 148 ] }, "nbformat": 4, "nbformat_minor": 5 }