## Non-Linear Programming Error 148 & 149

Problems with syntax of GAMS
rickyc2000
User
Posts: 2
Joined: 4 weeks ago

### Non-Linear Programming Error 148 & 149

Hello guys!

First of all, I am really new to this GAMS tool and I am using it as an input in my MNL model in python, so it clearly is not my field -- I apologize in advance because my doubts will probably be very simple.

So, I am currently trying to perform a non-linear programming problem that looks like this:
My current code is the following:

Code: Select all

``````\$sTitle Set Definitions
Set
i 'SKU in analysis'
j 'Complementary SKU';

\$sTitle Model Parameters
Parameter
d(j) stockout probability of each SKU
\$ondelim
\$include C:\Users\ricardo.cabral\Documents\Project\data.csv
\$offdelim;

Parameter
s(i) demand rate for each SKU
\$ondelim
\$include C:\Users\ricardo.cabral\Documents\Project\demand_rate.csv
\$offdelim;

\$sTitle Model Definition
Variable
a(i,j) 'the substitution rates between i and j'
l(i) 'the intrinsic demand rate for that SKU'
er 'the error of the equation';

Positive Variable a(i,j),l(i);
Free variable z, er;

Equation
cons1
cons2
obj;

cons1.. s(i) = er + l(i) + sum((i,j) \$ i ne j, a(i,j)*l(j)*d(j));
cons2.. sum((i,j), a(i,j) = le= 1;
'obj.. z =e= cons1**2 ;``````
I am not even at the running the model phase... I get lots of errors, specially at the cons1 line...

Can someone help me please? Been stuck for a couple days

bussieck
Moderator
Posts: 933
Joined: 6 years ago

### Re: Non-Linear Programming Error 148 & 149

I suggest to go through the tutorial material of the GAMS documentation: https://www.gams.com/latest/docs/UG_MAI ... l_Examples. The GAMS Tutorial by Rick Rosenthal is very helpful.

-Michael