- Posts: 3
Obtain Annual Net DC Energy for a simple efficiency PV model in Python
- Ansari
- Topic Author
Less
More
31 Jul 2021 23:18 #9898
by Ansari
Obtain Annual Net DC Energy for a simple efficiency PV model in Python was created by Ansari
Hi,
I am working on assessing the feasibility of PV in different locations of the world. I am using a simple efficiency PV model for the simulation. To make things easier I decided to use the Python code generated by SAM to loop the outputs for multiple locations. I am not able to understand how to get the annual net DC energy alongside the four generated outputs (annual AC energy, capacity factor, energy yield, and performance ratio.
ssc.module_free(module)
annual_energy = ssc.data_get_number(data, b'annual_energy')
print('Annual energy (year 1) = ', annual_energy)
capacity_factor = ssc.data_get_number(data, b'capacity_factor')
print('Capacity factor (year 1) = ', capacity_factor)
kwh_per_kw = ssc.data_get_number(data, b'kwh_per_kw')
print('Energy yield (year 1) = ', kwh_per_kw)
performance_ratio = ssc.data_get_number(data, b'performance_ratio')
print('Performance ratio (year 1) = ', performance_ratio)
annual_dc_net = ssc.data_get_number(data, b'Annual_DC_energy')
print('Annual DC energy (year 1) = ', annual_dc_net)
ssc.data_free(data)
Whenever I run this in the program, I get the value of DC energy to be zero. Can someone please guide me on this?
Also, the complete code for the program can be found here:
drive.google.com/drive/folders/1vNCFM9-maB0NFok-MM5_3kMM2EGUC03U?usp=sharing
Thank You.
P.S. I am new to programming
I am working on assessing the feasibility of PV in different locations of the world. I am using a simple efficiency PV model for the simulation. To make things easier I decided to use the Python code generated by SAM to loop the outputs for multiple locations. I am not able to understand how to get the annual net DC energy alongside the four generated outputs (annual AC energy, capacity factor, energy yield, and performance ratio.
ssc.module_free(module)
annual_energy = ssc.data_get_number(data, b'annual_energy')
print('Annual energy (year 1) = ', annual_energy)
capacity_factor = ssc.data_get_number(data, b'capacity_factor')
print('Capacity factor (year 1) = ', capacity_factor)
kwh_per_kw = ssc.data_get_number(data, b'kwh_per_kw')
print('Energy yield (year 1) = ', kwh_per_kw)
performance_ratio = ssc.data_get_number(data, b'performance_ratio')
print('Performance ratio (year 1) = ', performance_ratio)
annual_dc_net = ssc.data_get_number(data, b'Annual_DC_energy')
print('Annual DC energy (year 1) = ', annual_dc_net)
ssc.data_free(data)
Whenever I run this in the program, I get the value of DC energy to be zero. Can someone please guide me on this?
Also, the complete code for the program can be found here:
drive.google.com/drive/folders/1vNCFM9-maB0NFok-MM5_3kMM2EGUC03U?usp=sharing
Thank You.
P.S. I am new to programming
Attachments:
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
03 Aug 2021 09:20 #9907
by pgilman
Replied by pgilman on topic Obtain Annual Net DC Energy for a simple efficiency PV model in Python
Hi Ansari,
You can find a list of all of the input and output variables for the Pvsamv1 module here:
nrel-pysam.readthedocs.io/en/master/modules/Pvsamv1.html#outputs-group
I think the variable name you want to use is 'annual_dc_net' instead of 'Annual_DC_energy'.
Best regards,
Paul.
You can find a list of all of the input and output variables for the Pvsamv1 module here:
nrel-pysam.readthedocs.io/en/master/modules/Pvsamv1.html#outputs-group
I think the variable name you want to use is 'annual_dc_net' instead of 'Annual_DC_energy'.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- Ansari
- Topic Author
Less
More
- Posts: 3
16 Aug 2021 02:00 #9937
by Ansari
Replied by Ansari on topic Obtain Annual Net DC Energy for a simple efficiency PV model in Python
Hi Paul,
Thanks a lot for your reply. The code works perfectly.
Regards,
Ansari Aadil Shahzad
Thanks a lot for your reply. The code works perfectly.
Regards,
Ansari Aadil Shahzad
Please Log in or Create an account to join the conversation.
Moderators: pgilman