利用Excel进行简单线性规划求解
一、前言
简单线性规划在Matlab 中很好进行求解,最近偶然一次看到了用Excel进行线性规划求解,暴露了自己对excel的一无所知。哈哈哈,特此记录一下。
二、问题描述
Diet Problem in Linear Programming solved with Excel Solver
One of the classic applications of Linear Programming is the diet problem. The Diet Problem in Linear Programming was one of the first optimization problems studied in the 1930s and 1940s. The main goal is to select a set of foods that meets certain daily nutritional requirements and preferences and additionally at minimum cost. Let´s consider the following list of foods with their nutritional profile to illustrate this application:
We wish to propose a diet containing at least 2,000 (Kcal), at least 55 grams of protein and 800 (mg) of calcium. In addition, to provide some variety in the diet, some limits are set for the daily portions of food. This information is required to find the diet that has the lowest cost associated with meeting the above requirements.
三、模型建立
四、模型求解
1、在Excel中输入好模型参数
(具体细节可以参考目标函数、约束公式的定义):
数据-规划求解(没有规划求解的话,可以在灯泡那里点击搜索 规划求解 并把它显示出来):
2、设置规划求解器参数
包括设置目标函数位置、目标、自变量的位置、约束的具体关系
3、进行求解
4、求解结果
参考网址
https://jingyan.baidu.com/article/19020a0a2bc918529c284269.html
☀ 记录自己学习的同时,也希望能对大家有所帮助,欢迎留言交流!