+ Reply to Thread
Results 1 to 8 of 8

Solver: How to maximize a mark average (non-linear problem) in a linear way?

  1. #1
    Registered User
    Join Date
    06-06-2017
    Location
    São Paulo
    MS-Off Ver
    2016
    Posts
    3

    Lightbulb Solver: How to maximize a mark average (non-linear problem) in a linear way?

    Hi everyone,

    It's my first post here. I will try to be clear on my problem by giving you a simple example .

    My problem is a problem of linearity with the Excel Solver and I don't know how to handle formulas and restrictions in order to make it linear.

    Let's say we have to buy two items k =1,2 and we have two suppliers i=1,2. We give a mark mik for each item k provided by supplier i.
    Supplier 1 item 1: 9/10
    Supplier 1 item 2: 4/10
    Supplier 2 item 1: 3/10
    Supplier 2 item 2: 8/10

    I create a decision variable xik that takes the value 1 if the item k is allocated to supplier i, 0 otherwise.

    My objective is to maximize the average note of the allocation, that is to say SUM i=1,2;j=1;2 (xikmik)/SUM i=1,2;j=1;2 (xik)

    The problem is that if I divide by SUM(xik). My problem becomes non-linear and I don't know how to do.

    Does anyone have a solution please?

    Thank you a lot for your time and help

    I let you the model to help you understand my problem
    exemple.JPG

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    Please attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    One spreadsheet to rule them all. One spreadsheet to find them. One spreadsheet to bring them all and at corporate, bind them.

    A picture is worth a thousand words, but a sample spreadsheet is more likely to be worked on.

  3. #3
    Registered User
    Join Date
    06-06-2017
    Location
    São Paulo
    MS-Off Ver
    2016
    Posts
    3

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    Here is the sample model
    Attached Files Attached Files

  4. #4
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    I am not having any luck either.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    What do you expect for the final solution? After entering 1 into B7 (to get rid of the div/0 error), I ran your solver model and it seemed to solve it just fine with B7:E7=1,0,0,1 which seems to make sense for getting the highest average.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    06-06-2017
    Location
    São Paulo
    MS-Off Ver
    2016
    Posts
    3

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    Thank you for your response.

    I wanted to make the problem linear because it doesn't work when I try to solve it with a non-linear resolution method (even if I eliminate the div/0 error). I am using the Open Solver add-in.
    What solver and resolution method are you using please?

    And even if it works with a non-linear approach, I would rather prefer a linear one, if it is possible.

    Thank you.

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    I have no experience with Open Solver. I am using the basic built in Solver that comes pre-packaged with Excel 2007. The only change I made to the downloaded sheet was to enter a 1 in that one cell. Otherwise I changed nothing, including changing nothing in the Solver model (Set target cell B11 to a maximum by changing B7:E7 subject to constraints that G3:G4>=1 and B7:E7=bin).

    And even if it works with a non-linear approach, I would rather prefer a linear one, if it is possible.
    I am not knowledgeable enough about the field of linear programming to understand exactly what makes a problem "linear" or "non-linear" or what goes into transforming a non-linear problem into a linear problem. Someone more knowledgeable in linear programming will probably need to come along to help with this aspect of the problem.

  8. #8
    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: Solver: How to maximize a mark average (non-linear problem) in a linear way?

    As the OpenSolver (CBC engine) is a linear solver it will not work on your problem as you do a division. To run a solve a non-linear problem you can use "NOMAD", "Bonmin" or "Couenne".

    See link:

    https://opensolver.org/guide-to-solvers/

    or just the excel solver that comes with solver 2016 but you must use the "GRG nonlinear" engine.

    If you really wish to run OpenSolver you must run it as a two stage rocket using a macro.

    To test you can run macro "OpenSolver_loop" but first you must set a reference to "OpenSolver" in VBA.

    Select "Developers tab -> Click Visual Basic Icon -> click "Tools" -> click "References" and tick box marked "OpenSolver"

    OpenSolv_ref.jpg

    The macro "Excel_Solver_loop" is for the Excel "Simplex LP" also there a reference to the "Excel" solver must be set.

    Alf
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Help with Linear Programming Problem (Solver function)
    By smotwani_ in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-15-2016, 04:51 AM
  2. [SOLVED] Linear Equations Example - Solver
    By zanshin777 in forum Excel General
    Replies: 12
    Last Post: 10-03-2015, 10:39 AM
  3. Linear program using Excel Solver
    By natygrosso in forum Excel General
    Replies: 6
    Last Post: 07-02-2014, 09:00 PM
  4. Solver add-in linear programming problem
    By Stewart723 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-11-2014, 01:17 PM
  5. non linear equations solver using VBA
    By mwalshe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-06-2010, 11:10 AM
  6. [SOLVED] linear model with solver
    By vert in forum Excel General
    Replies: 1
    Last Post: 04-04-2006, 11:35 AM
  7. Replies: 2
    Last Post: 02-08-2006, 08:10 PM

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