odow / SDDP.jl

A JuMP extension for Stochastic Dual Dynamic Programming
https://sddp.dev
Other
305 stars 61 forks source link

Multiply two variables #744

Closed wrx1990 closed 4 months ago

wrx1990 commented 4 months ago

Define two variables, meeting the condition constraints with a product less than or equal to 0, how should it be written.

@variable(subproblem, a)
@variable(subproblem, b)
@constraint(subproblem,a*b<=0)
odow commented 4 months ago

The high-level answer: you cannot multiply two variables in SDDP.jl. That is a non-convex constraint.

A slightly more nuanced answer: you can multiply two variables in SDDP.jl if you use a solver like Gurobi.jl, but the resulting policy may be suboptimal.

wrx1990 commented 4 months ago

Thank you for your humorous response!