-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Multiple arrays in a PV system #1067
Comments
Exploring this a bit, to settle on a pattern, using a copy of the
This runs with
|
It might simplify things if we said PVSystem could accept any iterable of tilt or azimuth but coerce it into a standard type. For example class PVSystem:
def __init__(surface_tilt, surface_azimuth,...):
self.surface_tilt = np.array(surface_tilt) # or np.array(surface_tilt).tolist()
self.sufrace_azimuth = np.array(surface_azimuth) The following behavior is relevant: In [7]: np.array(1)
Out[7]: array(1)
In [8]: np.array(1).tolist()
Out[8]: 1
In [9]: np.array([1]).tolist()
Out[9]: [1]
Two things to try:
|
It would simplify the typing, but I think we have to resolve the overloading of
Perhaps a way forward is to use |
I'm a little confused...
That's a |
Aha. |
|
Just as another idea at risk of disrupting this line of thought. Have you considered creating a new type of "Multi Array ModelChain" that could implement and iterate through multiple ModelChains, instead of changing anything with A multiple array ModelChain could accept a single location, an iterable of multiple The benefit here would be that all the underlying code could be left as is and I think it would be a relatively simple to implement. But this it would be more of an approach of adding a new wrapper around what is already there rather than building functionality from the bottom-up. So it could be something like where system parameters is a list of dicts and inverters_per_array is a list of integers, and when it initializes is creates unique instances of PVsystem for each dict in the list and also creates instances of ModelChains with them. Then a function like |
@ncroft-b4 interesting idea, but I think @cwhanse is trying to address subarrays that are connected to the same inverter or to different inputs of a multi-mppt inverter (see #457 ) |
Possibly relevant to OpenPVspec and #96 |
Or how about using a subarray as a building block and creating a multi-subarray inverter? |
@adriesse I'm not understanding your suggestion - can you elaborate? @ncroft-b4 That's a thought... @mikofski the system I have in mind is one inverter with several non-identical DC arrays. @ncroft-b4 is right that the |
Although several systems connected to different inverters is trivial, just calculate each separately. We don't have any ac post processes. So the most pressing case is the one you and I both describe:
|
It's hardly a fully thought-out idea. It just seems a System class could get quite complex as it grows to accommodate more and more types of systems. Perhaps a Subarray class could help to make it more modular. |
@wholmgren and I discussed an |
I thought that supporting iterable Along with a new |
I do think it would need the ability to support additional attributes than just tilt and azimuth, such as Starting from a blank file, perhaps an |
That is my thinking also, except for
|
It is a challenge to keep the current interface for |
Instances of an |
I opened up pvlib-python/pvlib/pvsystem.py Lines 100 to 107 in 04a523f
I could not find any
|
|
What about an
and methods:
so that a higher level object like
Is the motivation for this just API compatibility with the existing |
Yes, but also to maintain a single object that fully represents a system that continues to work with Though if it is not too big a deal to maintain current API compatibility with |
This is how I'm thinking about it. If, in addition to an |
Or have I'm happy to mock up some code for one of the
Any other options to consider, and which would be your preference? |
Of those options, I would start with 1 or 2. It could be that we ultimately support 3 but I don't think it's worth considering as part of the initial design. I strongly feel that we need to think about a new If we don't have the appetite for achieving consensus on a bigger redesign then I'd advocate for a simple solution that casts input iterables to arrays and exploits broadcasting. |
I'm OK with a "new" and redesigned |
I think I like the direction the discussion is going. The motivation for an Array class is to be able to do interesting things with more than one of them having different parameters or operating conditions. The two main cases seem to be (1) connecting them to different MPPT's on the same inverter, and (2) connecting them in parallel to the same MPPT. (1) could be done with a new two-stage inverter efficiency model, but needs nothing new on the Array side. This doesn't seem hard to implement, but would just require some reasonable assumptions about the attribution of total internal losses. The same quadratic loss model can be used to model both conversion stages (with different parameter of course). (2) requires combining I-V curve characteristics of the two or more arrays. This seems more well-defined, but perhaps a bit harder to implement. I would shy away from short-cuts like weighted average of Vmp though. |
Summarizing some offline conversations for the benefit of all. It seems we are converging to the following pattern:
I still need to look uphill to This pattern meets the use case of a PV system with multiple arrays, with each array connected to a separate MPPT on one system-wide inverter. Follow-on work can extend this pattern to a PV system with one inverter per array. The case of multiple arrays feeding one inverter without separate MPPT is not addressed, but isn't ruled out by this pattern. This case would require a new function to compute DC current and voltage at the inverter input, and it's not clear how that should be done (Kirchoff's laws of course, but, one likely needs parameters that aren't already in pvlib). @wfvining fyi |
Where will |
Good place for now. |
I'm proposing to add capability to model more than one array in a PV system. Defining the term "array", I mean a collection of PV modules at the same orientation (tilt and azimuth). Many actual PV systems have several arrays, distinguished by different orientation and/or number of modules and strings of modules.
The current
PVSystem
defines the DC side of a PV system usingmodules_per_string
andstrings_per_inverter
and applies attributessurface_tilt
andsurface_azimuth
to all modules. A PV system may have a single inverter. This model implicitly describes a PV system with a single array.@wholmgren have discussed this a bit offline and think a way forward would be to make
PVSystem
attributes iterable. For example,surface_tilt
could contain a list or array, with each element being an array of tilts to be applied to one of the arrays comprising the PV system.PVSystem
andModelChain
methods would be extended to perform calculations for each array in the PV system, broadcasting where needed.Two principles guiding this proposal:
We discussed, and disfavor other approaches:
ModelChain
methods.PVsystem
or adding attributes, either of which look to be confusing for users.Open for comments here, before I start a branch to work on this feature.
#457 is relevant. Having multiple arrays lays the groundwork for modeling inverters with multiple MPPTs.
The text was updated successfully, but these errors were encountered: