How can I get hourly data using "data_get_array" command in MATLAB?

  • Ablimit
  • Topic Author
More
09 Jan 2019 20:14 #6592 by Ablimit
Hello,

I was about to run several thousands of simulations on concentrated solar power (CSP) by using SSC in MATLAB. Although I was able to retrieve annual data from the Data Container with "data_get_number" command, I couldn't retrieve any hourly data with "data_get_array" command. Yes, I could get the hourly data from SAM, but I don't want to do that as I'm about to run a huge number of simulations and need to reprocess data with MATLAB. Is it because the names of the hourly variables in the Data Container are different from the ones in SAM?

I would really appreciate if anyone could provide a guide.

Thank you,
Ablimit

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

  • pgilman
More
24 Jan 2019 10:20 #6593 by pgilman
Dear Ablimit,

You should be able to get the hourly data. You can use the SDKtool to see a list of all input and output variables for the different compute modules. For most of the performance models in SAM, including the CSP models, the output variable
Code:
gen
is the hourly or subhourly electric power generated by the system.

For the
Code:
tcstrough_physical
module, the variables
Code:
W_net
and
Code:
W_cycle_gross
are the net and gross cycle output, respectively.

Best regards,
Paul.

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

  • awendell989
More
08 Jan 2020 21:18 #7869 by awendell989
Paul in python, "gen" does in fact pull the KWh, but is there an accompanying array of dates and hours? If so, how do I pull that?

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

  • pgilman
More
09 Jan 2020 11:05 - 09 Jan 2020 11:06 #7870 by pgilman
Hi Avery,

The gen array is single value of kW values with no timestamps.

If you are running one of the solar energy modules (pvsamv1, pvwattsv5, trough_physical, etc. and need to know the year, month, day, hour, and minute time stamp values used for the sun position calculations, you can get the time stamp value from the weather file.

Otherwise, SAM assumes that the first row of gen is the first time stamp on Monday, January 1. For an hourly simulation, that would be the hour ending at 1 am on January 1. It does not account for daylight savings time or leap years.

Best regards,
Paul.
Last edit: 09 Jan 2020 11:06 by pgilman.

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

  • awendell989
More
09 Jan 2020 11:21 #7871 by awendell989
Thank you so much for the response! This is an amazing tool
I could not find the documentation for "gen" anywhere. Is ther documentation about what you can call for 
"data_get_array" or "data_get_number?"

Thanks again,

Avery.

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

  • pgilman
More
13 Jan 2020 10:32 #7880 by pgilman
Hi Avery,

The SSC input and output variables are not very well documented. Here are a few suggestions for learning about what the variables represent:

1. Use the SDKtool as described on the SDK webpage .
2. Use the variable documentation functions described in Section 3.4 of the SSC Guide (see link under Documentation on the SDK webpage .
3. Use the SAM desktop application to run simulations and explore the variables on the input pages and results page.

All of that said, the variable 'gen' is a time series array of the electrical output in kW of the power system you are modeling. Its value may be negative for some time steps. For example, a PV system's inverter may consume power at night, resulting in a negative value of gen for night-time time steps.

Best regards,
Paul.

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

Moderators: pgilman
Powered by Kunena Forum