Skip to content

Sample consistent currents when creating IV curves with pvlib.pvsystem.singlediode #1496

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
jpplanted opened this issue Jul 21, 2022 · 3 comments

Comments

@jpplanted
Copy link

New to solar, so please bear with me.

Is your feature request related to a problem? Please describe.
It's much easier and intuitive to create string IV curves when the currents for the IV points are already aligned.

Currently, pvlib.pvsystem.singlediode creates (when using "newton") a log-spaced DIODE voltage sample set and then samples at those voltages. The returned voltages and currents are not guaranteed to be aligned. It would be nice to have an easy/intuitive way to get either current-aligned or voltage-aligned iv-curve samples.

bishop88 is a close-form i-v solution as a function of diode voltage, so I don't know what is possible, other than solving bishop88_i_from_v or bishop88_v_from_i for the returned sample points.

Describe the solution you'd like
bishop88_i_from_v or bishop88_v_from_i called after sampling iv curves in pvlib.pvsystem.singlediode.

Describe alternatives you've considered
I'm pretty new here, and I don't know of many. I think bishop88_i_from_v and bishop88_v_from_i are the only options?

Additional context
I'm trying to do relatively high-accuracy MPPT simulation by building representative IV curves of modules -> strings -> MPPT. For instance, I want to try to increase the voltage when MPPT power is above its limit. Or current limit in the rare chance that this power-adjusted operating point is still above the max mppt/dc port continuous current.

Please let me know if I'm missing something very obvious!

@jpplanted jpplanted changed the title Sample consistent currents when create IV curves with pvlib.pvsystem.singlediode Sample consistent currents when creating IV curves with pvlib.pvsystem.singlediode Jul 21, 2022
@cwhanse
Copy link
Member

cwhanse commented Jul 22, 2022

HI @jpplanted

The returned voltages and currents are not guaranteed to be aligned.

I don't understand this statement - could you elaborate? The elements of the voltage and current vectors returned by singlediode are pairs which solve the single diode equation. Do you mean that the voltage (or current) values are not common for two different modules in a string? If that's what you mean, are you wanting to specify e.g. current values as input to pvlib.pvsystem.singlediode? If I've got that right, extending pvlib.pvystem.singlediode to accept (optional) user-specified voltage or current has been of interest for a while.

In the meantime, you can use bishop88_i_from_v etc. (or the private functions singlediode._lambertw_i_from_v etc.) to do what you describe.

By "high accuracy" what precision are you looking for? With default settings, the pvlib methods should provide 8-10 digits of precision.

@jpplanted
Copy link
Author

jpplanted commented Jul 25, 2022

"""
"Do you mean that the voltage (or current) values are not common for two different modules in a string? If that's what you mean, are you wanting to specify e.g. current values as input to pvlib.pvsystem.singlediode?"
"""
------That's pretty much exactly what I was thinking/looking for. I'm happy to hear that using bishop88_i_from_v is in fact the best way to do this in the short term.

"""
By "high accuracy [MPPT simulation]" what precision are you looking for? With default settings, the pvlib methods should provide 8-10 digits of precision.
"""

----- I haven't found any good examples on modeling a MPPT port's behavior when the input max-power-point would be above its max power, or when the input current is above its max current, or when the input voltage it above/below the MPPT's max/min input voltages.

Currently, for the hours in a year where all my strings are "similar enough" and their summed max power operating point is within the constraints of the MPPT port, I just use multiple the i_mps and v_mps returned by singlediode. In the hours where modules differ greatly or the max power gets too large, or the current is too large, etc..., I want to increase/decrease the mppt's voltage to find a realistic and representative operating point. Ideally, the one that most MPPT ports in real inverters would find.

P.s. This whole i-v curves aligned at the same voltage/current might be a bit of an "xy-problem" for me. If there's an elegant MPPTSimulator or solution you like, I'd love to learn about it!

@cwhanse
Copy link
Member

cwhanse commented Nov 12, 2024

Closing because the capability desired by the OP is provided in pvlib.pvsystem.i_from_v and pvlib.pvsystem.v_from_i, and we have removed the ivpoints kwarg from pvlib.pvsystem.singlediode.

@cwhanse cwhanse closed this as completed Nov 12, 2024
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

No branches or pull requests

2 participants