> I have a problem with calculating a fraction, the reason is that both
> the nominator and denominator are variables.
> So I am looking for some way to make this linear:
> x_suj = p_s * (y_suj/w_su) or well just find what this fraction
> is: y_suj/w_su
> where p_s is a constant, x,y and w are integer variables. and I also
> need to avoid the division with 0 problem.
> Anyone know some tips/tricks for this?

Another way is to replace the variables by their logarithms:

   ln x_suj = ln p_s + ln y_suj - ln w_su

and then, depending on the context, model the exponenta

   z = exp(ln z)

by a piecewise linear function using SOS2 constraints; see
http://lists.gnu.org/archive/html/help-glpk/2007-06/msg00005.html
http://winglpk.sourceforge.net/media/glpk-sos2_02.pdf



_______________________________________________
Help-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to