-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add PVsyst as option to ModelChain #487
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
Comments
I need some advice on this one. |
It occurs to me that PVsyst has a long history, during which it has evolved. So just using the name PVsyst would not be enough to identify an algorithm or model. I also think we should anticipate that inferring a model from the presence or absence of certain parameters will not always work. I'm not sure whether that helps you with your specific questions, but it seemed relevant. |
I'll make certain to note 'v6' in the comments. If we implement a different PVsyst model we can change the keywords. |
Please take this with a grain of salt as I myself am still learning about the current |
This is tricky. @cwhanse I agree that we should retain the simplicity of Not sure about the name, but for the sake of the examples linked below, let's say we add a kwarg The first file in the gist sketches I prefer the second file of the gist. It pushes some wrapping into a Another related idea, which I haven't fully thought through, is to allow for the possibility of the @thunderfish24 seems to be proposing a larger restructuring of the |
I think there is an even more fundamental disconnect here, which is that the single diode model signature |
One quick point:
Note, however, that @thunderfish24 are you proposing that we need a method such as:
If so, I agree that this would simplify the higher level At the risk of hijacking this issue, some of the discussion in #418 and #83(!) is relevant here. Edited to add: let's be sure to keep the discussion moving towards addressing the issue of adding a pvsyst option to |
Below is an idea, where the class PVSystem(object):
...
# This property would normally be set by PVSystem constructor
self.model_dc = 'pvsyst_v6' # or 'desoto' or 'campanelli' or 'sapm' or 'pvwatts'
def calc_model_dc(self, overloaded_irradiance, overloaded_temperature):
if self.model_dc == 'pvsyst_v6':
return sdm(get_params_pvsyst_v6(overloaded_irradiance, overloaded_temperature, **self.module_parameters))
elif self.model_dc == 'desoto':
return sdm(get_params_desoto(overloaded_irradiance, overloaded_temperature, **self.module_parameters)
elif self.model_dc == 'campanelli':
return sdm(get_params_campanelli(overloaded_irradiance, overloaded_temperature, **self.module_parameters)
elif self.model_dc == 'sapm':
return sapm(overloaded_irradiance, overloaded_temperature, **self.module_parameters)
elif self.model_dc == 'pvwatts':
return pvwatts_dc(overloaded_irradiance, overloaded_temperature, **self.module_parameters)
else:
# Assume custom case is given a function to call
return self.model_dc(irr, temp, **self.module_parameters)
# These are module-level functions in pvsystem, without wrappers.
def sdm(...):
# Essentially the same as current singlediode function (not sure about system scaling here)
...
return ...
def get_params_pvsyst_v6(effective_irradiance, cell_temp, **kwargs):
...
return IL, I0, Rs, Rsh, NsVth
def get_params_desoto(effective_irradiance, cell_temp, **kwargs):
...
return IL, I0, Rs, Rsh, NsVth
def get_params_campanelli(F, H, **kwargs):
...
return IL, I0, Rs, Rsh, NsVth
def sapm(self, effective_irradiance, temp_cell, **kwargs)
...
return ...
def pvwatts_dc(g_poa_effective, temp_cell, **kwargs)
...
return ... |
@wholmgren Note that I wasn't able to see your reply before posting the above architecture idea. |
I think, e.g., Also, I do value incremental improvements, but I also think the current architecture is a considerably disconnected and has a lot of "glue" :) to wade through when trying to make further contributions. |
I added an |
I pushed an initial prototype with more implementation details to #478. WARNING: The code is broken. I am now analyzing the changes to @cwhanse I added a placeholder for where the |
I think the quickest solution will require yet more glue. Some thoughts for the longer term: |
@thunderfish24 Mark I like the direction your pull request is going. It's not a small change and I'm going to have a number of comments/requests, including some to dial back the scope of the changes in some cases. I'm concerned that your (1) remark indicates that we are not communicating well through the comment board. Happy to have a phone call with you, or private emails. |
@cwhanse I appreciate you reaching out. At the bottom of it, I think I'm mostly just frustrated that I don't have the time to really offer up working prototype that is integrated across the stack, and I get even more concerned about the time-consuming "heavy lift" involved to (1) properly rally consensus around a I'm taking a little breather here, so I may be quiet for a while. I'll make one last point for consideration on this topic. I am in good agreement with many that the base-level functionality in functions is a key foundation for pvlib. When it comes to a "developer API" for adding DC model functions, etc. into |
@thunderfish24 well I appreciate the frustrations about time and about getting consensus on design changes. If you'd like, and there's a practical way to do it, feel free to share your partial code with me (by email or other technique). I think we have reached enough of an agreement on direction of this change that I could push it further along. |
Closed via #555 |
ModelChain
currently provides only the De Soto model when a single diode model is used.ModelChain
should use akwarg
to select among available single diode models, and test for consistency of themodule_parameters
dict with the selected single diode model.The text was updated successfully, but these errors were encountered: