Page 1 of 1

BARON solver cannot handle the "Sign" function

Posted: Mon Jan 15, 2024 7:54 pm
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

Re: BARON solver cannot handle the "Sign" function

Posted: Tue Jan 16, 2024 7:45 am
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

Re: BARON solver cannot handle the "Sign" function

Posted: Wed Jan 17, 2024 3:57 am
by Doriswu
Thank you, Michael! This is very helpful.

Doris