Trigonometric functions

Hi everybody!!

I have a weird error using “sin” and “cos” functions. For instance, when running the code of the TRIGX,SEQ=388 example (https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_trigx.html), the result is

**** MODEL STATUS 5 Locally Infeasible

and the expansion of the constraints:

con1… x - sin(2x + 3y) - cos(3x - 5y) =e= 0;
con2… y - sin(x - 2y) + cos(x + 3y) =e= 0;

are

con1… - (1)*x - (3)*y =E= 0 ; (LHS = -1, INFES = 1 ****)
con2… - (1)*x + (3)*y =E= 0 ; (LHS = 1, INFES = 1 ****)

quite strange… it seems as if GAMS were evaluating cos and sin at some fixed argument instead of taking the nonlinear functions defined in the expressions.
The the same happens with my own GAMS code using “cos” and “sin” (an OPF model). I’m using a GAMS Community license with the following distribution:

GAMS Distribution 35.2.0
GAMS Release: 35.2.0 r33388c4 WEX-WEI x86 64bit/MS Windows
Release Date: Jun 2, 2021

Any idea…? Thank you!!

Javier

Javier, you are looking at the equation listing (https://www.gams.com/latest/docs/UG_GAMSOutput.html#UG_GAMSOutput_TheEquationListing) section of the listing file. This indeed evaluates and displays the gradient of a variable in the equation at the input point.

-Michael

Ooops!!.. your right, sorry for that silly question… indeed, I don’t have too much experience using GAMS with nonlinear models. Nevertheless, example TRIGX,SEQ=388 is reported INFEASIBLE by CONOPT, which I think it shouldn’t be… I’ll see…

Thank you very much Michael.

Javier.

The trigx model has been added when GAMS added LGO. This is a highly non-convex model and hence a local solver like Conopt will produce local minima and will report “locally” infeasible when started from not so good starting points. So this is all expected behavior.

-Michael

Thank you again!!

Javier