-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AFM Kamal Chowdhury
authored
Sep 27, 2019
1 parent
7f51d81
commit 4ddb7f5
Showing
16 changed files
with
1,271,500 additions
and
0 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"%matplotlib inline \n", | ||
"import os\n", | ||
"import csv\n", | ||
"import pandas as pd\n", | ||
"import numpy as np\n", | ||
"import matplotlib.pyplot as plt" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"run_no = 1 \n", | ||
"rundays = 365\n", | ||
"runhours = rundays*24\n", | ||
"\n", | ||
"hr_range = pd.date_range('1/1/2001', periods=runhours, freq='H')\n", | ||
"day_range = pd.date_range('1/1/2001', periods=rundays, freq='D')" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"df_gen = pd.read_csv('data_camb_genparams.csv',header=0)\n", | ||
"df_load = pd.read_csv('data_camb_load_2016.csv',header=0)\n", | ||
" \n", | ||
"sys_load = (df_load.iloc[:,4:].sum(axis=1)).values\n", | ||
"#reserve = (sys_load*0.15).values" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"gen_name = df_gen['name']\n", | ||
"gen_type = df_gen['typ']" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"(9.010021695594252, 19.18987059712856)" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"srsv = pd.read_csv('out_camb_R'+str(run_no)+'_2016_srsv.csv',header=0)\n", | ||
"nrsv = pd.read_csv('out_camb_R'+str(run_no)+'_2016_nrsv.csv',header=0)\n", | ||
" \n", | ||
"###Include Generator_type to the srsv data\n", | ||
"for x in range(len(gen_name)):\n", | ||
" srsv.loc[srsv.Generator == gen_name[x], 'Type'] = gen_type[x]\n", | ||
" nrsv.loc[nrsv.Generator == gen_name[x], 'Type'] = gen_type[x]\n", | ||
" \n", | ||
"####Reserve_GWh by Type\n", | ||
"srsv_bytype = round(srsv.groupby(['Type'])['Value'].sum()/1000,1)\n", | ||
"nrsv_bytype = round(nrsv.groupby(['Type'])['Value'].sum()/1000,1)\n", | ||
" \n", | ||
"\n", | ||
"###Reserve_ratios by Time only\n", | ||
"srsv_bytime = srsv.groupby(['Time'])['Value'].sum().values\n", | ||
"nrsv_bytime = nrsv.groupby(['Time'])['Value'].sum().values\n", | ||
"trsv_bytime = srsv_bytime +nrsv_bytime \n", | ||
" \n", | ||
"srsv_ratio = srsv_bytime*100/sys_load\n", | ||
"nrsv_ratio = nrsv_bytime*100/sys_load\n", | ||
"trsv_ratio = trsv_bytime*100/sys_load\n", | ||
"\n", | ||
"avg_srsv = np.mean(srsv_ratio)\n", | ||
"avg_trsv = np.mean(trsv_ratio)\n", | ||
"\n", | ||
"\n", | ||
"avg_srsv,avg_trsv" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"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.7.3" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.