You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this case I deliberately forgot to place a * in order to multiply the values. The function should be:
return 0 == m.x*(m.y)
The expected Value Error is:
$ ValueError: Invalid constraint expression. The constraint expression resolved to a trivial Boolean (False) instead of a Pyomo object. Please modify your rule to return Constraint.Infeasible instead of False.Error thrown for Constraint 'const_1[0]'
However we found that for some specific cases the error won't throw.
In this simplified example we define a Param m.x and a Var m.y which is time dependant (i.e: m.y[t]). It is set as a feasibility problem, therefore the objective function returns the value 0. Running the program throws neither warnings nor errors and the solver is able to find an (wrong) optimal solution
Then we obtained the values for instance.y by running:
Summary
When defining a constraint like the following Pyomo will throw an "Invalid constraint expression" Value Error:
In this case I deliberately forgot to place a
*
in order to multiply the values. The function should be:The expected Value Error is:
However we found that for some specific cases the error won't throw.
Error
The following code is ready to run and replicate:
In this simplified example we define a Param
m.x
and a Varm.y
which is time dependant (i.e:m.y[t]
). It is set as a feasibility problem, therefore the objective function returns the value0
.Running the program throws neither warnings nor errors and the solver is able to find an (wrong) optimal solution
Then we obtained the values for
instance.y
by running:*
:{0: 0.5, 1: 0.5, 2: 0.5, 3: 0.5, 4: 0.5}
*
:{0: 0.0, 1: 0.0, 2: 0.0, 3: 0.0, 4: 0.0}
System information
Pyomo version: 6.6.1
Python version: 3.9.13
Operating system: Windows 10
How Pyomo was installed (PyPI, conda, source): pip
Solver (if applicable): ipopt (Ipopt 3.10.1)
The text was updated successfully, but these errors were encountered: