Hi guys,
Is there any rule that division can’t occur in equations or
particularly in objective function in gams?
for e.g.
I have one equation which is objective function:
objf… sum( ( i, j , k), ( q( i, j, k)/dt( i, j, k) ) ) + sum(j,
( qhu( j )/dthu( j ) ) ) ;
now when I execute the code, GAMS treats q and qhu as variable but
takes numerical value of dt and dthu even though they are varible (as
seen in equation listing). al dt, q, dthu, qhu are defined as positive
variables.
why is this happening? can any of you please provide some reason. I
want to dt and dthu to be treated as variable…
\
Hello Patrik,
I don’t know where the heck GAMs finds numerical values for the variables in equation listing stage.
However, if dt and dthu are (positive) variables, they should be formulated as different from zero in order to avoid division by zero (i.e defining them as positive variable is not enough!).
Hope this helps!
On Wed, Aug 3, 2011 at 10:35 AM, pratik patil wrote:
Hi guys,
Is there any rule that division can’t occur in equations or
particularly in objective function in gams?
for e.g.
I have one equation which is objective function:
objf… sum( ( i, j , k), ( q( i, j, k)/dt( i, j, k) ) ) + sum(j,
( qhu( j )/dthu( j ) ) ) ;
now when I execute the code, GAMS treats q and qhu as variable but
takes numerical value of dt and dthu even though they are varible (as
seen in equation listing). al dt, q, dthu, qhu are defined as positive
variables.
why is this happening? can any of you please provide some reason. I
want to dt and dthu to be treated as variable…
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.
In order to avoid division by zero ,please set:
dthu.Lo( j )=1E-5;
dt.Lo(i,j,k)=1E-5;
On Wed, Aug 3, 2011 at 1:05 PM, pratik patil wrote:
dthu( j )
\
To post to this group, send email to gamsworld@googlegroups.com.
To unsubscribe from this group, send email to gamsworld+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/gamsworld?hl=en.