LK Scripting Language

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

4 posts / 0 new
Last post
Croisfelt
Running Solar Tower optimization from script

Hello NREL,

I would like to know if there is any special function to be called before running a simulation from script, in case of optimization of Heliostat Field for SAM CSP power tower model.

I wrote a script to run several simulations by varying some parameters, but for some scenarios I get different results from a run done directly through SAM's interface (pushing "Simulate" button). I am using "for" looping and calling simulate() function. Simplifying the code (erasing other loops and commands to save outputs) it remains like below:

3 posts / 0 new
Last post
MikeJohnson
MikeJohnson's picture
Possible to use script to download weather files from NREL Solar Radiation Database?

Is it possible to use LK script (through SAM) to download weather files from the NREL Solar Radiation Database?

6 posts / 0 new
Last post
E_Ezeanya
SAM Interpolation Function

Does SAM come with any predefined interpolation function? I was just wondering if there is, because the simulations I'd like to do will warrant some interpolations. Thanks.

3 posts / 0 new
Last post
pstuder
Opening an LK script

Hi,

I am writing scripts to run and record simulations. In order to open a script, do you need to open up SAM/a project first? Ideally, I would like to just open the script, press run, and the script itself will open the project and run the simulations.

4 posts / 0 new
Last post
Paul Gilman
Shift-F5 for generating LK code

I see in one of your replies that it is possible to generate a LK script from a SAM project. Is that right?. I try to do so (shift-F5) but it only runs the simulation and no code is generated. Am I missing some step?

When you generate an LK script from a SAM case for the CSP tower model, a popup window appears behind the SAM main window. You have to click OK in the popup window to continue generating the code, so you'll have to find the popup to do so (you can use Shift-Tab in Windows to find it).

We will fix this issue in the next version of SAM.

1 post / 0 new
Paul Gilman
Use LK to Set Wind Resource File

How do I use LK to choose a wind resource file for the Wind model?

Use the variable use_specific_wf_wind to tell SAM to use a wind resource file on disk instead of one from the wind resource library. This is equivalent to the "Use a wind resource file stored on your computer" check box at the bottom of SAM's Wind Resource input page.

Use user_specified_wf_wind to store the full path and name of the wind resource file.

Here's an example:

2 posts / 0 new
Last post
parvindsastry
Over-flux objective penalty factor to be added to SolarPILOT script

Hello! Not a question..

While running the SolarPILOT lk script with the latest version of SAM ( SAM 2016.3.14), the script does not include the Over-flux objective penalty factor.

I just noticed that the Over-flux objective penalty factor is not added in the lk script and the script generates an error.

I added the line in the script and it now works: ssc_var(obj, "opt_flux_penalty", get('opt_flux_penalty'));

This should probably be added to the script on the sample files page.

Just wanted to share this. Thanks

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer