Inputs and outputs from large parametric analysis

  • sfrank
  • Topic Author
More
21 Oct 2014 22:13 #2640 by sfrank
I would like to use SAM to run a large parametric analysis. Specifically, I want to model similar PV arrays at roughly 550 individual sites and obtain time series outputs of the DC and AC energy production for input to other simulations.

I know I can implement this sort of study via the SDK (likely the way I will do it), but I am also wondering if it is possible to do efficiently from within the SAM GUI. The relevant questions seem to be:

1. Can I import (or copy/paste) a list of which TMY3 files I want to run in the parametric analysis, to avoid needing to manually select all ~550 of them?

2. For time series output, I see that if I save a CSV I can get time series as CSV string entries that are semicolon ; delimited. However, this makes a really giant CSV file when I run 550 simulations, each with DC and AC power as time series output. Is there a way to instead automatically pipe the time series output to individual results files for every simulation that I can later parse?

Incidentally, when I run so many parametric simulations within SAM and include time series as outputs, the plots it automatically generates (in the beta version) take a very long time to display. I don't really need the plots to auto-display and would like to turn them off to save time, if possible. Is there an option for that?

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

  • Paul Gilman
More
22 Oct 2014 18:06 #2641 by Paul Gilman
Replied by Paul Gilman on topic Inputs and outputs from large parametric analysis
SAM's Parametrics feature works well for parametric studies involving a relatively small number of values, and is particularly useful when you want to use SAM to create graphs to show the relationship between an output and one or two inputs, or to find a minimum or maximum for optimization.

For larger studies involving more than one or two dozen values, it is probably more efficient to use a script (SamUL in SAM 2014.1.14 and older, LK in SAM 2014.9.30 Beta and later). My answers assume that you would implement a solution via script.

1. Yes. You can put the weather files in a single folder, and then use the script to step through them.

2. You can write a script to write time series data to a separate file for each simulation run.

In SamUL, you can use the Simulate() function with the 'false' parameter to prevent SAM from generating the graph data. In LK, by default the Simulate() function does not generate graph data. There is not a way to turn off graphs with the Parametrics feature.

Best regards,
Paul.

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

  • sfrank
  • Topic Author
More
27 Oct 2014 14:57 #2642 by sfrank
Thanks. I will check out the scripting features.

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

  • sfrank
  • Topic Author
More
04 Dec 2014 19:54 #2643 by sfrank
Hi Paul,

I'm making good progress but stuck on efficiently extracting time series outputs from each simulation. Can you provide an example of how to generate a multi-column CSV using the new LK script?

Here's what I have so far:
// Get time series output
output = [
get('dc_gross'),
get('dc_net'),
get('ac_gross'),
get('ac_net')
];

// Write time series output
csvwrite(cases + '_' + locs[j], output);

The downside is that (a) there are no headers, and (b) the outputs are transposed from the usual layout (timestamps are by column but should be by row).

EDIT: Never mind! It was as simple as switching to a table structure...

// Get time series output
output = {
'dc_gross' = get('dc_gross'),
'dc_net' = get('dc_net'),
'ac_gross' = get('ac_gross'),
'ac_net' = get('ac_net')
};

// Write time series output
csvwrite(cases + '_' + locs[j], output);

Output looks like...
dc_gross,dc_net,ac_gross,ac_net
0,0,-0.0012,-0.001188
0,0,-0.0012,-0.001188
...

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

Moderators: Paul Gilman
Powered by Kunena Forum