Hi all,
I splited pvfacoter module from my code, and simulated only one day, then found that the problem is still there. The code is here and as attachment. The front and rear irradiance is as following graph.
As previous mail description, the tendency of fixed-rack system is reasonable, but it is unreasonable for tracker system. Hope you can point out what is wrong for my code. Thanks you.
# The code is the same as attachment
import pvlib
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from pvlib.bifacial import pvfactors_timeseries
from pvfactors.run import run_timeseries_engine
from datetime import datetime
from pandas import DataFrame
# Create input data
df_inputs = pd.DataFrame(
{'solar_zenith': [11, 19, 25, 29, 29, 26, 21, 13, 4],
'solar_azimuth': [130, 141, 155, 170, 186, 201, 215, 227, 237],
# 'surface_tilt': [11.5, 43.1, 51.6, 28.8, 0.182, 28.5, 51.4, 44.1, 11.9], # if tracker system, use the group data
# 'surface_azimuth': [90, 90, 90, 90, 90, 270, 270, 270, 270], # if tracker system, use the group data
'surface_tilt': [40, 40, 40, 40, 40, 40, 40, 40, 40],
'surface_azimuth': [180, 180, 180, 180, 180, 180, 180, 180, 180],
'dni': [531, 723, 677, 584, 103, 4.2, 0, 0, 0],
'dhi': [88, 91, 112, 158, 199, 126, 18, 5, 0]},
index=[datetime(1990, 1, 3, 9), datetime(1990, 1, 3, 10), datetime(1990, 1, 3, 11),
datetime(1990, 1, 3, 12), datetime(1990, 1, 3, 13), datetime(1990, 1, 3, 14),
datetime(1990, 1, 3, 15), datetime(1990, 1, 3, 16), datetime(1990, 1, 3, 17)]
)
def pvfactor_build_report(pvarray):
return {
'total_inc_back': pvarray.ts_pvrows[1].back.get_param_weighted('qinc').tolist(),
'total_inc_front': pvarray.ts_pvrows[1].front.get_param_weighted('qinc').tolist()
}
pvarray_parameters = {
'n_pvrows': 3,
'index_observed_pvrow': 1,
'axis_azimuth': 0,
'pvrow_height': 1.5,
'pvrow_width': 4.6,
'gcr': 0.4,
'rho_front_pvrow': 0.01,
'rho_back_pvrow': 0.03,
'horizon_band_angle': 15
}
pvfactor = run_timeseries_engine(pvfactor_build_report,
pvarray_parameters,
df_inputs.index,
df_inputs.dni,
df_inputs.dhi,
df_inputs.solar_zenith,
df_inputs.solar_azimuth,
df_inputs.surface_tilt,
df_inputs.surface_azimuth,
0.2 # you can change the number
)
print(pvfactor)
df_1=DataFrame(pvfactor['total_inc_back'],columns=['total_inc_back'])
df_2=DataFrame(pvfactor['total_inc_front'],columns=['total_inc_front'])
df=df_2.join(df_1)