Dear Johan,
First of all thanks for the great work you are doing with YALMIP.
I have encountered an annoying problem in my code, and I do not know exactly why this is happening (without warnings from the solver or YALMIP).
I have the following optimization problem,which can be thought as a sizing and control (over an interval 1:T) of an energy generation unit, in which a constraint is (slightly) violated all the time.
to summarize briefly:
- I use interp2 to estimate the variable z based on the values of variables x and y, with a predetermined data set.
- Beside the boundaries, the constraints can be expressed as D(t)<=z(t)<=y for every t=1:1:T.
- D(t)<=z(t) is always slightly violated.
I have the feeling that this has to do with the numerical precision of the solver, but the constraint violation is in the order of 10^-1. (e.g. 15.5<=15.4), which seems quite high.
Also, I do not get any warnings or errors from YALMIP or Gurobi. Yet, the constraint violation is there when i check the constraints with check().
Here attached a simple example code.
Do you have any suggestions on how to get rid or reduce this problem?
Thank you.
Best regards