-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simulated irradiance is not continuous at tilt=0 #125
Comments
hi @kanderso-nrel , sorry for the delay on this. And thanks a lot for posting this issue and for the super helpful notebook 🙏 I spent a couple of hours digging and I found an "easy" way to circumvent the bug and avoid the discontinuity using the inputs, but I couldn't find a way to fix the bug because of lack of time. I could reproduce the issue with a notebook also here: The problem arises from the value of I think the bug is related to some ground surface indexing issue when |
Ah ha, changing Some uninformed speculation: I wonder if that ground surface indexing difference could somehow be related to the NaN ground cutting points? I will try to find some time to look into it myself, but I can't promise that will happen any time soon. |
@kanderso-nrel - thanks for bringing this issue up. And @anomam - thank you for the reply. Are you aware of any link in this issue between I found that adjusting |
#128 provided a temporary fix. Leaving this open to (eventually) track down root cause of inconsistency w.r.t. the sign of zero. |
As always I will preface this by saying I'm not a frequent pvfactors user or even someone that has read the pvfactors PVSC paper, so there's a chance this is user error. @spaneja showed this behavior to me and I tried to identify the root cause before opening the issue.
The high-level issue is essentially that the simulated irradiance values for
surface_tilt=0
andsurface_tilt=0.001
are very different, despite no practical difference insurface_tilt
. Here is an example output where the only difference is whethersurface_tilt
is 0 or 0.001:I have uploaded a small notebook to reproduce the issue here: https://gist.github.com/kanderso-nrel/4c780640585881b01f82768c5bac5b51
I think I found two issues in the pvfactors code caused by tilt being exactly zero but it's possible that there are more. The first is pretty simple, and mentioned as a warning in that notebook (
divide by zero encountered in true_divide
). The problem is that finding the cutting points inpvground.py
fails when the modules are horizontal. This makes theoretical sense (two parallel lines never intersect), but I'm not sure what to do about it in the code.pvfactors/pvfactors/geometry/pvground.py
Line 121 in acfb7e2
The second is that when
surface_tilt=0
, it seems that some values inpvarray.ts_vf_aoi_matrix
go negative, which I'm assuming is unexpected. However the view factor calculation code is more than I want to chew on right now so I did not determine what code is to blame for it.I'm happy to help investigate further but I suspect it would be very inefficient given my lack of familiarity with view factor geometry, so I'm hoping someone more experienced can do it instead 😁
The text was updated successfully, but these errors were encountered: