Statistics
Dispatch
PowerModelsONM.get_timestep_dispatch!
— Methodget_timestep_dispatch!(
args::Dict{String,<:Any}
)::Vector{Dict{String,Any}}
Gets the optimal dispatch results in-place in args, for use in entrypoint
, using get_timestep_dispatch
.
PowerModelsONM.get_timestep_dispatch
— Methodget_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
PowerModelsONM.get_timestep_dispatch
— Methodget_timestep_dispatch(::Dict{String,<:Any}, ::String)::Vector{Dict{String,Any}}
Helper function for the variant where args["network"]
hasn't been parsed yet.
PowerModelsONM.get_timestep_dispatch_optimization_metadata!
— Methodget_timestep_dispatch_optimization_metadata!(
args::Dict{String,<:Any}
)::Dict{String,Any}
Retrieves the switching optimization results metadata from the optimal switching solution via get_timestep_dispatch_optimization_metadata
and applies it in-place to args, for use with entrypoint
PowerModelsONM.get_timestep_dispatch_optimization_metadata
— Methodget_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"
).
PowerModelsONM.get_timestep_inverter_states!
— Methodget_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)
PowerModelsONM.get_timestep_inverter_states
— Methodget_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.
PowerModelsONM.get_timestep_voltage_statistics!
— Methodget_timestep_voltage_statistics!(
args::Dict{String,<:Any}
)::Dict{String,Vector{Real}}
Gets voltage statistics min, mean, max for each timestep in-place in args, for use in [entrypoint
][@ref entrypoint], using get_timestep_voltage_statistics
PowerModelsONM.get_timestep_voltage_statistics
— Methodget_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.
PowerModelsONM.get_timestep_voltage_statistics
— Methodget_timestep_voltage_statistics(::Dict{String,<:Any}, ::String)
Helper function for the variant where args["network"]
hasn't been parsed yet.
PowerModelsONM.get_voltage_min_mean_max
— Methodget_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.
Actions
PowerModelsONM.get_timestep_device_actions!
— Methodget_timestep_device_actions!(args::Dict{String,<:Any})::Vector{Dict{String,Any}}
Gets the device actions at every timestep using get_timestep_device_actions
and applies it in place to args, for use in entrypoint
.
PowerModelsONM.get_timestep_device_actions
— Methodget_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.
PowerModelsONM.get_timestep_device_actions
— Methodget_timestep_device_actions(::String, ::Dict{String,<:Any})::Vector{Dict{String,Any}}
Helper function for the variant where args["network"]
hasn't been parsed yet.
PowerModelsONM.get_timestep_switch_changes
— Functionget_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
PowerModelsONM.get_timestep_switch_changes
— Functionget_timestep_switch_changes(::String, ::Dict{String,<:Any})::Vector{Vector{String}}
Helper function for the variant where args["network"]
hasn't been parsed yet.
PowerModelsONM.get_timestep_switch_changes!
— Methodget_timestep_switch_changes!(args::Dict{String,<:Any})::Vector{Vector{String}}
Gets the switch changes via get_timestep_switch_changes
and applies it in-place to args, for use with entrypoint
PowerModelsONM.get_timestep_switch_optimization_metadata!
— Methodget_timestep_switch_optimization_metadata!(
args::Dict{String,<:Any}
)::Vector{Dict{String,Any}}
Retrieves the switching optimization results metadata from the optimal switching solution via get_timestep_switch_optimization_metadata
and applies it in-place to args, for use with entrypoint
PowerModelsONM.get_timestep_switch_optimization_metadata
— Methodget_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"
).
Analysis
PowerModelsONM.get_microgrid_networks
— Methodget_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
PowerModelsONM.get_timestep_microgrid_networks!
— Methodget_timestep_microgrid_networks!(args::Dict{String,<:Any})::Vector{Dict{String,Any}}
Collects microgrid networks per timestep and assigns them to 'Device action timestep'/'Microgrid networks'
PowerModelsONM.get_timestep_microgrid_networks
— Methodget_timestep_microgrid_networks(network::Dict{String,Any}, switching_results::Dict{String,Any})::Vector{Vector{Vector{String}}}
Collects microgrid networks per timestep
PowerModelsONM.get_timestep_microgrid_networks_from_output_file
— Methodget_timestep_microgrid_networks_from_output_file(output::String, network::Dict{String,<:Any})::Vector{Vector{Vector{String}}}
Analytics for determining when microgrids network from output file
Faults
PowerModelsONM.get_timestep_fault_currents!
— Methodget_timestep_fault_currents!(
args::Dict{String,<:Any}
)::Vector{Dict{String,Any}}
Gets fault currents for switches and corresponding fault from study in-place in args, for use in entrypoint
, using get_timestep_fault_currents
.
PowerModelsONM.get_timestep_fault_currents
— Methodget_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
- the admittance (
- 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)
- the fault current
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)
PowerModelsONM.get_timestep_fault_currents
— Methodget_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
PowerModelsONM.get_timestep_fault_currents
— Methodget_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.
PowerModelsONM.get_timestep_fault_study_metadata!
— Methodget_timestep_fault_study_metadata!(
args::Dict{String,<:Any}
)::Vector{Dict{String,Any}}
Retrieves the switching optimization results metadata from the optimal switching solution via get_timestep_fault_study_metadata
and applies it in-place to args, for use with entrypoint
PowerModelsONM.get_timestep_fault_study_metadata
— Methodget_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"
).
Microgrid
PowerModelsONM.get_timestep_generator_profiles!
— Methodget_timestep_generator_profiles!(
args::Dict{String,<:Any}
)::Dict{String,Vector{Real}}
Gets generator profile statistics for each timestep in-place in args, for use in entrypoint
, using get_timestep_generator_profiles
PowerModelsONM.get_timestep_generator_profiles
— Methodget_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
PowerModelsONM.get_timestep_load_served
— Functionget_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.
PowerModelsONM.get_timestep_load_served
— Functionget_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.
PowerModelsONM.get_timestep_load_served!
— Methodget_timestep_load_served!(
args::Dict{String,<:Any}
)::Dict{String,Vector{Real}}
Gets Load served statistics in-place in args, for use in entrypoint
, using get_timestep_load_served
.
PowerModelsONM.get_timestep_storage_soc!
— Methodget_timestep_storage_soc!(
args::Dict{String,<:Any}
)::Vector{Real}
Gets storage energy remaining percentage for each timestep in-place in args, for use in entrypoint
, using get_timestep_storage_soc
PowerModelsONM.get_timestep_storage_soc
— Methodget_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.
PowerModelsONM.get_timestep_storage_soc
— Methodget_timestep_storage_soc(::Dict{String,<:Any}, ::String)
Helper function for the variant where args["network"]
hasn't been parsed yet.
Stability
PowerModelsONM.get_timestep_stability!
— Methodget_timestep_stability!(
args::Dict{String,<:Any}
)::Vector{Bool}
Gets the stability at each timestep and applies it in-place to args, for use in entrypoint
, using get_timestep_stability
PowerModelsONM.get_timestep_stability
— Methodget_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.