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?
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.
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?
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 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.