I'm trying to simulate and size a PV + Storage system to constantly supply 1kW 24h7 and then checking the overall cost and output for varying battery sizes, from 0 to 20kWh. I successfully did it with the SAM GUI, using a detailed PV+Battery for residential, whereby I set the target supply from grid to zero and a 1kW load set 100% on critical. I've then tried to simulate the system with pysam by first importing the models inputs from the Jason inputs produced by the SAM GUI. I have the following problems:
1. The simulation goes well the first time, but it crashes the second time. Giving an error about the crit_load variable not being as long as the weather data. I have indeed noticed that the simulation increases the length of the crit_load 10 times, form 8760 after initialisation to 87600.
2. Changing the analysis period on the pvsaams module seems to clear the first error, as the len of the variable crit-load does not change.
3. The problem then arises due to the sizing of the battery as I change the desired capacity of the battery from 20kWh to 0. As I decrease the battery capacity value using the helper function "battery_model_resizing" I eventually get an error :
compute fail(pvsamv1): Error during calculation of battery voltage model parameters: negative value(s) found. A: 0.670000, B: 1.160991, K: -0.179448, E0: 3.350645
It seems to be a problem with interdependent variables.
Is there an example that tries to achieve what I'm trying to do?