We will be performing a major infrastructure and web site ugprades on Friday, September 27th 8:00 am - 5:00 pm MST (UTC -7).

The website will be down during that time.

Obtain Annual Net DC Energy for a simple efficiency PV model in Python

  • Ansari
  • Topic Author
More
01 Aug 2021 05:18 #9898 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

File Attachment:

File Name: SAMcode.py
File Size:30 KB

File Attachment:

File Name: __init__.py
File Size:0 KB

File Attachment:

File Name: PySSC.py
File Size:7 KB

File Attachment:

File Name: grid_curtailment.csv
File Size:197 KB

Please Log in or Create an account to join the conversation.

  • pgilman
More
03 Aug 2021 15:20 #9907 by pgilman
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.

Please Log in or Create an account to join the conversation.

  • Ansari
  • Topic Author
More
16 Aug 2021 08:00 #9937 by Ansari
Hi Paul,

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
Powered by Kunena Forum