Comments (14)
@cwhanse - I think having a separate open source engine for this is an awesome idea! I'm mid-way through a prototype script for pv modules. Once I get in working order, how about I open a PR to pvlib/pvmodules?
Thanks for the guidance and support.
from sam.
Sorry for the radio silence @cpaulgilman! @kanderso-nrel for visibility (thanks for reminding me about this).
I have a simple (and messy) notebook that generates coefficients for the CEC modules dataset using PySAM, but I never figured out how to handle all the missing/erroneous data. I've had to shift focus away from this, but I'll clean up and push what I currently have to pvmodules in case someone else can pick up my slack before I come back to this.
from sam.
I may be interested in helping here. Could you point me to the workflow where the CEC data set is converted into the format used by SAM? I'm looking at this module data set. I'm wondering if might also be wise to just drop suspicious modules.
from sam.
Hi Allen,
Thanks for offering to help!
The process we use to build SAM's module and inverter libraries from the data in the CEC lists is:
-
Download the appropriate Excel file (.xlsx) from the CEC Solar Equipment Lists website.
-
Manually process the Excel file to remove unneeded rows information and clean up some things like extraneous Greek characters, and tabs, commas and line breaks within cells.
-
Save the cleaned-up Excel file as CSV.
-
Run a script to convert the data in the CSV file to SAM's library format. This involves running code for each module or inverter to calculate model input coefficients from the datasheet parameters in the CEC data that are in SAM's library file but not included in the CEC data. (For example, the module coefficient generator calculates coefficients for the 6-parameter single diode module model like light current and reverse saturation current.)
-
Run a test script to identify any modules and inverters that cause simulation problems and manually remove them from the list. In this step, we do some checks on the inverter data to try to identify suspicious ones.
I am happy to share the scripts we use and more details of the process.
We have been wanting to convert these scripts from SAM's LK scripting language to Python with the PySAM package, but have not had time to do that.
One other note is that the CEC Solar Equipment Lists website mentions that they are changing the format of the equipment lists after October 31, 2021, so we will likely need to update our process to work with the new format: https://www.energy.ca.gov/programs-and-topics/programs/solar-equipment-lists.
Thanks,
Paul.
from sam.
Hi Paul,
I'd happily port the LK script into python. I have used PySAM to generate coefficients for the 6-parameter model in the past, so I feel comfortable picking this up. Could you share the LK scripts with me? If they aren't available on github, you can email me at [email protected].
from sam.
@allenlawrence94 pvlib includes a function showing how to access the SDK functions to run the parameter estimation code. See fit_cec_sam
here; maybe helpful for this effort.
A few years back @janinefreeman and I had some discussion about rehosting the parameter generation capability outside of SAM, and to smooth over some of the cracks between the SAM parameter files and other applications making use of those files. Some of that conversation is in this thread. We set up a project here to contain a parameter generation engine but didn't get past that point. For my part I'm happy to help build and maintain that engine.
It is my opinion that a separate open-source engine translating the CEC database to model parameters would benefit the modeling community, including SAM developers and users.
from sam.
Hi Paul,
I'd happily port the LK script into python. I have used PySAM to generate coefficients for the 6-parameter model in the past, so I feel comfortable picking this up. Could you share the LK scripts with me? If they aren't available on github, you can email me at [email protected].
Thanks! Here's a zip file with the LK script we use for the conversion, a SAM file with LK script we use to test the resulting parameters, and an MD file with notes and instructions. This is documented sufficiently for us to use internally, but I think should be clear enough for you to figure out. Please let me know if you need any help or have questions. I agree with @cwhanse that having this as a separate open source tool is a good idea. We are planning to release a new version of SAM in the beginning of December, so if this is ready by then we'll use it to generate the SAM libraries for that version.
sam-cec-module-library-tools.zip
Thanks so much for making this contribution!
Paul.
from sam.
Thanks @cpaulgilman, this is super helpful. Do you also have similar scripts for inverters that you can share?
from sam.
@allenlawrence94 Here are scripts for inverters:
sam-cec-inverter-library-tools.zip
The CEC is switching over to a new "Energy Commission Solar Equipment Lists Home Web App," so your scripts should probably the Excel files from the new site. At first glance, they appear be similar to the ones we have been using.
For modules, click the "Download Excel file" link at the top right of the page:
https://solarequipment.energy.ca.gov/Home/PVModuleList
And similarly for inverters, although there are three lists (hover over the "Inverters" link to see them): Grid Support Solar Inverter, Grid Support Battery Inverter, and Grid Support Solar/Battery. I think we would want the combined list with a field indicating whether it is a battery inverter.
https://solarequipment.energy.ca.gov/Home/InvertersList
from sam.
I was not aware that SAM SSC included code to calculate inverter model parameters. pvlib provides this function. It would be good to benchmark these two implementations against each other.
from sam.
@cwhanse The SSC code (C++) that calculates the inverter model parameters ("coefficient generator" or "cg" in SAM lingo) is here: https://github.com/NREL/ssc/blob/develop/ssc/cmod_inv_cec_cg.cpp
The SSC code that calculates module model parameters for SAM's 6-parameter single-diode module model is here: https://github.com/NREL/ssc/blob/develop/ssc/cmod_6parsolve.cpp
These are SSC compute modules, so they can be accessed using any of the following methods:
- In SAM, using the ssc_exec() function in SAM's LK scripting language.
- In a Python script using the PySAM package
- In any of the languages for which there is a wrapper in the SAM SDK
from sam.
@allenlawrence94 Have you made any progress on this work? We were just updating the module and inverter libraries for SAM 2021.12.02 r1, and were reminded of how useful it would be to have this conversion process implemented in Python. Let me know if there's anything we can do to help.
from sam.
PR here: pvlib/pvmodules#11
from sam.
Scripts and instructions for the process NREL uses to generate module and inverter library CSV files from CEC Excel workbooks are here: https://github.com/NREL/SAM/tree/develop/samples/CEC%20Module%20and%20Inverter%20Libraries
from sam.
Related Issues (20)
- Change macOS requirements from macOS 10.15 to macOS 12
- Indifference vs PPA Price macro description issue
- PDF report doesn't work for battery self-consumption battery dispatch option
- Combine Cases Macro doesn't check simulation timesteps HOT 1
- Wind turbine doesn't generate power at wind speeds above cut-in speed HOT 1
- Incentives page should provide warning about PBI and grid charging
- Wind "Environmental Losses" description incorrect
- Electricity rates with different escalation rates for buy and sell rates HOT 1
- Mac Intel & Windows Runners for all repos
- Application window text unreadable HOT 1
- Support DC-connected batteries with multiple MPPT inputs
- Upgrade wxwidgets to 3.2.5
- Build SAM error on Apple silicon (arm64) HOT 1
- Update PV uncertainty distributions
- Error with Solar Resource Interpolation Macro
- Improve help docs/UI related to IEC spectral response HOT 1
- SAM doesn't throw an error for different tier in different TOU periods
- Divide by zero in send to excel with equations HOT 1
- Out-of-date Cambium metadata variable prevents downloads from working
- Consistently set the default PBI term to zero
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sam.