cplex安装_Excel软件规划求解工具的安装与功能介绍
引言
規劃求解工具是Excel軟件中自帶的一個功能非常強大的加載項/工具。它能夠完成包括線性規劃、整數線性規劃等一般規模的數學優化問題的問題求解。更重要的是,無論是在Windows操作系統下,還是蘋果電腦Mac平臺下,這個工具都是免費的。下面就這個工具的安裝和功能做一個簡單介紹。1 規劃求解工具的安裝
Excel軟件安裝時并不會自動安裝規劃求解工具,因此在使用規劃求解工具前必須手工實現其安裝。安裝的步驟非常簡單,下面以Office官網上給出的步驟,結合截圖給出操作步驟:(1)打開Excel軟件,在軟件的左上角找到“文件”菜單(2)進入“文件”菜單,找到左下角的“選項”子菜單(3)在“選項”窗口中,找到“加載項”欄目在“管理”旁邊,點擊“轉到”按鈕。(4)在打開的“加載項”窗口,勾選“規劃求解加載項”,確定后等待安裝完成。【注】在這個“加載項”窗口中,還有一個非常實用和強大的工具包“分析工具庫”。如果此時發現這個工具同樣沒有被勾選的話,建議同時勾選并安裝。(5)安裝成功后,在Excel軟件的主菜單“數據”下面,就會出現“規劃求解”的子菜單。(6)點擊“規劃求解”,就會打開“規劃求解參數”窗口。出現如此的窗口,就表明“規劃求解”工具安裝成功。詳細操作也可以參看下面視頻。【注】這個工具的安裝在微軟Microsoft公司的Office官網給出了簡單的說明,并給出了不同Excel版本下的安裝說明。用戶可以在微軟公司的Office軟件支持網站https://support.office.com上找到以類似“在Excel中加載規劃求解加載項”或"Load the Solver add-in in Excel"標題的介紹性文章。2?規劃求解工具基本介紹
Excel軟件的規劃求解工具操作比較簡單,窗口上內容主要可以分為三部分:(1)“設置目標”指出需要求解的優化問題的目標(單元格)。(2)“通過更改可變單元格”指出需要求解的優化問題的變量。(3)“遵守約束”指出需要求解的優化問題的約束條件。【注】窗口“選擇求解方法”下拉列表框中,總共有三個選項,其適用范圍也同時給出了解釋。一般來說,線性規劃問題可以采用“單純線性規劃”求解方法。3?深入了解規劃求解工具
規劃求解工具由Frontline公司提供(https://solver.com),在公司的網站中,對三個求解算法進行了說明(網站原文節選如下):The Microsoft Office Excel Solver tool uses several algorithms to find optimal solutions.
非線性GRG:
The GRG Nonlinear Solving Method for nonlinear optimization uses the Generalized Reduced Gradient (GRG2) code, which was developed by Leon Lasdon, University of Texas at Austin, and Alan Waren, Cleveland State University, and enhanced by Frontline Systems, Inc.
【翻譯】此方法采用Generalized Reduced Gradient (GRG2)代碼。開發者是...
單純線性規劃:
The Simplex LP Solving Method for linear programming uses the Simplex and dual Simplex method with bounds on the variables, and problems with integer constraints use the branch and bound method, as implemented by John Watson and Daniel Fylstra, Frontline Systems, Inc.
【翻譯】線性規劃問題采用單純形法(Simplex)和對偶單純形法(dual Simplex),對于整數約束的線性規劃問題采用分支定界方法(branch and bound)。開發者是...
演化:
The Evolutionary Solving Method for non-smooth optimization uses a variety of genetic algorithm and local search methods, implemented by several individuals at Frontline Systems, Inc.
【翻譯】演化算法采用了遺傳算法(genetic algorithm)和局部搜索方法(local search)。開發者是...
【注】規劃求解工具的英文原名是Solver。計算結果情況呢?(網站原文節選如下)With the Simplex LP Solving method, you can find a globally optimal solution given enough time – but you may have to settle for a solution that’s “close to optimal” found in a more reasonable amount of time.? With the GRG Nonlinear and Evolutionary Solving methods, you should expect a “good,” but not provably optimal solution.
【翻譯】如果是單純線性規劃算法求解,你一定能夠找出全局最優解(globally optimal solution),但是你需要設置算法精度(close to optimal)。但是,非線性GRG和演化算法,你可能只能找到一個還不錯(good)的解,但不一定是全局最優解。
這里所說的"設置"是指在“規劃求解參數”窗口中,通過點擊“選項”按鈕,得到“選項”對話框。在這里,可以通過精確度設置來保證問題求解的“質量”。最后,規劃求解能做什么,不能做什么呢?網站原文節選如下:*If your objective and constraints are linear functions of the decision variables, you can be confident of finding a globally optimal solution reasonably quickly, given the size of your model.? This is a linear programming problem; it is also a convex optimization problem (since all linear functions are convex).? The Simplex LP Solving method is designed for these problems.
【翻譯】如果問題是線性規劃問題,那么單純形法最能夠快速找到一個全局最優解,而求解速度取決于模型大小。
*If your objective and constraints are smooth nonlinear functions of the decision variables, solution times will be longer.? If the problem is convex, you can be confident of finding a globally optimal solution, but if it is non-convex, you can only expect?a locally optimal solution – and even this may be hard to find.? The GRG Nonlinear Solving method is designed for these problems.
【翻譯】如果問題是一個平滑的非線性問題,最好使用“非線性GRG”方法,計算時間會長一點。如果問題是一個凸函數(convex),還是能夠求出全局最優解;但是如果問題不是一個凸函數,那么這個問題求解非常困難。
*If your objective and constraints are non-smooth and non-convex functions of the decision variables (for example if you use IF, CHOOSE and LOOKUP functions whose arguments depend on decision variables), the best you can hope for is a “good” solution (better than the initial values of the variables), not a locally or globally optimal solution.? The Evolutionary Solving method is designed for these problems.
【翻譯】如果問題不是一個平滑和凸函數,例如,你在模型中用了類似Excel函數IF等,那么問題求解比較困難。此時,你需要使用“演化”方法。
*You can use integer, binary, and alldifferent constraints on variables with all three Solving methods.? However, these constraints make the problem non-convex and much harder to solve.
【翻譯】如果問題中增加了整數、0-1變量或者alldifferent約束形式,這個問題就變成了非凸函數,求解起來也非常困難。
4 總結
對于一般問題,采用規劃求解工具進行求解,不會有太大問題。但是,如果問題中出現了非線性、整數約束等,最好還是選用更加高級的商業工具,如matlab, ampl, cplex, ...。
|編輯:胡錦亞總結
以上是生活随笔為你收集整理的cplex安装_Excel软件规划求解工具的安装与功能介绍的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: think python 2ed_Thi
- 下一篇: 一般项目中哪里体现了数据结构_优秀程序员