Multiple Locations simulation

  • Adam Gallaher
More
25 Apr 2022 13:01 #10871 by Adam Gallaher
Replied by Adam Gallaher on topic Multiple Locations simulation
Hello Paul, 

Thank you for the suggestions, this helped and I was able to figure out how to run multiple simulations while changing various parameters for each simulation based on data in my csv file. I ran some tests, using my data comparing the GUI and my lk script. I found that my lk script kept outputting the same results (annual energy output) for each system design at different locations. I believe the issue is with the weather files, the location for each simulation is the same even when it should be changing after each iteration in the for loop. 

I've attached my lk script and the csv file I am accessing. Is there something I am doing wrong with how I am calling the different weather files, or is there something I can change with the system parameters to force a change of location. Thank you in advance for all your help. 

Adam 

File Attachment:

File Name: Parcel_Loc...test.csv
File Size:1 KB

File Attachment:

File Name: System_Parameters.lk
File Size:1 KB

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

  • Paul Gilman
More
25 Apr 2022 23:19 #10876 by Paul Gilman
Replied by Paul Gilman on topic Multiple Locations simulation
Hi Adam,

The National Solar Radiation Database (NSRDB) uses approximately 4 km square map grid cells. If the latitude and longitude values of the location in your request fall within the same grid cell, then the requests will return the same weather file. You can verify this by opening the .csv weather file and comparing at the latitude and longitude values in the file with the lat/lon values you used for the request.

In the file name SAM constructs when you download a weather file, it puts the location name (or lat/lon pair you used for the request) at the beginning of the file name and the lat/lon of the grid cell at the end of the file name so you can see the difference.



Best regards,
Paul.
Attachments:

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

  • Adam Gallaher
More
25 Apr 2022 23:47 #10877 by Adam Gallaher
Replied by Adam Gallaher on topic Multiple Locations simulation
Hello Paul, 

Thank you for getting back to me. I am aware that the data from the NSRDB has about a 4km resolution, this was one of the checks I preformed during trouble shooting. The issue is that, even when I have two locations that fall within the same NSRDB cell, if they have different nameplate capacities the annual energy output should be different. The csv from my last post, in column H shows the annual energy output for each location based on the NSRDB data I downloaded for that location, and the nameplate capacity of the system I am looking to model. The results in column H were calculated by interacting with the SAM GUI. You can see that the values are different for each location. However, when using my lk script to model the same parameters as from the SAM GUI runs, I find that the annual energy output for each location is the same even though the system nameplate capacity is changing, those results can be found in column J of the csv. 

I am wondering if my lk scrip is accessing the csv incorrectly, or if there is a setting that I messed up. I know that my script is reading in the nameplate capacity and location correctly because I write those results out to the console during each iteration in my for loop. I am reading my csv in as a string and then casting the necessary values to integers and real number before any parameter setting for each model, could that be causing my issue? Any suggestion would be greatly appricate.

Thank you, 

Adam 

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

  • Paul Gilman
More
26 Apr 2022 00:03 #10878 by Paul Gilman
Replied by Paul Gilman on topic Multiple Locations simulation
Hi Adam,

The system_capacity input variable type is real, so you should use the to_real() function to convert it from a string to a real number. To do that, you need the following line:

sys_cap = to_real(sys_cap);

Note that to_real(sys_cap) by itself will not change the value of sys_cap, you need to use sys_cap = to_real(sys_cap).

Best regards,
Paul.

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

  • Adam Gallaher
More
26 Apr 2022 00:10 #10879 by Adam Gallaher
Replied by Adam Gallaher on topic Multiple Locations simulation
Hello Paul, 

I see, I assumed that the system_capacity variable was an integer since the input type in the search window is [number], but a real number would make more sense. This worked, and I am now receiving different annual energy output numbers for different system capacities. Thank you very much for your help and sorry for the simple confusion. 

All the best, 

Adam 

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

  • Gabriel Simões
More
02 Nov 2022 18:16 #11634 by Gabriel Simões
Replied by Gabriel Simões on topic Multiple Locations simulation
Good afternoon, Paul.

i'm trying to use these two functions get() and set(), but SDKtool are returning me this error: '[41] referencing unassigned variable:set'.

Could you help me, please. Thank you

Gabriel

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

Moderators: Paul Gilman
Powered by Kunena Forum