jump-dev / jump-dev/DiffOpt.jl

ScalarAffine sensitivity on a VectorAffine constraint

Offen
#290 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Julia
Sterne
145
Forks
21
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Followup of #287
```julia
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: https://github.com/jump-dev/DiffOpt.jl/pull/287#issuecomment-2816109383

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Reproduce the Julia example in the issue, starting with MOI.set and DiffOpt.forward_differentiate!. Read the follow-up context in #287 and its linked comment to understand the ScalarAffine sensitivity failure on the VectorAffine constraint. Done means the shown differentiation sequence handles this case successfully.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
julia
Bereich
backend-api-design
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
38/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.