Hello,
I have a division by zero (UNDF) problem with my program. In my model
the country does not import Energy but imports Agriculture and
manufacrture products and Services. When I try to compute my imports
prices this appears in my program output:
**** Exec Error at line 292: division by zero (0)
---- 296 PARAMETER PWMO World price of imported commodity i
(without duties)
in the benchmark situation
AGRIC 0.680, MANUF 0.678, SERV 0.733, ENERG UNDF
I put my program in the file.
Best regard
Sylla
\
Sylla,
You can prevent the devision by 0 by restrict the i’s for which PWMO
get calculated using the $-operator:
PWMO(I) = na;
PWMO(I)$(MO(I)*ERO 0)
= [VMO(I)-TXIMPO(I)]/(MO(I)*ERO);
First I filled PWMO with ‘na’ (not available) to mark the places that
can’t be calculate (you can also assign some other values if you like)
and then only do the division if the divisor is 0. The display
results in:
---- 298 PARAMETER PWMO World price of imported commodity i
(without duties)
in the benchmark situation
AGRIC 0.680, MANUF 0.678, SERV 0.733, ENERG NA
Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Jun 11, 10:35 am, Sylla wrote:
Hello,
I have a division by zero (UNDF) problem with my program. In my model
the country does not import Energy but imports Agriculture and
manufacrture products and Services. When I try to compute my imports
prices this appears in my program output:
**** Exec Error at line 292: division by zero (0)
---- 296 PARAMETER PWMO World price of imported commodity i
(without duties)
in the benchmark situation
AGRIC 0.680, MANUF 0.678, SERV 0.733, ENERG UNDF
I put my program in the file.
Best regard
Sylla
\
Michael,
Thank you very much. I did what you adviced me and it works.
Best regards.
Sylla
\
Date: Mon, 14 Jun 2010 02:42:17 -0700
Subject: Re: division by zero (UNDF) problem
From: bussieck@gams.com
To: gamsworld@googlegroups.com
Sylla,
You can prevent the devision by 0 by restrict the i’s for which PWMO
get calculated using the $-operator:
PWMO(I) = na;
PWMO(I)$(MO(I)*ERO 0)
= [VMO(I)-TXIMPO(I)]/(MO(I)*ERO);
First I filled PWMO with ‘na’ (not available) to mark the places that
can’t be calculate (you can also assign some other values if you like)
and then only do the division if the divisor is 0. The display
results in:
---- 298 PARAMETER PWMO World price of imported commodity i
(without duties)
in the benchmark situation
AGRIC 0.680, MANUF 0.678, SERV 0.733, ENERG NA
Hope this helps,
Michael Bussieck - GAMSWorld Coordinator
On Jun 11, 10:35 am, Sylla wrote:
Hello,
I have a division by zero (UNDF) problem with my program. In my model
the country does not import Energy but imports Agriculture and
manufacrture products and Services. When I try to compute my imports
prices this appears in my program output:
**** Exec Error at line 292: division by zero (0)
---- 296 PARAMETER PWMO World price of imported commodity i
(without duties)
in the benchmark situation
AGRIC 0.680, MANUF 0.678, SERV 0.733, ENERG UNDF
I put my program in the file.
Best regard
Sylla
–
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.
Enter for a chance to get your town photo on Bing.ca! Submit a Photo Now!
–
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.