Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Correct infinite_sheds view factor from row to sky and ground; expose vf functions in bifacial.utils #1666

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

Merged
merged 27 commits into from
Jun 23, 2023
Merged
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f684623
correct view factor from row to sky and ground
mikofski Feb 15, 2023
ef346dd
update latex math in vf_row_gnd
mikofski Feb 15, 2023
510e8ad
revise vf_row_sky and test
Mar 22, 2023
fdc7a63
remake tests for vf_row_ground
cwhanse Mar 23, 2023
784a977
fix my mistakes
cwhanse Mar 23, 2023
c48b35c
fix row_ground_integ
cwhanse Mar 23, 2023
253bb89
new vf functions in utils
cwhanse Mar 24, 2023
2a9bff1
merge 0.9.5 upstream
cwhanse Mar 24, 2023
5837fd3
stickler
cwhanse Mar 24, 2023
3246196
use functions from utils
cwhanse Mar 24, 2023
a0451b7
documents
cwhanse Mar 24, 2023
a77dbb0
revise whatsnew
cwhanse Mar 24, 2023
09f3f86
add technical document
cwhanse Mar 24, 2023
e7b7d5f
doc edits
cwhanse Apr 3, 2023
fc6c7d9
fix conflicts
cwhanse May 15, 2023
df56b3a
Merge branch 'fix_vf_row_sky_gh1665' of https://github.com/mikofski/p…
cwhanse May 15, 2023
6a026ad
move fns to utils
cwhanse May 15, 2023
47bd4de
more fcn shuffling
cwhanse May 15, 2023
7e1be57
update docs
cwhanse May 15, 2023
02bc783
reorder arguments
cwhanse May 16, 2023
fbf3d93
docstring edits
cwhanse May 16, 2023
bdb80ea
add defaults to _integ functions
cwhanse May 16, 2023
ccac4b2
Merge branch 'main' into fix_vf_row_sky_gh1665
cwhanse May 24, 2023
710a5bd
Merge branch 'main' of https://github.com/pvlib/pvlib-python into fix…
cwhanse Jun 7, 2023
667e3f5
Merge branch 'fix_vf_row_sky_gh1665' of https://github.com/mikofski/p…
cwhanse Jun 7, 2023
a11257d
Merge remote-tracking branch 'upstream/main' into pr/1666
kandersolar Jun 23, 2023
b6996e5
fix whatsnew formatting issues
kandersolar Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remake tests for vf_row_ground
  • Loading branch information
cwhanse committed Mar 23, 2023
commit fdc7a630caa706b30926e4fd56dd48c0b61dde9c
33 changes: 17 additions & 16 deletions 33 pvlib/tests/bifacial/test_infinite_sheds.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,17 @@ def test__ground_angle_zero_gcr():
def test__vf_row_ground(test_system):
ts, _, _ = test_system
x = np.array([0., 0.5, 1.0])
sqr3 = np.sqrt(3)
vfs = infinite_sheds._vf_row_ground(
x, ts['surface_tilt'], ts['gcr'])
expected_vfs = np.array([
0.5 * (1. - sqr3 / 2),
0.5 * ((4 + sqr3 / 2) / np.sqrt(17 + 4 * sqr3) - sqr3 / 2),
0.5 * ((4 + sqr3) / np.sqrt(20 + 8 * sqr3) - sqr3 / 2)])

def analytic(fx, gcr, surface_tilt):
a = 1/gcr
c = cosd(surface_tilt)
def p(fx, a, c):
return np.sqrt(a*a + 2*a*c*fx + fx*fx)
return 0.5*(1 - (a*c - fx)/p(fx, a, c))

expected_vfs = analytic(x, ts['gcr'], ts['surface_tilt'])
assert np.allclose(vfs, expected_vfs)


Expand All @@ -143,18 +147,15 @@ def test__vf_row_ground_integ(test_system):
shaded, noshade = infinite_sheds._vf_row_ground_integ(
f_x, surface_tilt, gcr)

def analytic(x, surface_tilt, gcr):
def analytic(fx0, fx1, gcr, surface_tilt):
a = 1/gcr
c = cosd(surface_tilt)
a = 1. / gcr
dx = np.sqrt(a**2 + 2 * a * c * x + x**2)
return c * dx - a * (c**2 - 1) * np.arctanh((a * c + x) / dx)

expected_shade = 0.5 * (analytic(f_x, surface_tilt, gcr)
- analytic(0., surface_tilt, gcr)
- f_x * cosd(surface_tilt))
expected_noshade = 0.5 * (analytic(1., surface_tilt, gcr)
- analytic(f_x, surface_tilt, gcr)
- (1. - f_x) * cosd(surface_tilt))
def p(fx, a, c):
return np.sqrt(a*a + 2*a*c*fx + fx*fx)
return 0.5*(1 - p(fx1, a, c) + p(fx0, a, c))

expected_shade = analytic(0, f_x, gcr, surface_tilt)
expected_noshade = analytic(f_x, 1., gcr, surface_tilt)
assert np.allclose(shaded, expected_shade)
assert np.allclose(noshade, expected_noshade)

Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.