Skip to content

port MATLAB PVLIB's Boyle/Coello soiling model to python #739

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
wholmgren opened this issue Jun 24, 2019 · 6 comments · Fixed by #850
Closed

port MATLAB PVLIB's Boyle/Coello soiling model to python #739

wholmgren opened this issue Jun 24, 2019 · 6 comments · Fixed by #850

Comments

@wholmgren
Copy link
Member

sandialabs/MATLAB_PV_LIB#26

help wanted...

@alexandermorgan
Copy link
Contributor

I would like to participate in this issue. Is there a preference as to which model to implement first, i.e. Kimber Dynamic or Boyle/Coello? I could start by doing a pandas rewrite of the code @mikofski shared in issue #669. Mark's code was very clear and in Python, so maybe it's easiest to start with the Kimber Dynamic method.

@nappaillav
Copy link
Contributor

nappaillav commented Jan 8, 2020

Hello
As per the suggestion of @cwhanse, I have started working on, porting of the code from Matlab to python. I have taken reference from pvl_soiling_hsu.m code.
I have few doubts like should I reproduce the whole Matlab code (both pvl_soiling_hsu and depo_velocity or just the depo_velocity).

@DanRiley
Copy link

DanRiley commented Jan 8, 2020

@nappaillav If you have questions when porting any part of the Humboldt State University (HSU) code, feel free to contact me. I worked on developing that code from the code that was sent to me by the paper authors.

I recommend reproducing the entirety of the MATLAB code. The internal function depo_velocity is used by the variable deposition form of the model, but requires everything in pvl_soiling_hsu.m in order to correctly model the soil impact.

@cwhanse
Copy link
Member

cwhanse commented Jan 8, 2020

I think the expected behavior should be soiling_ratio = f(inputs), as pvl_soiling_hsu.m does. The MATLAB input ModelType selects the soiling deposition model from 3 options (option 1 uses delo_velocity helper function), I'd default to ModelType=2.

FYI: the paper authors requested us to name the function with HSU rather than a last name. It would be nice that this function become known as the Humboldt State University soiling model to honor their request.

@nappaillav
Copy link
Contributor

nappaillav commented Jan 8, 2020

Thanks for the reply @cwhanse @DanRiley
I'm trying to handle the argparse in python similar to matlab.
Else I have a complete code ported in python. Apart from that I'm yet to test the functions.
Hence It would be great if you can provide me with some test data which I can use to see if the python code reproduces the same values as the Matlab HSU code.

@cwhanse
Copy link
Member

cwhanse commented Jan 8, 2020

I wouldn't work too hard to imitate the MATLAB argument parsing. You can take defaults from the MATLAB function's Optional inputs. I wouldn't port the validation rules; rather, describe the value restrictions in the docstring.

@DanRiley do you have a few sets of test data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants