NREL / PyDSS

Other
33 stars 19 forks source link

Auto-determine snapshot simulation start time #78

Closed daniel-thom closed 3 years ago

daniel-thom commented 3 years ago

The goal of this feature is to have PyDSS run a snapshot simulation at the time point with the max PV-to-load ratio. This is only supported with QSTS and one time point. Snapshot mode is not supported.

In order to use this feature you have to set the following in the simulation.toml:

"Start time" = "2020-1-1 00:00:00.0"
"Simulation duration (min)" = 15.0
"Auto snapshot start time config" = {mode = "max_pv_load_ratio", search_duration_min = 1440.0}

The value for search_duration_min controls the time range of the load shape profiles to search.

This branch is based on prior work from Sherin to determine the proper time point.

daniel-thom commented 3 years ago

Looks good to me @daniel-thom. The only thing I am a bit concerned about is the number of digits we will have to write if we are searching across the entire year (8760 x 60). But that's okay I guess.

This is more of a problem for the simulation duration field (I copied the same format), which must be entered for all time series simulations. If @AadilLatif is open to it we could switch to the ISO 8601 format for timedelta (which is what Pydantic uses). Examples:

# 1 hour
"01:00:00
# 365 days
"P365D"

It could be a new field to maintain backwards compatibility.