2

I'm a total beginner with CPLEX and OPL, so maybe someone can help me with the coding of a mixed integer programming model. I finished the model and the data. When I run the configuration I get 44 errors, including "opl cannot extract expression", "CPLEX (default) cannont extract expression" for my objective function and some of the constraints. I really do not know how to solve these errors, so maybe someone can help me out here.

Unfortunately, my interface language is German. Can someone tell me how to change it to English so I can post the errors in a language more people can understand?

Here you can find the code of the objective function and the constraints that are named in the error section, and a screenshot of the errors (in German).

model enter image description here

tabacoben
  • 41
  • 2

1 Answers1

3

First, to launch the cplex opl ide in English you may do in command line oplide -nl en and see

https://www.ibm.com/support/knowledgecenter/SSSA5P_12.8.0/ilog.odms.ide.help/OPL_Studio/globalization/topics/opl_globaliz_overriding_settings.html

for more.

Now about your error, cannot extract. Are your constraints linear? I see a product and I d like to remind you that if x and y are decision variables then x times y is not linear.

PS: there's a similar question at https://developer.ibm.com/answers/questions/494538/error-cplex-default-cannot-extract-expression-opl.html?utm_campaign=answers&utm_medium=email&utm_source=answers-new-question&utm_content=answers-answer-question++

halfer
  • 19,824
  • 17
  • 99
  • 186
Alex Fleischer
  • 9,276
  • 2
  • 12
  • 15
  • Hi Alex, Thank you very much for your answer and your help. I solved the problem by ordering the indexes in a consistent way and the errors are solved now. But now I have another error 5002: Constraint NB(4) is not convex. So you are right, there are two decision variables in the product of this constraint. But can you help me with solving this? how can I rewrite the constraint to make it linear? Thanks so much for your help in advance. – tabacoben Feb 26 '19 at 08:48
  • Thank again for your help regarding the linearity of my constraints. I corrected it and it worked. But I get only a solution which is a feasible relaxed sum of infeasibilities. And some of the decisionvariables which are defined to not be negative, have negative values. I guess there is a major mistake in my model. Can you help to find the error please? – tabacoben Feb 26 '19 at 09:41
  • 1
    About the variables that should be non negative and are negative , I guess your model is not feasible and then cplex relaxed it. See https://www.ibm.com/developerworks/community/forums/html/topic?id=7922e99d-9d7d-451b-9c16-a5d1403f1361 if you want not to see that – Alex Fleischer Feb 26 '19 at 10:16
  • thanks for your answer. I had a look at the relaxations and conflicts and after deleting one constraint, the solution was optimal. So that's good. But unfortunately, the solutions for the decision variables is not right without the contraint I deleted.. I deleted the contraint that conserves the flow of product between the different stages of the supply chain. without the constraint, the product there is only product flow between the distribtion centers and the demand points, but not between the other stages. Do you know how I could find out how to fix this? – tabacoben Feb 26 '19 at 13:10
  • well, maybe your model is not feasible and then you should add more freedom in order to get a feasible solution – Alex Fleischer Feb 26 '19 at 13:25