I am begginer at Xpress Mosel, i am trying to calculate a surplus = max(0;production-consumption) The production is calculated based on the power installed which is a decision variable. The model gives me an error : Wrong logical Operator. Please if anyone can help
Asked
Active
Viewed 211 times
-3
-
Can you please add your .mos script to your question? Without that it is hard to guess what might go wrong. – Daniel Junglas Aug 30 '21 at 05:14
1 Answers
0
In order to get the maximum of things that involve decision variables, you can use the fmax
function from the mmxnlp package, see the documentation here.
A short example for a surplus definition is
model Surplus
uses "mmxprs"
uses "mmxnlp"
declarations
production: mpvar
consumption: mpvar
end-declarations
surplus := fmax(0.0, production - consumption)
minimize(surplus)
end-model

Daniel Junglas
- 5,830
- 1
- 5
- 22