8000 `pvlib.ivtools.sdm.fit_desoto_sandia` has incorrect sign for returned `dEgdT` · Issue #2321 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content
pvlib.ivtools.sdm.fit_desoto_sandia has incorrect sign for returned dEgdT #2321
Closed
@kandersolar

Description

@kandersolar

fit_desoto_sandia incorrectly returns +0.0002677 instead of -0.0002677 for dEgdT:

dEgdT = 0.0002677
x_for_io = const['q'] / const['k'] * (
1. / tok - 1. / tck[u] + dEgdT * (tc[u] - const['T0']) / tck[u])
# Estimate R_sh_ref
nans = np.isnan(rsh)
x = const['E0'] / ee[np.logical_and(u, ee > 400, ~nans)]
y = rsh[np.logical_and(u, ee > 400, ~nans)]
new_x = sm.add_constant(x)
beta = sm.RLM(y, new_x).fit()
R_sh_ref = beta.params[1]
params['dEgdT'] = dEgdT

That value is used both for the returned value and in the equations that compute other SDM parameters. I've not inspected the math to see whether the sign should be fixed in both places, or only for the returned value.

Noticed in #2315.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0