NREL / SAM

System Advisor Model (SAM)
BSD 3-Clause "New" or "Revised" License
337 stars 139 forks source link

ReOpt API “Get Size & Dispatch” Freezing SAM Software #310

Closed brianschmidly closed 4 years ago

brianschmidly commented 4 years ago

I tried to size a Microgrid (both domestic and international) using SAM’s ReOpt API using the commercial solar+BESS module, and when I clicked on the Get size and dispatch button, SAM became unresponsive in both Mac and Windows environments. Anyone else notice this issue? I sized the critical load as a percentage of the actual load. Tried it for both a NM and international project. Got the same results = SAM froze up. It’s a great feature if it works, though.

brianschmidly commented 4 years ago

This is the error message that came back after several minutes - just now seeing it. I’m using 5 min interval load data. Will the integration with ReOpt only work with 60 min (8760) time interval data?

“Could not evaluate callback function:call_reopt->on_change [76]: error in call to 'reopt_size_battery()': Load profile must have 8760 entries.[61]: eval error in statement list”

dguittet commented 4 years ago

Thanks for reporting the issue. The call to ReOpt indeed takes quite some time (~3-5 minutes).

From the reopt lite api, the load "must be hourly (8,760 samples), 30 minute (17,520 samples), or 15 minute (35,040 samples)." However, the SAM integration currently only allows hourly load profiles.

I will see if we can expand this to 30 and 15 minute data easily for the upcoming patch. Otherwise, we will fix this for the next release.

brianschmidly commented 4 years ago

Very good. Thank you for the quick response. Yes, expanding the allowable time step interval data would be very helpful. Thank you.

brianschmidly commented 4 years ago

I got the ReOpt API to work and recommend battery sizing, but it looks like it’s optimizing around fastest payback or NPV? Please confirm.

Also, Is there a way to optimize the battery sizing around the probability of surviving the outage by time? If not, is there a workaround to force SAM to solve for the latter?

Thanks, Brian

dguittet commented 4 years ago

It optimizes for NPV.

The ReOpt Lite website allows you to optimize for resilience. I haven't seen any flag in the API that we're using that toggles between NPV vs resilience as the objective function. There is the option to provide resilience statistics (avg hrs survived, survival function etc). I will inquire with the ReOpt team.

brianschmidly commented 4 years ago

That would be a great new feature, though: to let SAM pick the battery size (and solar PV size) based on probability of surviving an outage and then filter the results (in a parametric study) By NPV or savings or simple payback. Please document this feature request. Thanks!