Skip to content

Commit 4ddb7f5

Browse files
author
AFM Kamal Chowdhury
authored
Add files via upload
1 parent 7f51d81 commit 4ddb7f5

16 files changed

+1271500
-0
lines changed

Output analysis/analysis_genmix_cost_emi.ipynb

Lines changed: 517 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"metadata": {},
7+
"outputs": [],
8+
"source": [
9+
"%matplotlib inline \n",
10+
"import os\n",
11+
"import csv\n",
12+
"import pandas as pd\n",
13+
"import numpy as np\n",
14+
"import matplotlib.pyplot as plt"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": 2,
20+
"metadata": {},
21+
"outputs": [],
22+
"source": [
23+
"run_no = 1 \n",
24+
"rundays = 365\n",
25+
"runhours = rundays*24\n",
26+
"\n",
27+
"hr_range = pd.date_range('1/1/2001', periods=runhours, freq='H')\n",
28+
"day_range = pd.date_range('1/1/2001', periods=rundays, freq='D')"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": 3,
34+
"metadata": {},
35+
"outputs": [],
36+
"source": [
37+
"df_gen = pd.read_csv('data_camb_genparams.csv',header=0)\n",
38+
"df_load = pd.read_csv('data_camb_load_2016.csv',header=0)\n",
39+
" \n",
40+
"sys_load = (df_load.iloc[:,4:].sum(axis=1)).values\n",
41+
"#reserve = (sys_load*0.15).values"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 4,
47+
"metadata": {},
48+
"outputs": [],
49+
"source": [
50+
"gen_name = df_gen['name']\n",
51+
"gen_type = df_gen['typ']"
52+
]
53+
},
54+
{
55+
"cell_type": "code",
56+
"execution_count": 5,
57+
"metadata": {},
58+
"outputs": [
59+
{
60+
"data": {
61+
"text/plain": [
62+
"(9.010021695594252, 19.18987059712856)"
63+
]
64+
},
65+
"execution_count": 5,
66+
"metadata": {},
67+
"output_type": "execute_result"
68+
}
69+
],
70+
"source": [
71+
"srsv = pd.read_csv('out_camb_R'+str(run_no)+'_2016_srsv.csv',header=0)\n",
72+
"nrsv = pd.read_csv('out_camb_R'+str(run_no)+'_2016_nrsv.csv',header=0)\n",
73+
" \n",
74+
"###Include Generator_type to the srsv data\n",
75+
"for x in range(len(gen_name)):\n",
76+
" srsv.loc[srsv.Generator == gen_name[x], 'Type'] = gen_type[x]\n",
77+
" nrsv.loc[nrsv.Generator == gen_name[x], 'Type'] = gen_type[x]\n",
78+
" \n",
79+
"####Reserve_GWh by Type\n",
80+
"srsv_bytype = round(srsv.groupby(['Type'])['Value'].sum()/1000,1)\n",
81+
"nrsv_bytype = round(nrsv.groupby(['Type'])['Value'].sum()/1000,1)\n",
82+
" \n",
83+
"\n",
84+
"###Reserve_ratios by Time only\n",
85+
"srsv_bytime = srsv.groupby(['Time'])['Value'].sum().values\n",
86+
"nrsv_bytime = nrsv.groupby(['Time'])['Value'].sum().values\n",
87+
"trsv_bytime = srsv_bytime +nrsv_bytime \n",
88+
" \n",
89+
"srsv_ratio = srsv_bytime*100/sys_load\n",
90+
"nrsv_ratio = nrsv_bytime*100/sys_load\n",
91+
"trsv_ratio = trsv_bytime*100/sys_load\n",
92+
"\n",
93+
"avg_srsv = np.mean(srsv_ratio)\n",
94+
"avg_trsv = np.mean(trsv_ratio)\n",
95+
"\n",
96+
"\n",
97+
"avg_srsv,avg_trsv"
98+
]
99+
},
100+
{
101+
"cell_type": "code",
102+
"execution_count": null,
103+
"metadata": {},
104+
"outputs": [],
105+
"source": []
106+
},
107+
{
108+
"cell_type": "code",
109+
"execution_count": null,
110+
"metadata": {},
111+
"outputs": [],
112+
"source": []
113+
}
114+
],
115+
"metadata": {
116+
"kernelspec": {
117+
"display_name": "Python 3",
118+
"language": "python",
119+
"name": "python3"
120+
},
121+
"language_info": {
122+
"codemirror_mode": {
123+
"name": "ipython",
124+
"version": 3
125+
},
126+
"file_extension": ".py",
127+
"mimetype": "text/x-python",
128+
"name": "python",
129+
"nbconvert_exporter": "python",
130+
"pygments_lexer": "ipython3",
131+
"version": "3.7.3"
132+
}
133+
},
134+
"nbformat": 4,
135+
"nbformat_minor": 2
136+
}

0 commit comments

Comments
 (0)