@@ -345,7 +345,14 @@ def vf_row_sky_2d_integ(surface_tilt, gcr, x0=0, x1=1):
345345 from x0 to x1. [unitless]
346346
347347 '''
348- result = 0.5 * (1 / gcr + 1 - ((1 / gcr )** 2 - (2 / gcr )* cosd (surface_tilt ) + 1 )** 0.5 )
348+ u = np .abs (x1 - x0 )
349+ p0 = _vf_poly (surface_tilt , gcr , 1 - x0 , - 1 )
350+ p1 = _vf_poly (surface_tilt , gcr , 1 - x1 , - 1 )
351+ with np .errstate (divide = 'ignore' ):
352+ result = np .where (u < 1e-6 ,
353+ vf_row_sky_2d (surface_tilt , gcr , x0 ),
354+ 0.5 * (1 + 1 / u * (p1 - p0 ))
355+ )
349356 return result
350357
351358
@@ -409,5 +416,12 @@ def vf_row_ground_2d_integ(surface_tilt, gcr, x0=0, x1=1):
409416 [unitless]
410417
411418 '''
412- result = 0.5 * (1 / gcr + 1 - ((1 / gcr )** 2 + (2 / gcr )* cosd (surface_tilt ) + 1 )** 0.5 )
419+ u = np .abs (x1 - x0 )
420+ p0 = _vf_poly (surface_tilt , gcr , x0 , 1 )
421+ p1 = _vf_poly (surface_tilt , gcr , x1 , 1 )
422+ with np .errstate (divide = 'ignore' ):
423+ result = np .where (u < 1e-6 ,
424+ vf_row_ground_2d (surface_tilt , gcr , x0 ),
425+ 0.5 * (1 - 1 / u * (p1 - p0 ))
426+ )
413427 return result
0 commit comments