{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from notepad import WaterStorage, Heatpump\n", "from pyrecoy.forecasts import Mipf\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/html": [ " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import pandas as pd\n", "import cufflinks\n", "cufflinks.go_offline()\n", "from numpy.polynomial import Polynomial\n", "import numpy as np" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
DAMPOSNEGForeNegForePos
datetime
2018-11-01 00:00:00+01:0044.9046.3946.3953.60333344.623333
2018-11-01 00:15:00+01:0044.9043.0843.0868.96200063.177333
2018-11-01 00:30:00+01:0044.9043.1343.1355.41533357.922667
2018-11-01 00:45:00+01:0044.9046.2946.2957.63333354.712667
2018-11-01 01:00:00+01:0042.4632.0332.0337.35400035.400000
..................
2018-11-01 22:45:00+01:0050.7054.0254.0271.52066765.263333
2018-11-01 23:00:00+01:0050.70202.89202.89143.089333144.426000
2018-11-01 23:15:00+01:0050.7085.7085.70101.67600097.244000
2018-11-01 23:30:00+01:0050.7038.0338.0350.56000045.735333
2018-11-01 23:45:00+01:0050.7030.5330.5345.58466740.736000
\n", "

96 rows × 5 columns

\n", "
" ], "text/plain": [ " DAM POS NEG ForeNeg ForePos\n", "datetime \n", "2018-11-01 00:00:00+01:00 44.90 46.39 46.39 53.603333 44.623333\n", "2018-11-01 00:15:00+01:00 44.90 43.08 43.08 68.962000 63.177333\n", "2018-11-01 00:30:00+01:00 44.90 43.13 43.13 55.415333 57.922667\n", "2018-11-01 00:45:00+01:00 44.90 46.29 46.29 57.633333 54.712667\n", "2018-11-01 01:00:00+01:00 42.46 32.03 32.03 37.354000 35.400000\n", "... ... ... ... ... ...\n", "2018-11-01 22:45:00+01:00 50.70 54.02 54.02 71.520667 65.263333\n", "2018-11-01 23:00:00+01:00 50.70 202.89 202.89 143.089333 144.426000\n", "2018-11-01 23:15:00+01:00 50.70 85.70 85.70 101.676000 97.244000\n", "2018-11-01 23:30:00+01:00 50.70 38.03 38.03 50.560000 45.735333\n", "2018-11-01 23:45:00+01:00 50.70 30.53 30.53 45.584667 40.736000\n", "\n", "[96 rows x 5 columns]" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "mipf = Mipf(\n", " start = '2018-11-01',\n", " end = '2018-11-01', \n", " tidy=True, \n", " include_nextQ=False,\n", " folder_path=r\"C:\\Users\\Shahla Huseynova\\Recoy\\Recoy - Documents\\03 - Libraries\\12 - Data Management\\Forecast Data\"\n", ").data\n", "# mipf.columns\n", "price_data = mipf[['DAM', 'POS', 'NEG', 'ForeNeg', 'ForePos']]\n", "# price_data.index = price_data.index.tz_convert('Europe/Amsterdam')\n", "price_data = price_data.resample('15T').mean()\n", "price_data" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Tsource (VDG)Tsink (VDG)MW (VDG)Tsource (NDG)Tsink (NDG)MW (NDG)
2018-11-01 00:00:00+01:0064.964783142.0031090.019.897433147.7318140.0
2018-11-01 00:15:00+01:0054.578777138.9604930.017.950905148.1389640.0
2018-11-01 00:30:00+01:0065.166672139.8853290.033.500757147.5854260.0
2018-11-01 00:45:00+01:0065.358078139.7319010.042.203876147.5476120.0
2018-11-01 01:00:00+01:0064.947536139.5778710.018.702675148.2603350.0
\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) \\\n", "2018-11-01 00:00:00+01:00 64.964783 142.003109 0.0 \n", "2018-11-01 00:15:00+01:00 54.578777 138.960493 0.0 \n", "2018-11-01 00:30:00+01:00 65.166672 139.885329 0.0 \n", "2018-11-01 00:45:00+01:00 65.358078 139.731901 0.0 \n", "2018-11-01 01:00:00+01:00 64.947536 139.577871 0.0 \n", "\n", " Tsource (NDG) Tsink (NDG) MW (NDG) \n", "2018-11-01 00:00:00+01:00 19.897433 147.731814 0.0 \n", "2018-11-01 00:15:00+01:00 17.950905 148.138964 0.0 \n", "2018-11-01 00:30:00+01:00 33.500757 147.585426 0.0 \n", "2018-11-01 00:45:00+01:00 42.203876 147.547612 0.0 \n", "2018-11-01 01:00:00+01:00 18.702675 148.260335 0.0 " ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = pd.read_excel('Demand_Data_Smurfit_Preprocessed.xlsx', sheet_name='nov2018', index_col=0)\n", "start, end = '2018-11-01 00:00:00', '2018-11-01 12:00:00'\n", "df = data[start:end]\n", "df.index = df.index.tz_localize('Europe/Amsterdam')\n", "df = df.resample('15T').mean()\n", "df=df.drop(['Unnamed: 7', 'Unnamed: 8', 'Unnamed: 9', 'Unnamed: 10', 'Unnamed: 11', 'Unnamed: 12'], axis=1)\n", "\n", "df.head()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "15" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "source": [ "waterstorage = WaterStorage(\n", " name='MyStorage',\n", " max_power=10,\n", " min_power=-10,\n", " roundtrip_eff=0.90,\n", " capacity_per_volume = 50 * 1e-3,\n", " volume = 1000,\n", " lifetime = 25,\n", " temperature = 368, #K\n", " min_storagelevel = 5,\n", " # max_storagelevel = 50\n", " \n", ")\n", "waterstorage.set_freq('15T')\n", "waterstorage.set_storagelevel(15)\n", "waterstorage.storagelevel" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "process demand 25\n" ] } ], "source": [ "Tsink = 140 #Celcius\n", "Tsource = 60\n", "Tref = 0\n", "hp_capacity = 31 #MW\n", "process_demand_MW = 25 #MW\n", "Cp = 4190 #J/kgK\n", "MWtoJs = 1000_000\n", "efficiency = 0.9\n", "Tstorage = 95\n", "\n", "print('process demand', process_demand_MW)\n", "# hp_capacity vs hp_load?" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "50.0" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "waterstorage.max_storage_capacity" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "process_demand_MW 25\n", "hp_capacity 31\n" ] } ], "source": [ "print('process_demand_MW', process_demand_MW)\n", "print('hp_capacity', hp_capacity)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "def hp_mass_flow (hp_capacity, Tsink, Tref, Cp):\n", " return hp_capacity * MWtoJs /(Cp*(Tsink - Tref)) #kg/s\n", "\n", "def process_mass_flow (process_demand_MW, Tsink, Tref, Cp):\n", " return process_demand_MW * MWtoJs /(Cp*(Tsink - Tref)) \n", "\n", "def cop_curve(Tsink, Tsource):\n", " c0 = Tsink / (Tsink - Tsource) \n", " return Polynomial([c0])\n", "\n", "# charge_mass_flow = hp_mass_flow (hp_capacity, Tsink, Tref, Cp) - process_mass_flow (process_demand_MW, Tsink, Tref, Cp) #kg/s\n", "\n", "# def energy_to_storage (charge_mass_flow, Cp, Tsink, Tref):\n", "# return (charge_mass_flow * Cp * (Tsink - Tref)) / MWtoJs\n", "\n", "def energy_to_storage(hp_capacity, process_demand_MW):\n", " return hp_capacity - process_demand_MW #MW\n", "\n", "\n", "# discharged_heat = energy_to_storage(hp_capacity, process_demand_MW) #MW\n", "\n", "# def charged_heat (charge_mass_flow, Cp, Tsink, Tref):\n", "# return (charge_mass_flow * Cp * (Tsink - Tref)) / MW_to_J_per_s\n", "\n", "# discharged_heat = charged_heat(charge_mass_flow, Cp, Tsink, Tref) #MW\n", "\n", "def discharge_mass_flow (discharged_heat, Cp, Tstorage, Tref):\n", " return discharged_heat*MWtoJs/(Cp*(Tstorage - Tref))\n", "\n", "def Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow):\n", " return ((Tstorage * discharge_mass_flow + Tsource * process_mass_flow)\n", " / (discharge_mass_flow + process_mass_flow))\n", "\n", "\n", "# charged_heat can be also defined as hp_capacity-process_demand_MW" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "6" ] }, "execution_count": 10, "metadata": {}, "output_type": "execute_result" } ], "source": [ "energy_to_storage(hp_capacity, process_demand_MW)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'name': 'Heatpump',\n", " 'max_th_power': 40,\n", " 'min_th_power': 5,\n", " 'cop_curve': }" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# heatpump = Heatpump(\"heatpump1\", 50, cop_curve, 10)\n", "# heatpump.set_heat_output(50, Tsource=333, Tsink=413)\n", "cop_curve(140, 60)\n", "\n", "heatpump = Heatpump(\n", " name='Heatpump',\n", " max_th_power=40,\n", " min_th_power=5,\n", " cop_curve=cop_curve\n", ")\n", "\n", "heatpump.__dict__\n", "\n" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.1625" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heatpump.get_cop(50, Tsource=333, Tsink=413)\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(-3.8740920096852305, 20)" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heatpump.set_heat_output(20, Tsource=333, Tsink=41+372)\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Tsource (VDG)Tsink (VDG)MW (VDG)Tsource (NDG)Tsink (NDG)MW (NDG)DAMPOSNEGForeNegForePos
2018-11-01 00:00:00+01:0064.964783142.0031090.00000019.897433147.7318140.00000044.9046.3946.3953.60333344.623333
2018-11-01 00:15:00+01:0054.578777138.9604930.00000017.950905148.1389640.00000044.9043.0843.0868.96200063.177333
2018-11-01 00:30:00+01:0065.166672139.8853290.00000033.500757147.5854260.00000044.9043.1343.1355.41533357.922667
2018-11-01 00:45:00+01:0065.358078139.7319010.00000042.203876147.5476120.00000044.9046.2946.2957.63333354.712667
2018-11-01 01:00:00+01:0064.947536139.5778710.00000018.702675148.2603350.00000042.4632.0332.0337.35400035.400000
2018-11-01 01:15:00+01:0065.073433139.4233570.00000019.903652149.1868650.00000042.4632.0332.0335.93400031.469333
2018-11-01 01:30:00+01:0047.711559140.3287300.00000019.574467147.8000160.00000042.4634.4834.4837.64000035.276000
2018-11-01 01:45:00+01:0029.525829140.2989020.00000017.065464147.9068860.00000042.4632.0732.0731.02666728.963333
2018-11-01 02:00:00+01:0065.715569139.99165010.13958749.339708149.6037413.33330144.0040.6640.6640.54733338.702000
2018-11-01 02:15:00+01:0065.929909148.34232519.58510461.721718155.8879056.45535944.0046.0446.0444.69600042.961333
\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) \\\n", "2018-11-01 00:00:00+01:00 64.964783 142.003109 0.000000 \n", "2018-11-01 00:15:00+01:00 54.578777 138.960493 0.000000 \n", "2018-11-01 00:30:00+01:00 65.166672 139.885329 0.000000 \n", "2018-11-01 00:45:00+01:00 65.358078 139.731901 0.000000 \n", "2018-11-01 01:00:00+01:00 64.947536 139.577871 0.000000 \n", "2018-11-01 01:15:00+01:00 65.073433 139.423357 0.000000 \n", "2018-11-01 01:30:00+01:00 47.711559 140.328730 0.000000 \n", "2018-11-01 01:45:00+01:00 29.525829 140.298902 0.000000 \n", "2018-11-01 02:00:00+01:00 65.715569 139.991650 10.139587 \n", "2018-11-01 02:15:00+01:00 65.929909 148.342325 19.585104 \n", "\n", " Tsource (NDG) Tsink (NDG) MW (NDG) DAM POS \\\n", "2018-11-01 00:00:00+01:00 19.897433 147.731814 0.000000 44.90 46.39 \n", "2018-11-01 00:15:00+01:00 17.950905 148.138964 0.000000 44.90 43.08 \n", "2018-11-01 00:30:00+01:00 33.500757 147.585426 0.000000 44.90 43.13 \n", "2018-11-01 00:45:00+01:00 42.203876 147.547612 0.000000 44.90 46.29 \n", "2018-11-01 01:00:00+01:00 18.702675 148.260335 0.000000 42.46 32.03 \n", "2018-11-01 01:15:00+01:00 19.903652 149.186865 0.000000 42.46 32.03 \n", "2018-11-01 01:30:00+01:00 19.574467 147.800016 0.000000 42.46 34.48 \n", "2018-11-01 01:45:00+01:00 17.065464 147.906886 0.000000 42.46 32.07 \n", "2018-11-01 02:00:00+01:00 49.339708 149.603741 3.333301 44.00 40.66 \n", "2018-11-01 02:15:00+01:00 61.721718 155.887905 6.455359 44.00 46.04 \n", "\n", " NEG ForeNeg ForePos \n", "2018-11-01 00:00:00+01:00 46.39 53.603333 44.623333 \n", "2018-11-01 00:15:00+01:00 43.08 68.962000 63.177333 \n", "2018-11-01 00:30:00+01:00 43.13 55.415333 57.922667 \n", "2018-11-01 00:45:00+01:00 46.29 57.633333 54.712667 \n", "2018-11-01 01:00:00+01:00 32.03 37.354000 35.400000 \n", "2018-11-01 01:15:00+01:00 32.03 35.934000 31.469333 \n", "2018-11-01 01:30:00+01:00 34.48 37.640000 35.276000 \n", "2018-11-01 01:45:00+01:00 32.07 31.026667 28.963333 \n", "2018-11-01 02:00:00+01:00 40.66 40.547333 38.702000 \n", "2018-11-01 02:15:00+01:00 46.04 44.696000 42.961333 " ] }, "execution_count": 14, "metadata": {}, "output_type": "execute_result" } ], "source": [ "for col in price_data.columns:\n", " df[col] = price_data[col]\n", "df.head(10)\n", "# iki dataframeni birlesdirdik burda" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "for i in df.index:\n", " df.loc[i, 'hp_mass'] = hp_mass_flow(hp_capacity, df.loc[i, 'Tsink (VDG)'], Tref, Cp)\n", " df.loc[i, 'process_mass'] = process_mass_flow(df.loc[i, 'MW (VDG)'], df.loc[i, 'Tsink (VDG)'],Tref, Cp)\n", " df.loc[i, 'COP'] = cop_curve(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", " df.loc[i, 'charge_mass'] = df.loc[i, 'hp_mass'] - df.loc[i, 'process_mass']\n", " \n" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "c:\\Users\\Shahla Huseynova\\python\\Encore\\Simulations\\notepad.py:319: UserWarning:\n", "\n", "Chosen heat output is out of range [5 - 40]. Heat output is being limited to the closest boundary.\n", "\n", "C:\\Users\\SHAHLA~1\\AppData\\Local\\Temp/ipykernel_43244/3971255130.py:31: RuntimeWarning:\n", "\n", "invalid value encountered in double_scalars\n", "\n", "c:\\Users\\Shahla Huseynova\\python\\Encore\\Simulations\\notepad.py:319: UserWarning:\n", "\n", "Chosen heat output is out of range [5 - 40]. Heat output is being limited to the closest boundary.\n", "\n" ] } ], "source": [ "# df.index = df.index.tz_localize('Europe/Amsterdam')\n", "for i in df.index:\n", "# logic that applies IF NO STORAGE, BASELINE CASE\n", "\n", " \n", " hp_load = df.loc[i, 'MW (VDG)']\n", " old_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", " # hp_consumption_old = hp_load/ old_COP\n", " df.loc[i,'hp_consumption_old'] = hp_load/ old_COP\n", " \n", " if df.loc[i, 'ForeNeg'] < 50:\n", " hp_load = heatpump.max_th_power\n", " energy_2_storage = hp_load - df.loc[i, 'MW (VDG)']\n", " waterstorage.charge(energy_2_storage)\n", " df.loc[i, 'charged_heat'] = waterstorage.charge(energy_2_storage)\n", " charge_mass = hp_mass_flow (hp_capacity, df.loc[i, 'Tsink (VDG)']+273, Tref+273, Cp) - process_mass_flow (df.loc[i, 'MW (VDG)'], df.loc[i, 'Tsink (VDG)']+273, Tref+273, Cp)\n", " df.loc[i, 'new_cl'] = waterstorage.storagelevel\n", " new_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", " df.loc[i,'hp_consumption_new'] = hp_load/ new_COP\n", " elif price_data.loc[i,'ForePos'] > 50:\n", " # hp_load = heatpump.set_heat_output(df.loc[i, 'MW (VDG)'], df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)[1]\n", " energy_from_storage = energy_to_storage(hp_capacity ,df.loc[i, 'MW (VDG)'])\n", " waterstorage.discharge(energy_from_storage)\n", " df.loc[i, 'discharged_heat'] = waterstorage.discharge(energy_from_storage)\n", " df.loc[i, 'new_cl'] = waterstorage.storagelevel\n", " discharge_mass = discharge_mass_flow(df.loc[i, 'discharged_heat'], Cp, Tstorage, Tref)\n", " df.loc[i, 'discharge_mass'] = discharge_mass\n", " process_mass = process_mass_flow (df.loc[i, 'MW (VDG)'], df.loc[i, 'Tsink (VDG)']+273, Tref+273, Cp)\n", " df.loc[i, 'Tsource_new'] = Tsource_calculation(Tstorage, df.loc[i, 'discharge_mass'], df.loc[i, 'Tsource (VDG)'], process_mass)\n", " heat_output = heatpump.set_heat_output(df.loc[i, 'MW (VDG)'], df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource_new']+273)\n", " df.loc[i,'hp_consumption_new'] = heat_output[0]\n", " df.loc[i, 'new_COP'] = heatpump.get_cop(heat_output[1], df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource_new']+273)\n", " # df.loc[i,'hp_consumption_new'] = hp_load/ new_COP\n", " # new_COP = cop_curve (df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource_new']+273)\n", " else:\n", " hp_load = df.loc[i, 'MW (VDG)']\n", " df.loc[i, 'old_COP'] = old_COP\n", " df.loc[i,'hp_consumption_old'] = hp_load/ old_COP\n", " df.loc[i, 'new_cl'] = 0" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "# for i in df.index:\n", "# if df.loc[i, 'ForePos'] < 50:\n", "# hp_load = heatpump.max_th_power\n", "# old_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", "# df.loc[i,'hp_consumption_old'] = hp_load/ (old_COP * df.loc[i, 'POS'])\n", "# # df.loc[i,'hp_consumption_new'] = hp_load/df.loc[i,'new_COP'] * df.loc[i, 'POS']\n", "\n", "# elif price_data.loc[i,'ForePos'] > 50:\n", "# hp_load = heatpump.set_heat_output(df.loc[i, 'MW (VDG)'], df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)[1]\n", "# new_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource_new']+273)\n", "# df.loc[i, 'hp_consumption'] = hp_load/ (new_COP * df.loc[i, 'POS'] )\n", "\n", "# df[:20]" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2018-11-01 00:00:00+01:00 0.000000\n", "2018-11-01 00:15:00+01:00 0.000000\n", "2018-11-01 00:30:00+01:00 0.000000\n", "2018-11-01 00:45:00+01:00 0.000000\n", "2018-11-01 01:00:00+01:00 0.000000\n", "2018-11-01 01:15:00+01:00 0.000000\n", "2018-11-01 01:30:00+01:00 0.000000\n", "2018-11-01 01:45:00+01:00 0.000000\n", "2018-11-01 02:00:00+01:00 1.823593\n", "2018-11-01 02:15:00+01:00 3.830747\n", "2018-11-01 02:30:00+01:00 4.001079\n", "2018-11-01 02:45:00+01:00 4.064893\n", "2018-11-01 03:00:00+01:00 4.068391\n", "2018-11-01 03:15:00+01:00 4.052671\n", "2018-11-01 03:30:00+01:00 4.061479\n", "2018-11-01 03:45:00+01:00 4.067838\n", "2018-11-01 04:00:00+01:00 4.188972\n", "2018-11-01 04:15:00+01:00 4.382026\n", "2018-11-01 04:30:00+01:00 4.524195\n", "2018-11-01 04:45:00+01:00 4.507751\n", "2018-11-01 05:00:00+01:00 4.498205\n", "2018-11-01 05:15:00+01:00 4.504487\n", "2018-11-01 05:30:00+01:00 4.516361\n", "2018-11-01 05:45:00+01:00 4.535025\n", "2018-11-01 06:00:00+01:00 4.496483\n", "2018-11-01 06:15:00+01:00 4.502226\n", "2018-11-01 06:30:00+01:00 4.492637\n", "2018-11-01 06:45:00+01:00 4.480298\n", "2018-11-01 07:00:00+01:00 4.488528\n", "2018-11-01 07:15:00+01:00 4.505183\n", "2018-11-01 07:30:00+01:00 4.515428\n", "2018-11-01 07:45:00+01:00 4.519495\n", "2018-11-01 08:00:00+01:00 4.489461\n", "2018-11-01 08:15:00+01:00 4.474584\n", "2018-11-01 08:30:00+01:00 4.464653\n", "2018-11-01 08:45:00+01:00 4.484737\n", "2018-11-01 09:00:00+01:00 4.458603\n", "2018-11-01 09:15:00+01:00 4.482972\n", "2018-11-01 09:30:00+01:00 4.475751\n", "2018-11-01 09:45:00+01:00 4.457915\n", "2018-11-01 10:00:00+01:00 4.425400\n", "2018-11-01 10:15:00+01:00 4.437186\n", "2018-11-01 10:30:00+01:00 4.455529\n", "2018-11-01 10:45:00+01:00 4.464867\n", "2018-11-01 11:00:00+01:00 4.465723\n", "2018-11-01 11:15:00+01:00 4.472849\n", "2018-11-01 11:30:00+01:00 4.472572\n", "2018-11-01 11:45:00+01:00 4.488280\n", "2018-11-01 12:00:00+01:00 4.477443\n", "Freq: 15T, Name: hp_consumption_old, dtype: float64" ] }, "execution_count": 18, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['hp_consumption_old']" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "VISUALISATION" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "line": { "color": "rgba(70, 165, 121, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "new_cl", "text": "", "type": "scatter", "x": [ "2018-11-01 00:00:00+01:00", "2018-11-01 00:15:00+01:00", "2018-11-01 00:30:00+01:00", "2018-11-01 00:45:00+01:00", "2018-11-01 01:00:00+01:00", "2018-11-01 01:15:00+01:00", "2018-11-01 01:30:00+01:00", "2018-11-01 01:45:00+01:00", "2018-11-01 02:00:00+01:00", "2018-11-01 02:15:00+01:00", "2018-11-01 02:30:00+01:00", "2018-11-01 02:45:00+01:00", "2018-11-01 03:00:00+01:00", "2018-11-01 03:15:00+01:00", "2018-11-01 03:30:00+01:00", "2018-11-01 03:45:00+01:00", "2018-11-01 04:00:00+01:00", "2018-11-01 04:15:00+01:00", "2018-11-01 04:30:00+01:00", "2018-11-01 04:45:00+01:00", "2018-11-01 05:00:00+01:00", "2018-11-01 05:15:00+01:00", "2018-11-01 05:30:00+01:00", "2018-11-01 05:45:00+01:00", "2018-11-01 06:00:00+01:00", "2018-11-01 06:15:00+01:00", "2018-11-01 06:30:00+01:00", "2018-11-01 06:45:00+01:00", "2018-11-01 07:00:00+01:00", "2018-11-01 07:15:00+01:00", "2018-11-01 07:30:00+01:00", "2018-11-01 07:45:00+01:00", "2018-11-01 08:00:00+01:00", "2018-11-01 08:15:00+01:00", "2018-11-01 08:30:00+01:00", "2018-11-01 08:45:00+01:00", "2018-11-01 09:00:00+01:00", "2018-11-01 09:15:00+01:00", "2018-11-01 09:30:00+01:00", "2018-11-01 09:45:00+01:00", "2018-11-01 10:00:00+01:00", "2018-11-01 10:15:00+01:00", "2018-11-01 10:30:00+01:00", "2018-11-01 10:45:00+01:00", "2018-11-01 11:00:00+01:00", "2018-11-01 11:15:00+01:00", "2018-11-01 11:30:00+01:00", "2018-11-01 11:45:00+01:00", "2018-11-01 12:00:00+01:00" ], "y": [ 0, 5, 5, 5, 25, 45, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 41.91871504388979, 36.355937547937785, 0, 46.43782701428795, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 42.26433897497958, 0, 47.5, 42.36477805656372, 37.24558245848199, 46.92710194172405, 47.5, 0, 42.39346763228207, 37.229172173791014, 32.122045675436695, 26.997944090483415, 21.832260990663706, 16.590968988937824, 11.372192788723684, 6.1966444242856396, 5, 5, 5, 5, 5, 5 ] } ], "layout": { "height": 400, "legend": { "bgcolor": "#F5F6F9", "font": { "color": "#4D5663" } }, "paper_bgcolor": "#F5F6F9", "plot_bgcolor": "#F5F6F9", "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, "#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, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#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, "#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, "#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, "#f0f921" ] ], "sequentialminus": [ [ 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, "#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": { "font": { "color": "#4D5663" }, "text": "New_CL" }, "width": 800, "xaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "" }, "zerolinecolor": "#E1E5ED" }, "yaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "MW" }, "zerolinecolor": "#E1E5ED" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "from pyrecoy.colors import *\n", "\n", "\n", "fig_demands_over_time = df['new_cl'].iplot(\n", " title='New_CL', \n", " yTitle='MW', \n", " colors=recoygreen,\n", " asFigure=True,\n", " dimensions=(800, 400)\n", ")\n", "fig_demands_over_time" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "line": { "color": "rgba(255, 153, 51, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "MW (VDG)", "text": "", "type": "scatter", "x": [ "2018-11-01 00:00:00+01:00", "2018-11-01 00:15:00+01:00", "2018-11-01 00:30:00+01:00", "2018-11-01 00:45:00+01:00", "2018-11-01 01:00:00+01:00", "2018-11-01 01:15:00+01:00", "2018-11-01 01:30:00+01:00", "2018-11-01 01:45:00+01:00", "2018-11-01 02:00:00+01:00", "2018-11-01 02:15:00+01:00", "2018-11-01 02:30:00+01:00", "2018-11-01 02:45:00+01:00", "2018-11-01 03:00:00+01:00", "2018-11-01 03:15:00+01:00", "2018-11-01 03:30:00+01:00", "2018-11-01 03:45:00+01:00", "2018-11-01 04:00:00+01:00", "2018-11-01 04:15:00+01:00", "2018-11-01 04:30:00+01:00", "2018-11-01 04:45:00+01:00", "2018-11-01 05:00:00+01:00", "2018-11-01 05:15:00+01:00", "2018-11-01 05:30:00+01:00", "2018-11-01 05:45:00+01:00", "2018-11-01 06:00:00+01:00", "2018-11-01 06:15:00+01:00", "2018-11-01 06:30:00+01:00", "2018-11-01 06:45:00+01:00", "2018-11-01 07:00:00+01:00", "2018-11-01 07:15:00+01:00", "2018-11-01 07:30:00+01:00", "2018-11-01 07:45:00+01:00", "2018-11-01 08:00:00+01:00", "2018-11-01 08:15:00+01:00", "2018-11-01 08:30:00+01:00", "2018-11-01 08:45:00+01:00", "2018-11-01 09:00:00+01:00", "2018-11-01 09:15:00+01:00", "2018-11-01 09:30:00+01:00", "2018-11-01 09:45:00+01:00", "2018-11-01 10:00:00+01:00", "2018-11-01 10:15:00+01:00", "2018-11-01 10:30:00+01:00", "2018-11-01 10:45:00+01:00", "2018-11-01 11:00:00+01:00", "2018-11-01 11:15:00+01:00", "2018-11-01 11:30:00+01:00", "2018-11-01 11:45:00+01:00", "2018-11-01 12:00:00+01:00" ], "y": [ 0, 0, 0, 0, 0, 0, 0, 0, 10.139587403489637, 19.585104349479185, 19.97666603859159, 20.1345729198724, 20.0431219826813, 19.837430087779584, 19.874445008095993, 19.89946592943003, 19.836221067299668, 20.035889267766276, 20.661837522554038, 20.62268201410866, 20.55412130396838, 20.61215261628466, 20.664273166786217, 20.737743879254875, 20.591386019456255, 20.60277426046446, 20.57203629529396, 20.52867794995916, 20.579579872646292, 20.66921710928223, 20.72955611312745, 20.761608803836527, 20.636961033515874, 20.728004352891425, 20.68792150487991, 20.786935264564125, 20.671409083017885, 20.78574700329137, 20.75179683009344, 20.668633800360578, 20.517415996548245, 20.56244759957172, 20.64890327112391, 20.691963840139472, 20.69558736789476, 20.72826934058408, 20.726932785791455, 20.801353864934487, 20.752579437878723 ] } ], "layout": { "legend": { "bgcolor": "#F5F6F9", "font": { "color": "#4D5663" } }, "paper_bgcolor": "#F5F6F9", "plot_bgcolor": "#F5F6F9", "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, "#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, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#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, "#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, "#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, "#f0f921" ] ], "sequentialminus": [ [ 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, "#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": { "font": { "color": "#4D5663" } }, "xaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "" }, "zerolinecolor": "#E1E5ED" }, "yaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "" }, "zerolinecolor": "#E1E5ED" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df['MW (VDG)'].iplot()" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "linkText": "Export to plot.ly", "plotlyServerURL": "https://plot.ly", "showLink": true }, "data": [ { "line": { "color": "rgba(255, 153, 51, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Tsource (VDG)", "text": "", "type": "scatter", "x": [ "2018-11-01 00:00:00+01:00", "2018-11-01 00:15:00+01:00", "2018-11-01 00:30:00+01:00", "2018-11-01 00:45:00+01:00", "2018-11-01 01:00:00+01:00", "2018-11-01 01:15:00+01:00", "2018-11-01 01:30:00+01:00", "2018-11-01 01:45:00+01:00", "2018-11-01 02:00:00+01:00", "2018-11-01 02:15:00+01:00", "2018-11-01 02:30:00+01:00", "2018-11-01 02:45:00+01:00", "2018-11-01 03:00:00+01:00", "2018-11-01 03:15:00+01:00", "2018-11-01 03:30:00+01:00", "2018-11-01 03:45:00+01:00", "2018-11-01 04:00:00+01:00", "2018-11-01 04:15:00+01:00", "2018-11-01 04:30:00+01:00", "2018-11-01 04:45:00+01:00", "2018-11-01 05:00:00+01:00", "2018-11-01 05:15:00+01:00", "2018-11-01 05:30:00+01:00", "2018-11-01 05:45:00+01:00", "2018-11-01 06:00:00+01:00", "2018-11-01 06:15:00+01:00", "2018-11-01 06:30:00+01:00", "2018-11-01 06:45:00+01:00", "2018-11-01 07:00:00+01:00", "2018-11-01 07:15:00+01:00", "2018-11-01 07:30:00+01:00", "2018-11-01 07:45:00+01:00", "2018-11-01 08:00:00+01:00", "2018-11-01 08:15:00+01:00", "2018-11-01 08:30:00+01:00", "2018-11-01 08:45:00+01:00", "2018-11-01 09:00:00+01:00", "2018-11-01 09:15:00+01:00", "2018-11-01 09:30:00+01:00", "2018-11-01 09:45:00+01:00", "2018-11-01 10:00:00+01:00", "2018-11-01 10:15:00+01:00", "2018-11-01 10:30:00+01:00", "2018-11-01 10:45:00+01:00", "2018-11-01 11:00:00+01:00", "2018-11-01 11:15:00+01:00", "2018-11-01 11:30:00+01:00", "2018-11-01 11:45:00+01:00", "2018-11-01 12:00:00+01:00" ], "y": [ 64.96478271484375, 54.57877731323242, 65.16667175292969, 65.35807800292969, 64.94753646850586, 65.07343292236328, 47.7115592956543, 29.525829315185547, 65.71556854248047, 65.9299087524414, 64.95814895629883, 64.9863052368164, 64.99794006347656, 65.00770568847656, 65.01747512817383, 65.0272445678711, 65.0784912109375, 65.1628189086914, 65.00943756103516, 65.13150787353516, 64.97384643554688, 65.06539154052734, 65.01202774047852, 64.91437530517578, 65.00830459594727, 64.89657592773438, 64.91350936889648, 64.9304428100586, 64.94738006591797, 64.96430969238281, 64.98124694824219, 64.99818420410156, 65.0151138305664, 65.03205108642578, 65.04898071289062, 65.06591796875, 65.0814323425293, 65.0777816772461, 65.06596755981445, 65.05415344238281, 65.04234313964844, 64.98916625976562, 64.98598098754883, 64.97528076171875, 64.96401596069336, 64.95275115966797, 64.94278717041016, 64.94033813476562, 64.94033813476562 ] }, { "line": { "color": "rgba(55, 128, 191, 1.0)", "dash": "solid", "shape": "linear", "width": 1.3 }, "mode": "lines", "name": "Tsink (VDG)", "text": "", "type": "scatter", "x": [ "2018-11-01 00:00:00+01:00", "2018-11-01 00:15:00+01:00", "2018-11-01 00:30:00+01:00", "2018-11-01 00:45:00+01:00", "2018-11-01 01:00:00+01:00", "2018-11-01 01:15:00+01:00", "2018-11-01 01:30:00+01:00", "2018-11-01 01:45:00+01:00", "2018-11-01 02:00:00+01:00", "2018-11-01 02:15:00+01:00", "2018-11-01 02:30:00+01:00", "2018-11-01 02:45:00+01:00", "2018-11-01 03:00:00+01:00", "2018-11-01 03:15:00+01:00", "2018-11-01 03:30:00+01:00", "2018-11-01 03:45:00+01:00", "2018-11-01 04:00:00+01:00", "2018-11-01 04:15:00+01:00", "2018-11-01 04:30:00+01:00", "2018-11-01 04:45:00+01:00", "2018-11-01 05:00:00+01:00", "2018-11-01 05:15:00+01:00", "2018-11-01 05:30:00+01:00", "2018-11-01 05:45:00+01:00", "2018-11-01 06:00:00+01:00", "2018-11-01 06:15:00+01:00", "2018-11-01 06:30:00+01:00", "2018-11-01 06:45:00+01:00", "2018-11-01 07:00:00+01:00", "2018-11-01 07:15:00+01:00", "2018-11-01 07:30:00+01:00", "2018-11-01 07:45:00+01:00", "2018-11-01 08:00:00+01:00", "2018-11-01 08:15:00+01:00", "2018-11-01 08:30:00+01:00", "2018-11-01 08:45:00+01:00", "2018-11-01 09:00:00+01:00", "2018-11-01 09:15:00+01:00", "2018-11-01 09:30:00+01:00", "2018-11-01 09:45:00+01:00", "2018-11-01 10:00:00+01:00", "2018-11-01 10:15:00+01:00", "2018-11-01 10:30:00+01:00", "2018-11-01 10:45:00+01:00", "2018-11-01 11:00:00+01:00", "2018-11-01 11:15:00+01:00", "2018-11-01 11:30:00+01:00", "2018-11-01 11:45:00+01:00", "2018-11-01 12:00:00+01:00" ], "y": [ 142.00310855616846, 138.96049329913467, 139.8853286080591, 139.7319010492448, 139.57787113583828, 139.42335736219127, 140.32873036288532, 140.29890206259057, 139.99164987434241, 148.34232515339528, 149.5996206735899, 150.48135122376448, 151.0781253786815, 151.789771813141, 151.8355222042393, 151.88123310022075, 155.586501463521, 159.82560913794526, 159.77052577684205, 159.71538765479585, 159.66017937851927, 159.60491605591585, 159.54958528011946, 159.49419917950132, 159.4387406758979, 159.38322962591639, 159.32764734557236, 159.27200916280646, 159.2163024628501, 159.16053957516505, 159.10470472523954, 159.04881339060995, 158.9928528150294, 158.09262646775937, 158.08025849195363, 158.06788773036573, 158.05551032950444, 158.04313329387378, 158.03075276996597, 158.01836945382087, 158.0059826453554, 157.9935930414146, 157.98119994110252, 157.96880088142046, 157.95640148115876, 157.9439992789276, 157.93159357220048, 157.91918506025172, 157.91091084789872 ] } ], "layout": { "legend": { "bgcolor": "#F5F6F9", "font": { "color": "#4D5663" } }, "paper_bgcolor": "#F5F6F9", "plot_bgcolor": "#F5F6F9", "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, "#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, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#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, "#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, "#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, "#f0f921" ] ], "sequentialminus": [ [ 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, "#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": { "font": { "color": "#4D5663" } }, "xaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "" }, "zerolinecolor": "#E1E5ED" }, "yaxis": { "gridcolor": "#E1E5ED", "showgrid": true, "tickfont": { "color": "#4D5663" }, "title": { "font": { "color": "#4D5663" }, "text": "" }, "zerolinecolor": "#E1E5ED" } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "df[['Tsource (VDG)', 'Tsink (VDG)']].iplot()" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [], "source": [ "import plotly.graph_objects as go " ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "%{y}%{_xother}", "type": "bar", "x": [ "2018-11-01T00:00:00+01:00", "2018-11-01T00:15:00+01:00", "2018-11-01T00:30:00+01:00", "2018-11-01T00:45:00+01:00", "2018-11-01T01:00:00+01:00", "2018-11-01T01:15:00+01:00", "2018-11-01T01:30:00+01:00", "2018-11-01T01:45:00+01:00", "2018-11-01T02:00:00+01:00", "2018-11-01T02:15:00+01:00", "2018-11-01T02:30:00+01:00", "2018-11-01T02:45:00+01:00", "2018-11-01T03:00:00+01:00", "2018-11-01T03:15:00+01:00", "2018-11-01T03:30:00+01:00", "2018-11-01T03:45:00+01:00", "2018-11-01T04:00:00+01:00", "2018-11-01T04:15:00+01:00", "2018-11-01T04:30:00+01:00", "2018-11-01T04:45:00+01:00", "2018-11-01T05:00:00+01:00", "2018-11-01T05:15:00+01:00", "2018-11-01T05:30:00+01:00", "2018-11-01T05:45:00+01:00", "2018-11-01T06:00:00+01:00", "2018-11-01T06:15:00+01:00", "2018-11-01T06:30:00+01:00", "2018-11-01T06:45:00+01:00", "2018-11-01T07:00:00+01:00", "2018-11-01T07:15:00+01:00", "2018-11-01T07:30:00+01:00", "2018-11-01T07:45:00+01:00", "2018-11-01T08:00:00+01:00", "2018-11-01T08:15:00+01:00", "2018-11-01T08:30:00+01:00", "2018-11-01T08:45:00+01:00", "2018-11-01T09:00:00+01:00", "2018-11-01T09:15:00+01:00", "2018-11-01T09:30:00+01:00", "2018-11-01T09:45:00+01:00", "2018-11-01T10:00:00+01:00", "2018-11-01T10:15:00+01:00", "2018-11-01T10:30:00+01:00", "2018-11-01T10:45:00+01:00", "2018-11-01T11:00:00+01:00", "2018-11-01T11:15:00+01:00", "2018-11-01T11:30:00+01:00", "2018-11-01T11:45:00+01:00", "2018-11-01T12:00:00+01:00" ], "xhoverformat": "Q%q", "xperiodalignment": "middle", "y": [ null, 95, null, null, null, null, null, null, null, null, null, null, null, 79.20692355866174, 79.17556508649317, null, null, null, null, null, null, null, null, null, null, null, null, 78.79154917402023, null, null, 78.59426328638686, 78.56618631846071, null, null, null, 78.53004291515798, 78.66264888781235, 78.53669546930705, 78.566315616395, 78.64899938705008, 78.8045594461501, 78.72681302431741, 78.63132871446511, 64.97528076171875, 64.96401596069336, 64.95275115966797, 64.94278717041016, 64.94033813476562, 64.94033813476562 ] }, { "hovertemplate": "%{y}%{_xother}", "type": "scatter", "x": [ "2018-11-01T00:00:00+01:00", "2018-11-01T00:15:00+01:00", "2018-11-01T00:30:00+01:00", "2018-11-01T00:45:00+01:00", "2018-11-01T01:00:00+01:00", "2018-11-01T01:15:00+01:00", "2018-11-01T01:30:00+01:00", "2018-11-01T01:45:00+01:00", "2018-11-01T02:00:00+01:00", "2018-11-01T02:15:00+01:00", "2018-11-01T02:30:00+01:00", "2018-11-01T02:45:00+01:00", "2018-11-01T03:00:00+01:00", "2018-11-01T03:15:00+01:00", "2018-11-01T03:30:00+01:00", "2018-11-01T03:45:00+01:00", "2018-11-01T04:00:00+01:00", "2018-11-01T04:15:00+01:00", "2018-11-01T04:30:00+01:00", "2018-11-01T04:45:00+01:00", "2018-11-01T05:00:00+01:00", "2018-11-01T05:15:00+01:00", "2018-11-01T05:30:00+01:00", "2018-11-01T05:45:00+01:00", "2018-11-01T06:00:00+01:00", "2018-11-01T06:15:00+01:00", "2018-11-01T06:30:00+01:00", "2018-11-01T06:45:00+01:00", "2018-11-01T07:00:00+01:00", "2018-11-01T07:15:00+01:00", "2018-11-01T07:30:00+01:00", "2018-11-01T07:45:00+01:00", "2018-11-01T08:00:00+01:00", "2018-11-01T08:15:00+01:00", "2018-11-01T08:30:00+01:00", "2018-11-01T08:45:00+01:00", "2018-11-01T09:00:00+01:00", "2018-11-01T09:15:00+01:00", "2018-11-01T09:30:00+01:00", "2018-11-01T09:45:00+01:00", "2018-11-01T10:00:00+01:00", "2018-11-01T10:15:00+01:00", "2018-11-01T10:30:00+01:00", "2018-11-01T10:45:00+01:00", "2018-11-01T11:00:00+01:00", "2018-11-01T11:15:00+01:00", "2018-11-01T11:30:00+01:00", "2018-11-01T11:45:00+01:00", "2018-11-01T12:00:00+01:00" ], "xperiodalignment": "middle", "y": [ 0, 5, 5, 5, 25, 45, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 41.91871504388979, 36.355937547937785, 0, 46.43782701428795, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 47.5, 42.26433897497958, 0, 47.5, 42.36477805656372, 37.24558245848199, 46.92710194172405, 47.5, 0, 42.39346763228207, 37.229172173791014, 32.122045675436695, 26.997944090483415, 21.832260990663706, 16.590968988937824, 11.372192788723684, 6.1966444242856396, 5, 5, 5, 5, 5, 5 ] } ], "layout": { "hovermode": "x unified", "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, "#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, "#f0f921" ] ], "type": "contour" } ], "contourcarpet": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "contourcarpet" } ], "heatmap": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmap" } ], "heatmapgl": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "heatmapgl" } ], "histogram": [ { "marker": { "pattern": { "fillmode": "overlay", "size": 10, "solidity": 0.2 } }, "type": "histogram" } ], "histogram2d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2d" } ], "histogram2dcontour": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "colorscale": [ [ 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, "#f0f921" ] ], "type": "histogram2dcontour" } ], "mesh3d": [ { "colorbar": { "outlinewidth": 0, "ticks": "" }, "type": "mesh3d" } ], "parcoords": [ { "line": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "type": "parcoords" } ], "pie": [ { "automargin": true, "type": "pie" } ], "scatter": [ { "marker": { "colorbar": { "outlinewidth": 0, "ticks": "" } }, "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, "#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, "#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, "#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, "#f0f921" ] ], "sequentialminus": [ [ 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, "#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 } } } } }, "text/html": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.graph_objects as go\n", "\n", "fig = go.Figure()\n", "\n", "fig.add_trace(go.Bar(\n", " x=df.index,\n", " y=df['Tsource_new'],\n", "\n", " xperiodalignment=\"middle\",\n", " xhoverformat=\"Q%q\",\n", " hovertemplate=\"%{y}%{_xother}\"\n", "))\n", "\n", "fig.add_trace(go.Scatter(\n", " x=df.index,\n", " y=df['new_cl'],\n", " xperiodalignment=\"middle\",\n", " hovertemplate=\"%{y}%{_xother}\"\n", "))\n", "\n", "fig.update_layout(hovermode=\"x unified\")\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "time_factor = 1/4\n", "\n", "for col in price_data.columns:\n", " df[col] = price_data[col]\n", "for cons in ['old', 'new']:\n", " df['nomination_MWh'] = df['MW (VDG)'] * time_factor\n", " df[f'imbalance_MWh_{cons}'] = df['nomination_MWh'] - (df[f'hp_consumption_{cons}']*time_factor)\n", " df['day-ahead costs'] = df['nomination_MWh'] * df['DAM'] \n", "\n", " is_pos = df[f'imbalance_MWh_{cons}'] > 0\n", " df.loc[is_pos, f'imbalance costs_{cons}'] = df.loc[is_pos, f'imbalance_MWh_{cons}'] * df['POS'] \n", "\n", " is_neg = df[f'imbalance_MWh_{cons}'] < 0\n", " df.loc[is_neg, f'imbalance costs_{cons}'] = -df.loc[is_neg, f'imbalance_MWh_{cons}'] * df['NEG'] \n", "\n", " df[f'total cost_{cons}'] = df['day-ahead costs'] + df[f'imbalance costs_{cons}']\n", " # df[f'cumulative_{cons}'] = df[f'total cost_{cons}'].cumsum()" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "2018-11-01 00:00:00+01:00 NaN\n", "2018-11-01 00:15:00+01:00 NaN\n", "2018-11-01 00:30:00+01:00 NaN\n", "2018-11-01 00:45:00+01:00 NaN\n", "2018-11-01 01:00:00+01:00 NaN\n", "2018-11-01 01:15:00+01:00 NaN\n", "2018-11-01 01:30:00+01:00 NaN\n", "2018-11-01 01:45:00+01:00 NaN\n", "2018-11-01 02:00:00+01:00 196.067541\n", "2018-11-01 02:15:00+01:00 396.768803\n", "2018-11-01 02:30:00+01:00 400.107706\n", "2018-11-01 02:45:00+01:00 390.372642\n", "2018-11-01 03:00:00+01:00 376.119876\n", "2018-11-01 03:15:00+01:00 388.085714\n", "2018-11-01 03:30:00+01:00 387.807118\n", "2018-11-01 03:45:00+01:00 372.449380\n", "2018-11-01 04:00:00+01:00 369.757475\n", "2018-11-01 04:15:00+01:00 383.203470\n", "2018-11-01 04:30:00+01:00 386.038665\n", "2018-11-01 04:45:00+01:00 338.698059\n", "2018-11-01 05:00:00+01:00 371.695317\n", "2018-11-01 05:15:00+01:00 397.004324\n", "2018-11-01 05:30:00+01:00 404.906351\n", "2018-11-01 05:45:00+01:00 384.646323\n", "2018-11-01 06:00:00+01:00 204.569212\n", "2018-11-01 06:15:00+01:00 409.008178\n", "2018-11-01 06:30:00+01:00 533.041054\n", "2018-11-01 06:45:00+01:00 1044.994118\n", "2018-11-01 07:00:00+01:00 439.719388\n", "2018-11-01 07:15:00+01:00 405.539565\n", "2018-11-01 07:30:00+01:00 435.974581\n", "2018-11-01 07:45:00+01:00 439.521555\n", "2018-11-01 08:00:00+01:00 421.129434\n", "2018-11-01 08:15:00+01:00 399.957974\n", "2018-11-01 08:30:00+01:00 439.874904\n", "2018-11-01 08:45:00+01:00 464.042678\n", "2018-11-01 09:00:00+01:00 518.634699\n", "2018-11-01 09:15:00+01:00 593.809973\n", "2018-11-01 09:30:00+01:00 531.803145\n", "2018-11-01 09:45:00+01:00 546.489183\n", "2018-11-01 10:00:00+01:00 486.503123\n", "2018-11-01 10:15:00+01:00 471.417320\n", "2018-11-01 10:30:00+01:00 457.979187\n", "2018-11-01 10:45:00+01:00 754.307416\n", "2018-11-01 11:00:00+01:00 506.223695\n", "2018-11-01 11:15:00+01:00 1173.169207\n", "2018-11-01 11:30:00+01:00 693.914398\n", "2018-11-01 11:45:00+01:00 1177.324197\n", "2018-11-01 12:00:00+01:00 1348.831286\n", "Freq: 15T, Name: total cost_old, dtype: float64" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df['total cost_old']" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "20841.508235725\n", "22900.959197460757\n" ] } ], "source": [ "print(df['total cost_old'].sum())\n", "print(df['total cost_new'].sum())" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [], "source": [ "# discharged_heat = energy_to_storage(hp_capacity,19.585104)\n", "\n", "# print(discharged_heat)\n", "\n", "# discharge_mass = discharge_mass_flow(discharged_heat, Cp, 140+273, Tref+273)\n", "\n", "# print(discharge_mass)" ] }, { "cell_type": "code", "execution_count": 28, "metadata": {}, "outputs": [], "source": [ "# rng = pd.date_range('2018-11-01 00:00:00', end='2018-11-01 12:00:00', freq='15T' )\n", "\n", "# price_data = pd.DataFrame(np.random.randint(30, 110, size=(len(rng))), \n", "# columns=['ForeNeg'], \n", "# index=rng)\n", "\n", "# price_data['ForePos'] = np.random.randint(20, 50, size=(len(rng)))\n", "\n", "# price_data.head()" ] }, { "cell_type": "code", "execution_count": 29, "metadata": {}, "outputs": [], "source": [ "# def test_heatpump_and_waterstorage_system(Tsink, Tsource, process_demand_MW, e_price):\n", "# \"\"\"\n", "# 1. Follow a certain logic based on given price:\n", "# - If price is low --> Heatpump at full power, and charge the heatbuffer\n", "# - If price is high --> Discharge the heat buffer, and increase Tsource, which will increase COP\n", "# 2. Above logic should adhere to a couple of constraints:\n", "# - Storage levels\n", "# - Capacity of the heat pump \n", "# - Process demand\n", "# - ....\n", "# 3. This function should contain: \n", "# - Heat pump \n", "# - Water storage\n", "# - Interactions / logic between them\n", "# 4. Output of the function:\n", "# - Power of the heatpump (MWe)\n", "# - \"New\" water storage level\n", "# - (optional) Thermal output of the heatpump\n", "# - (optional) In/outflow from the storage\n", "# \"\"\"\n", " \n", "# if e_price < 50:\n", "# hp_load = heatpump.max_th_power\n", "# energy_to_storage = hp_load - process_demand_MW\n", "# waterstorage.charge(energy_to_storage)\n", "# new_cl = waterstorage.storagelevel\n", "# if e_price > 100:\n", "# energy_from_storage = discharged_heat\n", "# waterstorage.discharge(energy_from_storage)\n", "# new_cl = waterstorage.storagelevel\n", " \n", "# def Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow):\n", "# return ((Tstorage * discharge_mass_flow(discharged_heat, Cp, Tstorage, Tref) + Tsource * process_mass_flow(process_demand_MW, Tsink, Tref, Cp))\n", "# / (discharge_mass_flow(discharged_heat, Cp, Tstorage, Tref) + process_mass_flow(process_demand_MW, Tsink, Tref, Cp)))\n", "# new_COP = cop_curve (Tsink, Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow))\n", "# hp_load = heatpump.set_heat_output(process_demand_MW, Tsink, Tsource) #bu da hemcinin set load assetin funksiyasidir, \n", "# #heatpump da overwrite edilib. men evezinde yazdim ki set_heat_output\n", "# #sen gor hansi funksiya sene lazimdir.\n", "\n", "# return hp_load, new_cl" ] }, { "cell_type": "code", "execution_count": 30, "metadata": {}, "outputs": [], "source": [ "# for i in df.index:\n", "# df.loc[i, 'hp_mass'] = hp_mass_flow(hp_capacity, df.loc[i, 'Tsink (VDG)'], Tref, Cp)\n", "# df.loc[i, 'process_mass'] = process_mass_flow(df.loc[i, 'MW (VDG)'], df.loc[i, 'Tsink (VDG)'],Tref, Cp)\n", "# df.loc[i, 'COP'] = cop_curve(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", "# df.loc[i, 'charge_mass'] = df.loc[i, 'hp_mass'] - df.loc[i, 'process_mass']\n", "# df.loc[i, 'charged_heat'] = charged_heat(df.loc[i, 'charge_mass'], Cp, df.loc[i, 'Tsink (VDG)']+273, Tref + 273)\n", "# df.loc[i, 'discharged_heat'] = charged_heat(df.loc[i, 'charge_mass'], Cp, df.loc[i, 'Tsink (VDG)']+273, Tref + 273)\n", "# df.loc[i, 'discharge_mass'] = discharge_mass_flow(df.loc[i, 'discharged_heat'], Cp, Tstorage+273, Tref+273)\n", "# df.loc[i, 'Tsource_new'] = Tsource_calculation(Tstorage + 273, df.loc[i, 'discharge_mass'], df.loc[i, 'Tsource (VDG)']+273, df.loc[i, 'process_mass'])\n", "# df.loc[i, 'new_COP'] = cop_curve(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource_new'])\n", " \n", "# df.head(10)\n", "# # Tsource_new should be in the nested function but now it is calculated separately, need to be checked again\n", "# discharge_mass were checked manually,there is very slight change in the last decimals that's why seems constant here, but it calculates correctly.\n", "\n", "# process mass results are wrong" ] }, { "cell_type": "code", "execution_count": 31, "metadata": {}, "outputs": [], "source": [ "# for col in price_data.columns:\n", "# df[col] = price_data[col]\n", "\n", "# df['nomination_MWh'] = df['DAM'] * df['MW (VDG)']\n", "# df['heatpump_cons_MWh'] = 9\n", "# df['imbalance_MWh'] = df['nomination_MWh'] - df['heatpump_cons_MWh']\n", "# df['day-ahead costs'] = df['nomination_MWh'] * df['DAM'] \n", "\n", "# is_pos = df['imbalance_MWh'] > 0\n", "# df.loc[is_pos, 'imbalance costs'] = -df.loc[is_pos, 'imbalance_MWh'] * df['POS'] \n", "\n", "# is_neg = df['imbalance_MWh'] < 0\n", "# df.loc[is_neg, 'imbalance costs'] = -df.loc[is_neg, 'imbalance_MWh'] * df['NEG'] \n", "\n", "# df['total cost'] = df['day-ahead costs'] + df['imbalance costs']" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [], "source": [ "# data['Total demand'] = data['MW (VDG)'] + data['MW (NDG)']\n", "# data = data[start:end]\n", "# fig_demands_nov2018 = data['Total demand'].resample('1H').mean().iplot(\n", "# title='Smurfit Kappa: Heat demand in MW', \n", "# yTitle='MW', \n", "# asFigure=True,\n", "# dimensions=(800, 400)\n", "# )\n", "# fig_demands_nov2018" ] }, { "cell_type": "code", "execution_count": 33, "metadata": {}, "outputs": [], "source": [ "# for i in df.index:\n", "# if df.loc[i, 'ForePos'] < 50:\n", "# hp_load = heatpump.max_th_power\n", "# old_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)\n", "# df.loc[i,'hp_consumption_old'] = hp_load/ (old_COP * df.loc[i, 'POS'])\n", "# # df.loc[i,'hp_consumption_new'] = hp_load/df.loc[i,'new_COP'] * df.loc[i, 'POS']\n", "\n", "# elif price_data.loc[i,'ForePos'] > 50:\n", "# hp_load = heatpump.set_heat_output(df.loc[i, 'MW (VDG)'], df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273)[1]\n", "# new_COP = heatpump.get_cop(hp_load, df.loc[i,'Tsink (VDG)']+273, df.loc[i, 'Tsource_new']+273)\n", "# df.loc[i, 'hp_consumption'] = hp_load/ (new_COP * df.loc[i, 'POS'] )\n", "\n", "# df[:20]" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "VISUALIZATION" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "interpreter": { "hash": "5ec59cbcf9a87043036a8796d27aab156a33bd65b7023fbb41d7014b6ac2d886" }, "kernelspec": { "display_name": "Python 3.9.5 ('base')", "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.9.5" } }, "nbformat": 4, "nbformat_minor": 4 }