Input parameters for modules using the SDK

11 posts / 0 new
Last post
karooga
Input parameters for modules using the SDK

Good day,

I'm running SAM 14.1.14.

I have an existing Case model in SAM, which I'm trying to replicate using the SSC SDK. The model is based on a physical trough configuration and there are a number of components related to financing, incentives, system costs etc that I'm ignoring for now.

Using the SDK interface or SSC SDKTool, I have identified the required input parameters that I need to use so as to conform to the API of the tcstrough_physical module. I used the "Export Input Variable List" to generate a list of input parameters. The parameters however are designated by long text descriptions which are difficult to match up with short variable names given by SDKTool. There are also a number of input variables defined in SDKTool, which are quite cryptic or don't have any "meta" field information, meaning I've had search through the parameters from all the modules to try make an educated guess so as to match them up.

I wrote a script in SamUL to output the parameters (using "ActiveVariables()") and while it has got me a bit further down the path, it has also shown up a whole bunch of what I am guessing are environment variables meant for TRANSYS, sitting below the SAM engine. I understand the complete model will contain variables for each of the modules it uses but in some cases I didn't find them in any of the modules. I found that the parameter names used in SamUL are in some cases completely different from those used by SSC e.g. csp.dtr.solf.stow_angle and theta_stow.

Despite digging around for quite some time in the documentation and on this forum, I haven't been able to find a better way to do this. Have I missed something quite obvious here? Perhaps there are some look up tables? I did also have a look at CS and JAVA code that was automatically generated, however both of these only included parameters for the annual_output and ippppa modules, nothing for tcstrough_physical, which seemed a bit strange.

Any comments or suggestions would be greatly appreciated.

Thanks
Paul

Paul Gilman

Dear Paul,

This is a problem with SAM 2014.1.14 and the SAM SDK 2014-1-21. SSC requires the variables that you see listed in SDKtool, and there are separate input variables that SAM uses, and in the case of the CSP models, also TRNSYS variables. Some of the variables you see in the SamUL list are variables in SAM's user interface that are not used by SSC.

In the new version of SAM, currently in Beta testing (SAM 2014.9.30), we've completely rewritten the underlying code to eliminate this extra layer of code and associated variables between the user interface and SSC. The SAM inputs browser in the Beta version lists SSC variable names and their values, which makes what you are trying to do a little easier. We've also replaced the TRNSYS simulation engine for the CSP models with a new engine so that all of the calculations happen in the SSC environment.

Furthermore, in the new version of SAM, we've replaced SamUL with the LK scripting language. That means that SAM and SDKtool use the same scripting language.

We plan to develop a tool to export LK script from the SAM user interface that you can then run directly in SDKtool, but that is not yet available.

So, my recommendation would be switch to the new version of SAM -- you can start now with the Beta version. I realize that will involve some work to recreate SAM files and port your SamUL script to LK. We plan to release the new version in mid-November.

Otherwise, if you have a list of the long user-interface variable names from SAM 2014.1.14 for which you need SSC equivalents, you can send me the list, and I will try to match them up.

Thanks,
Paul.

karooga

Hi Paul,

Thanks so much for your reply. I actually already downloaded the Beta release and took a quick look at the variable browser. However due to what I saw regarding the variable names and underlying changes you subsequently indicated I felt that the added overhead in correlating the details was probably not worth the effort for me right now. I was also not able to find a download of the SSC SDK library for the beta release which I would need for Linux.

I think for now, my strategy is going to be to stick with 2014.1.14 as I see this as a more stable solution and my requirements are are slightly more immediate than the release date of the new version. I'm also somewhat concerned that the interfaces will change before the final release meaning there would be future effort that I need to put in.

The input variable name descriptions that I'm after are numerous (188) so I shall mail you directly with a list of them. I have managed to manually work out quite a few but my confidence that I have interpreted them correctly is variable. With regards to some of the variables, specifically those that relate to the drop down boxes in SAM, am I assuming correctly that the first item in the list, is represented by index 0 (and not 1) for the variable?

Another query I have is, does there exist any documentation regarding the logical relationships between each of the SSC modules? While I'd imagine that I can get quite far with just the details contained in each module, the fact that there are 38 separate modules leaves me a bit worried that when I run my model, I will have missed out using another module that is a dependency for the one I'm currently using.

Regards
Paul

Paul Gilman

Dear Paul,

Your assumption is correct that the index of the first item in a SAM user-interface dropdown box is zero.

And, no, we have not documented the connection between SSC modules. At the moment, we do not have funding to develop such documentation. We've tried to make each module as self-documented as possible with the meta data visible in SDKtool and through the SSC query functions. That's still a work in progress -- we are continually adding to each module's self documentation.

Best regards,
Paul.

karooga

Hi Paul,

With regards to your statement:

"We've also replaced the TRNSYS simulation engine for the CSP models with a new engine so that all of the calculations happen in the SSC environment."

For 2014.1.14, are all the CSP models using TRNSYS? With the new beta release have you moved away from using TRNSYS completely now? I would be interested to understand which modules are coupled to TRNSYS and which ones aren't; do you have this information available for both the beta and 2014.1.14 releases?

regards
Paul

Paul Gilman

Hi Paul,

You can tell whether a version of SAM is using TRNSYS by looking in the installation folder. For example, in Windows for SAM 2014.1.14, the default installation folder location is C:\SAM\2014.1.14. In that folder, if you go to \exelib, you'll see a trnsys folder with the files SAM uses to run TRNSYS.

In SAM 2014.1.14 and earlier versions, all of the CSP models use TRNSYS. In the original versions of SAM, all of the performance models used TRNSYS. Starting with version 2012.5.11, we started developing C++ versions of the models to run with SAM's simulation model (SSC).

Starting with next week's version (knock on wood) all of the performance models run in SSC.

Best regards,
Paul.

giovanni.picotti
giovanni.picotti's picture

Dear Paul,

I am trying to replicate the performance model 'CSP power tower molten salt' using the SDKtool, specifically I am using MATLAB to run it, through the given wrapper.
In order to identify each required input I referred to the tcsmolten_salt module in the SSC SDKtool (v.3.0.0, 64 bit). I then exported the input browsers table from the SAM interface (version 2015.6.30) to excel in order to give each input the related default value, that would let me to run the program. Unfortunately the names given to the variables in the SDKtool and in the SAM interface do not coincide. I tried to match them manually but I am not confident enough regarding what I assumed and still a lot of them are non-matched.
Is there any table or document in SAM that relates these variables? I could have missed it. Or can you suggest me how to relate each variable obtained from the SAM interface input browser with the ones obtained from the SDKtool?

Best Regards,
Giovanni

sergio.casimiro

Dear Paul,

Following this thread:
Hi,

I'm using pvsamv1 with the SDK, also with a language wrapper through Matlab. From what I understood Im following the same procedure than Giovanni.

I'm noticing that at least a variable called "cec_adjust" is required when running the pvsamv1 through the SDK, but when I export the inputs from the SAM GUI it is not described there. I tried several versions of SAM (2015.1.30 and 2015.6.30), but they don't show it as an input using the base scenario that comes pre-loaded.

>> Is the variables list described in the SDK updated? If not, would it be possible for you to share an updated list of variables currently being used by the SAM models.

Thanks
Best
--
Sérgio Casimiro

Paul Gilman

Dear Sérgio,

I tested this in SAM 2015.6.30 (SSC version 47) and the ssc-pvsamv1.lk script does assign a value to cec_adjust.

What method are you using to export the input variables from the SAM GUI? You should use the Shift-F5 method, which creates an LK script for each compute model in your SAM case. The LK script assigns values to all of the input variables.

You can open the LK script in the SDKtool Script Editor to test it. The SAM inputs browser only lists the inputs in the SAM user interface, which are different from the compute module inputs.

For example, the module_name input in the SAM GUI listed in the inputs browser is not an input to the pvsamv1 compute module. The SAM GUI uses the module_name input to identify the module in the CEC module library CSV file and then loads parameters like cec_adjust from the CSV file, but those parameters are not inputs in the GUI.

I hope that make sense! In brief:

  • To export input variables from a case in SAM, press the Shift-F5 keys. SAM will generate an LK script that you can use to extract compute module input variables and their values.
  • To verify that you are using the same version of SSC as the SAM GUI, in SAM, click Help and then About. The About window tells you the SAM version number and the SSC version number.

Best regards,
Paul.

Paul Gilman

Dear Giovanni,

Please see my reply to Sergio above.

Best regards,
Paul.

giovanni.picotti
giovanni.picotti's picture

Dear Paul,
thank you very much for your help.

Regards,
Giovanni

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer