Commit bea78af8 authored by Bognár, Á.'s avatar Bognár, Á.
Browse files

Update electr_sim_workflow_example_pvmm.py

parent 5db526f9
......@@ -30,6 +30,7 @@ for f in os.listdir():
start = pd.Timestamp('2001-03-06 07:02:30')
end = pd.Timestamp('2001-03-06 19:57:30')
ill = ill_to_df(p_name=project_name)[start:end]
ill_mean = ill.mean(axis=1)
# read sensor point metadata json
with open('pts/{}.json'.format(project_name), 'r') as fp:
......@@ -49,7 +50,7 @@ pv_mod = pvmodule.PVmodule(cell_pos=pv_mod_pattern, pvcells=None, pvconst=None,
pv_str = pvstring.PVstring(numberMods=str_len, pvmods=[pv_mod]*str_len)
pv_sys = pvsystem.PVsystem(numberStrs=str_num, pvstrs=[pv_str]*str_num, numberMods=[str_len]*str_num, pvmods=[pv_mod]*str_len)
# calulate dc power
# calulate dc power with cell level and mean irradiance
dc_power = []
for t in ill.index:
for s in list(system_layout.columns):
......@@ -58,4 +59,12 @@ for t in ill.index:
pv_sys.setSuns({s:{m:[Ee, mod_cell_idxs]}})
dc_power.append(pv_sys.calcSystem()[2].max())
system_power = pd.Series(index=ill.index, data=dc_power)
dc_power_ill_mean = []
for t in ill.index:
pv_sys.setSuns(ill_mean[t] / 1000)
dc_power_ill_mean.append(pv_sys.calcSystem()[2].max())
system_power = pd.DataFrame(index=ill.index, data={'dc_power_cell_level_irrad':dc_power, 'dc_power_mean_irrad':dc_power_ill_mean})
system_power.plot()
plt.ylabel('Pdc [W]')
plt.show(block=False)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment