-
Notifications
You must be signed in to change notification settings - Fork 15
Open
Description
Followup of #287
model = Model(() -> DiffOpt.diff_optimizer(SCS.Optimizer))
@variable(model, x[1:7])
@test num_variables(model) == 7
c1 = @constraint(model, -sum(x[i] for i in 1:6) + 10 ≥ 0)
c2 = [
@constraint(model, x[i] ≥ 0)
for i in 1:6
]
α = 0.8
δ = 0.9
c3 = @constraint(
model,
LinearAlgebra.Symmetric(hcat(
[((δ/2)*x[1] + α*x[2] + δ*x[3] + (δ/4)*x[4] + (δ/8)*x[5] - 1.0*x[7]) # a11
((-(δ/(2*√2)))*x[1] - (δ/4)*x[2] - (δ/(8*√2))*x[5])],
[((-(δ/(2*√2)))*x[1] - (δ/4)*x[2] - (δ/(8*√2))*x[5])
((δ/2)*x[1] + (δ - α)*x[2] + 0.0*x[3] + (δ/8)*x[5] + (δ/4)*x[6] - x[7])])
) in PSDCone()
)
@objective(model, Max, x[7])
optimize!(model)
MOI.set.(
model,
DiffOpt.ForwardConstraintFunction(),
c3,
sum(x) + 1,
)
DiffOpt.forward_differentiate!(model)The issue is a ScalarAffine sensitivity on a VectorAffine constraint: #287 (comment)
Metadata
Metadata
Assignees
Labels
No labels