Skip to content

singlediode: newton solver fails with Series input of length one #1787

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

Closed
cwhanse opened this issue Jun 27, 2023 · 0 comments · Fixed by #1822
Closed

singlediode: newton solver fails with Series input of length one #1787

cwhanse opened this issue Jun 27, 2023 · 0 comments · Fixed by #1822
Milestone

Comments

@cwhanse
Copy link
Member

cwhanse commented Jun 27, 2023

The vectorized newton solver doesn't work if parameters are Series of length one.


import pandas as pd
import pvlib


args = (0.001, 1.5, 6., 5e-9, 1000., 0.5)
params = pvlib.pvsystem.calcparams_desoto(1000., 25, *args)
params_series = pvlib.pvsystem.calcparams_desoto(pd.Series(data=[1000.]),
                                                 pd.Series([25.]), *args)
params_series2 = pvlib.pvsystem.calcparams_desoto(pd.Series(data=[1000., 1000.]),
                                                  pd.Series([25., 25.]), *args)
# works with each input as float
result = pvlib.pvsystem.singlediode(*params, method='newton')

# works with Series if length > 1
result_series2 = pvlib.pvsystem.singlediode(*params_series2, method='newton')

# errors with Series if length is 1
result_series = pvlib.pvsystem.singlediode(*params_series, method='newton')

Versions:

  • pvlib.__version__: 0.9.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants