- Posts: 2
wrong annual energy output in PySAM
- Niki89
- Topic Author
Less
More
18 Apr 2023 15:56 #12059
by Niki89
wrong annual energy output in PySAM was created by Niki89
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
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.
- pgilman
Less
More
- Posts: 5447
18 Apr 2023 16:22 #12061
by pgilman
Replied by pgilman 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
Best regards,
Paul.
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.
- Niki89
- Topic Author
Less
More
- Posts: 2
19 Apr 2023 00:58 #12064
by Niki89
Replied by Niki89 on topic wrong annual energy output in PySAM
Thank you Paul
Please Log in or Create an account to join the conversation.
Moderators: pgilman