Solver Not Respecting Constraints

  • Thread starter Thread starter Larry Curcio
  • Start date Start date
L

Larry Curcio

Is there a known bug where the solver, in nonlinear mode,
ignores constraints? I'm constraining a decision variable to
be positive and getting a negative answer.

Here is a recording of the procedure:

SolverReset
SolverAdd CellRef:="$B$2", Relation:=3, FormulaText:="0.000001"
SolverAdd CellRef:="$C$2", Relation:=3, FormulaText:="0.000001"
SolverAdd CellRef:="$D$2", Relation:=3, FormulaText:="0.000001"
SolverAdd CellRef:="$E$2", Relation:=3, FormulaText:="0.000001"
SolverOk SetCell:="$A$2", MaxMinVal:=1, ValueOf:="0",
ByChange:="$B$2:$E$2"
SolverSolve

The D2 is coming up negative.

Thanks and Regards,
-Larry (New to Excel) Curcio
 
I've run problems with 40 constraints with no problems.
On a problem like this it's easier to enter all the constraints
on one line. e.g.
SolverAdd CellRef:="$B$2:$E$2", Relation:=3, FormulaText:="0.000001"
or in solver by entering the range in the cell reference box.
This is one of those areas where Excel is smart enough to
apply the constraint to each cell in the range and it seems to
do it more consistently than separate constraints.

Also, some option settings can also cause problems,
e.g. high tolerance or low iterations. It may be assuming
a small negative number is close enough for what you are doing
kcc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top