Hello,
There are two parts to my question.
The first is that I am unable to achieve comparable results when building a Pvwattsv8 No financial model in pySAM compared to those obtained in the SAM application. Specifically comparing achieved capacity factors. The pySAM model consistently produces lower capacity factors compared to the SAM application.
A link to those files can be found
here
.
The second part is in regard to issues when importing JSON inputs.
This was done following the example code from the documentation below, however I encounter the error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 41: invalid start byte.
The json file was downloaded from the code generator, and the SAM application and pySAM versions are 2023.12.17. and v5.0
Could you please advise on what might be causing this problem?
import json
import PySAM.Pvwattsv8 as pv # import the PVWatts module from PySAM
# create a new instance of the Pvwattsv8 module
pv_model = pv.new()
# get the inputs from the JSON file
with open( 'untitled1_pvwattsv8.json', 'r') as f:
pv_inputs = json.load( f )
# iterate through the input key-value pairs and set the module inputs
for k, v in pv_inputs.items():
if k != 'number_inputs':
pv_model.value(k, v)
# run the module
pv_model.execute()
# print results
print('Annual AC output for {capacity:,.2f} kW system is {output:,.0f} kWh.\n'.format(capacity = pv_model.value('system_capacity'), output = pv_model.Outputs.ac_annual) )
Thanks in advance for your help.
Jaco