{ "cells": [ { "cell_type": "code", "execution_count": 79, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The autoreload extension is already loaded. To reload it, use:\n", " %reload_ext autoreload\n" ] } ], "source": [ "from notepad import WaterStorage, Heatpump\n", "\n", "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "code", "execution_count": 80, "metadata": {}, "outputs": [], "source": [ "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 81, "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", " \n", " \n", " \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)Unnamed: 7Unnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12
2018-11-01 00:00:0064.986977143.3587980.00000020.514811147.6211260.000000NaNNaNNaNNaNNaNNaN
2018-11-01 00:10:0064.942589140.6474190.00000019.280056147.8425030.000000NaNNaNNaNNaNNaNNaN
2018-11-01 00:20:0054.578777138.9604930.00000017.950905148.1389640.000000NaNNaNNaNNaNNaNNaN
2018-11-01 00:30:0065.195641139.9363920.00000023.053127147.8646600.000000NaNNaNNaNNaNNaNNaN
2018-11-01 00:40:0065.137703139.8342650.00000043.948387147.3061910.000000NaNNaNNaNNaNNaNNaN
.......................................
2018-11-01 15:50:0064.977669157.64950920.63146264.929398166.1472896.785675NaNNaNNaNNaNNaNNaN
2018-11-01 16:00:0064.951965157.75509420.62155464.830673165.0596286.795409NaNNaNNaNNaNNaNNaN
2018-11-01 16:10:0064.940338157.86045020.59488764.749290164.3504826.795437NaNNaNNaNNaNNaNNaN
2018-11-01 16:20:0064.940338157.96558020.58989464.489296163.4349156.804813NaNNaNNaNNaNNaNNaN
2018-11-01 16:30:0064.940338158.07048420.79907964.245148163.3126296.876395NaNNaNNaNNaNNaNNaN
\n", "

100 rows × 12 columns

\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) Tsource (NDG) \\\n", "2018-11-01 00:00:00 64.986977 143.358798 0.000000 20.514811 \n", "2018-11-01 00:10:00 64.942589 140.647419 0.000000 19.280056 \n", "2018-11-01 00:20:00 54.578777 138.960493 0.000000 17.950905 \n", "2018-11-01 00:30:00 65.195641 139.936392 0.000000 23.053127 \n", "2018-11-01 00:40:00 65.137703 139.834265 0.000000 43.948387 \n", "... ... ... ... ... \n", "2018-11-01 15:50:00 64.977669 157.649509 20.631462 64.929398 \n", "2018-11-01 16:00:00 64.951965 157.755094 20.621554 64.830673 \n", "2018-11-01 16:10:00 64.940338 157.860450 20.594887 64.749290 \n", "2018-11-01 16:20:00 64.940338 157.965580 20.589894 64.489296 \n", "2018-11-01 16:30:00 64.940338 158.070484 20.799079 64.245148 \n", "\n", " Tsink (NDG) MW (NDG) Unnamed: 7 Unnamed: 8 \\\n", "2018-11-01 00:00:00 147.621126 0.000000 NaN NaN \n", "2018-11-01 00:10:00 147.842503 0.000000 NaN NaN \n", "2018-11-01 00:20:00 148.138964 0.000000 NaN NaN \n", "2018-11-01 00:30:00 147.864660 0.000000 NaN NaN \n", "2018-11-01 00:40:00 147.306191 0.000000 NaN NaN \n", "... ... ... ... ... \n", "2018-11-01 15:50:00 166.147289 6.785675 NaN NaN \n", "2018-11-01 16:00:00 165.059628 6.795409 NaN NaN \n", "2018-11-01 16:10:00 164.350482 6.795437 NaN NaN \n", "2018-11-01 16:20:00 163.434915 6.804813 NaN NaN \n", "2018-11-01 16:30:00 163.312629 6.876395 NaN NaN \n", "\n", " Unnamed: 9 Unnamed: 10 Unnamed: 11 Unnamed: 12 \n", "2018-11-01 00:00:00 NaN NaN NaN NaN \n", "2018-11-01 00:10:00 NaN NaN NaN NaN \n", "2018-11-01 00:20:00 NaN NaN NaN NaN \n", "2018-11-01 00:30:00 NaN NaN NaN NaN \n", "2018-11-01 00:40:00 NaN NaN NaN NaN \n", "... ... ... ... ... \n", "2018-11-01 15:50:00 NaN NaN NaN NaN \n", "2018-11-01 16:00:00 NaN NaN NaN NaN \n", "2018-11-01 16:10:00 NaN NaN NaN NaN \n", "2018-11-01 16:20:00 NaN NaN NaN NaN \n", "2018-11-01 16:30:00 NaN NaN NaN NaN \n", "\n", "[100 rows x 12 columns]" ] }, "execution_count": 81, "metadata": {}, "output_type": "execute_result" } ], "source": [ "data = pd.read_excel('Demand_Data_Smurfit_Preprocessed_minutely.xlsx', sheet_name='nov2018', index_col=0)\n", "data[:100]" ] }, { "cell_type": "code", "execution_count": 82, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
Tsource (VDG)Tsink (VDG)MW (VDG)Tsource (NDG)Tsink (NDG)MW (NDG)Unnamed: 7Unnamed: 8Unnamed: 9Unnamed: 10Unnamed: 11Unnamed: 12
2018-11-01 00:00:0064.986977143.3587980.020.514811147.6211260.0NaNNaNNaNNaNNaNNaN
2018-11-01 00:10:0064.942589140.6474190.019.280056147.8425030.0NaNNaNNaNNaNNaNNaN
2018-11-01 00:20:0054.578777138.9604930.017.950905148.1389640.0NaNNaNNaNNaNNaNNaN
2018-11-01 00:30:0065.195641139.9363920.023.053127147.8646600.0NaNNaNNaNNaNNaNNaN
2018-11-01 00:40:0065.137703139.8342650.043.948387147.3061910.0NaNNaNNaNNaNNaNNaN
2018-11-01 00:50:0065.358078139.7319010.042.203876147.5476120.0NaNNaNNaNNaNNaNNaN
2018-11-01 01:00:0065.084549139.6292950.018.354761148.3374770.0NaNNaNNaNNaNNaNNaN
2018-11-01 01:10:0064.810524139.5264470.019.050589148.1831920.0NaNNaNNaNNaNNaNNaN
2018-11-01 01:20:0065.073433139.4233570.019.903652149.1868650.0NaNNaNNaNNaNNaNNaN
2018-11-01 01:30:0065.007141139.3200260.021.213211147.7643560.0NaNNaNNaNNaNNaNNaN
\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) Tsource (NDG) \\\n", "2018-11-01 00:00:00 64.986977 143.358798 0.0 20.514811 \n", "2018-11-01 00:10:00 64.942589 140.647419 0.0 19.280056 \n", "2018-11-01 00:20:00 54.578777 138.960493 0.0 17.950905 \n", "2018-11-01 00:30:00 65.195641 139.936392 0.0 23.053127 \n", "2018-11-01 00:40:00 65.137703 139.834265 0.0 43.948387 \n", "2018-11-01 00:50:00 65.358078 139.731901 0.0 42.203876 \n", "2018-11-01 01:00:00 65.084549 139.629295 0.0 18.354761 \n", "2018-11-01 01:10:00 64.810524 139.526447 0.0 19.050589 \n", "2018-11-01 01:20:00 65.073433 139.423357 0.0 19.903652 \n", "2018-11-01 01:30:00 65.007141 139.320026 0.0 21.213211 \n", "\n", " Tsink (NDG) MW (NDG) Unnamed: 7 Unnamed: 8 \\\n", "2018-11-01 00:00:00 147.621126 0.0 NaN NaN \n", "2018-11-01 00:10:00 147.842503 0.0 NaN NaN \n", "2018-11-01 00:20:00 148.138964 0.0 NaN NaN \n", "2018-11-01 00:30:00 147.864660 0.0 NaN NaN \n", "2018-11-01 00:40:00 147.306191 0.0 NaN NaN \n", "2018-11-01 00:50:00 147.547612 0.0 NaN NaN \n", "2018-11-01 01:00:00 148.337477 0.0 NaN NaN \n", "2018-11-01 01:10:00 148.183192 0.0 NaN NaN \n", "2018-11-01 01:20:00 149.186865 0.0 NaN NaN \n", "2018-11-01 01:30:00 147.764356 0.0 NaN NaN \n", "\n", " Unnamed: 9 Unnamed: 10 Unnamed: 11 Unnamed: 12 \n", "2018-11-01 00:00:00 NaN NaN NaN NaN \n", "2018-11-01 00:10:00 NaN NaN NaN NaN \n", "2018-11-01 00:20:00 NaN NaN NaN NaN \n", "2018-11-01 00:30:00 NaN NaN NaN NaN \n", "2018-11-01 00:40:00 NaN NaN NaN NaN \n", "2018-11-01 00:50:00 NaN NaN NaN NaN \n", "2018-11-01 01:00:00 NaN NaN NaN NaN \n", "2018-11-01 01:10:00 NaN NaN NaN NaN \n", "2018-11-01 01:20:00 NaN NaN NaN NaN \n", "2018-11-01 01:30:00 NaN NaN NaN NaN " ] }, "execution_count": 82, "metadata": {}, "output_type": "execute_result" } ], "source": [ "start, end = '2018-11-01 00:00:00', '2018-11-01 16:30:00'\n", "df = data[start:end]\n", "df[:10]\n" ] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [], "source": [ "df = df.resample('15T', origin=start).mean()" ] }, { "cell_type": "code", "execution_count": 84, "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:0064.964783142.0031090.019.897433147.7318140.0
2018-11-01 00:15:0054.578777138.9604930.017.950905148.1389640.0
2018-11-01 00:30:0065.166672139.8853290.033.500757147.5854260.0
2018-11-01 00:45:0065.358078139.7319010.042.203876147.5476120.0
2018-11-01 01:00:0064.947536139.5778710.018.702675148.2603350.0
\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) Tsource (NDG) \\\n", "2018-11-01 00:00:00 64.964783 142.003109 0.0 19.897433 \n", "2018-11-01 00:15:00 54.578777 138.960493 0.0 17.950905 \n", "2018-11-01 00:30:00 65.166672 139.885329 0.0 33.500757 \n", "2018-11-01 00:45:00 65.358078 139.731901 0.0 42.203876 \n", "2018-11-01 01:00:00 64.947536 139.577871 0.0 18.702675 \n", "\n", " Tsink (NDG) MW (NDG) \n", "2018-11-01 00:00:00 147.731814 0.0 \n", "2018-11-01 00:15:00 148.138964 0.0 \n", "2018-11-01 00:30:00 147.585426 0.0 \n", "2018-11-01 00:45:00 147.547612 0.0 \n", "2018-11-01 01:00:00 148.260335 0.0 " ] }, "execution_count": 84, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df=df.drop(['Unnamed: 7', 'Unnamed: 8', 'Unnamed: 9', 'Unnamed: 10', 'Unnamed: 11', 'Unnamed: 12'], axis=1)\n", "df[:5]" ] }, { "cell_type": "code", "execution_count": 85, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "15" ] }, "execution_count": 85, "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", " energy_density = 50 * 10e-3,\n", " volume = 500,\n", " lifetime = 25,\n", " temperature = 368, #K\n", " min_storagelevel = 5,\n", " max_storagelevel = 23\n", " \n", ")\n", "waterstorage.set_freq('15T')\n", "waterstorage.storagelevel = 3\n", "waterstorage.set_storagelevel(15)\n", "waterstorage.storagelevel\n" ] }, { "cell_type": "code", "execution_count": 86, "metadata": {}, "outputs": [], "source": [ "def hp_mass_flow (hp_capacity, Tsink, Tref, Cp):\n", " return hp_capacity /(Cp*(Tsink - Tref)) \n", "\n", "def process_mass_flow (demand, Tsink, Tref, Cp):\n", " return demand /(Cp*(Tsink - Tref)) \n", "\n", "def COP_calculation(Tsink, Tsource):\n", " return Tsink / (Tsink - Tsource)\n", "\n", "from numpy.polynomial import Polynomial\n", "\n", "def cop_curve(Tsink, Tsource):\n", " c0 = Tsink / (Tsink - Tsource) \n", " return Polynomial([c0])\n" ] }, { "cell_type": "code", "execution_count": 103, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'name': 'Heatpump',\n", " 'max_th_power': 40,\n", " 'min_th_power': 5,\n", " 'cop_curve': }" ] }, "execution_count": 103, "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, 13)\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": 104, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "341.450974129671" ] }, "execution_count": 104, "metadata": {}, "output_type": "execute_result" } ], "source": [ "Tsink = 413 #K\n", "Tsource = 333 #K\n", "Tref = 273 #K\n", "hp_capacity = 31 #MW\n", "demand = 25 #MW\n", "Cp = 4190 #J/kgK\n", "MW_to_J_per_s = 1000_000\n", "hp_capacity *= MW_to_J_per_s\n", "demand *= MW_to_J_per_s\n", "\n", "charge_mass_flow = hp_mass_flow (hp_capacity, Tsink, Tref, Cp) - process_mass_flow (demand, Tsink, Tref, Cp)\n", "charged_heat = (charge_mass_flow * Cp * (Tsink - Tref)) / MW_to_J_per_s\n", "charged_heat\n", "\n", "efficiency = 0.9\n", "Tstorage = 95 + 273\n", "discharged_heat = charged_heat * efficiency #MW\n", "discharged_heat *= MW_to_J_per_s \n", "discharge_mass_flow = discharged_heat /(Cp*(Tstorage - Tref))\n", "discharge_mass_flow\n", "process_mass_flow\n", "\n", "def Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow):\n", " return (Tstorage * discharge_mass_flow + Tsource * process_mass_flow)/ (discharge_mass_flow + process_mass_flow)\n", " \n", "\n", "Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow (demand, Tsink, Tref, Cp))\n" ] }, { "cell_type": "code", "execution_count": 105, "metadata": {}, "outputs": [], "source": [ "def test_heatpump_and_waterstorage_system(Tsink, Tsource, process_demand_MW, e_price, waterstorage_level):\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 \n", " - \"New\" water storage level\n", " \"\"\"\n", " waterstorage.storage_level = waterstorage_level\n", " \n", " if e_price < 50:\n", " hp_load = heatpump.max_th_power #bunu yoxla heat pump-a birbasa set load demek olmur. Ve funksiyada heatpump obyekti var ama o evvel initialize olunmayib\n", " energy_to_storage = hp_load - process_demand_MW\n", " waterstorage.charge(energy_to_storage)\n", " waterstorage.charged_energy = waterstorage.MW_to_MWh(energy_to_storage)\n", " waterstorage_level = waterstorage.storage_level\n", " new_cl = waterstorage.storage_level + waterstorage.charged_energy\n", " if e_price > 100:\n", " Tstorage = 320\n", " energy_from_storage = discharged_heat\n", " waterstorage_level = waterstorage.storage_level\n", " waterstorage.discharged_energy = waterstorage.MW_to_MWh(energy_from_storage)\n", " new_cl = waterstorage.storage_level - waterstorage.discharged_energy\n", " def Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow):\n", " return (\n", " (Tstorage * discharge_mass_flow + Tsource * process_mass_flow)\n", " / (discharge_mass_flow + process_mass_flow)\n", " )\n", " new_Tsource = Tsource_calculation(Tstorage, discharge_mass_flow, Tsource, process_mass_flow (demand, Tsink, Tref, Cp))\n", " new_COP = COP_calculation (Tsink, new_Tsource)\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, waterstorage_level" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 106, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(40, 26.75, 23)" ] }, "execution_count": 106, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = test_heatpump_and_waterstorage_system(\n", " Tsink = 150+273, \n", " Tsource = 60+273, \n", " process_demand_MW = 25, \n", " e_price = 30, \n", " waterstorage_level = 23\n", ")\n", "\n", "results" ] }, { "cell_type": "code", "execution_count": 107, "metadata": {}, "outputs": [], "source": [ "for i in df.index:\n", " df.loc[i, 'hpload'] = test_heatpump_and_waterstorage_system(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273, df.loc[i, 'MW (VDG)'], 30, 23)[0]\n", " df.loc[i, 'new_cl'] = test_heatpump_and_waterstorage_system(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273, df.loc[i, 'MW (VDG)'], 30, 23)[1]\n", " df.loc[i, 'storage_level'] = test_heatpump_and_waterstorage_system(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273, df.loc[i, 'MW (VDG)'], 30, 23)[2]" ] }, { "cell_type": "code", "execution_count": 108, "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", "
Tsource (VDG)Tsink (VDG)MW (VDG)Tsource (NDG)Tsink (NDG)MW (NDG)hploadnew_clstorage_level
2018-11-01 00:00:0064.964783142.0031090.00000019.897433147.7318140.00000040.033.00000023.0
2018-11-01 00:15:0054.578777138.9604930.00000017.950905148.1389640.00000040.033.00000023.0
2018-11-01 00:30:0065.166672139.8853290.00000033.500757147.5854260.00000040.033.00000023.0
2018-11-01 00:45:0065.358078139.7319010.00000042.203876147.5476120.00000040.033.00000023.0
2018-11-01 01:00:0064.947536139.5778710.00000018.702675148.2603350.00000040.033.00000023.0
..............................
2018-11-01 15:30:0065.016212157.22950820.71692664.996845167.1359016.79845540.027.82076923.0
2018-11-01 15:45:0064.977669157.64950920.63146264.929398166.1472896.78567540.027.84213423.0
2018-11-01 16:00:0064.946152157.80777220.60822164.789982164.7050556.79542340.027.84794523.0
2018-11-01 16:15:0064.940338157.96558020.58989464.489296163.4349156.80481340.027.85252623.0
2018-11-01 16:30:0064.940338158.07048420.79907964.245148163.3126296.87639540.027.80023023.0
\n", "

67 rows × 9 columns

\n", "
" ], "text/plain": [ " Tsource (VDG) Tsink (VDG) MW (VDG) Tsource (NDG) \\\n", "2018-11-01 00:00:00 64.964783 142.003109 0.000000 19.897433 \n", "2018-11-01 00:15:00 54.578777 138.960493 0.000000 17.950905 \n", "2018-11-01 00:30:00 65.166672 139.885329 0.000000 33.500757 \n", "2018-11-01 00:45:00 65.358078 139.731901 0.000000 42.203876 \n", "2018-11-01 01:00:00 64.947536 139.577871 0.000000 18.702675 \n", "... ... ... ... ... \n", "2018-11-01 15:30:00 65.016212 157.229508 20.716926 64.996845 \n", "2018-11-01 15:45:00 64.977669 157.649509 20.631462 64.929398 \n", "2018-11-01 16:00:00 64.946152 157.807772 20.608221 64.789982 \n", "2018-11-01 16:15:00 64.940338 157.965580 20.589894 64.489296 \n", "2018-11-01 16:30:00 64.940338 158.070484 20.799079 64.245148 \n", "\n", " Tsink (NDG) MW (NDG) hpload new_cl storage_level \n", "2018-11-01 00:00:00 147.731814 0.000000 40.0 33.000000 23.0 \n", "2018-11-01 00:15:00 148.138964 0.000000 40.0 33.000000 23.0 \n", "2018-11-01 00:30:00 147.585426 0.000000 40.0 33.000000 23.0 \n", "2018-11-01 00:45:00 147.547612 0.000000 40.0 33.000000 23.0 \n", "2018-11-01 01:00:00 148.260335 0.000000 40.0 33.000000 23.0 \n", "... ... ... ... ... ... \n", "2018-11-01 15:30:00 167.135901 6.798455 40.0 27.820769 23.0 \n", "2018-11-01 15:45:00 166.147289 6.785675 40.0 27.842134 23.0 \n", "2018-11-01 16:00:00 164.705055 6.795423 40.0 27.847945 23.0 \n", "2018-11-01 16:15:00 163.434915 6.804813 40.0 27.852526 23.0 \n", "2018-11-01 16:30:00 163.312629 6.876395 40.0 27.800230 23.0 \n", "\n", "[67 rows x 9 columns]" ] }, "execution_count": 108, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df" ] }, { "cell_type": "code", "execution_count": 112, "metadata": {}, "outputs": [ { "data": { "application/vnd.plotly.v1+json": { "config": { "plotlyServerURL": "https://plot.ly" }, "data": [ { "hovertemplate": "variable=storage_level
index=%{x}
value=%{y}", "legendgroup": "storage_level", "line": { "color": "#636efa", "dash": "solid" }, "marker": { "symbol": "circle" }, "mode": "lines", "name": "storage_level", "orientation": "v", "showlegend": true, "type": "scatter", "x": [ "2018-11-01T00:00:00", "2018-11-01T00:15:00", "2018-11-01T00:30:00", "2018-11-01T00:45:00", "2018-11-01T01:00:00", "2018-11-01T01:15:00", "2018-11-01T01:30:00", "2018-11-01T01:45:00", "2018-11-01T02:00:00", "2018-11-01T02:15:00", "2018-11-01T02:30:00", "2018-11-01T02:45:00", "2018-11-01T03:00:00", "2018-11-01T03:15:00", "2018-11-01T03:30:00", "2018-11-01T03:45:00", "2018-11-01T04:00:00", "2018-11-01T04:15:00", "2018-11-01T04:30:00", "2018-11-01T04:45:00", "2018-11-01T05:00:00", "2018-11-01T05:15:00", "2018-11-01T05:30:00", "2018-11-01T05:45:00", "2018-11-01T06:00:00", "2018-11-01T06:15:00", "2018-11-01T06:30:00", "2018-11-01T06:45:00", "2018-11-01T07:00:00", "2018-11-01T07:15:00", "2018-11-01T07:30:00", "2018-11-01T07:45:00", "2018-11-01T08:00:00", "2018-11-01T08:15:00", "2018-11-01T08:30:00", "2018-11-01T08:45:00", "2018-11-01T09:00:00", "2018-11-01T09:15:00", "2018-11-01T09:30:00", "2018-11-01T09:45:00", "2018-11-01T10:00:00", "2018-11-01T10:15:00", "2018-11-01T10:30:00", "2018-11-01T10:45:00", "2018-11-01T11:00:00", "2018-11-01T11:15:00", "2018-11-01T11:30:00", "2018-11-01T11:45:00", "2018-11-01T12:00:00", "2018-11-01T12:15:00", "2018-11-01T12:30:00", "2018-11-01T12:45:00", "2018-11-01T13:00:00", "2018-11-01T13:15:00", "2018-11-01T13:30:00", "2018-11-01T13:45:00", "2018-11-01T14:00:00", "2018-11-01T14:15:00", "2018-11-01T14:30:00", "2018-11-01T14:45:00", "2018-11-01T15:00:00", "2018-11-01T15:15:00", "2018-11-01T15:30:00", "2018-11-01T15:45:00", "2018-11-01T16:00:00", "2018-11-01T16:15:00", "2018-11-01T16:30:00" ], "xaxis": "x", "y": [ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23 ], "yaxis": "y" } ], "layout": { "legend": { "title": { "text": "variable" }, "tracegroupgap": 0 }, "margin": { "t": 60 }, "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": [ { "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, "#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 } } }, "xaxis": { "anchor": "y", "domain": [ 0, 1 ], "title": { "text": "index" } }, "yaxis": { "anchor": "x", "domain": [ 0, 1 ], "title": { "text": "value" } } } } }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import plotly.express as px\n", "\n", "fig = px.line(df['storage_level'])\n", "fig.show()" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "interpreter": { "hash": "dd1accba5c44bbc1a722925963d63420d7a225a16ee8ad40deae87a5c5fb7f29" }, "kernelspec": { "display_name": "Python 3.9.12 ('myenv': venv)", "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.12" }, "orig_nbformat": 4 }, "nbformat": 4, "nbformat_minor": 2 }