odow / SDDP.jl

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

Constraint depending on state value #126

Closed rodripor closed 5 years ago

rodripor commented 6 years ago

Hello,

I could not find a way to load restrictions to the SDDP model framework depending on the value of a state variable. Particularly in a hydroplant model it is necessary that the spillage variable is zero when the state variable representing the volume of the reservoir is less than a certain value. if i put the condition inside @constraints tag i get an error. Maybe someone had the same issue and can help me. I would really appreciate that.

Thanks, Rodrigo Porteiro

odow commented 6 years ago

Hi @rodripor,

The two main conditions required by SDDP are

the spillage variable is zero when the state variable representing the volume of the reservoir is less than a certain value

This sounds dangerous since, if I understand correctly, it requires binary variables to implement. I do have a plan to implement these at some point (see https://github.com/odow/SDDP.jl/issues/100), but it won't be in the near-term.

If you do not include the constraint, do you observe that it is violated when you simulate the policy? Or is this just a constraint you believe should be in the model. I would be surprised if the reservoir spilled when the volume was low.

Oscar

roporte commented 6 years ago

Hi,

This sounds dangerous since, if I understand correctly, it requires binary variables to implement. I do have a plan to implement these at some point (see #100), but it won't be in the near-term.

Yes, I tried to add the constraint to verify that the value function was calculated incorrectly due to a "bad" cut associated with the non-convexity. I understand that it can only be implemented with binary variables.

If you do not include the constraint, do you observe that it is violated when you simulate the policy? Or is this just a constraint you believe should be in the model. I would be surprised if the reservoir spilled when the volume was low.

Yes, I observe that it is violated in some sceanarios. Is think it should be in the model because downstream there's another hydroplant with higher turbinate flow. In some cases the optimal policy consists in spilling (when turbinate is at maximum) in the upper hydroplant with the only purpose of turbine that water downstream despite being reservoir volume low.

I will try to find a way to model this behavior without using binary variables.

Thanks! Rodrigo

odow commented 6 years ago

In some cases the optimal policy consists in spilling (when turbinate is at maximum) in the upper hydroplant with the only purpose of turbine that water downstream despite being reservoir volume low.

If you have the correct cost on spillage, this suggests that either it is an optimal decision, or the policy has not converged.

This could also be a finite horizon issue where the terminal value of water in the upper reservoir is too low, so the policy spills it to the lower reservoir in order to turbine the water before the end of the time-horizon.

odow commented 5 years ago

Closing since this isn't an issue with the library, and the underlying issue (non-convexity) should be discussed in #65.

odow commented 5 years ago

See #206 which implements a continuous relaxation approach.