How to solve the nonlinear Weymouth equation in GAMS?

Problems with modeling
Post Reply
f4r3in
User
User
Posts: 2
Joined: 2 years ago

How to solve the nonlinear Weymouth equation in GAMS?

Post by f4r3in »

Hi everyone,
I want to write Weymouth equation in GAMS and solve it using MINLP solvers. here is the equation :

Image

The problem is : I cant solve my model in GAMS due to "sign" operator. I received infeasible error when using "DICOPT" or "BARON" solver due to "sign" operator. Only the "SBB" solver starts to solving the model but it never ends.
I also try to define "sign" operator by myself but we cant use variables in "$" operator in GAMS to define it.

So, please help me to define Weymouth equation and solve my model in GAMS.
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: How to solve the nonlinear Weymouth equation in GAMS?

Post by bussieck »

You can model sgn like this:

Code: Select all

binary variable b(m,n);
equation defb(m,n),deff(m,n);
defb(m,n).. p(m) =g= p(n) - (1-b(m,n))*bigM;
deff(m,n).. f(m,n) =e= (2*b(m,n)-1)*C(m,n)*sqrt(abs(sqr(p(m) - sqr(p(n))));
where bigM is a an upper bound on the variable p.

-Michael
Post Reply