Q: .. does not recognize the exponential function exp(x) and gives me “Error 141, Symbol neither initalized nor assigend”.
(Contributed by Arne Drud:) You have probably declared a parameter or a variable with the name “exp
” (export??). This is legal in GAMS, but it will remove “exp
” from the list of available functions. The following example gives a message similar to yours:
set i / i1*i2/; parameter exp(i); scalar u,v /0 /; u = exp(v); display u,v;
To avoid the error you can use system.exp
instead of exp
. The example below will not return an error message:
set i / i1*i2/; parameter exp(i); scalar u,v /0 /; u = system.exp(v); display u,v;
This will work with all built in functions and predefined data. A complete list of reserved words is given in the GAMS User's Guide.