Main Entrypoint
Entrypoint Functions
PowerModelsONM.entrypoint
— Functionentrypoint(args::Dict{String,<:Any})::Dict{String,Any}
The main ONM Algorithm, performs the following steps:
initialize_output!
sanitize_args!
setup_logging!
prepare_data!
build_solver_instances!
optimize_switches!
optimize_dispatch!
run_stability_analysis!
run_fault_studies!
analyze_results!
If args["debug"]
a file containing all data, results, etc. will be written to "debugonmyyyy-mm-dd–HH-MM-SS.json"
Returns the full data structure contains all inputs and outputs.
PowerModelsONM.initialize_output!
— Functioninitialize_output!(args::Dict{String,<:Any})::Dict{String,Any}
Initializes the output data strucutre inside of the args dict at "output_data"
PowerModelsONM.setup_logging!
— Functionsetup_logging!(args::Dict{String,<:Any})
Configures logging based on runtime arguments
PowerModelsONM.prepare_data!
— Functionprepare_data!(args::Dict{String,<:Any})::Dict{String,Any}
Performs the data preparation actions
PowerModelsONM.build_solver_instances!
— Functionbuild_solver_instances!(args::Dict{String,<:Any})::Dict{String,Any}
Creates the Optimizers in-place (within the args dict data structure), for use inside entrypoint
, using build_solver_instances
, assigning them to args["solvers"]
`
PowerModelsONM.optimize_switches!
— Functionoptimize_switches!(args::Dict{String,<:Any})::Dict{String,Any}
Optimizes switch states (therefore shedding load or not) in-place, for use in entrypoint
, using [optimize_switches
]
Uses LPUBFDiagPowerModel (LinDist3Flow), and therefore requires args["solvers"]["misocp_solver"]
to be specified
PowerModelsONM.optimize_dispatch!
— Functionoptimize_dispatch!(
args::Dict{String,<:Any};
solver::Union{Missing,String}=missing
)::Dict{String,Any}
Solves optimal dispatch problem in-place, for use in entrypoint
, using optimize_dispatch
. If you are using this to optimize after running optimize_switches!
, this assumes that the correct switch states from those results have already been propagated into args["network"]
solver
(default: "nlp_solver"
) specifies which solver to use for the OPF problem from args["solvers"]
PowerModelsONM.run_stability_analysis!
— Functionrun_stability_analysis!(
args::Dict{String,<:Any};
validate::Bool=true,
formulation::Type=PMD.ACRUPowerModel,
solver::String="nlp_solver"
)::Dict{String,Bool}
Runs small signal stability analysis using PowerModelsStability and determines if each timestep configuration is stable, in-place, storing the results in args["stability_results"]
, for use in entrypoint
, Uses run_stability_analysis
If validate
, raw inverters data will be validated against JSON schema
The formulation can be specified with formulation
, but note that it must result in "vm"
and "va"
variables in the solution, or else PowerModelsDistribution.sol_data_model!
must support converting the voltage variables into polar coordinates.
solver
(default: "nlp_solver"
) specifies which solver in args["solvers"]
to use for the stability analysis (NLP OPF)
PowerModelsONM.run_fault_studies!
— Functionrun_fault_studies!(
args::Dict{String,<:Any};
validate::Bool=true,
solver::String="nlp_solver"
)::Dict{String,Any}
Runs fault studies using args["faults"]
, if defined, and stores the results in-place in args["fault_stuides_results"]
, for use in entrypoint
, using run_fault_studies
PowerModelsONM.analyze_results!
— Functionanalyze_results!(args::Dict{String,<:Any})::Dict{String,Any}
Adds information and statistics to "output_data", including
"Runtime arguments"
: Copied fromargs["raw_args"]
"Simulation time steps"
: Copied fromvalues(args["network"]["mn_lookup"])
, sorted by multinetwork id"Events"
: Copied fromargs["raw_events"]
"Voltages"
:get_timestep_voltage_statistics!
"Load served"
:get_timestep_load_served!
"Generator profiles"
:get_timestep_generator_profiles!
"Storage SOC (%)"
:get_timestep_storage_soc!
"Powerflow output"
:get_timestep_dispatch!
"Device action timeline"
:get_timestep_device_actions!
"Switch changes"
:get_timestep_switch_changes!
"Small signal stability"
:get_timestep_stability!
"Fault currents"
:get_timestep_fault_currents!
"Optimal dispatch metadata"
:get_timestep_dispatch_optimization_metadata!
"Optimal switching metadata"
:get_timestep_switch_optimization_metadata!
Command-line arguments
PowerModelsONM.parse_commandline
— Functionparse_commandline(; validate::Bool=true)::Dict{String,Any}
Command line argument parsing
PowerModelsONM.sanitize_args!
— Functionsanitize_args!(args::Dict{String,<:Any})::Dict{String,Any}
Sanitizes deprecated arguments into the correct new ones, and gives warnings
Binary Operations
PowerModelsONM.julia_main
— Functionjulia_main()
PackageCompiler entrypoint