Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for unevaluated compressor power expression in the solution dictionary #261

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading