Skip to content
Snippets Groups Projects
Commit 72678f50 authored by Julian Stürmer's avatar Julian Stürmer
Browse files

Change default Ipopt print_level to 5 in AC and DC calculations

parent d7421794
No related branches found
No related tags found
No related merge requests found
...@@ -40,9 +40,9 @@ function calc_init_op(file::String; model=:ac) ...@@ -40,9 +40,9 @@ function calc_init_op(file::String; model=:ac)
### Calculate power flow for chosen model ### Calculate power flow for chosen model
if model == :dc if model == :dc
calc_dc_pf!(network_data) # calculate DC-PF solution and add it to NDD calc_dc_pf!(network_data) # calculate and add DC-PF
elseif model == :ac elseif model == :ac
calc_ac_pf!(network_data) # calculate AC-PF solution and add it to NDD calc_ac_pf!(network_data) # calculate and add AC-PF
else else
throw(ArgumentError("Unknown model $model.")) throw(ArgumentError("Unknown model $model."))
end end
...@@ -58,7 +58,7 @@ CAUTION: Overwrites any previous AC solution contained in the NDD! ...@@ -58,7 +58,7 @@ CAUTION: Overwrites any previous AC solution contained in the NDD!
function calc_ac_pf!( function calc_ac_pf!(
network_data::Dict{String,<:Any}, network_data::Dict{String,<:Any},
method = :JuMP; method = :JuMP;
print_level = 0 print_level = 5
) )
if method == :JuMP # calculate AC-PF solution using a JuMP model if method == :JuMP # calculate AC-PF solution using a JuMP model
...@@ -84,14 +84,18 @@ end ...@@ -84,14 +84,18 @@ end
Calculates the DC power flow solution for the given NDD and updates it in the NDD. Calculates the DC power flow solution for the given NDD and updates it in the NDD.
CAUTION: Overwrites any previous DC solution contained in the NDD! CAUTION: Overwrites any previous DC solution contained in the NDD!
=# =#
function calc_dc_pf!(network_data::Dict{String,<:Any}) function calc_dc_pf!(network_data::Dict{String,<:Any}; print_level = 5)
### Calculate AC-PF solution using PowerModels.jl and Ipopt ### Calculate AC-PF solution using PowerModels.jl and Ipopt
pf_result = run_dc_pf( pf_result = run_dc_pf(
network_data, network_data,
optimizer_with_attributes(Ipopt.Optimizer, "print_level" => 0) optimizer_with_attributes(
Ipopt.Optimizer,
"print_level" => print_level
)
) )
update_pf_data!(network_data, pf_result, model=:dc) # update PF in NDD update_pf_data!(network_data, pf_result, model=:dc) # update PF in NDD
return network_data return nothing
end end
#= #=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment