BARON solver cannot handle the "Sign" function Topic is solved

Solver related questions
Post Reply
Doriswu
User
User
Posts: 4
Joined: 4 months ago

BARON solver cannot handle the "Sign" function

Post by Doriswu »

Hi All,

I am running a DNLP model using the global solver BARON. The error message said the BARON cannot handle the "sign" function for one of my equations as attached.

Could anyone help rewrite the equation by posing the following conditions:
(1) if vpi(i)-vpi(j) >0,
eweymouthp(aij(ap,i,j)).. vf(aij) * vf(aij) =e= (pipe_data_gg(aij,'Mk')) * (vpi(i) - vpi(j));

(1) if vpi(i)-vpi(j) <0,
negative_condition(aij(ap,i,j)).. -vf(aij) * vf(aij) =e= (pipe_data_gg(aij,'Mk')) * (vpi(i) - vpi(j));

I understand we cannot pose conditional operations on variables, and one way seems to introduce binary variables (or big M). But I do not know how that would work. Thank you for the help if you have any ideas.

Doris
Attachments
DNLP.gms
(384 Bytes) Downloaded 197 times
User avatar
bussieck
Moderator
Moderator
Posts: 1042
Joined: 7 years ago

Re: BARON solver cannot handle the "Sign" function

Post by bussieck »

BARON only "understands" a subset of functions offered by GAMS. BARON, unlike local solvers like Conopt, need the algebra of the non-linear expression to build (linear) underestimators. It can do that for all operators (*,/,**,+,-) but not for all functions. The trig functions sin, cos, tan are another examples of functions not supported by BARON. Your are lucky in in your example, because you can just replace sign(vf(aij))*vf(aij)*vf(aij) by abs(vf(aij)*vf(aij)). Abs is something BARON understands.

-Michael
Doriswu
User
User
Posts: 4
Joined: 4 months ago

Re: BARON solver cannot handle the "Sign" function

Post by Doriswu »

Thank you, Michael! This is very helpful.

Doris
Post Reply