- Posts: 20
Creating a function to monitor PV module output as a function of cell efficiency
- Michael Caballero
- Topic Author
Less
More
14 Jan 2025 11:46 #13808
by Michael Caballero
Creating a function to monitor PV module output as a function of cell efficiency was created by Michael Caballero
Hello,
I'm trying to create a model in python for microgrid capacity based on load requirements. Basically I'm trying to get to a point where the model i create says 'based on this electric load, solar resource at this location, and costs, the optimal PV module efficiency is X%" Within the pvsamv1 model and the PVBatteryThirdParty configuration how can I call up and modify specific variables? Also has anyone done any work with changing these parameters from values to continuous variables?
Thanks,
Michael
I'm trying to create a model in python for microgrid capacity based on load requirements. Basically I'm trying to get to a point where the model i create says 'based on this electric load, solar resource at this location, and costs, the optimal PV module efficiency is X%" Within the pvsamv1 model and the PVBatteryThirdParty configuration how can I call up and modify specific variables? Also has anyone done any work with changing these parameters from values to continuous variables?
Thanks,
Michael
Please Log in or Create an account to join the conversation.
- Paul Gilman
Less
More
- Posts: 5507
14 Jan 2025 12:49 #13809
by Paul Gilman
Replied by Paul Gilman on topic Creating a function to monitor PV module output as a function of cell efficiency
Hi Michael,
For information about working with variables, see:
nrel-pysam.readthedocs.io/en/main/variables-pysam.html
nrel-pysam.readthedocs.io/en/main/variables-sam.html
One approach might be to design your approach using the SAM desktop application: Use it to identify the input variables you want to change and the output variables you want to evaluate, and then set up the model in Python to work with those variables.
Best regards,
Paul.
For information about working with variables, see:
nrel-pysam.readthedocs.io/en/main/variables-pysam.html
nrel-pysam.readthedocs.io/en/main/variables-sam.html
One approach might be to design your approach using the SAM desktop application: Use it to identify the input variables you want to change and the output variables you want to evaluate, and then set up the model in Python to work with those variables.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- Michael Caballero
- Topic Author
Less
More
- Posts: 20
14 Jan 2025 14:25 #13810
by Michael Caballero
Replied by Michael Caballero on topic Creating a function to monitor PV module output as a function of cell efficiency
Hi Paul,
Thanks for this. I think using the simple efficiency model makes the most sense for my model. The inputs I want to modify are PV STC and nominal efficiency and the output I'm looking for is hourly generation. Look at the SAM GUI the value is 'Electricity from System to load' from the data tables after simulation is complete. I want to see how the hourly PV power out changes based on STC and efficiency given solar resource data.
In a semi-related question: How do I make sure when a model executes its using the desired module model. For example if I have a model called newmodel set to PV-Battery Third Party newmodel=pv.default("PVBatteryThirdParty")How do I code it so it executes using the simple efficiency model as opposed to the CEC model since they're both set up with with pvsamv1.
Thanks,
Michael
Thanks for this. I think using the simple efficiency model makes the most sense for my model. The inputs I want to modify are PV STC and nominal efficiency and the output I'm looking for is hourly generation. Look at the SAM GUI the value is 'Electricity from System to load' from the data tables after simulation is complete. I want to see how the hourly PV power out changes based on STC and efficiency given solar resource data.
In a semi-related question: How do I make sure when a model executes its using the desired module model. For example if I have a model called newmodel set to PV-Battery Third Party newmodel=pv.default("PVBatteryThirdParty")How do I code it so it executes using the simple efficiency model as opposed to the CEC model since they're both set up with with pvsamv1.
Thanks,
Michael
Please Log in or Create an account to join the conversation.
- Paul Gilman
Less
More
- Posts: 5507
14 Jan 2025 16:47 #13811
by Paul Gilman
Replied by Paul Gilman on topic Creating a function to monitor PV module output as a function of cell efficiency
Hi Michael,
The variable that sets the module model is 'module_model' where:
0 = Simple efficiency model
1 = CEC performance model with module database
2 = CEC performance model with user entered specifications
3 = Sandia array performance model with module database
4 = IEC61853 single diode model
Its PySAM documentation is here: nrel-pysam.readthedocs.io/en/main/modules/Pvsamv1.html#PySAM.Pvsamv1.Pvsamv1.Module.module_model
The "Electricity from System to load" variable name is 'year1_hourly_system_to_load', which is an output of the Utilityrate5 module: nrel-pysam.readthedocs.io/en/main/modules/Utilityrate5.html#PySAM.Utilityrate5.Utilityrate5.Outputs.year1_hourly_system_to_load
Best regards,
Paul.
The variable that sets the module model is 'module_model' where:
0 = Simple efficiency model
1 = CEC performance model with module database
2 = CEC performance model with user entered specifications
3 = Sandia array performance model with module database
4 = IEC61853 single diode model
Its PySAM documentation is here: nrel-pysam.readthedocs.io/en/main/modules/Pvsamv1.html#PySAM.Pvsamv1.Pvsamv1.Module.module_model
The "Electricity from System to load" variable name is 'year1_hourly_system_to_load', which is an output of the Utilityrate5 module: nrel-pysam.readthedocs.io/en/main/modules/Utilityrate5.html#PySAM.Utilityrate5.Utilityrate5.Outputs.year1_hourly_system_to_load
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- Michael Caballero
- Topic Author
Less
More
- Posts: 20
23 Feb 2025 13:13 #13891
by Michael Caballero
Replied by Michael Caballero on topic Creating a function to monitor PV module output as a function of cell efficiency
Hi Paul,
I've been looking through the code files and haven't seen or been able to decipher where the actual calculations happen. I would like to use SAM, specifically the simple PV performance model, to validate the outputs of my model so I want to see if my hourly generation equations are the same. Do you know which file that would be in or how I can search the SSC to find them?
Michael
I've been looking through the code files and haven't seen or been able to decipher where the actual calculations happen. I would like to use SAM, specifically the simple PV performance model, to validate the outputs of my model so I want to see if my hourly generation equations are the same. Do you know which file that would be in or how I can search the SSC to find them?
Michael
Please Log in or Create an account to join the conversation.
- Paul Gilman
Less
More
- Posts: 5507
24 Feb 2025 10:23 #13898
by Paul Gilman
Replied by Paul Gilman on topic Creating a function to monitor PV module output as a function of cell efficiency
Hi Michael,
If you're looking for a specific equation for the Simple Efficiency Module Model, here are some places to look in the code:
Gilman, P.; Dobos, A.; DiOrio, N.; Freeman, J.; Janzou, S.; Ryberg, D. (2018) SAM Photovoltaic Model Technical Reference Update. 93 pp.; NREL/TP-6A20-67399. ( PDF 1.8 MB )
Let me know if you need help finding a specific equation. It's a bit tricky to trace through the model equations without setting up a complete build environment. (That process is described for Windows, Mac, and Linux on the SAM GitHub repository's wiki: github.com/NREL/SAM/wiki .)
Best regards,
Paul.
If you're looking for a specific equation for the Simple Efficiency Module Model, here are some places to look in the code:
- The model inputs are defined here:
github.com/NREL/ssc/blob/82d9c9ebb98b556018e02ffa8464f53528be31d4/ssc/cmod_pvsamv1.cpp#L282
- The relationship between inputs and the model is established here:
github.com/NREL/ssc/blob/82d9c9ebb98b556018e02ffa8464f53528be31d4/shared/lib_pv_io_manager.cpp#L1004
- The equations are implemented here: github.com/NREL/ssc/blob/82d9c9ebb98b556018e02ffa8464f53528be31d4/shared/lib_pvmodel.cpp#L142
Gilman, P.; Dobos, A.; DiOrio, N.; Freeman, J.; Janzou, S.; Ryberg, D. (2018) SAM Photovoltaic Model Technical Reference Update. 93 pp.; NREL/TP-6A20-67399. ( PDF 1.8 MB )
Let me know if you need help finding a specific equation. It's a bit tricky to trace through the model equations without setting up a complete build environment. (That process is described for Windows, Mac, and Linux on the SAM GitHub repository's wiki: github.com/NREL/SAM/wiki .)
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: Paul Gilman