1、LINDO软体操作简易说明 LINDO軟體操作簡易說明1、 指令與環境 LINDO - 進入LINDO系統 TAKE 檔名 - 讀取外部程式(ASCII碼)檔 QUIT - 離開LINDO系統 DIVERT file -輸出到外部檔案或列表機 HELP - 線上支援 RVRT -中斷DIVERT的輸出恢復輸出到營幕CAT - 列示指令清單Ctrl+Print - 與列表機同步 : - LINDO的提示符號 RETR - 讀取外部(壓縮)檔案 ? - 次階指令的提示符號 SAVE - 儲存外部(壓縮)檔案 ! - 批次作業程式中註解的標記 RMPS - 讀取外部(MPS)檔案 MAX - 極大化
2、 SMPS -儲存線性規劃模式為外部(MPS)檔案 MIN - 極小化 SDBC - 以DS格式儲存線性規畫解 LOOK - 查看程式內容(如LOOK ALL) RDBC - 讀取外部(SDBC)檔案 GO - 進行求解 PIVOT - 逐步求解計算下一個單純表 TABLU - 展示現階段單純表 SOLUTION-列示線性規畫解 RANGE - 展示敏感度分析表 EDIT - 進入LINDO全營幕編輯系統,按ESC鍵離開EDIT系統 ALTER -修改某一個係數 APPC - 加入一個新行(新變數) EXT - 加入一個新限制式 DEL - 刪除某一限制式 PARARHS - 做右手邊常數的參
3、數分析 FREE 變數 - 無限制界限變數的設定 SLB 變數 數值 - 變數下界的設定 SUB 變數 數值 - 變數上界的設定 GIN 變數 - 設定整數變數 INTE 變數 - 設定0,1整數變數2、 範例 LINDO :MAX 15 X1 + 20 X2 !開始輸入資料 ? SUBJECT TO ? 4 X1 + 2 X2 36 ? X1 + 2 X2 24 ? X2 11 ? X1 + X2 20 ? END :LOOK ALL !展示程式全部內容 ! MAX 15 X1 + 20 X2 ! SUBJECT TO ! 2) 4 X1 + 2 X2 = 36 ! 3) X1 + 2 X2
4、 = 24 ! 4) X2 = 11 ! 5) X1 + X2 = 20 ! END :GO !執行程式 LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) 260.00000 VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.666667 3) .000000 8.333333 4) 1.000000 .000000 5) 6.000000 .000000N
5、O. ITERATIONS= 2DO RANGE(SENSITIVITY) ANALYSIS? !是否執行參數分析? YRANGES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGESVARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE X1 15.000000 25.000000 5.000000 X2 20.000000 9.999999 12.500000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE
6、RHS INCREASE DECREASE 2 36.000000 36.000000 6.000000 3 24.000000 1.500000 15.000000 4 11.000000 INFINITY 1.000000 5 20.000000 INFINITY 6.000000: SOLUTION !列出最佳解 OBJECTIVE FUNCTION VALUE 1) 260.00000 VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES
7、 2) .000000 1.666667 3) .000000 8.333333 4) 1.000000 .000000 5) 6.000000 .000000NO. ITERATIONS= 2!與外部檔案連結,儲存程式檔 :DIVERT PP71.LIN !與檔案pp71.lin連線,準備輸出程式資料存檔 :LOOK ALL !輸出 :RVRT !中斷連線 :ALTER !修改資料 ROW: !欲修改資料在第?列 1 VAR: ! 欲修改資料的變數名稱 X1 NEW COEFFICIENT: !輸入新係數 ?20 :LOOK ALL ! MAX 20 X1 + 20 X2 ! SUBJECT
8、 TO ! 2) 4 X1 + 2 X2 = 36 ! 3) X1 + 2 X2 = 24 ! 4) X2 = 11 ! 5) X1 + X2 = 20 ! END :GO LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) 280.00000 VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 3.333333 3) .000000 6.666667 4) 1.0
9、00000 .000000 5) 6.000000 .000000 NO. ITERATIONS= 2 DO RANGE(SENSITIVITY) ANALYSIS? ?N ! 儲存到外部的資料,其格式如何?如何再次讀取和運用 !:TAKE PP71.LIN ! 讀取程式檔:LOOK ALL ! MAX 15 X1 + 20 X2 ! SUBJECT TO ! 2) 4 X1 + 2 X2 = 36 ! 3) X1 + 2 X2 = 24 ! 4) X2 = 11 ! 5) X1 + X2 TYPE PP71.LIN !MAX 40 X1 + 50 X2 !SUBJECT TO ! 2) X1
10、 + 2 X2 = 40 ! 3) 4 X1 + 3 X2 TYPE PP71MPS.DAT ! NAME ( MAX) ! ROWS ! N 1 ! L 2 ! L 3 ! L 4 ! L 5 !COLUMNS ! X1 1 15.0000000 ! X1 2 4.0000000 ! X1 3 1.0000000 ! X1 5 1.0000000 ! X2 1 20.0000000 ! X2 2 2.0000000 ! X2 3 2.0000000 ! X2 4 1.0000000 ! X2 5 1.0000000 !RHS ! RHS 2 36.0000000 ! RHS 3 24.000
11、0000 ! RHS 4 11.0000000 ! RHS 5 20.0000000 !ENDATA C:LINDOTYPE PP71DBC.DAT ! 260.00000 1.0000000 F .10000000E+31 ! X1 4.0000000 .00000000 C .10000000E+31 ! X2 10.000000 .00000000 C .10000000E+31 ! 批次檔案的執行與批次檔案的格式 ! LINDO OUTCP71.TXT !在LINDO模組外做批次作業 C:LINDOTYPE CCP71.TXT ! ! 第一行必須空白 !PAGE 0 ! 第一行必須註解
12、第0頁 ! !可由此行開始輸入資料 !MAX 15 X1 + 20 X2 !線性規劃模式 !SUBJECT TO ! 4 X1 + 2 X2 36 ! X1 + 2 X2 TYPE OUTCP71.TXT LINDO/PC 5.02 (4 MAR 92)COPYRIGHT (C) 1992 LINDO SYSTEMS INC, CHICAGO, IL.LICENSED MATERIAL, ALL RIGHTS RESERVED. COPYINGEXCEPT AS AUTHORIZED IS PROHIBITED.SINGLE USER LICENSE : : : : ? ? ? ? ? ? :
13、 LP OPTIMUM FOUND AT STEP 2 OBJECTIVE FUNCTION VALUE 1) 260.00000 VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.666667 3) .000000 8.333333 4) 1.000000 .000000 5) 6.000000 .000000NO. ITERATIONS= 2DO RANGE(SENSITIVITY) ANALYSIS? RANG
14、ES IN WHICH THE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGESVARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE X1 15.000000 25.000000 5.000000 X2 20.000000 9.999999 12.500000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 36.000000 36.000000 6.000000 3 24.000000
15、 1.500000 15.000000 4 11.000000 INFINITY 1.000000 5 20.000000 INFINITY 6.000000: OBJECTIVE FUNCTION VALUE 1) 260.00000 VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.666667 3) .000000 8.333333 4) 1.000000 .000000 5) 6.000000 .000000
16、NO. ITERATIONS= 2 ! 用單純法解線性規劃模式時,所用的單純表 ! LINDO :TAKE PP71.LIN :TABLU !列出單純表 THE TABLEAU ROW (BASIS) X1 X2 SLK 2 SLK 3 SLK 4 1 ART -15.000 -20.000 .000 .000 .000 2 SLK 2 4.000 2.000 1.000 .000 .000 3 SLK 3 1.000 2.000 .000 1.000 .000 4 SLK 4 .000 1.000 .000 .000 1.000 5 SLK 5 1.000 1.000 .000 .000 .
17、000 ART 5 ART -15.000 -20.000 .000 .000 .000 ROW SLK 5 1 .000 .000 2 .000 36.000 3 .000 24.000 4 .000 11.000 5 1.000 20.000:PIVOT !逐步執行線性規畫 X1 ENTERS AT VALUE 9.0000 IN ROW 2 OBJ. VALUE= 135.00 :TABLU THE TABLEAU ROW (BASIS) X1 X2 SLK 2 SLK 3 SLK4 1 ART .000 -12.500 3.750 .000 .000 2 X1 1.000 .500 .
18、250 .000 .000 3 SLK 3 .000 1.500 -.250 1.000 .000 4 SLK 4 .000 1.000 .000 .000 1.000 5 SLK 5 .000 .500 -.250 .000 .000 ROW SLK 5 1 .000 135.000 2 .000 9.000 3 .000 15.000 4 .000 11.000 5 1.000 11.000:PIVOT X2 ENTERS AT VALUE 10.000 IN ROW 3 OBJ. VALUE= 260.00 :TABLU THE TABLEAU ROW (BASIS) X1 X2 SLK
19、 2 SLK 3 SLK 4 1 ART .000 .000 1.667 8.333 .000 2 X1 1.000 .000 .333 -.333 .000 3 X2 .000 1.000 -.167 .667 .000 4 SLK 4 .000 .000 .167 -.667 1.000 5 SLK 5 .000 .000 -.167 -.333 .000 ROW SLK 5 1 .000 260.000 2 .000 4.000 3 .000 10.000 4 .000 1.000 5 1.000 6.000:PIVOT LP OPTIMUM FOUND AT STEP 2 OBJECT
20、IVE FUNCTION VALUE 1) 260.00000 DO RANGE(SENSITIVITY) ANALYSIS? !是否執行參數分析? Y VARIABLE VALUE REDUCED COST X1 4.000000 .000000 X2 10.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 1.666667 3) .000000 8.333333 4) 1.000000 .000000 5) 6.000000 .000000 NO. ITERATIONS= 2:RANGE RANGES IN WHICH T
21、HE BASIS IS UNCHANGED: OBJ COEFFICIENT RANGESVARIABLE CURRENT ALLOWABLE ALLOWABLE COEF INCREASE DECREASE X1 15.000000 25.000000 5.000000 X2 20.000000 9.999999 12.500000 RIGHTHAND SIDE RANGES ROW CURRENT ALLOWABLE ALLOWABLE RHS INCREASE DECREASE 2 36.000000 36.000000 6.000000 3 24.000000 1.500000 15.
22、000000 4 11.000000 INFINITY 1.000000 5 20.000000 INFINITY 6.000000 :RVRT !中斷連線 ! LINDO模組內的編輯子程式 !:EDIT !呼叫編輯子模組,按下 ESC 鍵,離開 EDIT 模組,並儲存程式 ! 整數規劃模式 ! :LOOK ALL !整數規畫例題 MIN 340000 X1 + 270000 X2 + 290000 X3 + 12 X4 + 13 X5 + 10 X6 SUBJECT TO 2) X4 + X5 + X6 = 18000 3) - 11000 X1 + X4 = 0 4) - 10000 X2
23、 + X5 = 0 5) - 9000 X3 + X6 22222.2 SET X3 TO = 1 AT 1, BND= -.7670E+06 TWIN= -.7433E+06 87 NEW INTEGER SOLUTION OF 767000.000 AT BRANCH 18 PIVOT 87 OBJECTIVE FUNCTION VALUE 1) 767000.00 VARIABLE VALUE REDUCED COST X1 .000000 .000000 X2 1.000000 270000.000000 X3 1.000000 263000.000000 X4 .000000 29.
24、909090 X5 9000.000000 .000000 X6 9000.000000 .000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 -13.000000 3) .000000 30.909090 4) 1000.000000 .000000 5) .000000 3.000000 NO. ITERATIONS= 87 BRANCHES= 18 DETERM.= 1.000E 0 BOUND ON OPTIMUM: 743272.8 FLIP X3 TO = 1 AT 2, BND=-.8330E+06 TWIN= -.1000E+3
25、1 88 DELETE X1 AT LEVEL 2 DELETE X3 AT LEVEL 1 RELEASE FIXED VARIABLES FIX ALL VARS.( 1) WITH RC 6181.81 SET X1 TO = 1 AT 1, BND= -.8280E+06 TWIN= -.1000E+31 94 DELETE X1 AT LEVEL 1 ENUMERATION COMPLETE. BRANCHES= 20 PIVOTS= 94 LAST INTEGER SOLUTION IS THE BEST FOUND RE-INSTALLING BEST SOLUTION. :SO
26、LUTION OBJECTIVE FUNCTION VALUE 1) 767000.00 VARIABLE VALUE REDUCED COST X1 .000000 340000.000000 X2 1.000000 270000.000000 X3 1.000000 290000.000000 X4 .000000 12.000000 X5 9000.000000 13.000000 X6 9000.000000 10.000000 ROW SLACK OR SURPLUS DUAL PRICES 2) .000000 .000000 3) .000000 .000000 4) 1000.
27、000000 .000000 5) .000000 .000000 NO. ITERATIONS= 95 BRANCHES= 20 DETERM.= 1.000E 0 在EXCEL 2000 執行線性規劃 在B&B電子公司的問題中,1. X1=行動電話每星期的產量 , X2=呼叫器每星期的產量2. 目標是求利潤的最大化,目標函數 f = 15 X1 + 20 X2 3. 資源的限制條件 4 X1 + 2 X2 = 36 X1 + 2 X2 = 24 X2 = 11 X1 + X2 = 0一、進入EXCEL2000,在工作底稿中輸入如下資料:ABC1變數2行動電話每星期的產量(X1)03呼叫器每星期的產量(X2)045目標函數6利潤最大化=15*B2+20*B378受限於9資源的使用數量資源的上限10裝配時間=4*B2+2*B33611監試時間=B2+2*B32412呼叫器需求=B31113總需求=B2+B320二、由主功能表中工具的下拉選單內點選規劃求解;但若工具的下拉選單內沒有規劃求解,表示EXCEL系統尚未將規劃求解功能設定,則由工具下拉選單內點選增益集,進入增益集的對話方塊內將規劃求解項目打勾,按確定,則系統會將規劃求解功能設定進入系統內。
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1