division by zero
Posted: Wed Mar 17, 2021 7:04 pm
Hi everyone!
I have a working code and I wanted to add a constraint and I defined a parameter.
<
parameters
K(i,j);
K(i,j)$(ord(i)<>ord(j))=1/power(x(i,j));
>
Whenever I try to run this code, it gives me division by zero error.
How can I ensure that
if x(i,j) is 0, K(i,j) directly 0
otherwise, K(i,j) will give the result 1/x(i,j)?
Thanks in advance,
I have a working code and I wanted to add a constraint and I defined a parameter.
<
parameters
K(i,j);
K(i,j)$(ord(i)<>ord(j))=1/power(x(i,j));
>
Whenever I try to run this code, it gives me division by zero error.
How can I ensure that
if x(i,j) is 0, K(i,j) directly 0
otherwise, K(i,j) will give the result 1/x(i,j)?
Thanks in advance,