Enhance SAM with features tailored to your specific needs! We collaborate with companies, universities, and organizations to privately fund new capabilities or analyses. Your investment drives innovation while benefiting the broader energy community. Email us to learn more.

wrong annual energy output in PySAM

  • Niki
  • Topic Author
More
18 Apr 2023 15:56 #12059 by Niki
Hello,
I am trying to model a simple PV system in PySAM. 
I used Pvwattsv8.default("PVWattsNone") and then set some inputs in the code. For example, I set the system capacity as 4kW, while the default value is 100,000 kW. After executing the model, the result shows the annual energy output for a 100,000 kW system. 
It seems the code executes the model for default values, although I set different values.
I have no idea what's wrong with it.
I copy my code here:

import PySAM.Pvwattsv8 as PV
pv_model = PV.default("PVWattsNone")

pv_model.SolarResource.solar_resource_file = 'path'
pv_model.system_capacity = 4.0  # System capacity in kW
pv_model.SystemDesign.dc_ac_ratio = 1.2  # DC-to-AC ratio
pv_model.SystemDesign.array_type = 0  # Fixed array type
pv_model.SystemDesign.tilt = 30  # Tilt angle in degrees
pv_model.SystemDesign.azimuth = 180  # Azimuth angle in degrees (South-facing)
pv_model.SystemDesign.gcr = 0.4  # Ground coverage ratio
pv_model.Losses = 5

pv_model.execute()

annual_energy = pv_model.Outputs.annual_energy
capacity_factor = pv_model.Outputs.capacity_factor
energy_yield = pv_model.Outputs.kwh_per_kw


 

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

  • Paul Gilman
More
18 Apr 2023 16:22 #12061 by Paul Gilman
Replied by Paul Gilman on topic wrong annual energy output in PySAM
Hi Niki,

Please see the PySAM documentation for different ways to set a variable's value:

nrel-pysam.readthedocs.io/en/main/variables-pysam.html#set-a-variable-value

For example, you could use
Code:
pv_model.value('system_capacity',4.0) # System capacity in kW

Best regards,
Paul.

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

  • Niki
  • Topic Author
More
19 Apr 2023 00:58 #12064 by Niki
Replied by Niki on topic wrong annual energy output in PySAM
Thank you Paul

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

Moderators: Paul Gilman
Powered by Kunena Forum