positive variables

Problems with syntax of GAMS
yanzhiping
User
User
Posts: 85
Joined: 9 months ago

positive variables

Postby yanzhiping » 4 months ago

Excuse me,
I defined a positive variable for cost1, cost 2, cost3, objective is cost.
cost2=90*cost1;
cost=cost2+cost3;
I observed some strange values in the solution,
1) cost1 is zero, but cost 2 is nonzero.
2) cost 3 is negative.
Does anyone know why it happens?

Manassaldi
User
User
Posts: 44
Joined: 10 months ago
Location: Rosario - Argentina

Re: positive variables

Postby Manassaldi » 4 months ago

Did you check the ModelStat?
I think It's has to be 1 or 2

yanzhiping
User
User
Posts: 85
Joined: 9 months ago

Re: positive variables

Postby yanzhiping » 4 months ago

I did check modelstat. and it is 1 indeed.

yanzhiping
User
User
Posts: 85
Joined: 9 months ago

Re: positive variables

Postby yanzhiping » 4 months ago

I found the problem.
I set lpmethod=4, which is using barrier method.
when barcrossalg=-1, No crossover from barrier to simplex method, then the results are weird.
when I set barcrossalg to other values, then it works.
SO I guess the barrier method does not work on my problem


Who is online

Users browsing this forum: No registered users and 2 guests