LK Scripting Language

2 posts / 0 new
Last post
h.johnson
Turbine output control

Hi SAM team,

I'm working on a LK script to change some simulation inputs and I'm wondering if it's possible to change the turbine output fraction to an array. In my script, it sets the 'ui_disp_1_turbout' to hourly values over a year with no error, but after simulating, it shows that the turbine output fraction does not follow the assigned array, and just stays as a single value. Attached is an image of part of the code.

If this is not possible, is there a way to best mimic an off grid CSP system to follow the demand profile?

2 posts / 0 new
Last post
lx9
Case study codes sharing

Hello SAM supporting team,

I am studying one of your webinars about scripting, and interested in the case study "CSP System LCOE Optimization". If possible, could you kindly upload corresponding script onto GitHub?

I checked this link "https://github.com/NREL/SAM/tree/develop/samples", but examples of scripting are not found. It would be appreciated if you can share more examples to facilitate more applications.

Many thanks,
Lue

11 posts / 0 new
Last post
stef
python error

Hi ,
I generate code pyton with SAM, but doesn''t work when I execude a code.
syntax error (ssc.data_set_matrix( data, b'subarray1_shading:mxh', subarray1_shading:mxh );

any idea ?

regards
stef

4 posts / 0 new
Last post
wukangqian
SAM open source test

In the windows SAM build instruction (https://github.com/NREL/SAM/wiki/Windows-Build-Instructions), step 6 suggest to "Start a new project" on SAM's welcome page. However, after I click the bottom, a window comes out saying "Updating solar resource library..." and after a few minutes, the program stops.
Does anyone know how to solve this problem? Thanks!
Regards,
Kangqian

2 posts / 0 new
Last post
Solpwr
GCR & Time Series - Self Shading

I am trying to write a time series script to monitor self shading based on a series of GCR values. I have used the script below but i am getting a series of 0 for my result

for( i=0; i<#GCR; i++ )
{
G = GCR[i][0];
set( 'subarray1_gcr_ref', G);
simulate();

cf = get('subarray1_linear_derate');
outln( 'simulation ' + i + ': ' + cf );

}

Any help will be greatly appreciated.
Thanks

3 posts / 0 new
Last post
pspitsen
Scripting to Input Hourly Electric Load Data

Hi,

I am writing a script to input different hourly load profiles, but am having trouble getting SAM to recognize the input data. I have tried csv files with either 8760 rows or 8761 rows (where the first row is a place holder) of data organized in a single column, however neither work.

The code I have been trying is:

active_case('untitled');
set('load_model', 1);
set('normalize_to_utility_bill', 0);
set('load', real_array(read_text_file('C:/Users/pspitsen/Desktop/load.csv')));
simulate();

5 posts / 0 new
Last post
Harry Han
Use LK to import user defined TOD array

Dear Paul

Is it possible that I can import user defined TOD array into power tower model with LK? The user defined TOD array is consisted of 8760 numbers.

Thank you!

Han

2 posts / 0 new
Last post
liub06
tcstrough-physical example failed in matlab

Hi

I was attempting to run the tcstrough_physical model with Matlab. I receive an error:

tcstrough_physical errors:
time 0.00 { Controller 3 }:
Heat exchanger sizing failed
unit 3 (Controller) type 'sam_mw_trough_type251' failed at initialization
exec fail(tcstrough_physical): there was a problem simulating in tcskernel(physical trough)

I have already examined the input parameters carefully. In addition,I can't find the explanation for 'hx_config'.

The .m and weather file are as attached. Is there any clue when that might happen?

3 posts / 0 new
Last post
dagoski
Bulk CSV Exports

I have a mess of projects I'm modeling. I would like to export the summary, monthly, and annual data tables to csv for all the projects in bulk. All in one go instead of going from project to project and exporting each one by hand. Is it possible to script this in SAM? In case anyone's curious, I'm working up evaluations for several parcels of land in a small city. I want to get this all into something like R or Excel. I'm using R to make some prettier plots than SAM can do. Excel makes it easier to format tables for insertion into a written report.

2 posts / 0 new
Last post
David.Garza
How to run SAM script from Excel file and output to the same excel file.

Hi,

I have a LX script which I would like to modify so that the script opens an excel file I direct it to. It then runs the script for all of the data from a selected area and outputs the results in designated cells in the same excel file.

Would that be possible and how would I go about adding that feature to my current script?

Best,
David

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer