Optimization - a baptism of fire

1 view (last 30 days)
Charles
Charles on 19 Jul 2015
Answered: John D'Errico on 19 Jul 2015
Hi all,
I am looking for some assistance on using the optimization tool box. The problem is fairly simple however I am struggling to find my way around the GUI.
The problem :
- I am producing a grain bar which must contain vitamins of minimum concentrations (7 vitamins).
- I have 5 food products all containing different concentrations of the required vitamins.
- The 5 food products are different monetary costs per kilogram.
- * I want to produce the grain bar recipe for the lowest monetary cost; and a target weight of ~ 125 grams. *
I have been using Matlab for almost ten years but have never had to use the optimization toolbox before. If anyone is willing to provide me with some basic instructions for fulfilling the above it would save me a great deal of time and effort.
best wishes

Answers (1)

John D'Errico
John D'Errico on 19 Jul 2015
I don't see the purpose of a gui here for a very simple problem. The objective function appears to be linear, based on your description. The constraints are all linear. So use a linear programming tool, thus linprog.
There are 5 food products. The objective is to minimize the total cost, so a simple linear combination of the unknowns.
There is an equality constraint, that the total weight is known. Since each unknown will have units of weight (kilograms) that seems clear to me.
There are inequality constraints on the vitamin content, thus another linear combination of the unknowns, since each product has differing amounts of vitamins.
Why not make an effort? For example, how would you write the objective for linprog in this problem?

Categories

Find more on Linear Programming and Mixed-Integer Linear Programming in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!