Page 1 of 1

Error in all lines

Posted: Tue Feb 09, 2021 6:33 pm
by duygu
Although I wrote everything correctly, the program finds errors for each line. Error 141, Error 37, Error 257, Error 140. I am sure that I did everything right. Anyone have any idea about this?

Variable x1;
Free Variable x2,z;
Negative Variable x3;

Equations
con1,
con2,
con3,
obj;

con1..x1+x2+x3+L=7;
Con2..4*x1+2*x2=E=40;
Con3..10*x1+x3=G=30;
obj..30*x1+100*x2-50*x3=E=z;

Model SampleProblem1 /

con1,
con2,
con3,
obj/;

Options Lp = Cplex;

Solve SampleProblem1 using LP maximizing z ;

Display x1.L, x2.L, x3.L, z.L;
-----------------------------------------------------------------------

Re: Error in all lines

Posted: Tue Feb 09, 2021 9:00 pm
by abhosekar
well, I see that in con1 you have +L=7 instead of =L= 7
The error message must have showed that L is an unknown symbol. Best way to debug is to read errors.

- Atharv