Battery module execution errors

  • g1ashok
  • Topic Author
More
16 Apr 2018 16:00 #6180 by g1ashok
Battery module execution errors was created by g1ashok
I'm trying to run battery storage module separately.

Having issues in running battwatts module using SAM SDK after setting the input parameters specified in battwatts module SDK. Can I run it as standalone module? meaning not running pvwatts module before this run. Any dependent input values populated by pvwatts that needs to be set?

Is there a way to debug or get more information on SAM module exec failure? Like missing input parameters, invalid values for the parameter etc? (ssc_module_log always returns null, is this call invocation correct?)

I don't see any errors being logged in the console using ssc_module_exec_simple method either.

Here is the Java code snippet to execute battwatts module.

api.ssc_data_set_number( data, "system_capacity", 2000f );
set_array( data, "load", "./load.csv", 8760); // Using the default load.csv generated from SAM application
api.ssc_data_set_number( data, "batt_simple_enable", 1f );
api.ssc_data_set_number( data, "batt_simple_kwh", 1000f );
api.ssc_data_set_number( data, "batt_simple_kw", 700f );
api.ssc_data_set_number( data, "batt_simple_chemistry", 1f );
api.ssc_data_set_number( data, "batt_simple_dispatch", 0f );
api.ssc_data_set_number( data, "batt_simple_meter_position", 0f );
api.ssc_data_set_number( data, "dc", 1900000f );
api.ssc_data_set_number( data, "ac", 1500000f );
api.ssc_data_set_number( data, "inverter_model", 0f );
api.ssc_data_set_number( data, "inverter_efficiency", 96f );

mod = api.ssc_module_create("battwatts");
if (api.ssc_module_exec(mod,data)==0)
{
System.out.println("error during simulation.");
int idx = 0;
int[] type = new int[2];
float[] time = new float[2];
String msg = null;
while ((msg = SSCAPIJNI.ssc_module_log(mod, idx, type, time)) != null) {
System.out.println("SAM module log " + msg + " Type:" + type[0] + " time:" + time[0]);
}
api.ssc_module_free(mod);
api.ssc_data_free(data);
return;
}
else {
System.out.println("battwatts run completed");
}

Appreciate your help.

Thanks
Ashok

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

  • pgilman
More
17 Apr 2018 11:15 #6181 by pgilman
Replied by pgilman on topic Battery module execution errors
Dear Ashok,

Please see the SDK Guide that comes with the SDK: Section 3.4 describes how to generate a list of inputs for an SSC compute module.

The best way to to debug your code is to write it in LK for SDKtool so you can execute it in the SDKtool development environment that allows you to explore the SSC data container and modules. Once you have a basic model working in SDKtool, you can convert it to Java or another language and further develop it.

From the Module Browser in SDKtool, you can see that the
Code:
ac
and
Code:
dc
inputs are arrays, not numbers as you have specified above.

Best regards,
Paul.

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

  • g1ashok
  • Topic Author
More
18 Apr 2018 12:14 #6182 by g1ashok
Replied by g1ashok on topic Battery module execution errors
Thanks Paul, exporting to LK script and running it using SDKTool helped.

Is there a way to enable debug logs in ssc_module_exec to get more information when it fails?

Was facing another failure in ssc_module_exec (pvsamv1 module), found out it was caused by setting the solar_resource_file param twice. ssc_module_exec failed but there was no error reported in ssc_module_log.
SSCAPIJNI.ssc_data_set_string( data, "solar_resource_file", "PhoenixTMY2.csv" );

Thanks
Ashok

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

  • pgilman
More
19 Apr 2018 09:36 #6183 by pgilman
Replied by pgilman on topic Battery module execution errors
Dear Ashok,

I think you know this, but for the benefit of others, Sections 4.4 and 4.5 of the SDK Guide explain how to access warning and error messages generated by the compute module during simulations. As you note, you can retrieve those messages using the
Code:
ssc_module_log()</ssc> function. I'm not sure why setting the value of <code>solar_resource_file
twice would cause
Code:
pvsamv1
to fail.

Best regards,
Paul.

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

Moderators: pgilman
Powered by Kunena Forum