- Posts: 3
Dispatch strategy for generic system in PySAM
- slundhol
- Topic Author
Less
More
06 Feb 2023 06:56 #11902
by slundhol
Dispatch strategy for generic system in PySAM was created by slundhol
Hello,
I'm trying to make a generic battery system in PySAM that takes an hourly generation profile from a file as input. Is it possible to choose a dispatch strategy and lifetime and degradation for that model similarly to what is possible in Pvsamv1? Alternatively, can an hourly generation profile be inserted into the Pvsamv1 model?
I'm trying to make a generic battery system in PySAM that takes an hourly generation profile from a file as input. Is it possible to choose a dispatch strategy and lifetime and degradation for that model similarly to what is possible in Pvsamv1? Alternatively, can an hourly generation profile be inserted into the Pvsamv1 model?
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
06 Feb 2023 15:58 - 27 Feb 2023 17:13 #11903
by pgilman
Replied by pgilman on topic Dispatch strategy for generic system in PySAM
Hi Sofia,
Yes, it is possible to use PySAM to model a Generic Battery system that takes an hourly generation profile as an input. I would recommend first setting the system up in SAM so that it works as you expect, and then using the Code Generator as described in the PySAM documentation to import the inputs from SAM to PySAM: nrel-pysam.readthedocs.io/en/main/inputs-from-sam.html .
The 'energy_output_array' input variable of the GenericSystem module is the one you'll want to use to store the generation profile from your file: nrel-pysam.readthedocs.io/en/main/modules/GenericSystem.html#PySAM.GenericSystem.GenericSystem.Plant.energy_output_array .
For the Generic Battery configuration, the battery dispatch and lifetime options are inputs to the Battery module: nrel-pysam.readthedocs.io/en/main/modules/Battery.html .
It is not possible to use an hourly generation profile as input to the Pvsamv1 module.
Best regards,
Paul.
Yes, it is possible to use PySAM to model a Generic Battery system that takes an hourly generation profile as an input. I would recommend first setting the system up in SAM so that it works as you expect, and then using the Code Generator as described in the PySAM documentation to import the inputs from SAM to PySAM: nrel-pysam.readthedocs.io/en/main/inputs-from-sam.html .
The 'energy_output_array' input variable of the GenericSystem module is the one you'll want to use to store the generation profile from your file: nrel-pysam.readthedocs.io/en/main/modules/GenericSystem.html#PySAM.GenericSystem.GenericSystem.Plant.energy_output_array .
For the Generic Battery configuration, the battery dispatch and lifetime options are inputs to the Battery module: nrel-pysam.readthedocs.io/en/main/modules/Battery.html .
It is not possible to use an hourly generation profile as input to the Pvsamv1 module.
Best regards,
Paul.
Last edit: 27 Feb 2023 17:13 by pgilman.
Please Log in or Create an account to join the conversation.
- slundhol
- Topic Author
Less
More
- Posts: 3
24 Feb 2023 07:56 #11957
by slundhol
Replied by slundhol on topic Dispatch strategy for generic system in PySAM
Thank you so much for the help! Using the Code Generator made me understand the module much more.
However, I have one more question. I want to build a battery model where the capacity can be easily changed. When I generate the code with different capacities many of the computed values change such as the "batt_current_charge_max", "batt_Qfull_flow" and "LeadAcid_q20_computed" are changed. Is it possible to make PySAM automatically make those calculations in the same way as in SAM? Alternatively, is there any information on how those values are calculated in SAM?
Best regards,
Sofia Lundholm
However, I have one more question. I want to build a battery model where the capacity can be easily changed. When I generate the code with different capacities many of the computed values change such as the "batt_current_charge_max", "batt_Qfull_flow" and "LeadAcid_q20_computed" are changed. Is it possible to make PySAM automatically make those calculations in the same way as in SAM? Alternatively, is there any information on how those values are calculated in SAM?
Best regards,
Sofia Lundholm
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
27 Feb 2023 17:13 #11963
by pgilman
Replied by pgilman on topic Dispatch strategy for generic system in PySAM
Hi Sofia,
The battery_model_sizing() function in BatteryTools might be helpful. See nrel-pysam.readthedocs.io/en/main/helper-tools.html#battery-tools .
Also, these code examples in the PySAM repository include some examples of setting battery dispatch options: github.com/NREL/pysam/tree/main/Examples
Let me know if you have specific questions after reviewing these materials.
Best regards,
Paul.
The battery_model_sizing() function in BatteryTools might be helpful. See nrel-pysam.readthedocs.io/en/main/helper-tools.html#battery-tools .
Also, these code examples in the PySAM repository include some examples of setting battery dispatch options: github.com/NREL/pysam/tree/main/Examples
Let me know if you have specific questions after reviewing these materials.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- slundhol
- Topic Author
Less
More
- Posts: 3
14 Mar 2023 05:24 #11993
by slundhol
Replied by slundhol on topic Dispatch strategy for generic system in PySAM
Hello Paul,
Thank you again for the help! I have looked through the battery dispatch options and Im wondering if there is any more information about how to simulate the performance of the "Price Signal Forecast" battery dispatch. I saw that that option could be chosen by setting batt_dispatch_choice=5, however, I cannot find any information about it in the battery model description. When I try to choose that alternative in my PySAM code I get the error: "Exception: battery execution error.
compute fail(battery): vector<T> too long"Best regards,
Sofia Lundholm
Thank you again for the help! I have looked through the battery dispatch options and Im wondering if there is any more information about how to simulate the performance of the "Price Signal Forecast" battery dispatch. I saw that that option could be chosen by setting batt_dispatch_choice=5, however, I cannot find any information about it in the battery model description. When I try to choose that alternative in my PySAM code I get the error: "Exception: battery execution error.
compute fail(battery): vector<T> too long"Best regards,
Sofia Lundholm
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5447
14 Mar 2023 17:31 #11998
by pgilman
Replied by pgilman on topic Dispatch strategy for generic system in PySAM
Hi Sofia,
Please try setting up the dispatch option in SAM, and then using the code generator to export the inputs from SAM to PySAM. There are a number of inputs that need to be set for the price signal forecast dispatch option that you can see in the SAM user interface. If you set them as you want in SAM, when you export the inputs to PySAM JSON, they will be correctly set for your PySAM code.
The SAM Help system also has a description of the price signal forecast dispatch option: samrepo.nrelcloud.org/help/battery_dispatch_btm.htm
Best regards,
Paul.
Please try setting up the dispatch option in SAM, and then using the code generator to export the inputs from SAM to PySAM. There are a number of inputs that need to be set for the price signal forecast dispatch option that you can see in the SAM user interface. If you set them as you want in SAM, when you export the inputs to PySAM JSON, they will be correctly set for your PySAM code.
The SAM Help system also has a description of the price signal forecast dispatch option: samrepo.nrelcloud.org/help/battery_dispatch_btm.htm
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
Moderators: pgilman