Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions src/quadratic_approximations/epigraph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,7 @@ function _add_epigraph_quadratic_approx!(
meta,
)

# Precompute breakpoint values and upper bound (invariant across names and time steps)
step = delta / (n_breakpoints - 1)
breakpoints = [(x_min + (k - 1) * step) for k in 1:n_breakpoints]
# Precompute upper bound (invariant across names and time steps)
z_ub = max(x_min^2, x_max^2)

for name in names, t in time_steps
Expand Down
7 changes: 4 additions & 3 deletions test/test_dnmdt_approximations.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const DNMDT_META = "DNMDTTest"
const DNMDT_HYBS_META = "HybSTest"

@testset "D-NMDT Univariate Approximation" begin
@testset "Binary expansion correctness" begin
Expand Down Expand Up @@ -445,11 +446,11 @@ end
IOM._add_hybs_bilinear_approx!(
setup_h.container, MockThermalGen, ["dev1"], 1:1,
setup_h.x_var_container, setup_h.y_var_container,
0.0, 1.0, 0.0, 1.0, depth, HYBS_META,
0.0, 1.0, 0.0, 1.0, depth, DNMDT_HYBS_META,
)
expr_h = IOM.get_expression(
setup_h.container, IOM.HybSProductExpression(),
MockThermalGen, HYBS_META,
setup_h.container, IOM.BilinearProductExpression(),
MockThermalGen, DNMDT_HYBS_META,
)

JuMP.@objective(setup_h.jump_model, Max, expr_h["dev1", 1])
Expand Down
Loading