+ Reply to Thread
Results 1 to 7 of 7

Excel Solver: Constraint Specification

  1. #1
    Registered User
    Join Date
    11-15-2010
    Location
    Antarctica
    MS-Off Ver
    Excel 2003
    Posts
    3

    Excel Solver: Constraint Specification

    I am having trouble specifying a solver constraint such that:

    cell(x) >= cell(y) -or-
    cell(x) = 0

    How do I implement this? If Excel Solver is not robust enough to implement this condition, would something like Matlab using the optimization toolbox be more appropriate?

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Solver: Constraint Specification

    I'm unsure of your question; you can set either of those constraints directly in the Solver dialog.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel Solver: Constraint Specification

    wouldn't that mean if set in constraints that
    cell x must be =0
    AND
    >= cell y
    not OR?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  4. #4
    Registered User
    Join Date
    11-15-2010
    Location
    Antarctica
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel Solver: Constraint Specification

    Quote Originally Posted by martindwilson View Post
    wouldn't that mean if set in constraints that
    cell x must be =0
    AND
    >= cell y
    not OR?
    If cell(x) must be zero, then the fact that it must be greater than cell(y) is irrelevant.

    Cell(x) may only accept values of 0 or any value >= Cell(y) hence the "or".

    In mathematical terms, [0] -or- [cell(y), infinity) where cell(y) > 0.

  5. #5
    Registered User
    Join Date
    11-15-2010
    Location
    Antarctica
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Excel Solver: Constraint Specification

    Quote Originally Posted by shg View Post
    I'm unsure of your question; you can set either of those constraints directly in the Solver dialog.
    OK, how?

    If Cell(x) can only take on values of 0 or values greater than Cell(y) and Cell(y) is a positive number, how can this be programmed? I can input the conditions separately, sure, but having two conditions specifying

    Cell(x) = 0 and another saying
    Cell(x) >= Cell(y)

    simply means Cell(x) will always be constrained to 0 (when Cell(y) is negative or 0) or will be in conflict with the second expression.

    What I need is: Cell(x) can only take on values of zero, or any real number in the interval [Cell(y), infinity) where Cell(y) > 0.

    I should add that Cell(x) is the "changing" cell.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Excel Solver: Constraint Specification

    I took your -or- to mean -exclusive or-, i.e., set one constraint or the other.

    You could add a formula into another cell =(x>=y) + (x<y)*(x=0) and constrain that to =1. How well that works probably depends on the problem.

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Excel Solver: Constraint Specification

    i wasn't replying to you just asking shg a question

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1