+ Reply to Thread
Results 1 to 7 of 7

Solver - Solving Non Linear Equation by linearizing the equation

  1. #1
    Registered User
    Join Date
    07-23-2017
    Location
    Peoria, USA
    MS-Off Ver
    2016
    Posts
    55

    Solver - Solving Non Linear Equation by linearizing the equation

    Hello,

    I have a problem in excel solver where I need to multiply two variable making it a non linear equation. Please help me by transforming it into linear equation

    I have attached the excel sheet for reference
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    396

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    The non-linearity comes from the choice to express the transportation costs as a product of a binary var that tells us if a site has been chosen, and a real var for the demand shipped. By the way, you don't need to set it to integer.

    This is a very intuitive way to think about the problem, but not the only one. We want the demand to be zero when the site is not chosen, and free to take any value if the site is chosen.
    Since we have a capacity constraint in row 88, we can build a matrix like D62:AA85 where, in each cell, we set this limit, and then constraint our vars to be less than it (if the constraint must hold for the sum in a column, it must also hold for each single variable).
    What happens if the site is not selected? Demand must be zero, so here is the trick: multiply the max by the binary var. If the site is chosen we respect the first constraint, and OpenSolver is free to find the best value, if it isn't we will have a zero in the cell, and the real var must then be zero as well.

    Adding this constraint we can remove the binary variable from the formulas in D62:AA85. Changing then the formula in AB62:AB85 to a simple SUM, we have a linear model. If I didn't got something wrong, the minimum cost should be $70.150.174.758,4.

    Let me know if these hints are enough.

    HTH,

    Francesco
    Last edited by Hydraulics; 04-09-2022 at 06:24 AM.
    Aim high or don't even try.
    ---------------------------------
    If your question has been answered, don't forget to mark the thread as SOLVED.
    If you find an answer helpful, click on the star icon at the bottom of the post.

  3. #3
    Registered User
    Join Date
    07-23-2017
    Location
    Peoria, USA
    MS-Off Ver
    2016
    Posts
    55

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    Thank you Francesco for explaining the hints. I understand the part where you mentioned set the limt and constraint our variable less than that. However, I could not understand by multiply the max by the binary variable. Appreciate if you can explain that again.

    Also, it would help if you can attach the excel sheet to it.

    Thanks again for your help.

  4. #4
    Registered User
    Join Date
    07-23-2017
    Location
    Peoria, USA
    MS-Off Ver
    2016
    Posts
    55

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    Please check if I could apply your hint successfully
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    396

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    Sure, here is the file. I think it's self-explanatory, let me know if you still have questions.

    HTH,

    Francesco

    P.S. Total cost is $ 41.339.339.794,8 if you maximize total demand.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    07-23-2017
    Location
    Peoria, USA
    MS-Off Ver
    2016
    Posts
    55

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    Thank you Francesco, This really works. Appreciate your help

  7. #7
    Valued Forum Contributor Hydraulics's Avatar
    Join Date
    07-15-2018
    Location
    Udine - Italy
    MS-Off Ver
    Office 365
    Posts
    396

    Re: Solver - Solving Non Linear Equation by linearizing the equation

    Glad I could help. Would you please mark the thread as solved?

    Francesco

+ 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. Possibly linear of Non-linear equation solution?
    By SamJay in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-03-2021, 03:27 PM
  2. Solving equation using the Solver Function of Excel
    By ltomilas in forum Excel General
    Replies: 2
    Last Post: 08-29-2013, 04:13 PM
  3. Non-linear fitting and equation solving
    By kd5649 in forum Excel Charting & Pivots
    Replies: 15
    Last Post: 04-10-2013, 10:55 AM
  4. Solving non-linear equation
    By Lagrene in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-16-2011, 06:56 PM
  5. Replies: 3
    Last Post: 03-06-2011, 01:38 PM
  6. Solving an equation
    By sydmil in forum Excel General
    Replies: 6
    Last Post: 05-13-2009, 12:29 AM
  7. [SOLVED] Please help me solving this equation ...: )
    By Joe Satriani in forum Excel General
    Replies: 3
    Last Post: 02-22-2006, 01:50 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