Battery analysis: gen not assigned

  • ilozka
  • Topic Author
More
26 Jul 2023 17:34 #12351 by ilozka
Battery analysis: gen not assigned was created by ilozka
Hello, 

I'm trying to upgrade our v209 to the current v280 without too much success - I'm getting the "gen not assigned" message for a request working in v209 (it's even more interesting that Linux library requires even more parameters than the Windows DLL).
Can you please help me why this Linux script fails?
Thank you,
Zoltan
 

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

  • pgilman
More
26 Jul 2023 23:40 #12352 by pgilman
Replied by pgilman on topic Battery analysis: gen not assigned
Hi Zoltan,

Can you provide more context about what you are trying to do so I can help troubleshoot?

The script you provided appears to be for SDKtool. To run the battery module, you must provide all of the inputs required by the module.

You can find a list of the module input and outputs on the Module Browser tab of SDKtool:

 

One of the required inputs is 'gen', so you will need to assign it a value before you can run the battery module.

To get a complete, working script, you might try creating a Standalone Battery model in SAM, and using the code generator to create an LK script for SDKtool as described here: sam.nrel.gov/software-development-kit-sdk.html

Best regards,
Paul.
Attachments:

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

  • ilozka
  • Topic Author
More
27 Jul 2023 15:08 #12353 by ilozka
Replied by ilozka on topic Battery analysis: gen not assigned
Hi Paul,

Thanks for your response.

we have a battery analysis using SSC module v209 called from Ruby, I'm trying to upgrade it to v280 - tried to isolate the issue by calling SSC from SDKTool. 
It's weird that our current v209 client sends an input parameter named "AC" for the hourly production values (Watts), but I don't see this param in Module Browser, not even for the old v209 version - I see that "ac" is a "pvwatts" module parameter, but the guy who developed this for us used it in this battery module call - is that valid for the old version?

Anyway, added the 'gen' parameter by passing the kW production values 30 times (for some reason, gen is not marked as required in Module Browser), and also added some other required parameters and the simulation runs successfully - thank you! 

Unfortunately I can't call the current SSC library version from Ruby, since the parameters working fine in SDKtool will result in a killed process (Segmentation fault) when trying to pass them from Ruby. Also having some other weird parameter validation issues, can only pass "0" for inverter_model and batt_replacement_option, else getting the following validation errors:
fail(inverter_model, integer): number could not be interpreted as an integer: 4.77864e-314
fail(batt_replacement_option, integer): number could not be interpreted as an integer: 4.77035e-314
Didn't have these issues with the old version, do you have any idea what happened during the updates?

Also tried to run the SDKtool with the old v209 .so file and the original parameters to see that I can reproduce an existing, working library call using SDKtool, but the tool terminates with this message:
IA__gtk_widget_set_size_request: assertion 'height >= -1' failed  
Any idea what's happening there?

Thank you!
Zoltán

 

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

  • pgilman
More
27 Jul 2023 18:04 - 27 Jul 2023 18:05 #12354 by pgilman
Replied by pgilman on topic Battery analysis: gen not assigned
Hi Zoltán,

SSC Version 209 goes with SAM 2018.11.11 r4, which is quite old compared to the current SSC 280 for SAM 2022.11.21 r3. We have done a lot of work on the battery model between those two versions, so upgrading will require some effort to remove some old variables and add new ones.

Attached are three files that I hope will help you with the upgrade:

inputs-ssc280.txt contains the required inputs for the 'battery' module in SSC 280, arranged in alphabetical order.

inputs-zoltan.txt contains the inputs from your "fail-linux.lk" script, also arranged in alphabetical order. You can use a text comparison tool to see what variables have changed between versions.

battery-ssc280.lk is an LK script for SDKtool that sets inputs and runs the 'battery' module for SSC 280.

I'm not sure what is causing the errors when you make calls to SSC from Ruby. The 'inverter_model' input is not an input to the 'battery' module in SSC 280, so that issue may be moot. You should be able to assign an integer value of 0, 1, or 2 to 'battery_replacement_option'.

I was able to run your linux-fail.lk script in SDKtool (the version that comes with SAM 2018.11.11 r4) on Linux Mint 21.1 from the command line with
./SDKtool

I do see the GTK errors, but they do not prevent the application from running.

Best regards,
Paul.

 
Last edit: 27 Jul 2023 18:05 by pgilman.

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

  • ilozka
  • Topic Author
More
01 Aug 2023 13:56 #12363 by ilozka
Replied by ilozka on topic Battery analysis: gen not assigned
Thanks Paul, the script works in one of my older Kubuntu 18 environments.
Do you have any idea why is it crashing on Kubuntu 22? Message is "free(): invalid pointer"
 

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

  • pgilman
More
01 Aug 2023 16:19 #12364 by pgilman
Replied by pgilman on topic Battery analysis: gen not assigned
Hi Zoltan,

I'm not sure what's causing that error, or why it works in one Kubuntu version but not the other.

One possible way to cause this error is to modify an array element that is not allocated, like assigning a[4] = x when a[3] is the last element in the array.

Thanks,
Paul.

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

Moderators: pgilman
Powered by Kunena Forum