Forum Discussion
FICO
1 year agoCommunity Manager
Issue building a nonlinear expressions with Xpress python package
Hello, I was building a nonlinear expression but came across a strange behavior. I am trying to produce (1 / (a + b) ) but all that I am getting is (1 / a + b ). Below is a minimal example that s...
FICO
1 year agoCommunity Manager
Thanks for reporting this! This seems to be a bug in printing expressions in Python :-(
The bug is only in printing expressions in Python. If I add these lines to your code:
p.addConstraint(f == 1)
p.addConstraint(g == 1)
p.write('nonlinear.lp')then the generated nonlinear.lp file contains these lines, which look correct:
R1: { 1 / ( lambda(A) + lambda(B) ) } = 1
R2: { ( 10 * lambda(A) + 10 * lambda(B) ) / lambda(C) } = 1I will file an internal defect to get this fixed.
