{ "cells": [ { "cell_type": "code", "execution_count": 2, "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": 4, "metadata": {}, "outputs": [], "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": 5, "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", "
ForeNegForePos
2018-11-01 00:00:009134
2018-11-01 00:15:003931
2018-11-01 00:30:005229
2018-11-01 00:45:0010842
2018-11-01 01:00:004936
\n", "
" ], "text/plain": [ " ForeNeg ForePos\n", "2018-11-01 00:00:00 91 34\n", "2018-11-01 00:15:00 39 31\n", "2018-11-01 00:30:00 52 29\n", "2018-11-01 00:45:00 108 42\n", "2018-11-01 01:00:00 49 36" ] }, "execution_count": 5, "metadata": {}, "output_type": "execute_result" } ], "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": 6, "metadata": {}, "outputs": [], "source": [ "# mipf = Mipf(\n", "# start='2018-11-01', \n", "# end='2018-11-02', \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 = price_data.resample('15T').mean()\n", "# price_data" ] }, { "cell_type": "code", "execution_count": 7, "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": 7, "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 = df.resample('15T', origin=start).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": 8, "metadata": {}, "outputs": [], "source": [ "# df[['Tsource (VDG)', 'Tsink (VDG)']].iplot()" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "15" ] }, "execution_count": 9, "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": 110, "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", "# hp_capacity *= MW_to_J_per_s\n", "# process_demand_MW *= MW_to_J_per_s\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": 111, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "50.0" ] }, "execution_count": 111, "metadata": {}, "output_type": "execute_result" } ], "source": [ "waterstorage.max_storage_capacity" ] }, { "cell_type": "code", "execution_count": 112, "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 (process_demand_MW, Tsink, Tref, Cp):\n", " return process_demand_MW /(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)\n", "\n", "\n", "def energy_to_storage(hp_capacity, process_demand_MW):\n", " return hp_capacity - process_demand_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": 113, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "11.414895999999999\n", "19.459420388680527\n" ] } ], "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": 114, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "{'name': 'Heatpump',\n", " 'max_th_power': 40,\n", " 'min_th_power': 5,\n", " 'cop_curve': }" ] }, "execution_count": 114, "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": 115, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "5.1625" ] }, "execution_count": 115, "metadata": {}, "output_type": "execute_result" } ], "source": [ "heatpump.get_cop(50, Tsource=333, Tsink=413)\n" ] }, { "cell_type": "code", "execution_count": 116, "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": 117, "metadata": {}, "outputs": [], "source": [ "# waterstorage.get_soc (30, 50)" ] }, { "cell_type": "code", "execution_count": 118, "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)ForeNegForePoshp_massprocess_massCOPcharge_mass
2018-11-01 00:00:0064.964783142.0031090.00000019.897433147.7318140.00000091340.0000520.000000(5.386969459992516)0.000052
2018-11-01 00:15:0054.578777138.9604930.00000017.950905148.1389640.00000039310.0000530.000000(4.882106135030027)0.000053
2018-11-01 00:30:0065.166672139.8853290.00000033.500757147.5854260.00000052290.0000530.000000(5.5258665771869335)0.000053
2018-11-01 00:45:0065.358078139.7319010.00000042.203876147.5476120.000000108420.0000530.000000(5.549424302045392)0.000053
2018-11-01 01:00:0064.947536139.5778710.00000018.702675148.2603350.00000049360.0000530.000000(5.528286493353138)0.000053
2018-11-01 01:15:0065.073433139.4233570.00000019.903652149.1868650.00000075270.0000530.000000(5.547058190973266)0.000053
2018-11-01 01:30:0047.711559140.3287300.00000019.574467147.8000160.000000100220.0000530.000000(4.462765657815752)0.000053
2018-11-01 01:45:0029.525829140.2989020.00000017.065464147.9068860.00000054450.0000530.000000(3.731041234226957)0.000053
2018-11-01 02:00:0065.715569139.99165010.13958749.339708149.6037413.333301100420.0000530.000017(5.560223997670469)0.000036
2018-11-01 02:15:0065.929909148.34232519.58510461.721718155.8879056.45535985360.0000500.000032(5.112607341877656)0.000018
\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", "2018-11-01 01:15:00 65.073433 139.423357 0.000000 19.903652 \n", "2018-11-01 01:30:00 47.711559 140.328730 0.000000 19.574467 \n", "2018-11-01 01:45:00 29.525829 140.298902 0.000000 17.065464 \n", "2018-11-01 02:00:00 65.715569 139.991650 10.139587 49.339708 \n", "2018-11-01 02:15:00 65.929909 148.342325 19.585104 61.721718 \n", "\n", " Tsink (NDG) MW (NDG) ForeNeg ForePos hp_mass \\\n", "2018-11-01 00:00:00 147.731814 0.000000 91 34 0.000052 \n", "2018-11-01 00:15:00 148.138964 0.000000 39 31 0.000053 \n", "2018-11-01 00:30:00 147.585426 0.000000 52 29 0.000053 \n", "2018-11-01 00:45:00 147.547612 0.000000 108 42 0.000053 \n", "2018-11-01 01:00:00 148.260335 0.000000 49 36 0.000053 \n", "2018-11-01 01:15:00 149.186865 0.000000 75 27 0.000053 \n", "2018-11-01 01:30:00 147.800016 0.000000 100 22 0.000053 \n", "2018-11-01 01:45:00 147.906886 0.000000 54 45 0.000053 \n", "2018-11-01 02:00:00 149.603741 3.333301 100 42 0.000053 \n", "2018-11-01 02:15:00 155.887905 6.455359 85 36 0.000050 \n", "\n", " process_mass COP charge_mass \n", "2018-11-01 00:00:00 0.000000 (5.386969459992516) 0.000052 \n", "2018-11-01 00:15:00 0.000000 (4.882106135030027) 0.000053 \n", "2018-11-01 00:30:00 0.000000 (5.5258665771869335) 0.000053 \n", "2018-11-01 00:45:00 0.000000 (5.549424302045392) 0.000053 \n", "2018-11-01 01:00:00 0.000000 (5.528286493353138) 0.000053 \n", "2018-11-01 01:15:00 0.000000 (5.547058190973266) 0.000053 \n", "2018-11-01 01:30:00 0.000000 (4.462765657815752) 0.000053 \n", "2018-11-01 01:45:00 0.000000 (3.731041234226957) 0.000053 \n", "2018-11-01 02:00:00 0.000017 (5.560223997670469) 0.000036 \n", "2018-11-01 02:15:00 0.000032 (5.112607341877656) 0.000018 " ] }, "execution_count": 118, "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": 119, "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": 125, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "52.94831003899137\n", "17.232571785757365\n", "15.690906523897725\n", "15.833641124244465\n", "15.766858500063137\n" ] } ], "source": [ "# df.index = df.index.tz_localize('Europe/Amsterdam')\n", "for i in df.index:\n", " # if df.loc[i, 'ForePos'] < 50:\n", " # hp_load = heatpump.max_th_power\n", " # energy_to_storage = hp_load - df.loc[i, 'MW (VDG)']\n", " # waterstorage.charge(energy_to_storage)\n", " # new_cl = waterstorage.storagelevel\n", " # print(new_cl)\n", " if price_data.loc[i,'ForeNeg'] > 100:\n", " # discharged_heat = energy_to_storage(hp_capacity, df.loc[i, 'MW (VDG)'])\n", " energy_from_storage = energy_to_storage(hp_capacity, df.loc[i, 'MW (VDG)'])\n", " waterstorage.discharge(energy_from_storage)\n", " new_cl = waterstorage.storagelevel\n", " discharge_mass = discharge_mass_flow(energy_from_storage, Cp, df.loc[i, 'Tsink (VDG)']+273, Tref + 273)\n", " print(discharge_mass)\n", " Tsource_new = Tsource_calculation(Tstorage, discharge_mass, Tsource, process_mass_flow(df.loc[i, 'MW (VDG)'], df.loc[i, 'Tsink (VDG)'], Tref, Cp))\n", " new_COP = cop_curve (df.loc[i, 'Tsink (VDG)']+273, Tsource_new+273)\n", " # # print(new_COP) " ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "'numpy.float64' object is not callable", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32mC:\\Users\\SHAHLA~1\\AppData\\Local\\Temp/ipykernel_20628/3532083246.py\u001b[0m in \u001b[0;36m\u001b[1;34m\u001b[0m\n\u001b[0;32m 1\u001b[0m \u001b[1;32mfor\u001b[0m \u001b[0mi\u001b[0m \u001b[1;32min\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'charged_heat'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0menergy_to_storage\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mhp_capacity\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'MW (VDG)'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'discharged_heat'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'charged_heat'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 4\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'discharge_mass'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mdischarge_mass_flow\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'discharged_heat'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mCp\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTstorage\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m273\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mTref\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m273\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m 5\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'Tsource_new'\u001b[0m\u001b[1;33m]\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mTsource_calculation\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mTstorage\u001b[0m \u001b[1;33m+\u001b[0m \u001b[1;36m273\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'discharge_mass'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'Tsource (VDG)'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m+\u001b[0m\u001b[1;36m273\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdf\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mloc\u001b[0m\u001b[1;33m[\u001b[0m\u001b[0mi\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;34m'process_mass'\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n", "\u001b[1;31mTypeError\u001b[0m: 'numpy.float64' object is not callable" ] } ], "source": [ "for i in df.index:\n", " df.loc[i, 'charged_heat'] = energy_to_storage(hp_capacity, df.loc[i, 'MW (VDG)'])\n", " df.loc[i, 'discharged_heat'] = df.loc[i, 'charged_heat']\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)" ] }, { "cell_type": "code", "execution_count": 43, "metadata": {}, "outputs": [], "source": [ "# for i in df.index:\n", "# # df.loc[i, 'MWe'] = test_heatpump_and_waterstorage_system(df.loc[i, 'Tsink (VDG)']+273, df.loc[i, 'Tsource (VDG)']+273, df.loc[i, 'MW (VDG)'], 130)[0][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)[1]\n" ] }, { "cell_type": "code", "execution_count": 19, "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)ForeNegForePoshp_massprocess_massCOPcharge_mass
2018-11-01 00:00:0064.964783142.0031090.00000019.897433147.7318140.0000001094352.1014510.000000(5.386969459992516)52.101451
2018-11-01 00:15:0054.578777138.9604930.00000017.950905148.1389640.000000344653.2422410.000000(4.882106135030027)53.242241
2018-11-01 00:30:0065.166672139.8853290.00000033.500757147.5854260.000000454852.8902360.000000(5.5258665771869335)52.890236
2018-11-01 00:45:0065.358078139.7319010.00000042.203876147.5476120.000000943852.9483100.000000(5.549424302045392)52.948310
2018-11-01 01:00:0064.947536139.5778710.00000018.702675148.2603350.0000001022453.0067410.000000(5.528286493353138)53.006741
2018-11-01 01:15:0065.073433139.4233570.00000019.903652149.1868650.000000694053.0654850.000000(5.547058190973266)53.065485
2018-11-01 01:30:0047.711559140.3287300.00000019.574467147.8000160.000000784652.7231170.000000(4.462765657815752)52.723117
2018-11-01 01:45:0029.525829140.2989020.00000017.065464147.9068860.000000942352.7343260.000000(3.731041234226957)52.734326
2018-11-01 02:00:0065.715569139.99165010.13958749.339708149.6037413.333301972452.8500670.000017(5.560223997670469)52.850049
2018-11-01 02:15:0065.929909148.34232519.58510461.721718155.8879056.4553591054449.8749630.000032(5.112607341877656)49.874932
\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", "2018-11-01 01:15:00 65.073433 139.423357 0.000000 19.903652 \n", "2018-11-01 01:30:00 47.711559 140.328730 0.000000 19.574467 \n", "2018-11-01 01:45:00 29.525829 140.298902 0.000000 17.065464 \n", "2018-11-01 02:00:00 65.715569 139.991650 10.139587 49.339708 \n", "2018-11-01 02:15:00 65.929909 148.342325 19.585104 61.721718 \n", "\n", " Tsink (NDG) MW (NDG) ForeNeg ForePos hp_mass \\\n", "2018-11-01 00:00:00 147.731814 0.000000 109 43 52.101451 \n", "2018-11-01 00:15:00 148.138964 0.000000 34 46 53.242241 \n", "2018-11-01 00:30:00 147.585426 0.000000 45 48 52.890236 \n", "2018-11-01 00:45:00 147.547612 0.000000 94 38 52.948310 \n", "2018-11-01 01:00:00 148.260335 0.000000 102 24 53.006741 \n", "2018-11-01 01:15:00 149.186865 0.000000 69 40 53.065485 \n", "2018-11-01 01:30:00 147.800016 0.000000 78 46 52.723117 \n", "2018-11-01 01:45:00 147.906886 0.000000 94 23 52.734326 \n", "2018-11-01 02:00:00 149.603741 3.333301 97 24 52.850067 \n", "2018-11-01 02:15:00 155.887905 6.455359 105 44 49.874963 \n", "\n", " process_mass COP charge_mass \n", "2018-11-01 00:00:00 0.000000 (5.386969459992516) 52.101451 \n", "2018-11-01 00:15:00 0.000000 (4.882106135030027) 53.242241 \n", "2018-11-01 00:30:00 0.000000 (5.5258665771869335) 52.890236 \n", "2018-11-01 00:45:00 0.000000 (5.549424302045392) 52.948310 \n", "2018-11-01 01:00:00 0.000000 (5.528286493353138) 53.006741 \n", "2018-11-01 01:15:00 0.000000 (5.547058190973266) 53.065485 \n", "2018-11-01 01:30:00 0.000000 (4.462765657815752) 52.723117 \n", "2018-11-01 01:45:00 0.000000 (3.731041234226957) 52.734326 \n", "2018-11-01 02:00:00 0.000017 (5.560223997670469) 52.850049 \n", "2018-11-01 02:15:00 0.000032 (5.112607341877656) 49.874932 " ] }, "execution_count": 19, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[:10]" ] }, { "cell_type": "code", "execution_count": 22, "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": 23, "metadata": {}, "outputs": [], "source": [ "# import plotly.express as px\n", "\n", "# fig = px.line(df['new_cl'])\n", "# fig.show()" ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [], "source": [ "df.index = df.index.tz_localize('Europe/Amsterdam')" ] }, { "cell_type": "code", "execution_count": 26, "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": 37, "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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \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)hp_massprocess_massCOPcharge_mass...ForeNegForePoscharged_heatdischarged_heatnomination_MWhheatpump_cons_MWhimbalance_MWhday-ahead costsimbalance coststotal cost
2018-11-01 00:00:0064.964783142.0031090.00000019.897433147.7318140.00000052.1014510.000042(5.386969459992516)52.101409...NaNNaN30.99997530.999975NaN9NaNNaNNaNNaN
2018-11-01 00:15:0054.578777138.9604930.00000017.950905148.1389640.00000053.2422410.000043(4.882106135030027)53.242198...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 00:30:0065.166672139.8853290.00000033.500757147.5854260.00000052.8902360.000043(5.5258665771869335)52.890193...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 00:45:0065.358078139.7319010.00000042.203876147.5476120.00000052.9483100.000043(5.549424302045392)52.948267...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 01:00:0064.947536139.5778710.00000018.702675148.2603350.00000053.0067410.000043(5.528286493353138)53.006698...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 01:15:0065.073433139.4233570.00000019.903652149.1868650.00000053.0654850.000043(5.547058190973266)53.065442...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 01:30:0047.711559140.3287300.00000019.574467147.8000160.00000052.7231170.000043(4.462765657815752)52.723074...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 01:45:0029.525829140.2989020.00000017.065464147.9068860.00000052.7343260.000043(3.731041234226957)52.734283...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 02:00:0065.715569139.99165010.13958749.339708149.6037413.33330152.8500670.000043(5.560223997670469)52.850024...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
2018-11-01 02:15:0065.929909148.34232519.58510461.721718155.8879056.45535949.8749630.000040(5.112607341877656)49.874923...NaNNaNNaNNaNNaN9NaNNaNNaNNaN
\n", "

10 rows × 23 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", "2018-11-01 01:15:00 65.073433 139.423357 0.000000 19.903652 \n", "2018-11-01 01:30:00 47.711559 140.328730 0.000000 19.574467 \n", "2018-11-01 01:45:00 29.525829 140.298902 0.000000 17.065464 \n", "2018-11-01 02:00:00 65.715569 139.991650 10.139587 49.339708 \n", "2018-11-01 02:15:00 65.929909 148.342325 19.585104 61.721718 \n", "\n", " Tsink (NDG) MW (NDG) hp_mass process_mass \\\n", "2018-11-01 00:00:00 147.731814 0.000000 52.101451 0.000042 \n", "2018-11-01 00:15:00 148.138964 0.000000 53.242241 0.000043 \n", "2018-11-01 00:30:00 147.585426 0.000000 52.890236 0.000043 \n", "2018-11-01 00:45:00 147.547612 0.000000 52.948310 0.000043 \n", "2018-11-01 01:00:00 148.260335 0.000000 53.006741 0.000043 \n", "2018-11-01 01:15:00 149.186865 0.000000 53.065485 0.000043 \n", "2018-11-01 01:30:00 147.800016 0.000000 52.723117 0.000043 \n", "2018-11-01 01:45:00 147.906886 0.000000 52.734326 0.000043 \n", "2018-11-01 02:00:00 149.603741 3.333301 52.850067 0.000043 \n", "2018-11-01 02:15:00 155.887905 6.455359 49.874963 0.000040 \n", "\n", " COP charge_mass ... ForeNeg ForePos \\\n", "2018-11-01 00:00:00 (5.386969459992516) 52.101409 ... NaN NaN \n", "2018-11-01 00:15:00 (4.882106135030027) 53.242198 ... NaN NaN \n", "2018-11-01 00:30:00 (5.5258665771869335) 52.890193 ... NaN NaN \n", "2018-11-01 00:45:00 (5.549424302045392) 52.948267 ... NaN NaN \n", "2018-11-01 01:00:00 (5.528286493353138) 53.006698 ... NaN NaN \n", "2018-11-01 01:15:00 (5.547058190973266) 53.065442 ... NaN NaN \n", "2018-11-01 01:30:00 (4.462765657815752) 52.723074 ... NaN NaN \n", "2018-11-01 01:45:00 (3.731041234226957) 52.734283 ... NaN NaN \n", "2018-11-01 02:00:00 (5.560223997670469) 52.850024 ... NaN NaN \n", "2018-11-01 02:15:00 (5.112607341877656) 49.874923 ... NaN NaN \n", "\n", " charged_heat discharged_heat nomination_MWh \\\n", "2018-11-01 00:00:00 30.999975 30.999975 NaN \n", "2018-11-01 00:15:00 NaN NaN NaN \n", "2018-11-01 00:30:00 NaN NaN NaN \n", "2018-11-01 00:45:00 NaN NaN NaN \n", "2018-11-01 01:00:00 NaN NaN NaN \n", "2018-11-01 01:15:00 NaN NaN NaN \n", "2018-11-01 01:30:00 NaN NaN NaN \n", "2018-11-01 01:45:00 NaN NaN NaN \n", "2018-11-01 02:00:00 NaN NaN NaN \n", "2018-11-01 02:15:00 NaN NaN NaN \n", "\n", " heatpump_cons_MWh imbalance_MWh day-ahead costs \\\n", "2018-11-01 00:00:00 9 NaN NaN \n", "2018-11-01 00:15:00 9 NaN NaN \n", "2018-11-01 00:30:00 9 NaN NaN \n", "2018-11-01 00:45:00 9 NaN NaN \n", "2018-11-01 01:00:00 9 NaN NaN \n", "2018-11-01 01:15:00 9 NaN NaN \n", "2018-11-01 01:30:00 9 NaN NaN \n", "2018-11-01 01:45:00 9 NaN NaN \n", "2018-11-01 02:00:00 9 NaN NaN \n", "2018-11-01 02:15:00 9 NaN NaN \n", "\n", " imbalance costs total cost \n", "2018-11-01 00:00:00 NaN NaN \n", "2018-11-01 00:15:00 NaN NaN \n", "2018-11-01 00:30:00 NaN NaN \n", "2018-11-01 00:45:00 NaN NaN \n", "2018-11-01 01:00:00 NaN NaN \n", "2018-11-01 01:15:00 NaN NaN \n", "2018-11-01 01:30:00 NaN NaN \n", "2018-11-01 01:45:00 NaN NaN \n", "2018-11-01 02:00:00 NaN NaN \n", "2018-11-01 02:15:00 NaN NaN \n", "\n", "[10 rows x 23 columns]" ] }, "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df[:10]" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "raw", "metadata": {}, "source": [] } ], "metadata": { "interpreter": { "hash": "7f2ef37d4cd98e77829d8e11e50cd33d70bb304d4b7429ca9cbfd34f7e6ffe13" }, "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.12" } }, "nbformat": 4, "nbformat_minor": 4 }