Library
PowerModelsADA.build_pmada_ref
— MethodPowerModelsADA.calc_dual_residual!
— Methodcalc_dual_residual!(data::Dict{String, <:Any}; central::Bool=false)
calculate the dual redidual as seen by the area. Set central=true if the algorithm uses the optimality condition of a central coordinator.
PowerModelsADA.calc_global_dual_residual
— Methodcalculate the global mismatch based on local mismatch
PowerModelsADA.calc_global_mismatch
— Methodcalculate the global mismatch based on local mismatch
PowerModelsADA.calc_mismatch!
— Methodcalc_mismatch!(data::Dict{String, <:Any}; central::Bool=false)
calculate the mismatch and return the area data dictionary with the mismatch as seen by the area. Set central=true if the algorithm uses the optimality condition of a central coordinator.
PowerModelsADA.flag_convergance
— Methodcheck flag convergance using mismatch and dual residual
PowerModelsADA.initialize_dopf!
— Methodinitialize dopf parameters
PowerModelsADA.instantiate_pmada_model
— MethodPowerModelsADA.print_convergence
— Methodprint final solution status
PowerModelsADA.print_iteration
— Functionprint iteration information
PowerModelsADA.print_iteration_coordinator
— Functionprint iteration information
PowerModelsADA.save_solution!
— Methodsave last solution in previous_solutions vector
PowerModelsADA.solve_dopf
— Methodsolve_dopf(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, multiprocessors::Bool=false, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using fully distributed algorithm.
Arguments:
- data::Dict{String, <:Any} : dictionary contains case in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method::Function : initialize the algorithm parameters and shared variables
- update_method::Function : update the algorithm after each iteration
- build_method::Function : problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- multiprocessors::Bool=false : enable multiprocessors using available workers. Multiprocessors feature requires loading the PowerModelsADA and the optimizer packages on all the processors using @everywhere using <package_name>.
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previoussolution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_dopf_coordinated
— Methodsolve_dopf_coordinated(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, multiprocessors::Bool=false, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using distributed algorithm with central coordinator.
Arguments:
- data::Dict{String, <:Any} : dictionary contains case in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method_local::Function : initialize the local algorithm parameters and shared variables
- initialize_method_coordinator::Function : initialize the coordinator algorithm parameters and shared variables
- update_method_local::Function : update the local data after each iteration
- update_method_coordinator::Function : update the coordinator data after each iteration
- build_method_local::Function : local problem formulation
- build_method_coordinator::Function : coordinator problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- multiprocessors::Bool=false : enable multiprocessors using available workers. Multiprocessors feature requires loading the PowerModelsADA and the optimizer packages on all the processors using @everywhere using <package_name>.
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previous\solution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_dopf_coordinated_mp
— Methodsolve_dopf_coordinated_mp(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, multiprocessors::Bool=false, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using distributed algorithm with central coordinator on multiprocessors. Multiprocessors feature requires loading the PowerModelsADA and the optimizer packages on all the processors using @everywhere using <package_name>.
Arguments:
- data::Dict{String, <:Any} : dictionary contains case in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method_local::Function : initialize the local algorithm parameters and shared variables
- initialize_method_coordinator::Function : initialize the coordinator algorithm parameters and shared variables
- update_method_local::Function : update the local data after each iteration
- update_method_coordinator::Function : update the coordinator data after each iteration
- build_method_local::Function : local problem formulation
- build_method_coordinator::Function : coordinator problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previous\solution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_dopf_coordinated_sp
— Methodsolve_dopf_coordinated_sp(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, multiprocessors::Bool=false, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using distributed algorithm with central coordinator on single-processors.
Arguments:
- data::Dict{String, <:Any} : dictionary contains case in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method_local::Function : initialize the local algorithm parameters and shared variables
- initialize_method_coordinator::Function : initialize the coordinator algorithm parameters and shared variables
- update_method_local::Function : update the local data after each iteration
- update_method_coordinator::Function : update the coordinator data after each iteration
- build_method_local::Function : local problem formulation
- build_method_coordinator::Function : coordinator problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previous\solution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_dopf_mp
— Methodsolve_dopf_mp(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using fully distributed algorithm on multiprocessors. Multiprocessors feature requires loading the PowerModelsADA and the optimizer packages on all the processors using @everywhere using <package_name>.
Arguments:
- data::Dict{Int64, <:Any} : dictionary contains area data in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method::Function : initialize the algorithm parameters and shared variables
- update_method::Function : update the algorithm after each iteration
- build_method::Function : problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previoussolution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_dopf_sp
— Methodsolve_dopf_sp(data::Dict{String, <:Any}, model_type::DataType, optimizer, dopf_method::Module; print_level::Int64=1, mismatch_method::String="norm", tol::Float64=1e-4, max_iteration::Int64=1000, save_data::Vector{String}=[], kwargs...)
Solve OPF problem using fully distributed algorithm on single-processor.
Arguments:
- data::Dict{Int64, <:Any} : dictionary contains area data in PowerModel format
- model_type::DataType : power flow formulation (PowerModel type)
- optimizer : optimizer JuMP initiation object
- dopf_method::Module : module contains the distributed algorithm methods as follows:
- initialize_method::Function : initialize the algorithm parameters and shared variables
- update_method::Function : update the algorithm after each iteration
- build_method::Function : problem formulation
- print_level::Int64=1 : 0 - no print, 1 - print mismatch after each iteration and result summary, 2 - print optimizer output
- mismatch_method::String="norm" : mismatch calculation method (norm, max)
- tol::Float64=1e-4 : mismatch tolerance
- max_iteration::Int64=1000 : maximum number of iteration
- savedata::Vector{String}=[] : vector contains the keys of the dictionaries to be saved at each iteration in "previoussolution". For example, savedata=["solution", "sharedvariable", "mismatch"]
- kwargs = includes algorithm-specific and initialization parameters
PowerModelsADA.solve_pmada_model
— MethodPowerModelsADA.update_flag_convergence!
— Methodcheck the shared variables of a local area are within tol
PowerModelsADA.update_global_flag_convergence
— Methodcheck the flag convergence for all areas and return a global variables
PowerModelsADA.update_iteration!
— Methodupdate iteration
PowerModelsADA.update_shared_variable!
— Methodupdate primal variables after obtaining a solution at each iteraton
PowerModelsADA.update_solution!
— Methodupdate the area data solution dictionary
PowerModelsADA.add_virtual_gen
— Methodadd virtual generators at the neighboring buses of an area
PowerModelsADA.arrange_areas_id!
— Methodarrange area ID from 1 to number of areas. This step is necessary when having area number 0 and using central coordinator
PowerModelsADA.assign_area!
— Methodassign area to the system data using a matrix with [bus, area] columnsor rows
PowerModelsADA.assign_area!
— Methodassign area to the system data using a CVS file with buses and area ID
PowerModelsADA.assign_area!
— Methodassign area to the system data using a vector with (bus => area) pairs
PowerModelsADA.assign_area!
— Methodassign area to the system data using a dictionary with (bus => area) integers pairs
PowerModelsADA.decompose_coordinator
— Methodobtain system coordinator data
PowerModelsADA.decompose_system
— Methoddecompose_system(data::Dict{String, <:Any})
decompose a system into areas defined by bus area.
PowerModelsADA.decompose_system
— Methodobtain an area decomposition with area ID
PowerModelsADA.get_area_id
— Methodhelper function to get the area ID
PowerModelsADA.get_area_id
— Methodhelper function to get the area ID
PowerModelsADA.get_areas_bus
— Methodhelper functions to all areas buses in a dicrionary
PowerModelsADA.get_areas_bus
— Methodhelper functions to all areas buses in a dicrionary
PowerModelsADA.get_areas_id
— Methodhelper function to get all areas IDs
PowerModelsADA.get_areas_id
— Methodhelper function to get all areas IDs
PowerModelsADA.get_areas_id
— Methodhelper function to get all areas IDs
PowerModelsADA.get_local_bus
— Methodhelper functions to get the area's local buses
PowerModelsADA.get_local_bus
— Methodhelper functions to get the area's local buses
PowerModelsADA.get_neighbor_bus
— Methodhelper functions to get the area's neighbor buses
PowerModelsADA.get_neighbor_bus
— Methodhelper functions to get the area's neighbor buses
PowerModelsADA.get_neighbor_bus
— Methodhelper functions to get the area's neighbor buses
PowerModelsADA.get_neighbor_bus
— Methodhelper functions to get the area's neighbor buses
PowerModelsADA.get_shared_component
— Methodget the shared buses and branches between defined area and all other areas
PowerModelsADA.get_shared_component
— Methodget the shared buses and branches between defined area and all other areas
PowerModelsADA.get_shared_component
— Methodget the shared buses and branches between defined area and all other areas
PowerModelsADA.get_shared_component
— Methodget the shared buses and branches between an area and all other areas
PowerModelsADA.prepare_shared_data
— Methodprepare the shared data with or without serialization
PowerModelsADA.receive_shared_data!
— Methodstore received data in the local data dictionary
PowerModelsADA.receive_shared_data!
— Methoddeserialize and store the received data in the local data dictionary
PowerModelsADA.constraint_opf
— Methoddefine OPF problem constraints
PowerModelsADA.no_objective
— Methodno objective function case
PowerModelsADA.objective_min_fuel_and_consensus!
— Functiondefine objective function using PowerModels and algorithm-specific objective
PowerModelsADA.variable_opf
— Methoddefine OPF problem variable
PowerModelsADA.calc_dist_gen_cost
— Methodcalculate distributed solution operation cost
PowerModelsADA.compare_solution
— Methodcompare the distributed algorithm solution with PowerModels centralized solution
PowerModelsADA.get_diameter
— Methodget the communication network diameter
PowerModelsADA._var
— Methodreturn JuMP variable object from PowerModel object
PowerModelsADA.initial_value
— Functioninitial_value(variable::String, initialization_method::String="flat", value::Float64=0.0)
assign initial value based on initialization method
Arguments:
- variable::String : variable names
- initializationmethod::String="flat" : ("flat", "previoussolution", "constant")
- value::Float64=0.0 : return value if initialization_method = "constant"
PowerModelsADA.initialize_all_variable
— Functioninitialize_all_variable(data::Dict{String, <:Any}, model_type::DataType, dics_name::String="solution", initialization_method::String="flat")
return a dictionary contains all the problem variables. can be used to store the solutions.
Arguments:
- data::Dict{String, <:Any} : area data
- model_type::DataType : power flow formulation (PowerModel type)
- dics_name::String="solution" : location of existing dicrionary to be used to worm start the output
- initialization_method::String="flat" : "flat" or "worm" initialization
PowerModelsADA.initialize_shared_variable
— Functioninitialize shared variable dictionary
PowerModelsADA.variable_names
— Methodidentifyall the variables names
PowerModelsADA.variable_shared_names
— Methodidentifythe shared bus and branch variables names