Skip to content
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

Feat: script for generating pv module coefficients #11

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

allenlawrence94
Copy link

Script for generating CEC PV coefficients using PySAM. See the README for how to run it. Here's what it currently does:

  1. Some initial processing of the CEC data to clean it up. Notably, we remove some pairs of family/technology that don't make sense.
  2. Run CEC coefficient generation in multiple processes.
  3. Write the results to a csv in the format that SAM takes.

Current issues:
Lots of modules fail with 6parsolve execution error from PySAM. I haven't looked closely at what is causing this.

I won't be able to prioritize this work for the next few months, but I will let you all know if that changes. For now, I just want to make this available in case anyone wants to pick up where I've left off.

@allenlawrence94
Copy link
Author

@cwhanse @cpaulgilman @kanderso-nrel

@allenlawrence94
Copy link
Author

Seems PySAM's 6ParSolver fails when there are fewer than 36 cells in series (N_s in the CEC dataset). There are a lot of modules in the CEC dataset with N_p values of 2-6 that have N_s values of less than 36.

@cwhanse
Copy link
Member

cwhanse commented Feb 23, 2022

Thanks @allenlawrence94. It may be a few days yet before I get to look through this.

@cpaulgilman
Copy link

cpaulgilman commented Feb 24, 2022

@allenlawrence94 Thanks for posting your work so far. This is great progress!

Here are some files I generated using the 6parsolve module in SAM from the LK scripts that we use to build the SAM module library file. This is based on the Excel file from the CEC that I downloaded on Dec 1, 2021:

6parsolve-test-files.zip

cec-modules-fail-sort-by-nser.csv contains a list of 1,051 modules with parameters that cause 6parsolve to fail, sorted by N_s. All of these modules have N_s <= 12 or N_s >= 120

cec-modules-pass-sort-by-nser.csv contains a list of 16,885 modules that solve, sorted by N_s. Values of N_s range from 6 to 408.

The solver uses the number of cells in series to generate an initial guess for the value if Io (see the source code here and here). 6parsolve-nser-a-calculation.xlsx replicates the calculation of a for the six cell types to help with troubleshooting.

I should have some time in the next few weeks to compare your Python scripts to our process.

@kandersolar
Copy link
Member

We've not used poetry in any pvlib/* project so far, and I'm only passingly familiar with it myself. I don't want to be a luddite, but I'm also not enthusiastic about learning a new package maintenance tool without a compelling reason. @allenlawrence94 for my own education can you comment on how it compares to a more old-school approach like setup.py and maybe a conda environment file? Thanks!

@allenlawrence94
Copy link
Author

Apologies for the slow response Kevin! I'm a big poetry fan and default to it these days, but it's definitely not necessary - would be happy to switch to requirements.txt / setup.py if consistency with other pvlib repos is important.

For context, here's a blog outlining some of the advantages of poetry: https://towardsdatascience.com/solving-dependency-management-in-python-with-poetry-165b92069e9d

Basically poetry is a lot like the other popular dependency managers from other languages - like js's npm and yarn, and rust's cargo.

@cpaulgilman
Copy link

cpaulgilman commented May 29, 2022

@dguittet Here is an updated set of files that should help with troubleshooting the 6parsolve issues:
CEC Modules 2022-May-29.zip

It contains:

Bad Modules 2022-May-29_10-19.csv is a list of modules that caused 6parsolve to fail with informative error messages and input parameters as separate columns to make it easier to sort and troubleshoot.

CEC Modules 2022-May-29_10-19.csv is a SAM library file with list of modules for which 6parsolve was successful..

PV_Module_List_Full_Data_ADA-2022-5-25_processed.csv is the complete list of modules from the CEC Excel workbook. This is the file that our LK script reads to generate the SAM library file.

PV_Module_List_Full_Data_ADA-2022-5-25.xlsx is the original Excel file that I downloaded from the CEC website, with data from May 25, 2022.

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

Successfully merging this pull request may close these issues.

4 participants