Endogenous operands for / not allowed in linear models

Problems with modeling
Post Reply
Knut
User
User
Posts: 1
Joined: 5 years ago

Endogenous operands for / not allowed in linear models

Post by Knut »

Hello,

I have the problem that I have to divide in an equation by a positive variable (Batt_Kap_ges):

Eq_eta_ges..
Eta_ges =e= sum(Set_Batt, Anz_Batt(Set_Batt) * Batt_Kap(Set_Batt) * eta(Set_Batt)) / Batt_Kap_ges;

The equation triggers the error message "Endogenous operands for / not allowed in linear models".
In my understanding, the error is triggered because the variable Batt_Kap_ges can also be 0. Therefore I have inserted the following equation to exclude the 0 solution:

Eq_Fest..
Batt_Kap_ges =g=1;

Unfortunately this does not change the error message. Does anyone have a hint how to set the lower bound of the variable to 1 or how else to fix the problem?

Edit: I've also tried to fix the lower bound to 1 with the following lines but it didn't work:

Batt_Kap_ges.LO = 1.0;
Batt_Kap_ges.L = 1.0;
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Endogenous operands for / not allowed in linear models

Post by bussieck »

You misinterpreted the error message. It reads "Endogenous operands for / not allowed in linear models". This means you can't use / where the denominator is a variable in a linear model (LP/MIP). This is not linear anymore. Change the model type to NLP or MINLP and you will be fine. Be aware that this most likely becomes a non-convex model with many local optima. Pay attention to the starting point or use a global solver (like Antigone, Baron, ...).

-Michael
Post Reply