Skip to content

Schlick ground diffuse IAM exceeds its physical bound at shallow tilt #2958

Open

Description

@rcgiri-physics

On pvlib 0.16.1 the Schlick ground diffuse IAM at positive tilts near
horizontal can exceed the largest IAM of any incident ground ray.

import numpy as np
from pvlib.iam import schlick_diffuse

tilt = 0.00005
actual = schlick_diffuse(tilt)["ground"]
upper = -np.expm1(5 * np.log1p(-np.sin(np.deg2rad(tilt))))
assert 0 < actual <= upper, (actual, upper)

The ground diffuse modifier is a positive weighted average of the
directional modifier. Every ray from the visible ground has an
incidence cosine at most sin(tilt). At the tilt above, that puts the
average below 4.36332e-6. Direct integration over the visible ground
gives 2.46913e-6, stable under doubling the quadrature order. The
returned value is 0.001953125.

The formula subtracts two large, nearly equal terms as the ground
view approaches zero. The same expression is present on the default
branch. Issue #2939 describes nonfinite values exactly at 180 degrees.
This example exercises a positive ground view and returns a finite
value outside the allowed range.

I found this while testing physverify, a small verification tool I'm working on, against public codes. The tests and this write-up were done with help from an AI assistant; the numbers come from actually running the code.

Activity

  1. rcgiri-physics commented on Nov 23, 2026

    @rcgiri-physics
    Author

    A note on scope: this only shows up at extreme tilts (about 0.00005°); from 0.001° upward the values stay within the bound. So it is a very small edge case. Please feel free to close it if it isn't worth handling.

  2. cwhanse commented on Nov 23, 2026

    @cwhanse
    Member

    Would this issue be fixed by #2942?

  3. rcgiri-physics commented on Nov 23, 2026

    @rcgiri-physics
    Author

    Yes, it looks like it. Near tilt 0 the PR's series gives 2.4691329e-6 at 0.00005°, which matches the direct integration over the visible ground (2.46913e-6), and the leading terms 80/(9π)·β − (15/4)·β² agree with an independent high-precision expansion of Eq 6. Values at 0.001°, 0.1° and 0.29° also stay within the bound. I'm happy for this to be closed by #2942.

  4. cwhanse commented on Nov 23, 2026

    @cwhanse
    Member

    thank you for the issue report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions