You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mooi-Kickstart/.ipynb_checkpoints/simulation_test (2)-checkpo...

2176 lines
62 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{
"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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Tsource (VDG)</th>\n",
" <th>Tsink (VDG)</th>\n",
" <th>MW (VDG)</th>\n",
" <th>Tsource (NDG)</th>\n",
" <th>Tsink (NDG)</th>\n",
" <th>MW (NDG)</th>\n",
" <th>Unnamed: 7</th>\n",
" <th>Unnamed: 8</th>\n",
" <th>Unnamed: 9</th>\n",
" <th>Unnamed: 10</th>\n",
" <th>Unnamed: 11</th>\n",
" <th>Unnamed: 12</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2018-11-01 00:00:00</th>\n",
" <td>64.986977</td>\n",
" <td>143.358798</td>\n",
" <td>0.000000</td>\n",
" <td>20.514811</td>\n",
" <td>147.621126</td>\n",
" <td>0.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:10:00</th>\n",
" <td>64.942589</td>\n",
" <td>140.647419</td>\n",
" <td>0.000000</td>\n",
" <td>19.280056</td>\n",
" <td>147.842503</td>\n",
" <td>0.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:20:00</th>\n",
" <td>54.578777</td>\n",
" <td>138.960493</td>\n",
" <td>0.000000</td>\n",
" <td>17.950905</td>\n",
" <td>148.138964</td>\n",
" <td>0.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:30:00</th>\n",
" <td>65.195641</td>\n",
" <td>139.936392</td>\n",
" <td>0.000000</td>\n",
" <td>23.053127</td>\n",
" <td>147.864660</td>\n",
" <td>0.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:40:00</th>\n",
" <td>65.137703</td>\n",
" <td>139.834265</td>\n",
" <td>0.000000</td>\n",
" <td>43.948387</td>\n",
" <td>147.306191</td>\n",
" <td>0.000000</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 15:50:00</th>\n",
" <td>64.977669</td>\n",
" <td>157.649509</td>\n",
" <td>20.631462</td>\n",
" <td>64.929398</td>\n",
" <td>166.147289</td>\n",
" <td>6.785675</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:00:00</th>\n",
" <td>64.951965</td>\n",
" <td>157.755094</td>\n",
" <td>20.621554</td>\n",
" <td>64.830673</td>\n",
" <td>165.059628</td>\n",
" <td>6.795409</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:10:00</th>\n",
" <td>64.940338</td>\n",
" <td>157.860450</td>\n",
" <td>20.594887</td>\n",
" <td>64.749290</td>\n",
" <td>164.350482</td>\n",
" <td>6.795437</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:20:00</th>\n",
" <td>64.940338</td>\n",
" <td>157.965580</td>\n",
" <td>20.589894</td>\n",
" <td>64.489296</td>\n",
" <td>163.434915</td>\n",
" <td>6.804813</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:30:00</th>\n",
" <td>64.940338</td>\n",
" <td>158.070484</td>\n",
" <td>20.799079</td>\n",
" <td>64.245148</td>\n",
" <td>163.312629</td>\n",
" <td>6.876395</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>100 rows × 12 columns</p>\n",
"</div>"
],
"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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Tsource (VDG)</th>\n",
" <th>Tsink (VDG)</th>\n",
" <th>MW (VDG)</th>\n",
" <th>Tsource (NDG)</th>\n",
" <th>Tsink (NDG)</th>\n",
" <th>MW (NDG)</th>\n",
" <th>Unnamed: 7</th>\n",
" <th>Unnamed: 8</th>\n",
" <th>Unnamed: 9</th>\n",
" <th>Unnamed: 10</th>\n",
" <th>Unnamed: 11</th>\n",
" <th>Unnamed: 12</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2018-11-01 00:00:00</th>\n",
" <td>64.986977</td>\n",
" <td>143.358798</td>\n",
" <td>0.0</td>\n",
" <td>20.514811</td>\n",
" <td>147.621126</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:10:00</th>\n",
" <td>64.942589</td>\n",
" <td>140.647419</td>\n",
" <td>0.0</td>\n",
" <td>19.280056</td>\n",
" <td>147.842503</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:20:00</th>\n",
" <td>54.578777</td>\n",
" <td>138.960493</td>\n",
" <td>0.0</td>\n",
" <td>17.950905</td>\n",
" <td>148.138964</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:30:00</th>\n",
" <td>65.195641</td>\n",
" <td>139.936392</td>\n",
" <td>0.0</td>\n",
" <td>23.053127</td>\n",
" <td>147.864660</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:40:00</th>\n",
" <td>65.137703</td>\n",
" <td>139.834265</td>\n",
" <td>0.0</td>\n",
" <td>43.948387</td>\n",
" <td>147.306191</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:50:00</th>\n",
" <td>65.358078</td>\n",
" <td>139.731901</td>\n",
" <td>0.0</td>\n",
" <td>42.203876</td>\n",
" <td>147.547612</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:00:00</th>\n",
" <td>65.084549</td>\n",
" <td>139.629295</td>\n",
" <td>0.0</td>\n",
" <td>18.354761</td>\n",
" <td>148.337477</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:10:00</th>\n",
" <td>64.810524</td>\n",
" <td>139.526447</td>\n",
" <td>0.0</td>\n",
" <td>19.050589</td>\n",
" <td>148.183192</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:20:00</th>\n",
" <td>65.073433</td>\n",
" <td>139.423357</td>\n",
" <td>0.0</td>\n",
" <td>19.903652</td>\n",
" <td>149.186865</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:30:00</th>\n",
" <td>65.007141</td>\n",
" <td>139.320026</td>\n",
" <td>0.0</td>\n",
" <td>21.213211</td>\n",
" <td>147.764356</td>\n",
" <td>0.0</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" <td>NaN</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Tsource (VDG)</th>\n",
" <th>Tsink (VDG)</th>\n",
" <th>MW (VDG)</th>\n",
" <th>Tsource (NDG)</th>\n",
" <th>Tsink (NDG)</th>\n",
" <th>MW (NDG)</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2018-11-01 00:00:00</th>\n",
" <td>64.964783</td>\n",
" <td>142.003109</td>\n",
" <td>0.0</td>\n",
" <td>19.897433</td>\n",
" <td>147.731814</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:15:00</th>\n",
" <td>54.578777</td>\n",
" <td>138.960493</td>\n",
" <td>0.0</td>\n",
" <td>17.950905</td>\n",
" <td>148.138964</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:30:00</th>\n",
" <td>65.166672</td>\n",
" <td>139.885329</td>\n",
" <td>0.0</td>\n",
" <td>33.500757</td>\n",
" <td>147.585426</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:45:00</th>\n",
" <td>65.358078</td>\n",
" <td>139.731901</td>\n",
" <td>0.0</td>\n",
" <td>42.203876</td>\n",
" <td>147.547612</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:00:00</th>\n",
" <td>64.947536</td>\n",
" <td>139.577871</td>\n",
" <td>0.0</td>\n",
" <td>18.702675</td>\n",
" <td>148.260335</td>\n",
" <td>0.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"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': <function __main__.cop_curve(Tsink, Tsource)>}"
]
},
"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": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Tsource (VDG)</th>\n",
" <th>Tsink (VDG)</th>\n",
" <th>MW (VDG)</th>\n",
" <th>Tsource (NDG)</th>\n",
" <th>Tsink (NDG)</th>\n",
" <th>MW (NDG)</th>\n",
" <th>hpload</th>\n",
" <th>new_cl</th>\n",
" <th>storage_level</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>2018-11-01 00:00:00</th>\n",
" <td>64.964783</td>\n",
" <td>142.003109</td>\n",
" <td>0.000000</td>\n",
" <td>19.897433</td>\n",
" <td>147.731814</td>\n",
" <td>0.000000</td>\n",
" <td>40.0</td>\n",
" <td>33.000000</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:15:00</th>\n",
" <td>54.578777</td>\n",
" <td>138.960493</td>\n",
" <td>0.000000</td>\n",
" <td>17.950905</td>\n",
" <td>148.138964</td>\n",
" <td>0.000000</td>\n",
" <td>40.0</td>\n",
" <td>33.000000</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:30:00</th>\n",
" <td>65.166672</td>\n",
" <td>139.885329</td>\n",
" <td>0.000000</td>\n",
" <td>33.500757</td>\n",
" <td>147.585426</td>\n",
" <td>0.000000</td>\n",
" <td>40.0</td>\n",
" <td>33.000000</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 00:45:00</th>\n",
" <td>65.358078</td>\n",
" <td>139.731901</td>\n",
" <td>0.000000</td>\n",
" <td>42.203876</td>\n",
" <td>147.547612</td>\n",
" <td>0.000000</td>\n",
" <td>40.0</td>\n",
" <td>33.000000</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 01:00:00</th>\n",
" <td>64.947536</td>\n",
" <td>139.577871</td>\n",
" <td>0.000000</td>\n",
" <td>18.702675</td>\n",
" <td>148.260335</td>\n",
" <td>0.000000</td>\n",
" <td>40.0</td>\n",
" <td>33.000000</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 15:30:00</th>\n",
" <td>65.016212</td>\n",
" <td>157.229508</td>\n",
" <td>20.716926</td>\n",
" <td>64.996845</td>\n",
" <td>167.135901</td>\n",
" <td>6.798455</td>\n",
" <td>40.0</td>\n",
" <td>27.820769</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 15:45:00</th>\n",
" <td>64.977669</td>\n",
" <td>157.649509</td>\n",
" <td>20.631462</td>\n",
" <td>64.929398</td>\n",
" <td>166.147289</td>\n",
" <td>6.785675</td>\n",
" <td>40.0</td>\n",
" <td>27.842134</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:00:00</th>\n",
" <td>64.946152</td>\n",
" <td>157.807772</td>\n",
" <td>20.608221</td>\n",
" <td>64.789982</td>\n",
" <td>164.705055</td>\n",
" <td>6.795423</td>\n",
" <td>40.0</td>\n",
" <td>27.847945</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:15:00</th>\n",
" <td>64.940338</td>\n",
" <td>157.965580</td>\n",
" <td>20.589894</td>\n",
" <td>64.489296</td>\n",
" <td>163.434915</td>\n",
" <td>6.804813</td>\n",
" <td>40.0</td>\n",
" <td>27.852526</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2018-11-01 16:30:00</th>\n",
" <td>64.940338</td>\n",
" <td>158.070484</td>\n",
" <td>20.799079</td>\n",
" <td>64.245148</td>\n",
" <td>163.312629</td>\n",
" <td>6.876395</td>\n",
" <td>40.0</td>\n",
" <td>27.800230</td>\n",
" <td>23.0</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>67 rows × 9 columns</p>\n",
"</div>"
],
"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<br>index=%{x}<br>value=%{y}<extra></extra>",
"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
}