- Posts: 12
parout not working with CSP physical trough model
- karooga
- Topic Author
Less
More
18 Mar 2015 06:27 #3182
by karooga
parout not working with CSP physical trough model was created by karooga
Good day Paul,
I'm trying to run multiple simulations using LK scripting language. My plant configuration is a CSP Physical trough and it's based on the defaults supplied by the SAM wizard. I'm running 2015.1.30 version of SAM.
For my different simulations, all I'm wanting to do is change the weather file. I'm using parsim(runs) to run the simulations where 'runs' is a table I've created with each entry defined as "runs[n] = {'user_specified_weather_file'=fileWithFullDir }". In the UI of the project file model I've enabled the check box "user specified weather file".
I'm using parout(i, 'annual_energy') to extract the output information from each of the simulations. The simulations all seem to run (no failures etc) and from looking at parout(i), the run time for each of the entries is different. However what I'm seeing is that the output (e.g.'annual_energy') is all the same. Cross referencing the calculated energy with manual runs of each weather file, it appears to correspond with the last entry (of the user_specified_weather_file) in my runs table.
To me this appears to be either a bug, or that I am not using parsim and parout correctly.
I have fiddled with setting the 'file_name' parameter as this is the only relevant input variable name I see when using the SDK SSC browser tool. Using the inputs browser in SAM however, I don't see a 'file_name' variable but instead only 'user_specified_weather_file'). I've also looked at the get() and set() methods, but I don't think these are applicable to parallel processing.
Any guidance would be greatly appreciated.
regards
Paul
I'm trying to run multiple simulations using LK scripting language. My plant configuration is a CSP Physical trough and it's based on the defaults supplied by the SAM wizard. I'm running 2015.1.30 version of SAM.
For my different simulations, all I'm wanting to do is change the weather file. I'm using parsim(runs) to run the simulations where 'runs' is a table I've created with each entry defined as "runs[n] = {'user_specified_weather_file'=fileWithFullDir }". In the UI of the project file model I've enabled the check box "user specified weather file".
I'm using parout(i, 'annual_energy') to extract the output information from each of the simulations. The simulations all seem to run (no failures etc) and from looking at parout(i), the run time for each of the entries is different. However what I'm seeing is that the output (e.g.'annual_energy') is all the same. Cross referencing the calculated energy with manual runs of each weather file, it appears to correspond with the last entry (of the user_specified_weather_file) in my runs table.
To me this appears to be either a bug, or that I am not using parsim and parout correctly.
I have fiddled with setting the 'file_name' parameter as this is the only relevant input variable name I see when using the SDK SSC browser tool. Using the inputs browser in SAM however, I don't see a 'file_name' variable but instead only 'user_specified_weather_file'). I've also looked at the get() and set() methods, but I don't think these are applicable to parallel processing.
Any guidance would be greatly appreciated.
regards
Paul
Please Log in or Create an account to join the conversation.
- pgilman
Less
More
- Posts: 5423
18 Mar 2015 13:04 #3183
by pgilman
Replied by pgilman on topic parout not working with CSP physical trough model
Hi Paul,
I posted a sample script on our Samples page that shows how to cycle through a set of weather files stored in a folder. See instructions for running it in the comments at the top of the script.
It uses both simulate() and parsim(), and should help you sort out what might be wrong with your script. I tested it with SAM's default physical trough case, and the parallel simulations with parsim() generate the same results as sequential simulations with simulate().
If you use the weather files I posted in the .zip file for your tests, remove the "XXX broken weather file.csv" from the weather folder so that you can see the parout() output.
Best regards,
Paul.
I posted a sample script on our Samples page that shows how to cycle through a set of weather files stored in a folder. See instructions for running it in the comments at the top of the script.
It uses both simulate() and parsim(), and should help you sort out what might be wrong with your script. I tested it with SAM's default physical trough case, and the parallel simulations with parsim() generate the same results as sequential simulations with simulate().
If you use the weather files I posted in the .zip file for your tests, remove the "XXX broken weather file.csv" from the weather folder so that you can see the parout() output.
Best regards,
Paul.
Please Log in or Create an account to join the conversation.
- karooga
- Topic Author
Less
More
- Posts: 12
19 Mar 2015 00:06 #3184
by karooga
Replied by karooga on topic parout not working with CSP physical trough model
Hi Paul,
Great success, yours works for me and also it isn't my custom weather files that are causing the problem either. While my code was almost identical to your example, there was one subtle difference. When assigning a value to the table element, you updated the original array element in place; where as I created a separate variable to assign to the table element. I was printing out the output as well and while it seems identical, mine doesn't work and yours does. This is something I cannot explain, but perhaps you have some insights. I will mail you my script directly.
Thanks again!
regards
Paul
Great success, yours works for me and also it isn't my custom weather files that are causing the problem either. While my code was almost identical to your example, there was one subtle difference. When assigning a value to the table element, you updated the original array element in place; where as I created a separate variable to assign to the table element. I was printing out the output as well and while it seems identical, mine doesn't work and yours does. This is something I cannot explain, but perhaps you have some insights. I will mail you my script directly.
Thanks again!
regards
Paul
Please Log in or Create an account to join the conversation.
Moderators: pgilman