Multiple Locations simulation

  • pgilman
More
02 Nov 2022 17:35 #11637 by pgilman
Replied by pgilman on topic Multiple Locations simulation
Hi Gabriel,

There are some differences between LK in SDKtool and LK in SAM. Click Help in the SDKtool Script Editor to see a list of functions.

In this case, SDKtool uses var() to set and get variable names. For example:
Code:
var( 'tilt', 30 ); tilt_angle = var( 'tilt' );


Best regards,
Paul.

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

  • GabrielSimoes
More
07 Nov 2022 06:07 #11660 by GabrielSimoes
Replied by GabrielSimoes on topic Multiple Locations simulation
I was able to run the lk simulation. Thks, Paul.

But I was comparing the results i got and there is a problem with it. My lk simulation needs to run 28 weather files, half of it is filled with hourly data and the other half is filled with 1 minute data. Yet some of the weather files are returning wrong results when i compare with SAM simulation. Meantime if i run only the file that presented error on LK simulation, it returns me the right value.

The wrong results:
Summary
Annual AC energy in Year 1 [kWh]: 1.83294e+07
DC capacity factor in Year 1 [%]: 20.5685
Energy yield in Year 1 [kWh/kW]: 1801.8
Performance ratio in Year 1 [-]: 0.825696

Clipping
Total Clipping energy [kW]: 711759
Total DC input power [kW]: 1.98286e+07
Total Clipping loss [%]: 3.58955



The right results:
Summary

Annual AC energy in Year 1 [kWh]: 18332990
DC capacity factor in Year 1 [%]: 20.5725
Energy yield in Year 1 [kWh/kW]: 1802.15
Performance ratio in Year 1 [-]: 0.826152

Clipping

Total Clipping energy [kW]: 724072
Total DC input power [kW]: 1.9845e+07
Total Clipping loss [%]: 3.64863



Could you help?

best regards
Gabriel

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

  • pgilman
More
07 Nov 2022 15:26 #11661 by pgilman
Replied by pgilman on topic Multiple Locations simulation
Hi Gabriel,

If you can attach a minimum code sample that demonstrates the problem, I can try to help you troubleshoot.

Best regards,
Paul.

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

  • GabrielSimoes
More
16 Nov 2022 11:01 #11700 by GabrielSimoes
Replied by GabrielSimoes on topic Multiple Locations simulation
that's all my code, paul.

Others system's informations:
DC/AC: 1.40
Number of inverters: 22
Module power: 660Wp
Inverter power: 330kWac


path = 'weather files path';

files = dir_list(path, 'csv'); // search for csv files only

set('use_specific_weather_file',1);
errors = '';


for ( idx = 0; idx < #files;idx=idx+1) {

fpath[0] = path;
fpath[1] = files[idx];

weatherfiles[idx] = join(fpath,'');


outln('--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.\n');
outln('Simulacao realizada com o RMY: ' + files[idx] + '\n');
set( 'user_specified_weather_file', weatherfiles[idx] );
simulate(errors,0);


//sum_clip = sum(get('inv_cliploss'));
sum_dcinput = sum(get('dc_net'));
clippingloss = get('annual_ac_inv_clip_loss_percent');


outln('
Summary
\n');
outln('Annual AC energy in Year 1 [kWh]: ' + get('annual_energy'));
outln('DC capacity factor in Year 1 [%]: ' + get('capacity_factor'));
outln('Energy yield in Year 1 [kWh/kW]: ' + get('kwh_per_kw'));
outln('Performance ratio in Year 1 [-]: ' + get('performance_ratio') + '\n');
outln('
Clipping
\n');
outln('Total Clipping energy [kW]: ' + get('annual_inv_cliploss'));
outln('Total DC input power [kW]: ' + sum_dcinput);
outln('Total Clipping loss [%]: ' + clippingloss + '\n');
//
//Gerando .txt de sa_da


if (idx == 0){
data = "";
}
data = data + '--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--.--\n';
data = data + 'Simulacao realizada com o RMY: ' + files[idx] + '\n';
data = data + '\n';

data = data + '
Summary
\n';
data = data + 'Annual AC energy in Year 1 [kWh]: ' + get('annual_energy') + '\n';
data = data + 'DC capacity factor in Year 1 [%]: ' + get('capacity_factor') + '\n';
data = data + 'Energy yield in Year 1 [kWh/kW]: ' + get('kwh_per_kw') + '\n';
data = data + 'Performance ratio in Year 1 [-]: ' + get('performance_ratio') + '\n';
data = data + '\n';

data = data + '
Clipping
\n';
data = data + 'Total Clipping energy [kW]: ' + get('annual_inv_cliploss') + '\n';
data = data + 'Total DC input power [kW]: ' + sum_dcinput + '\n';
data = data + 'Total Clipping loss [%]: ' + clippingloss + '\n';
data = data + '\n';
data = data + '\n';
data = data + '\n';
}

ok = write_text_file( "txt file path", data );  //path to create a txt file with the results of 28 simulations
if (!ok)
outln("Error writing text file.");

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

  • pgilman
More
16 Nov 2022 16:43 #11703 by pgilman
Replied by pgilman on topic Multiple Locations simulation
Hi Gabriel,

When you compare results between SDKtool and SAM, make sure that SDKtook is using the same ssc.dll file as SAM. You can check the path in the bar at the bottom of the SDKtook for the path to ssc.dll, and the SSC version number should be the same as the one y ou see in SAM when you click About in the Help window (click Help to open the Help window, and then click About at the top of the Help window. In SDKtool, use the Choose SSC library button in the Module Browser to choose a different version of ssc.dll.

Best regards,
Paul.

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

  • sarahahmed
More
06 Mar 2023 09:00 #11978 by sarahahmed
Replied by sarahahmed on topic Multiple Locations simulation
Hi Umut,

I tried to run your code on multiple weather files and it worked, however, all the results outputted into the csv were identical for each weather file. I am wondering how you fixed this?

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

Moderators: pgilman
Powered by Kunena Forum