From ec9fb6a183746c086c9da145a41c942fd08ff026 Mon Sep 17 00:00:00 2001 From: Edwin Lee Date: Fri, 26 Apr 2024 10:22:45 -0500 Subject: [PATCH] Checkout prev versions of the notebooks that got modified somehow --- .../scripts/Pareto_Investigations.ipynb | 280 +++++++++--------- .../MFRTRT/Investigate_Aggregation.ipynb | 136 ++++----- validation/MFRTRT/MFRTRT_Validation.ipynb | 136 ++++----- validation/MFRTRT_STS/STS_Flow_Testing.ipynb | 248 ++++++++-------- validation/Pipe/plot_pipe_temps.ipynb | 64 ++-- .../compare_radial_g-vals.ipynb | 48 +-- validation/SwedishHP/Neighbor_GHEs.ipynb | 88 +++--- .../SwedishHP/Process_Stats_Start_0.ipynb | 120 ++++---- .../SwedishHP/Process_Stats_Start_5.ipynb | 100 +++---- 9 files changed, 610 insertions(+), 610 deletions(-) diff --git a/studies/aggregation/scripts/Pareto_Investigations.ipynb b/studies/aggregation/scripts/Pareto_Investigations.ipynb index cd9b2457..391b3f29 100644 --- a/studies/aggregation/scripts/Pareto_Investigations.ipynb +++ b/studies/aggregation/scripts/Pareto_Investigations.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "\n", @@ -16,13 +17,13 @@ "\n", "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [15, 9]\n", @@ -30,72 +31,72 @@ "\n", "pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "dynamic_path = norm(join(cwd, '../dynamic/runs/dynamic_stats.csv'))\n", "static_path = norm(join(cwd, '../static/runs/static_stats.csv'))\n", "mlaa_path = norm(join(cwd, '../MLAA-Bernier/runs/MLAA_stats.csv'))\n", "liu_path = norm(join(cwd, '../Hierarchical-Liu/runs/Hierarchical_stats.csv'))\n", "cenk_path = norm(join(cwd, '../Yavuzturk/runs/Yavuzturk_stats.csv'))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d = pd.read_csv(dynamic_path, index_col=[0])\n", "df_s = pd.read_csv(static_path, index_col=[0])\n", "df_m = pd.read_csv(mlaa_path, index_col=[0])\n", "df_l = pd.read_csv(liu_path, index_col=[0])\n", "df_c = pd.read_csv(cenk_path, index_col=[0])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d.head(2)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def find_claesson(load, year):\n", " _df = df_d.loc[(df_d['load'] == load) & (df_d['sim time'] == year) & (df_d['start width'] == 5) & (df_d['end width'] == 5) & (df_d['exp_rate'] == 2)]\n", " x = _df['rmse'].values\n", " y = _df['run time fraction'].values\n", " return float(x), float(y)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_all_methods_runtimefrac_vs_rmse(dfs, names, load, year):\n", " fig = plt.figure(figsize=(7, 5), dpi=200)\n", @@ -119,8 +120,7 @@ " plt.grid(True)\n", "# plt.savefig('{}_{}.pdf'.format(load, year), bbox_inches='tight')\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -128,90 +128,91 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'balanced',\n", " 1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'imbalanced',\n", " 1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'balanced',\n", " 5)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'imbalanced',\n", " 5)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'balanced',\n", " 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_all_methods_runtimefrac_vs_rmse([df_d, df_s, df_m, df_l, df_c], \n", " ['Dynamic', 'Static', 'Bernier', 'Liu', 'Yavuzturk'],\n", " 'imbalanced',\n", " 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def define_pareto(df_in):\n", " df = pd.DataFrame.from_records(pareto.eps_sort([list(df_in.itertuples(False))], [4, 5]), columns=list(df_in.columns.values))\n", " df.sort_values(by=['rmse'], inplace=True)\n", " return df" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_pareto_with_data(df, load, year, data_label, ymax=None, ymin=None):\n", " mask = (df['sim time'] == year) & (df['load'] == load)\n", @@ -240,53 +241,52 @@ " plt.grid(True)\n", " plt.savefig('{}_{}_pareto.pdf'.format(load, year), bbox_inches='tight')\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'balanced', 1, 'Dynamic', ymax = 0.035, ymin=0.023)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'imbalanced', 1, 'Dynamic', ymax=0.035, ymin=0.023)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'balanced', 5, 'Dynamic', ymax=0.013, ymin=0.005)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'imbalanced', 5, 'Dynamic', ymax=0.013, ymin=0.005)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'balanced', 10, 'Dynamic', ymax=0.008, ymin=0.003)" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -294,24 +294,25 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "plot_pareto_with_data(df_d, 'imbalanced', 10, 'Dynamic', ymax=0.008, ymin=0.003)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d.head(1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def get_all_paretos(df, loads, years):\n", " \n", @@ -326,31 +327,31 @@ " df_ret = pd.concat([df_ret, df_pareto])\n", " \n", " return df_ret" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_all_pareto = get_all_paretos(df_d, ['balanced', 'imbalanced'], [1, 5, 10])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_all_pareto.head(1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_all_pareto[['depth', \n", " 'end width', \n", @@ -371,22 +372,22 @@ " 'sample count', \n", " 'sim time', \n", " 'start width']].apply(pd.to_numeric)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_all_pareto.hist()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def make_hist(series, label, save_name):\n", " \n", @@ -425,40 +426,40 @@ " \n", " fig = ax[0].get_figure()\n", " fig.savefig(save_name, bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "make_hist('rmse', 'RMSE MFT [C]', 'hist_rmse.pdf')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "make_hist('start width', '$N_{b,1}$', 'hist_num_first_level.pdf')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "make_hist('end width', '$N_{b,n}$', 'hist_num_last_level.pdf')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def make_scatter_with_color_bar(df, color_name, color_label, title, ymax=None, ymin=None, save_name=None):\n", "\n", @@ -488,103 +489,103 @@ " plt.savefig('{}.pdf'.format(save_name), bbox_inches='tight')\n", " \n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d['sw-ew'] = df_d['start width'] - df_d['end width']" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 1\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 1\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 5\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 5\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 10\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 10\n", "mask = (df_d['load'] == load) & (df_d['sim time'] == year)\n", "make_scatter_with_color_bar(df_d.loc[mask], 'exp_rate', 'Expansion Rate', '{} {}'.format(load.title(), year), save_name='{}_{}_exp_rate'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d.head(2)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def make_scatter_with_color_bar_and_markers(df, color_name, color_label, marker_data, marker_names, title, ymax=None, ymin=None, save_name=None):\n", "\n", @@ -618,13 +619,13 @@ " plt.savefig('{}.pdf'.format(save_name), bbox_inches='tight')\n", " \n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 1\n", @@ -633,13 +634,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 1\n", @@ -648,13 +649,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 5\n", @@ -663,13 +664,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 5\n", @@ -678,13 +679,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 5\n", @@ -693,13 +694,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 10\n", @@ -708,13 +709,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 10\n", @@ -723,13 +724,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b,1}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_start_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 1\n", @@ -738,13 +739,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 1\n", @@ -753,13 +754,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 5\n", @@ -768,13 +769,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 5\n", @@ -783,13 +784,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 10\n", @@ -798,13 +799,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 10\n", @@ -813,8 +814,7 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'start width', '$N_{b}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_uniform_start_width_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -822,6 +822,7 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 1\n", @@ -830,13 +831,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 1\n", @@ -845,13 +846,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 5\n", @@ -860,13 +861,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 5\n", @@ -875,13 +876,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'balanced'\n", "year = 10\n", @@ -890,13 +891,13 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load = 'imbalanced'\n", "year = 10\n", @@ -905,8 +906,7 @@ "mask_2 = (df_d['exp_rate'] == 1.25) | (df_d['exp_rate'] == 1.50) | (df_d['exp_rate'] == 1.62) | (df_d['exp_rate'] == 1.75)\n", "mask = mask_1 & mask_2\n", "make_scatter_with_color_bar(df_d.loc[mask], 'end width', '$N_{b,n}$', '{} {}'.format(load.title(), year), save_name='{}_{}_125-to-175_exp_rate_end_width'.format(load, year))" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -914,6 +914,7 @@ "metadata": { "scrolled": true }, + "outputs": [], "source": [ "make_fig(pareto_i1, exp_rates, 'exp_rate', '1-year Imbalanced')\n", "make_fig(pareto_i2, exp_rates, 'exp_rate', '2-year Imbalanced')\n", @@ -921,13 +922,13 @@ "make_fig(pareto_i4, exp_rates, 'exp_rate', '4-year Imbalanced')\n", "make_fig(pareto_i5, exp_rates, 'exp_rate', '5-year Imbalanced')\n", "make_fig(pareto_i6, exp_rates, 'exp_rate', '6-year Imbalanced')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def make_fig_with_annotation(df_in, mask_series, mask_col_name, annotate_col_name, title=None):\n", " fig = plt.figure()\n", @@ -950,31 +951,31 @@ " \n", " plt.legend()\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "exp_rate_mask = df['exp_rate'] == 1.75" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "start_widths = range(1, 6)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "make_fig_with_annotation(df.loc[m_b1 & exp_rate_mask], start_widths, 'start width', 'end width', '1-year Balanced')\n", "make_fig_with_annotation(df.loc[m_b2 & exp_rate_mask], start_widths, 'start width', 'end width', '2-year Balanced')\n", @@ -982,8 +983,7 @@ "make_fig_with_annotation(df.loc[m_b4 & exp_rate_mask], start_widths, 'start width', 'end width', '4-year Balanced')\n", "make_fig_with_annotation(df.loc[m_b5 & exp_rate_mask], start_widths, 'start width', 'end width', '5-year Balanced')\n", "make_fig_with_annotation(df.loc[m_b6 & exp_rate_mask], start_widths, 'start width', 'end width', '6-year Balanced')" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -991,6 +991,7 @@ "metadata": { "scrolled": true }, + "outputs": [], "source": [ "make_fig_with_annotation(df.loc[m_i1 & exp_rate_mask], start_widths, 'start width', 'end width', '1-year Imbalanced')\n", "make_fig_with_annotation(df.loc[m_i2 & exp_rate_mask], start_widths, 'start width', 'end width', '2-year Imbalanced')\n", @@ -998,13 +999,13 @@ "make_fig_with_annotation(df.loc[m_i4 & exp_rate_mask], start_widths, 'start width', 'end width', '4-year Imbalanced')\n", "make_fig_with_annotation(df.loc[m_i5 & exp_rate_mask], start_widths, 'start width', 'end width', '5-year Imbalanced')\n", "make_fig_with_annotation(df.loc[m_i6 & exp_rate_mask], start_widths, 'start width', 'end width', '6-year Imbalanced')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def make_some_plot(*args):\n", " fig = plt.figure()\n", @@ -1022,24 +1023,23 @@ " plt.grid()\n", " plt.legend()\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "make_some_plot([a, b, c])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/MFRTRT/Investigate_Aggregation.ipynb b/validation/MFRTRT/Investigate_Aggregation.ipynb index df7c42b6..1147ed48 100644 --- a/validation/MFRTRT/Investigate_Aggregation.ipynb +++ b/validation/MFRTRT/Investigate_Aggregation.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import io\n", "import os\n", @@ -24,13 +25,13 @@ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = [15, 9]\n", @@ -38,13 +39,13 @@ "\n", "pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def add_delimiters(fpath, delimiter=','):\n", " \n", @@ -61,13 +62,13 @@ " s_delimiters = delimiter * max_num_delimiters + '\\n'\n", " \n", " return io.StringIO(s_delimiters + s_data)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def load_data(d_files, drop_col=False):\n", " dfs = []\n", @@ -84,13 +85,13 @@ " d['data'] = key\n", " dfs.append(d)\n", " return pd.concat(dfs).reset_index().set_index(['time stamp', 'data'])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "f_dyna = {'Load': 'loads_dynamic.csv',\n", " 'g-val': 'g_dynamic.csv',\n", @@ -105,13 +106,13 @@ " df_dynamic.loc[i, 'Resist'][0] = rb.loc[i]\n", " \n", "df_dynamic.loc[120]" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "f_stat = {'Load': 'loads_static.csv',\n", " 'g-val': 'g_static.csv',\n", @@ -127,8 +128,7 @@ " df_static.loc[i, 'Resist'][0] = rb.loc[i]\n", " \n", "df_static.loc[240]" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -136,6 +136,7 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "f_none = {'Load': 'loads_none.csv',\n", " 'g-val': 'g_none.csv',\n", @@ -151,13 +152,13 @@ " df_none.loc[i, 'Resist'][0] = rb.loc[i]\n", " \n", "df_none.loc[240]" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "t_g = 16.1\n", "depth = 76.2\n", @@ -167,13 +168,13 @@ "c_0 = 1 / (2 * np.pi * soil_cond)\n", "soil_diffusivity = soil_cond / (soil_dens * soil_cp)\n", "ts = depth ** 2 / (9 * soil_diffusivity)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def calc_history_temp_rise(df, timestep):\n", "\n", @@ -224,22 +225,22 @@ " temp_rise_sum += get_load(energy, width) * g * c_0\n", " \n", " return temp_rise_sum" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "calc_history_temp_rise(df_none, 120)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def calc_MFT(df, timestep):\n", " energy = df.loc[timestep, 'Load'][0]\n", @@ -250,32 +251,32 @@ " arr = [t_g, calc_history_temp_rise(df, timestep), load * r_b]\n", " arr.append(sum(arr))\n", " return arr" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "calc_MFT(df_none, 120)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "timestamps = list(df_none.index.levels[0])\n", "# timestamps" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def calc_all_MFT(df):\n", " lst = []\n", @@ -283,50 +284,50 @@ " lst.append(calc_MFT(df, time))\n", " \n", " return lst" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_d = pd.DataFrame(data=calc_all_MFT(df_dynamic), index=timestamps, columns=['Tg', 'Temp Hist', 'Load Rb', 'MFT'])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_s = pd.DataFrame(data=calc_all_MFT(df_static), index=timestamps, columns=['Tg', 'Temp Hist', 'Load Rb', 'MFT'])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_n = pd.DataFrame(data=calc_all_MFT(df_none), index=timestamps, columns=['Tg', 'Temp Hist', 'Load Rb', 'MFT'])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_exp_raw = pd.read_csv('MFRTRT_loads.csv', parse_dates=True, index_col='Date/Time')\n", "df_exp_raw = df_exp_raw.resample('2T').mean()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_exp = df_exp_raw.interpolate(method='linear')\n", "df_exp['Run Time'] = df_exp.index.to_series().diff().dt.total_seconds().cumsum()\n", @@ -335,13 +336,13 @@ "df_exp.set_index('Run Time', drop=True, inplace=True)\n", "df_exp['MFT'] = df_exp[['Inlet 1 [C]', 'Outlet 1 [C]']].mean(axis=1)\n", "df_exp.head(2)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "start_pt = 0\n", "end_pt = 8000\n", @@ -358,13 +359,13 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure()\n", "ax = fig.add_subplot(1, 1, 1)\n", @@ -375,13 +376,13 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure()\n", "ax = fig.add_subplot(1, 1, 1)\n", @@ -392,23 +393,23 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "g_data = np.loadtxt('MFRTRT_g_functions.csv', delimiter=',')\n", "g_func = interp1d(g_data[:,0], g_data[:,1], fill_value='extrapolate')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def get_g_val(t, r_b):\n", " \n", @@ -420,13 +421,13 @@ " return -r_b * 2 * np.pi * soil_cond\n", " else:\n", " return g" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_g_values(df, timestep):\n", " \n", @@ -463,17 +464,16 @@ " ret_df = pd.DataFrame(data={'times': times, 'lntts': lntts, 'Actual': act, 'Simulation': sim})\n", " ret_df.set_index('times', inplace=True)\n", " return ret_df" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_none.index.levels" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -481,10 +481,10 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "stat_plot_data = plot_g_values('static', 36000)" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -492,29 +492,29 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "dyna_plot_data = plot_g_values('dynamic', 36000)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "none_plot_data = plot_g_values('none', 36000)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from ipywidgets import interactive\n", "import ipywidgets as widgets" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -522,18 +522,19 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "interactive_plot = interactive(plot_g_values, df='static', timestep=(120, 36000, 120))\n", "output = interactive_plot.children[-1]\n", "output.layout.height = '600px'\n", "interactive_plot" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_delta_g(timestep):\n", " \n", @@ -556,24 +557,23 @@ " \n", " plt.legend()\n", " plt.plot()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_delta_g(10800)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/MFRTRT/MFRTRT_Validation.ipynb b/validation/MFRTRT/MFRTRT_Validation.ipynb index aeb5b4d8..91195847 100644 --- a/validation/MFRTRT/MFRTRT_Validation.ipynb +++ b/validation/MFRTRT/MFRTRT_Validation.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", @@ -24,23 +25,23 @@ "sys.path.append(norm(join(cwd, '..', '..', '..', 'standalone')))\n", "\n", "from standalone.run_g_function import RunGFunctions" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('ggplot')\n", "plt.rcParams['figure.figsize'] = [15, 9]\n", @@ -48,46 +49,45 @@ "\n", "pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df = pd.read_csv('MFRTRT_loads.csv', parse_dates=True, index_col='Date/Time')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df.head(3)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "timestep = 2 # minutes\n", "df = df.resample('{}T'.format(timestep)).mean()\n", "df = df.interpolate(method='linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df.head(3)" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -95,10 +95,10 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "df.plot(y=['mdot [kg/s]'])" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -106,19 +106,19 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "df.plot(y=['Meas. Total Power [W]'])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df.to_csv('in.csv', columns=['Meas. Total Power [W]', 'mdot [kg/s]'])" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -126,48 +126,49 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "df['Run Time'] = df.index.to_series().diff().dt.total_seconds().cumsum()\n", "df['Run Time'].iloc[0] = 0\n", "df['Run Time'].head(3)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df.set_index('Run Time', drop=True, inplace=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_file = join(cwd, 'MFRTRT_input.json')\n", "with open(in_file, 'r') as f:\n", " json_blob = f.read()\n", "in_json = json.loads(json_blob)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_json['simulation']['runtime'] = 192 * 3600\n", "in_json['simulation']['time-steps per hour'] = int(60 / timestep)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "load_file = in_json['load-profile']['external']['path'] \n", "in_json['load-profile']['external']['path'] = join(cwd, load_file)\n", @@ -177,13 +178,13 @@ "\n", "g_file = in_json['g-functions']['file']\n", "in_json['g-functions']['file'] = join(cwd, g_file)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_json['load-aggregation']['type'] = 'dynamic'\n", "\n", @@ -195,55 +196,54 @@ "\n", "with open(join(cwd, 'in_dynamic.json'), 'w') as f:\n", " f.write(json.dumps(in_json, sort_keys=True, indent=2))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_json['load-aggregation']['type'] = 'static'\n", "in_json['simulation']['output-path'] = join(cwd, 'out_static.csv')\n", "\n", "with open(join(cwd, 'in_static.json'), 'w') as f:\n", " f.write(json.dumps(in_json, sort_keys=True, indent=2))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_json['load-aggregation']['type'] = 'none'\n", "in_json['simulation']['output-path'] = join(cwd, 'out_none.csv')\n", "\n", "with open(join(cwd, 'in_none.json'), 'w') as f:\n", " f.write(json.dumps(in_json, sort_keys=True, indent=2))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "in_static = join(cwd, 'in_static.json')\n", "in_dynamic = join(cwd, 'in_dynamic.json')\n", "in_none = join(cwd, 'in_none.json')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def do_a_run(in_file):\n", " RunGFunctions(in_file).simulate()" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -251,6 +251,7 @@ "metadata": { "scrolled": true }, + "outputs": [], "source": [ "p1 = Thread(target=do_a_run, args=(in_static,))\n", "p2 = Thread(target=do_a_run, args=(in_dynamic,))\n", @@ -263,44 +264,43 @@ "p1.join()\n", "p2.join()\n", "p3.join()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_static = pd.read_csv(\"out_static.csv\", index_col='Simulation Time')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_dynamic = pd.read_csv(\"out_dynamic.csv\", index_col='Simulation Time')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_none = pd.read_csv(\"out_none.csv\", index_col='Simulation Time')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_static.tail()" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -308,6 +308,7 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "start_pt = 0\n", "end_pt = 36000\n", @@ -335,26 +336,26 @@ "plt.legend()\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df_static['Flow Fraction [-]'].loc[start_pt : end_pt], label='Static')\n", "plt.plot(df_dynamic['Flow Fraction [-]'].loc[start_pt : end_pt], label='Dynamic')\n", "plt.plot(df_none['Flow Fraction [-]'].loc[start_pt : end_pt], label='None')\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df['Meas. Total Power [W]'].loc[start_pt : end_pt], label=\"Exp Data\", marker='x')\n", "plt.plot(df_static['GLHE Heat Transfer Rate [W]'].loc[start_pt : end_pt], label=\"Static\")\n", @@ -363,13 +364,13 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df_static['Load on GHE [W/m]'].loc[start_pt : end_pt], label='Static')\n", "plt.plot(df_dynamic['Load on GHE [W/m]'].loc[start_pt : end_pt], label='Dynamic') \n", @@ -377,22 +378,22 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df['MFT'] = df[['Inlet 1 [C]', 'Outlet 1 [C]']].mean(axis=1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df_static['Average Fluid Temp [C]'].loc[start_pt : end_pt], label=\"Static\")\n", "plt.plot(df_dynamic['Average Fluid Temp [C]'].loc[start_pt : end_pt], label=\"Dynamic\")\n", @@ -403,13 +404,13 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df_static[\"Local Borehole Resistance 'Rb' [K/(W/m)]\"].loc[start_pt : end_pt], label=\"Static\")\n", "plt.plot(df_dynamic[\"Local Borehole Resistance 'Rb' [K/(W/m)]\"].loc[start_pt : end_pt], label=\"Dynamic\")\n", @@ -417,13 +418,13 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(df_static[\"Soil Resistance 'Rs' [K/(W/m)]\"].loc[start_pt : end_pt], label=\"Static\")\n", "plt.plot(df_dynamic[\"Soil Resistance 'Rs' [K/(W/m)]\"].loc[start_pt : end_pt], label=\"Dynamic\")\n", @@ -431,15 +432,14 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/MFRTRT_STS/STS_Flow_Testing.ipynb b/validation/MFRTRT_STS/STS_Flow_Testing.ipynb index 5ad6bdda..607467cc 100644 --- a/validation/MFRTRT_STS/STS_Flow_Testing.ipynb +++ b/validation/MFRTRT_STS/STS_Flow_Testing.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", @@ -12,55 +13,55 @@ "\n", "import pandas as pd\n", "import numpy as np" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "sys.path.append(norm(join(cwd, '..', '..', '..', 'glhe')))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from standalone.plant_loop import PlantLoop\n", "import glhe" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import matplotlib.dates as mdates\n", "import matplotlib.colors as clrs\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [7, 5]\n", @@ -68,13 +69,13 @@ "\n", "# pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def sim(flow_rate, q):\n", "\n", @@ -129,40 +130,40 @@ " df['gb'] = df['gb'].fillna(0)\n", " \n", " return df, ts" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_02_02, ts = sim(0.2, 2)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_02_10, ts = sim(0.2, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_02_40, ts = sim(0.2, 40)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_resist(var, var_label, time):\n", " fig = plt.figure(dpi=200)\n", @@ -202,184 +203,184 @@ "\n", " plt.savefig('{}-vs-q-{}.PNG'.format(var, time), bbox_inches='tight')\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rb', 'R_b', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rb', 'R_b', 'log')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rg', 'R_g', 'log')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rg', 'R_g', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rp', 'R_p', 'log')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist('Rp', 'R_p', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_002_10, ts = sim(0.02, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_0025_10, ts = sim(0.025, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_003_10, ts = sim(0.03, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_0038_10, ts = sim(0.038, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_004_10, ts = sim(0.04, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_0045_10, ts = sim(0.045, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_005_10, ts = sim(0.05, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_01_10, ts = sim(0.1, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_015_10, ts = sim(0.15, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_03_10, ts = sim(0.3, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_04_10, ts = sim(0.4, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_045_10, ts = sim(0.45, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_05_10, ts = sim(0.5, 10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_resist_2(var, var_label, time):\n", " fig = plt.figure(dpi=200)\n", @@ -435,53 +436,52 @@ "\n", " plt.savefig('{}-vs-flow-Reynolds_{}.PNG'.format(var, time), bbox_inches='tight')\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist_2('Rb', 'R_b', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist_2('Rb', 'R_b', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist_2('Rg', 'R_g', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist_2('Rg', 'R_g', 'log')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_resist_2('Rp', 'R_p', 'linear')" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -489,15 +489,16 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "plot_resist_2('Rp', 'R_p', 'log')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -517,13 +518,13 @@ "plt.legend()\n", "plt.savefig('gb-vs-lntts.PNG', bbox_inches='tight')\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -548,8 +549,7 @@ "plt.legend()\n", "plt.savefig('T-ExFT_2hr.PNG', bbox_inches='tight')\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -557,6 +557,7 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -581,23 +582,23 @@ "plt.legend()\n", "plt.savefig('T-ExFT_24hr.PNG', bbox_inches='tight')\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from glhe.utilities.functions import resample_g_functions as re_g\n", "from glhe.utilities.functions import write_arrays_to_csv" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "lntts = df_002_10['lntts'].values\n", "lntts[0] = -17\n", @@ -615,48 +616,48 @@ "_, gb_04 = re_g(lntts, df_04_10['gb'].values)\n", "_, gb_045 = re_g(lntts, df_045_10['gb'].values)\n", "_, gb_05 = re_g(lntts, df_05_10['gb'].values)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "arr_low_interp = np.array([lntts_out, gb_002, gb_003, gb_004, gb_005])\n", "arr_low_no_interp = np.array([lntts_out, gb_002, gb_0025, gb_003, gb_0038, gb_0045, gb_005])\n", "\n", "arr_high_interp = np.array([lntts_out, gb_01, gb_03, gb_05])\n", "arr_high_no_interp = np.array([lntts_out, gb_01, gb_015, gb_03, gb_045, gb_05])" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "write_arrays_to_csv('gb_low_interp.csv', arr_low_interp)\n", "write_arrays_to_csv('gb_low_no_interp.csv', arr_low_no_interp)\n", "\n", "write_arrays_to_csv('gb_high_interp.csv', arr_high_interp)\n", "write_arrays_to_csv('gb_high_no_interp.csv', arr_high_no_interp)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_002_10.columns" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def tabulate_gb_data(time):\n", " dfs = [df_002_10, df_003_10, df_004_10, df_005_10, df_01_10, df_03_10, df_05_10]\n", @@ -686,22 +687,22 @@ " \n", " print(s_out)\n", " return np.array(arr).T" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "arr = tabulate_gb_data(86400)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[4])\n", @@ -711,13 +712,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-Tb.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[7])\n", @@ -727,13 +728,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-DeltaT.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[8])\n", @@ -743,13 +744,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-qRb.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[5])\n", @@ -759,13 +760,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-q.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[6])\n", @@ -775,13 +776,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-Rb.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[9], norm=clrs.LogNorm())\n", @@ -791,13 +792,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-Reynolds.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[10])\n", @@ -807,13 +808,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-qb.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[11])\n", @@ -823,13 +824,13 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-Ra.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[0], arr[2], c=arr[12])\n", @@ -839,33 +840,33 @@ "plt.ylabel(r'$g_b$')\n", "plt.grid()\n", "plt.savefig('gb-vs-flow-R12.PNG', bbox_inches='tight')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig, ax = plt.subplots(dpi=200)\n", "pts = ax.scatter(arr[5], arr[10])\n", "ax.plot([9.985, 10], [9.985, 10], c='k')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_05_10.iloc[-1]" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "dfs = [df_002_10, df_003_10, df_004_10, df_005_10, df_01_10, df_03_10, df_05_10]\n", "labels = [0.02, 0.03, 0.04, 0.05, 0.1, 0.3, 0.5]\n", @@ -885,13 +886,13 @@ "plt.ylabel(r'$q_f$ [W/m]')\n", "plt.savefig('qf_vs_qb_full.PNG', bbox_inches='tight')\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "dfs = [df_002_10, df_003_10, df_004_10, df_005_10, df_01_10, df_03_10, df_05_10]\n", "labels = [0.02, 0.03, 0.04, 0.05, 0.1, 0.3, 0.5]\n", @@ -913,13 +914,13 @@ "plt.ylim([9.98, 10])\n", "plt.savefig('qf_vs_qb_zoom.PNG', bbox_inches='tight')\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "dfs = [df_002_10, df_003_10, df_004_10, df_005_10, df_01_10, df_03_10, df_05_10]\n", "labels = [0.02, 0.03, 0.04, 0.05, 0.1, 0.3, 0.5]\n", @@ -940,15 +941,14 @@ "plt.xlim([9.8, 9.9])\n", "plt.ylim([17, 17.4])\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/Pipe/plot_pipe_temps.ipynb b/validation/Pipe/plot_pipe_temps.ipynb index 41c6d895..35629d03 100644 --- a/validation/Pipe/plot_pipe_temps.ipynb +++ b/validation/Pipe/plot_pipe_temps.ipynb @@ -4,58 +4,59 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", "\n", "import numpy as np" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "sys.path.insert(0, norm(join(cwd, '..', '..', '..', 'GLHE')))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from unit_tests.glhe.topology.test_pipe import TestPipe\n", "from glhe.interface.response import SimulationResponse" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [7, 5]\n", @@ -63,13 +64,13 @@ "\n", "# pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def check_response(m_dot, dt):\n", " init_temp = 20\n", @@ -90,13 +91,13 @@ " tau.append(t / t_tr)\n", " \n", " return tau, temps, re, t_tr" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_results(m_dot):\n", " fig = plt.figure(dpi=200)\n", @@ -118,62 +119,61 @@ " plt.grid()\n", " plt.savefig('Pipe_Re-{:0.0f}.PNG'.format(re), bbox_inches='tight')\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.01)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.03)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.05)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.25)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_results(0.5)" - ], - "outputs": [] + ] }, { "cell_type": "code", @@ -181,17 +181,17 @@ "metadata": { "scrolled": false }, + "outputs": [], "source": [ "plot_results(1.0)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/Radial_Numerical_BH/compare_radial_g-vals.ipynb b/validation/Radial_Numerical_BH/compare_radial_g-vals.ipynb index 7758d22f..e21628f1 100644 --- a/validation/Radial_Numerical_BH/compare_radial_g-vals.ipynb +++ b/validation/Radial_Numerical_BH/compare_radial_g-vals.ipynb @@ -4,6 +4,7 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", @@ -13,53 +14,53 @@ "\n", "# from io import StringIO\n", "# from scipy.interpolate import interp1d" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "# shortcuts\n", "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "sys.path.append(norm(join(cwd, '..', '..', 'tests')))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import tests" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [15, 9]\n", @@ -67,51 +68,51 @@ "\n", "pd.set_option('display.max_columns', None)\n", "# pd.set_option('display.max_rows', None)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df = pd.read_csv(\"GLHEPro_g-vals.csv\")" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "f_glhepro = interp1d(df['LNTTS (GLHEPro)'].dropna().values, df['g (GLHEPro)'].dropna().values)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "tst = tests.glhe.topology.test_radial_numerical_borehole.TestRadialNumericalBH().add_instance()\n", "lntts, g = tst.calc_sts_g_functions()\n", "f_sts = interp1d(lntts, g, fill_value='extrapolate')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "x = np.arange(-14.5, -9, 0.1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.plot(x, f_eplus(x), label='E+')\n", "plt.plot(x, f_glhepro(x), label='GLHEPro')\n", @@ -123,15 +124,14 @@ "plt.legend()\n", "plt.grid()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/SwedishHP/Neighbor_GHEs.ipynb b/validation/SwedishHP/Neighbor_GHEs.ipynb index 22f4a745..d7395328 100644 --- a/validation/SwedishHP/Neighbor_GHEs.ipynb +++ b/validation/SwedishHP/Neighbor_GHEs.ipynb @@ -4,70 +4,71 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", "\n", "import pandas as pd\n", "import numpy as np" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [15, 9]\n", "plt.rcParams['font.size'] = 12" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "sys.path.append(norm(join(cwd, '..', '..', '..', 'glhe')))" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "from standalone.plant_loop import PlantLoop\n", "import glhe" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def run_sim(years_to_sim, num_cross=None, years_to_delay_cross=None, dist_cross=None, testing=False):\n", "\n", @@ -113,49 +114,49 @@ " glhe.utilities.functions.write_json(f_in, d)\n", " \n", " PlantLoop(f_in).simulate()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "run_sim(20, testing=False)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "run_sim(20, num_cross=1, years_to_delay_cross=0, dist_cross=10)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "run_sim(20, num_cross=1, years_to_delay_cross=0, dist_cross=15)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "run_sim(20, num_cross=1, years_to_delay_cross=0, dist_cross=20)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def resample_data(df, freq):\n", " \n", @@ -183,42 +184,42 @@ " \n", " df_temp = pd.concat([df_sums, df_means], axis=1, sort=True)\n", " return df_temp.reindex(sorted(df_temp.columns), axis=1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_self = pd.read_csv('out_5-yr_self.csv', index_col=0, parse_dates=True)\n", "df_cross = pd.read_csv('out_5-yr_3-cross_start-2-yr.csv', index_col=0, parse_dates=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_self = resample_data(df_self, 'M')\n", "df_cross = resample_data(df_cross, 'M')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_self.columns" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure()\n", "\n", @@ -232,23 +233,23 @@ "\n", "plt.legend()\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_march_self = df_self.loc[df_self.index.month==3]\n", "df_march_cross = df_cross.loc[df_cross.index.month==3]" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure()\n", "\n", @@ -260,42 +261,41 @@ "ax.bar(x, df_march_cross['SwedishHP:SVENSKA VARMMEPUMPE:Electrical Usage for Water Heating [kWh]'])\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_march.shape" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_march_self['SwedishHP:SVENSKA VARMMEPUMPE:Source-side Heat Rate [kWh]']" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_march_cross['SwedishHP:SVENSKA VARMMEPUMPE:Source-side Heat Rate [kWh]']" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/SwedishHP/Process_Stats_Start_0.ipynb b/validation/SwedishHP/Process_Stats_Start_0.ipynb index c494c717..07c6b2fc 100644 --- a/validation/SwedishHP/Process_Stats_Start_0.ipynb +++ b/validation/SwedishHP/Process_Stats_Start_0.ipynb @@ -4,51 +4,52 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", "\n", "import pandas as pd\n", "import numpy as np" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [7, 5]\n", "plt.rcParams['font.size'] = 12" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def resample_data(df, freq):\n", " \n", @@ -77,13 +78,13 @@ " \n", " df_temp = pd.concat([df_sums, df_means], axis=1, sort=True)\n", " return df_temp.reindex(sorted(df_temp.columns), axis=1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def process_results(path):\n", " \n", @@ -130,37 +131,37 @@ " df_ann = resample_data(df_mo, 'A')\n", " \n", " return df, df_mo, df_ann" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_s, df_s_mo, df_s_ann = process_results('out_20-yr_self.csv')\n", "df_c1_0, df_c1_0_mo, df_c1_0_ann = process_results('out_20-yr_1-cross_10-m_start-0-yr.csv')\n", "df_c2_0, df_c2_0_mo, df_c2_0_ann = process_results('out_20-yr_1-cross_15-m_start-0-yr.csv')\n", "df_c3_0, df_c3_0_mo, df_c3_0_ann = process_results('out_20-yr_1-cross_20-m_start-0-yr.csv')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "# df_s_ann.to_csv('annual_data_none.csv')\n", "# df_c1_0_ann.to_csv('annual_data_10-m.csv')\n", "# df_c2_0_ann.to_csv('annual_data_15-m.csv')\n", "# df_c3_0_ann.to_csv('annual_data_20-m.csv')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_ann_data(col, xlabel, y1_label, y2_label, percent_change=False, hide_lines=False, save_name=False):\n", "\n", @@ -213,97 +214,97 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "# plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'Ave. HP Inlet Temp. [C]', r'$\\Delta$ T', save_name='HP-Inlet-Temp_Start-0-yr.PNG')\n", "plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'Ave. HP Inlet Temp. [C]', r'$\\Delta$ T')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "# plot_ann_data('COP [-]', 'Years', 'Ave. COP [-]', '% Change', percent_change=True, save_name='COP_Start-0-yr.PNG')\n", "plot_ann_data('COP [-]', 'Years', 'Ave. COP [-]', r'$\\Delta$', percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total HP Elec. [kWh]', 'Years', 'Tot. HP Elec. [kWh]', 'kWh Change', percent_change=True, save_name='HP-Elec_Start-0-yr.PNG')\n", "# plot_ann_data('Total HP Elec. [kWh]', 'Years', 'Tot. HP Elec. [kWh]', 'kWh', percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total Imm. Elec. [kWh]', 'Years', 'Tot. HTR Elec. [kWh]', 'kWh Change', percent_change=True, hide_lines=True, save_name='HTR_Elec_Start-0-yr.PNG')\n", "# plot_ann_data('Total Imm. Elec. [kWh]', 'Years', 'Tot. HTR Elec. [kWh]', 'kWh', percent_change=True, hide_lines=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total Elec. [kWh]', 'Years', 'Tot. Elec. [kWh]', 'kWh Change', percent_change=True, save_name='Tot_Elec_Start-0-yr.PNG')\n", "# plot_ann_data('Total Elec. [kWh]', 'Years', 'Tot. Elec. [kWh]', 'kWh', percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total HP Elec. [kWh]', 'Years', 'Tot. HP. Elec. [kWh]', '% Change', plot_right=True, percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Source-side Heat Rate [kWh]', 'Years', 'Src-Side Energy [kWh]', '% Change', plot_right=True, percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Load-side Heat Rate [kWh]', 'Years', 'Load-Side Energy [kWh]', '% Change', plot_right=True, percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_ann_data_src_side(col, xlabel, y1_label, y2_label, save_name=False):\n", "\n", @@ -338,67 +339,67 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data_src_side('SwedishHP:SVENSKA VARMMEPUMPE:Source-side Heat Rate [kWh]', 'Years', 'Tot. HP. Src-Side [kWh]', '% Change', save_name='HP-SRC-Side_Start-0-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data_src_side('SwedishHP:SVENSKA VARMMEPUMPE:Load-side Heat Rate [kWh]', 'Years', 'Tot. HP. Load-Side [kWh]', '% Change', save_name='HP-Load-Side_Start-0-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('GroundHeatExchangerLTS:SELF-GHE:BH Resist. [m-K/W]', 'Years', r'$R_b$ [m-K/W]', '% Change', percent_change=True, save_name='Rb_Start-0-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('GroundHeatExchangerLTS:SELF-GHE:Borehole Wall Temp. [C]', 'Years', 'BH Wall Temp. [C]', r'$\\Delta$ T', save_name='BH_Wall_Temp_Start-0-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_s_mo_ann_mean = df_s_mo.resample('A').mean()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_c1_0_mo_mean = df_c1_0_mo.resample('A').mean()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_montly_mean_data(col, xlabel, y1_label, save_name=False):\n", "\n", @@ -422,22 +423,22 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_montly_mean_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'HP Inlet Temp. [C]', save_name='Self_Houly_Monthly_Annual_Inlet_Temp.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -474,13 +475,13 @@ "plt.savefig('Feb_Temps_Loads_Self.PNG')\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -517,15 +518,14 @@ "plt.savefig('July_Temps_Loads_Self.PNG')\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": { diff --git a/validation/SwedishHP/Process_Stats_Start_5.ipynb b/validation/SwedishHP/Process_Stats_Start_5.ipynb index 91a17be6..1ef744ea 100644 --- a/validation/SwedishHP/Process_Stats_Start_5.ipynb +++ b/validation/SwedishHP/Process_Stats_Start_5.ipynb @@ -4,51 +4,52 @@ "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import os\n", "import sys\n", "\n", "import pandas as pd\n", "import numpy as np" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "cwd = os.getcwd()\n", "join = os.path.join\n", "norm = os.path.normpath" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "%matplotlib inline" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plt.style.use('seaborn-bright')\n", "plt.rcParams['figure.figsize'] = [7, 5]\n", "plt.rcParams['font.size'] = 12" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def resample_data(df, freq):\n", " \n", @@ -77,13 +78,13 @@ " \n", " df_temp = pd.concat([df_sums, df_means], axis=1, sort=True)\n", " return df_temp.reindex(sorted(df_temp.columns), axis=1)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def process_results(path):\n", " \n", @@ -130,25 +131,25 @@ " df_ann = resample_data(df_mo, 'A')\n", " \n", " return df, df_mo, df_ann" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_s, df_s_mo, df_s_ann = process_results('out_20-yr_self.csv')\n", "df_c1_0, df_c1_0_mo, df_c1_0_ann = process_results('out_20-yr_1-cross_10-m_start-5-yr.csv')\n", "df_c2_0, df_c2_0_mo, df_c2_0_ann = process_results('out_20-yr_1-cross_15-m_start-5-yr.csv')\n", "df_c3_0, df_c3_0_mo, df_c3_0_ann = process_results('out_20-yr_1-cross_20-m_start-5-yr.csv')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_ann_data(col, xlabel, y1_label, y2_label, percent_change=False, save_name=False):\n", "\n", @@ -188,61 +189,61 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'Ave. HP Inlet Temp. [C]', r'$\\Delta$ T', save_name='HP-Inlet-Temp_Start-5-yr.PNG')\n", "# plot_ann_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'Ave. HP Inlet Temp. [C]', r'$\\Delta$ T')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('COP [-]', 'Years', 'Ave. COP [-]', '% Change', percent_change=True, save_name='COP_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total HP Elec. [kWh]', 'Years', 'Tot. HP Elec. [kWh]', '% Change', percent_change=True, save_name='HP-Elec_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total Imm. Elec. [kWh]', 'Years', 'Tot. HTR Elec. [kWh]', '% Change', percent_change=True, save_name='HTR_Elec_Start-5-yr.PNG')\n", "# plot_ann_data('Total Imm. Elec. [kWh]', 'Years', 'Tot. HTR Elec. [kWh]', '% Change', percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('Total Elec. [kWh]', 'Years', 'Tot. Elec. [kWh]', '% Change', percent_change=True, save_name='Tot_Elec_Start-5-yr.PNG')\n", "# plot_ann_data('Total Elec. [kWh]', 'Years', 'Tot. Elec. [kWh]', '% Change', percent_change=True)" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_ann_data_src_side(col, xlabel, y1_label, y2_label, save_name=False):\n", "\n", @@ -277,67 +278,67 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data_src_side('SwedishHP:SVENSKA VARMMEPUMPE:Source-side Heat Rate [kWh]', 'Years', 'Tot. HP. Src-Side [kWh]', '% Change', save_name='HP-SRC-Side_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data_src_side('SwedishHP:SVENSKA VARMMEPUMPE:Load-side Heat Rate [kWh]', 'Years', 'Tot. HP. Load-Side [kWh]', '% Change', save_name='HP-Load-Side_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('GroundHeatExchangerLTS:SELF-GHE:BH Resist. [m-K/W]', 'Years', r'$R_b$ [m-K/W]', '% Change', percent_change=True, save_name='Rb_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_ann_data('GroundHeatExchangerLTS:SELF-GHE:Borehole Wall Temp. [C]', 'Years', 'BH Wall Temp. [C]', r'$\\Delta$ T', save_name='BH_Wall_Temp_Start-5-yr.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_s_mo_ann_mean = df_s_mo.resample('A').mean()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "df_c1_0_mo_mean = df_c1_0_mo.resample('A').mean()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "def plot_montly_mean_data(col, xlabel, y1_label, save_name=False):\n", "\n", @@ -361,22 +362,22 @@ " plt.savefig(save_name, bbox_inches='tight')\n", "\n", " plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "plot_montly_mean_data('SwedishHP:SVENSKA VARMMEPUMPE:Inlet Temp. [C]', 'Years', 'HP Inlet Temp. [C]', save_name='Self_Houly_Monthly_Annual_Inlet_Temp.PNG')" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -413,13 +414,13 @@ "plt.savefig('Feb_Temps_Loads_Self.PNG')\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, + "outputs": [], "source": [ "fig = plt.figure(dpi=200)\n", "\n", @@ -456,15 +457,14 @@ "plt.savefig('July_Temps_Loads_Self.PNG')\n", "\n", "plt.show()" - ], - "outputs": [] + ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, - "source": [], - "outputs": [] + "outputs": [], + "source": [] } ], "metadata": {