Dispatch strategy for generic system in PySAM

  • Sofia Lundholm
  • Topic Author
More
06 Feb 2023 13:56 #11902 by Sofia Lundholm
Dispatch strategy for generic system in PySAM was created by Sofia Lundholm
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?

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

  • Paul Gilman
More
06 Feb 2023 22:58 - 28 Feb 2023 00:13 #11903 by Paul Gilman
Replied by Paul Gilman 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.
Last edit: 28 Feb 2023 00:13 by Paul Gilman.

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

  • Sofia Lundholm
  • Topic Author
More
24 Feb 2023 14:56 #11957 by Sofia Lundholm
Replied by Sofia Lundholm 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

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

  • Paul Gilman
More
28 Feb 2023 00:13 #11963 by Paul Gilman
Replied by Paul Gilman 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.

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

  • Sofia Lundholm
  • Topic Author
More
14 Mar 2023 11:24 #11993 by Sofia Lundholm
Replied by Sofia Lundholm 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

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

  • Paul Gilman
More
14 Mar 2023 23:31 #11998 by Paul Gilman
Replied by Paul Gilman 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 Log in or Create an account to join the conversation.

Moderators: Paul Gilman
Powered by Kunena Forum