User Tools

Site Tools


gams:exponential_function_exp_x_not_recognized

Exponential function exp(x) not recognized

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.

gams/exponential_function_exp_x_not_recognized.txt · Last modified: 2017/09/02 17:12 by support