SAM vs PySAM output differences

  • zippo
  • Topic Author
More
10 Jul 2024 13:53 #13292 by zippo
SAM vs PySAM output differences was created by zippo
I am a SAM and PySAM beginner but have tried my best to read through recent forum threads and documentation.

I am not getting the same output from PySAM as for my SAM desktop app. I have confirmed they use the same underlying versions:
  • SAM desktop app: SSC Version 290: OS X 64 bit GNU/C++ Mar 7 2024 03:31:21
  • PySAM Version 5.1.0, SSC version 290

How do I best find reasons why SAM and PySAM are not coming to the same output metrics?
I have started with just defaults to keep it simple but am using a custom location ('lat': 33.45, 'lon': -111.98, Sedona AZ).

I have attached my python program and here are outputs of runs with some variations but still does not yield the same result.

PySAM program that uses NSRDB to get weather file

❯ python sam3.py

Starting data download for solar using 1 thread workers.
File already exists. Skipping download: data/sam/nrel/nsrdb_33.45_-111.98_psm3-tmy_60_tmy.csv
Number of resource files returned: 1
Resource file to load: data/sam/nrel/nsrdb_33.45_-111.98_psm3-tmy_60_tmy.csv

Annual AC energy in Year 1: 812,638 kWh
DC capacity factor in Year 1: 18.3%
Energy yield in Year 1: 1,601 kWh/kW
Performance ratio in Year 1: 0.67
LCOE Levelized cost of energy nominal: 4.10 cent/kWh
LCOE Levelized cost of energy real: 3.28 cent/kWh
Electricity bill without system (year 1): $104,614
Electricity bill with system (year 1): $49,112
Net savings with system (year 1): $55,502
Net present value: $176,459
Simple payback period: 11.3 years
Discounted payback period: nan years
Net capital cost: $882,247
Equity: $0
Debt: $882,247

PySAM program that uses SAM desktop app weather file

❯ python sam3.py

Annual AC energy in Year 1: 816,786 kWh
DC capacity factor in Year 1: 18.4%
Energy yield in Year 1: 1,609 kWh/kW
Performance ratio in Year 1: 0.68
LCOE Levelized cost of energy nominal: 4.08 cent/kWh
LCOE Levelized cost of energy real: 3.26 cent/kWh
Electricity bill without system (year 1): $104,614
Electricity bill with system (year 1): $51,348
Net savings with system (year 1): $53,266
Net present value: $156,697
Simple payback period: 11.8 years
Discounted payback period: nan years
Net capital cost: $882,247
Equity: $0
Debt: $882,247


SAM desktop app

Annual AC energy in Year 1  940,471 kWh
DC capacity factor in Year 1    21.4%
Energy yield in Year 1  1,872 kWh/kW
Performance ratio in Year 1 0.79 
LCOE Levelized cost of energy nominal   3.51 ¢/kWh
LCOE Levelized cost of energy real  2.80 ¢/kWh
Electricity bill without system (year 1)    $104,614 
Electricity bill with system (year 1)   $50,061 
Net savings with system (year 1)    $54,554 
Net present value   $168,608 
Simple payback period   11.5 years
Discounted payback period   NaN
Net capital cost    $882,247 
Equity  $0 
Debt    $882,247 
 
Attachments:

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

  • pgilman
More
10 Jul 2024 17:23 #13295 by pgilman
Replied by pgilman on topic SAM vs PySAM output differences
Hello,

In order to get the same results from PySAM and SAM, first, as you have done, make sure you are using equivalent versions. You can compare the information about PySAM versions here, github.com/NREL/pysam/releases , with the information on SAM's About page (click Help and then About in SAM) to check that the SAM and SSC version numbers are the same for SAM and PySAM.

Next, the SAM and PySAM inputs values must be indentical to get the same results. There are a lot of inputs, so this is tricky. The best way to ensure your PySAM inputs are the same as SAM's is to create a SAM file for the project you want to model, set the inputs in SAM to what you want them to be, and then import those inputs into PySAM as described here: nrel-pysam.readthedocs.io/en/main/inputs-from-sam.html .

In principle, you should get the same results from SAM and PySAM with default values (create a case in SAM and don't change any inputs, and then create a model for the same configuration in PySAM from defaults as described here: nrel-pysam.readthedocs.io/en/main/defaults.html ). A more reliable way to ensure SAM and PySAM have the exact same inputs is to create the default case in SAM and then import those inputs into PySAM.

In your example above, it's not clear to that the three scenarios all use the same weather file. And, as I mentioned in my response to your post about interdependent variables , to be completely sure your PySAM model is using the same inputs as SAM, you should import the inputs from SAM rather than creating a model from defaults.

Best regards,
Paul.

 

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

  • zippo
  • Topic Author
More
11 Jul 2024 03:07 #13297 by zippo
Replied by zippo on topic SAM vs PySAM output differences
Thanks Paul, I will try the JSON export and import to make sure defaults are exactly the same.

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

Moderators: pgilman
Powered by Kunena Forum