+ Reply to Thread
Results 1 to 6 of 6

Help with Linear Programming Problem (Solver function)

  1. #1
    Registered User
    Join Date
    11-14-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    3

    Help with Linear Programming Problem (Solver function)

    Can someone help with the problem below?

    The answer I get satisfies 5/6 constraints - Not sure if I am doing something wrong? I need it to satisfy all 6 constraints.

    The chart is all messed up when i copy paste so I have attached the word document with the chart and also the excel document with my attempt on the solution.

    Sandra Robles is the dietitian for a College basketball team, and she is attempting to determine a nutritious lunch menu for the team. She has set the following nutritional guidelines for each lunch serving.

    • Between 1500 and 2000 calories
    • At least 5 mg of iron
    • At least 20 but no more than 60 g of fat
    • At least 30 g of protein
    • At least 40 g of carbohydrates
    • No more than 30 mg of cholesterol
    She selects the menu from seven basic food items as follows, with the nutritional contribution per pound and the cost as given.

    Calories
    (per lb) Iron
    (mg/lb) Protein
    (g/lb) Carbohydrates
    (g/lb) Fat
    (g/lb) Cholesterol
    (mg/lb) $/lb
    Chicken 520 4.4 17 0 30 180 3.44
    Fish 500 3.3 85 0 5 90 3.99
    Ground beef 860 0.3 82 0 75 350 4.99
    Dried beans 600 3.4 10 30 3 0 1.10
    Lettuce 50 0.5 6 0 0 0 0.90
    Potatoes 460 2.2 10 70 0 0 0.59
    Milk (2%) 240 0.2 16 22 10 20 0.83

    Sandra wants to select a menu to meet the nutritional guidelines while minimizing the total cost per serving.

    Please help Sandra to formulate a linear programming model and solve it using Excel Solver.

  2. #2
    Registered User
    Join Date
    11-14-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: Help with Linear Programming Problem (Solver function)

    Can someone please help?

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

    Re: Help with Linear Programming Problem (Solver function)

    A couple of things I noticed:

    If I read your constraints correctly, you are telling Solver to limit solutions to those solutions where column I is greater than both column K and L -- essentially column I is greater than the max of column K and L. The problem statement looks like it is asking for values between K and L. Look at how you have formulated your constraints again, as they don't look right to me.

    In your constraints columns (K and L), you have left some blank. Solver/Excel will interpret blanks as the value 0. Where the intent of the Solver model seems to be trying to find values for I that are between K and L, Solver will be trying to find a value that is greater than, say 5 for iron, and also less than 0, which is impossible. Again, I think you need to think through your constraint statements more carefully.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  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: Help with Linear Programming Problem (Solver function)

    I find your problem a bit puzzling. I assume the different qualities blends linearly on a weight basis. A balanced lunch would then consist of different % of some of
    the components to meet the required specification for calories, iron and so fort. This I've set up a model for on Sheet1.
    The bad: With the given constraint solver can not find a solution that satisfies all given constraints.

    On Sheet2 I've set up another solver solution but even if this gives a solution meeting the constraints I'm not sure the team will be able to play any basketball
    after every one of them have had 3,5 pound of foodstuff for lunch. On the other hand I may be wrong. If solver assumes the dried beans to be "Mexican jumping beans"
    then perhaps this will work in the teams favor.

    Alf
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    11-14-2016
    Location
    Ontario, Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: Help with Linear Programming Problem (Solver function)

    Quote Originally Posted by Alf View Post
    I find your problem a bit puzzling. I assume the different qualities blends linearly on a weight basis. A balanced lunch would then consist of different % of some of
    the components to meet the required specification for calories, iron and so fort. This I've set up a model for on Sheet1.
    The bad: With the given constraint solver can not find a solution that satisfies all given constraints.

    On Sheet2 I've set up another solver solution but even if this gives a solution meeting the constraints I'm not sure the team will be able to play any basketball
    after every one of them have had 3,5 pound of foodstuff for lunch. On the other hand I may be wrong. If solver assumes the dried beans to be "Mexican jumping beans"
    then perhaps this will work in the teams favor.

    Alf
    Thank you so much Alf!

    The answer on sheet 2 seems right. I really appreciate your help!!

  6. #6
    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: Help with Linear Programming Problem (Solver function)

    You are welcome and thanks for feedback.

    Alf

+ 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. Help with Linear Programming
    By Cadis in forum Excel General
    Replies: 1
    Last Post: 10-15-2014, 01:48 PM
  2. Multipage linear function problem.
    By Archaimot in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 08-18-2014, 01:18 PM
  3. Solver add-in linear programming problem
    By Stewart723 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 05-11-2014, 01:17 PM
  4. Transportation model, linear programming and Solver
    By GregDP in forum Excel General
    Replies: 6
    Last Post: 12-07-2013, 04:56 AM
  5. How to use Solver & Dynamic Programming to solve this problem?
    By brooklyn12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-26-2013, 03:45 PM
  6. Solver and Interger Programming Problem
    By hpman247 in forum Excel General
    Replies: 5
    Last Post: 10-08-2010, 12:51 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