Statistics

Dispatch

PowerModelsONM.get_timestep_dispatchMethod
get_timestep_dispatch(
    solution::Dict{String,<:Any},
    network::Dict{String,<:Any}
)::Vector{Dict{String,Any}}

Returns the dispatch information for generation assets (generator, storage, solar, voltage_source) and bus voltage magnitudes in SI units for each timestep from the optimal dispatch solution

source
PowerModelsONM.get_timestep_dispatch_optimization_metadataMethod
get_timestep_dispatch_optimization_metadata(
    optimal_dispatch_result::Dict{String,Any}
)::Dict{String,Any}

Gets the metadata from the optimal switching results for each timestep, returning a list of Dicts (if opt_switch_algorithm="rolling-horizon"), or a list with a single Dict (if opt_switch_algorithm="full-lookahead").

source
PowerModelsONM.get_timestep_inverter_states!Method
get_timestep_inverter_states!(args::Dict{String,<:Any})::Vector{Dict{String,Any}}

Adds field "inverter" to power flow output for inverter objects, i.e., storage generator, voltagesource, solar. See [`gettimestepinverterstates`](@ref gettimestepinverter_states)

source
PowerModelsONM.get_timestep_inverter_statesMethod
get_timestep_inverter_states(optimal_switching_results::Dict{String,<:Any})::Vector{Dict{String,Any}}

Gets 'inverter' state for each generation object at each timestep from optimal_switching_results. Defaults to GRID_FORMING if no inverter state is available.

source
PowerModelsONM.get_timestep_voltage_statisticsMethod
get_timestep_voltage_statistics(
    solution::Dict{String,<:Any},
    network::Dict{String,<:Any};
    make_per_unit::Bool=true
)::Dict{String,Vector{Real}}

Returns statistics on the Minimum, Mean, and Maximum voltages for each timestep using get_voltage_min_mean_max

If make_per_unit (default: true), will return voltage statistics in per-unit representation. If make_per_unit is false, and there are different voltage bases across the network, the statistics will not make sense.

source
PowerModelsONM.get_voltage_min_mean_maxMethod
get_voltage_min_mean_max(
    solution::Dict{String,<:Any},
    data::Dict{String,<:Any};
    make_per_unit::Bool=true
)::Tuple{Real,Real,Real}

Calculates the minimum, mean, and maximum of the voltages across a network (not a multinetwork)

data is used to convert the units to perunit if `makeperunit` and the data is not already perunit.

If make_per_unit (default: true), will return voltage statistics in per-unit representation. If make_per_unit is false, and there are different voltage bases across the network, the statistics will not make sense.

source

Actions

PowerModelsONM.get_timestep_device_actionsMethod
get_timestep_device_actions(
    network::Dict{String,<:Any},
    optimal_switching_results::Dict{String,<:Any}
)::Vector{Dict{String,Any}}

From the multinetwork network, determines the switch configuration at each timestep. If the switch does not exist in mld_results, the state will default back to the state given in the original network. This could happen if the switch is not dispatchable, and therefore state would not be expected in the results.

Will output Vector{Dict} where each Dict will contain "Switch configurations", which is a Dict with switch names as keys, and the switch state, "open" or "closed" as values, and "Shedded loads", which is a list of load names that have been shed at that timestep.

source
PowerModelsONM.get_timestep_switch_changesFunction
get_timestep_switch_changes(
    network::Dict{String,<:Any},
    optimal_switching_results::Dict{String,<:Any}=Dict{String,Any}()
)::Vector{Vector{String}}

Gets a list of switches whose state has changed between timesteps (always expect the first timestep to be an empty list). This expects the solutions from the MLD problem to have been merged into network

source
PowerModelsONM.get_timestep_switch_optimization_metadataMethod
get_timestep_switch_optimization_metadata(
    optimal_switching_results::Dict{String,Any};
    opt_switch_algorithm::String="full-lookahead"
)::Vector{Dict{String,Any}}

Gets the metadata from the optimal switching results for each timestep, returning a list of Dicts (if opt_switch_algorithm="iterative), or a list with a single Dict (if opt_switch_algorithm="full-lookahead").

source

Analysis

PowerModelsONM.get_microgrid_networksMethod
get_microgrid_networks(network::Dict{String,Any}; switch_config::Union{Missing,Dict{String,PMD.SwitchState}}=missing)::Vector{Vector{String}}

Collects microgrid networks in a single timestep

source

Faults

PowerModelsONM.get_timestep_fault_currentsMethod
get_timestep_fault_currents(
    fault_studies_results::Dict{String,<:Any},
    faults::Dict{String,<:Any},
    network::Dict{String,<:Any};
    ret_protection_only::Bool=false
)::Vector{Dict{String,Any}}

Gets information about the results of fault studies at each timestep, including:

  • information about the fault, such as
    • the admittance ("conductance (S)" and "susceptance (S)"),
    • the bus at which the fault is applied
    • the type of fault (3p, 3pg, llg, ll, lg), and
    • to which connections the fault applies
  • information about the state at the network's protection, including
    • the fault current |I| (A)
    • the zero-sequence fault current |I0| (A)
    • the positive-sequence fault current |I1| (A)
    • the negative-sequence fault current |I2| (A)
    • the bus voltage from the from-side of the switch |V| (V)
    • the bus voltage angle from the from-side of the switch phi (deg)

ret_protection_only==false indicates that currents and voltages should be returned for all lines where switch=y, and if true, should only return switches for which a protection device is defined (recloser, relay, fuse)

source
PowerModelsONM.get_timestep_fault_currentsMethod
get_timestep_fault_currents(
    fault_studies_results::Dict{String,<:Any},
    faults::String,
    network::Dict{String,<:Any}
)::Vector{Dict{String,Any}}

Special case where the faults string was not parsed

source
PowerModelsONM.get_timestep_fault_currentsMethod
get_timestep_fault_currents(::Dict{String,<:Any}, ::String, ::String; ret_protection_only::Bool=false)::Vector{Dict{String,Any}}

Helper function for the variant where args["network"] hasn't been parsed yet.

source
PowerModelsONM.get_timestep_fault_study_metadataMethod
get_timestep_fault_study_metadata(
    fault_studies_results::Dict{String,Any}
)::Vector{Dict{String,Any}}

Gets the metadata from the optimal switching results for each timestep, returning a list of Dicts (if opt_switch_algorithm="rolling-horizon"), or a list with a single Dict (if opt_switch_algorithm="full-lookahead").

source

Microgrid

PowerModelsONM.get_timestep_generator_profilesMethod
get_timestep_generator_profiles(
    solution::Dict{String,<:Any}
)::Dict{String,Vector{Real}}

Returns statistics about the generator profiles from the optimal dispatch solution:

  • "Grid mix (kW)": how much power is from the substation
  • "Solar DG (kW)": how much power is from Solar PV DER
  • "Energy storage (kW): how much power is from Energy storage DER
  • "Diesel DG (kW)": how much power is from traditional generator DER
source
PowerModelsONM.get_timestep_load_servedFunction
get_timestep_load_served(
    solution::Dict{String,<:Any},
    network::Dict{String,<:Any}
)::Dict{String,Vector{Real}}

Returns Load statistics from an optimal dispatch solution, and compares to the base load (non-shedded) in network, giving statistics for

  • "Feeder load (%)": How much load is the feeder supporting,
  • "Microgrid load (%)": How much load is(are) the microgrid(s) supporting,
  • "Bonus load via microgrid (%)": How much extra load is being supported.

Note

Currently, because microgrids are not explicitly defined yet (see 'settings' file for initial implementation of microgrid tagging), "Bonus load via microgrid (%)" only indicates how much charging is being performed on Storage.

source
PowerModelsONM.get_timestep_load_servedFunction
get_timestep_load_served(::Dict{String,<:Any}, network::String, switching_solution::Union{Missing,Dict{String,<:Any}}=missing)

Helper function for the variant where args["network"] hasn't been parsed yet.

source
PowerModelsONM.get_timestep_storage_socMethod
get_timestep_storage_soc(
    solution::Dict{String,<:Any},
    network::Dict{String,<:Any}
)::Vector{Real}

Returns the storage state of charge, i.e., how much energy is remaining in all of the the energy storage DER based on the optimal dispatch solution. Needs network to give percentage.

source

Stability

PowerModelsONM.get_timestep_stabilityMethod
get_timestep_stability(
    is_stable::Dict{String,Bool}
)::Vector{Bool}

This is a placeholder function that simple passes through the is_stable Vector back, until the Stability feature gets more complex.

source