Skip to content

Commit

Permalink
Merge pull request #261 from hskkanth/master
Browse files Browse the repository at this point in the history
fix for unevaluated compressor power expression in the solution dictionary
  • Loading branch information
kaarthiksundar authored Oct 8, 2024
2 parents fabf9c0 + 4259e62 commit 629e923
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/core/transient_expression.jl
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ function expression_non_slack_affine_derivative(
end

"compression power"
function expression_compressor_power(gm::AbstractGasModel, nw::Int; report::Bool = true)
function expression_compressor_power(gm::AbstractGasModel, nw::Int; report::Bool = false)
comp_power = var(gm, nw)[:compressor_power_expr] = Dict{Int,Any}()
for (i, compressor) in ref(gm, nw, :compressor)
alpha = var(gm, nw, :compressor_ratio, i)
Expand All @@ -162,12 +162,4 @@ function expression_compressor_power(gm::AbstractGasModel, nw::Int; report::Bool
var(gm, nw, :compressor_power_expr)[i] = JuMP.@expression(gm.model, W * abs(f) * (alpha^m - 1.0))
end

report && sol_component_value(
gm,
nw,
:compressor,
:power_expr,
ids(gm, nw, :compressor),
comp_power,
)
end

0 comments on commit 629e923

Please sign in to comment.