+ Reply to Thread
Results 1 to 8 of 8

Excel2007 Solver fails to solve apparently easy problem

  1. #1
    Registered User
    Join Date
    09-04-2011
    Location
    My House
    MS-Off Ver
    Excel 2007
    Posts
    4

    Excel2007 Solver fails to solve apparently easy problem

    Hi everyone. I'm trying to use Solver to optimise a project finance model, and I started off by using a basic example to get my head around it. Except that Solver failed to produce the best or second best solution. I was hoping that someone could tell me if I did something wrong, or else explain why the Solver algorithm fell down here.

    I gave 4 power plant types a value for power generation, cost and carbon emissions (A1:D5). I set a lower limit for total power generation (L3) and an upper limit for emissions (L2), and then used Solver to optimize the numbers of each type of power plant (E2:E5) to produce the minimum cost (G6 - see below).

    \1

    But that produced this output, which is obviously not the best:

    \1

    But, when I fixed E2 at zero and eliminated it from the goalseek, Solver did achieve the right answer easily, despite the fact that it had already deduced that E2 was 0 last time:

    \1

    I'd appreciate any ideas.
    Attached Files Attached Files
    Last edited by Itsatwap; 09-04-2011 at 02:27 PM. Reason: Attached workbook

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

    Re: Excel2007 Solver fails to solve apparently easy problem

    afaik solver finds A solution not necesarilly the best
    "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

  3. #3
    Registered User
    Join Date
    09-04-2011
    Location
    My House
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel2007 Solver fails to solve apparently easy problem

    Thanks, and I accept that, but I was hoping for some insight into whether the settings I was using for Solver were inappropriate to the task, or if not then why the algorithm failed to deal with such a simplistic problem.

  4. #4
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Excel2007 Solver fails to solve apparently easy problem

    There is an old saying "To ask the right question you must know at least 90 % of the right answer".

    Well Solver does work in that way so setting up the "right" constraints can be rather difficult.

    In your example there the only restraint on "Emission" was it should be <=12. I.e. a high limit. If you introduce a low limit as well on emission then Solver would be forced to take in other kinds of plants.

    I've added an extra column in your example with emission cost assuming that gas "emission" costs less than oil "emission" and oil "emission" cost less then nuclear "emission".

    As shown in your "Answer Report" the "Tot Emission" is not binding not really sure if that has caused the problem.

    I'll play around with this a bit more and see if I can come up with a better explanation.

    Alf
    .
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    09-04-2011
    Location
    My House
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel2007 Solver fails to solve apparently easy problem

    Thanks very much for the response. Putting in the lower limit is a good point, the correct solution was reached even when I specified that emissions must be greater than one.

    The point about non-binding variables: I had assumed that that was because I put in a "less than or equal to" rather than an "equal to".

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Excel2007 Solver fails to solve apparently easy problem

    Hi Itsatwap,

    I know the Solver has changed from the 2007 to 2010 versions of Excel. I wonder if the newer version would suit your needs better. Read:
    http://office.microsoft.com/en-us/ex...#_Toc274394092 and
    http://www.solver.com/excel2010/solverhelp.htm
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  7. #7
    Forum Expert Alf's Avatar
    Join Date
    03-13-2004
    Location
    Gothenburg/Mullsjoe, Sweden
    MS-Off Ver
    Excel 2019 and not sure I like it
    Posts
    4,758

    Re: Excel2007 Solver fails to solve apparently easy problem

    Have not found any good explanation to why Solver doesn’t find the best solution without a constraint on lower limit for emission.

    Still one can always test the Solver solution to see if it is a "true" value. In you example the optimal Solution according to Solver was 400 (Cell G6).

    If you add the constraint G6 <= 399 Solver will then change cell G6 value to 391 showing that the first result was not the best solution.

    Alf

  8. #8
    Registered User
    Join Date
    09-04-2011
    Location
    My House
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Excel2007 Solver fails to solve apparently easy problem

    Thanks for the help guys. I'm pretty sure that the evolutionary solver in 2010 would do a much better job, unfortunately the client has only just upgraded to 2007, so that'll be a hard sell.

    Alf, that's a great idea, thanks mate, I'll try looping with the last solution minus a bit as a constraint.

    Edit: I won't tag this one as answered just yet in case anyone else can chip in.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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