pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

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

Open jpplanted opened this issue 2 years ago • 2 comments

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 avatar Jul 21 '22 22:07 jpplanted

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.

cwhanse avatar Jul 22 '22 14:07 cwhanse

""" "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!

jpplanted avatar Jul 25 '22 15:07 jpplanted