7 The package of LP.ppt_第1頁(yè)
7 The package of LP.ppt_第2頁(yè)
7 The package of LP.ppt_第3頁(yè)
7 The package of LP.ppt_第4頁(yè)
7 The package of LP.ppt_第5頁(yè)
已閱讀5頁(yè),還剩14頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、The Computer Package of LP,2 LINGO,1 LINDO,3 MATLAB - LINPROG,- To Solve LP, IP and QP,- To Solve LP and NLP,- To Solve LP, IP, QP, Multi-Goal Programming and NLP,Using LINDO to Solve LP,Input Given Data Solution Press Button Output,The Computer Package of LP-LINDO,!This is a LP for max max 3 x1+5 x

2、2+4 x3 subject to 2 x1+3 x21500 2 x2+4 x3800 3 x1+2 x2 +5 x32000 end,1 Input Given Data,max z=3x1+5x2+4x3 s. t. 2x1+3x2 1500 2x2+4x3 800 3x1+2x2+5x3 2000 x1, x2, x3 0.,The Computer Package of LP-LINDO,變量以字母開頭,下標(biāo)寫在后面,系數(shù)與變量之間加空格; 約束條件以 subject to (或ST) 開始; 要輸入 = 約束,也可用 代替; 變量的非負(fù)約束條件可省略; 不能接受括號(hào) “()”,逗號(hào)

3、 “ ,” 和運(yùn)算符“ * ”; 不區(qū)分變量的大小寫; 結(jié)束時(shí)以end 標(biāo)示。,Remarks:,The Computer Package of LP-LINDO,2 Output,LP OPTIMUM FOUND AT STEP 3 OBJECTIVE FUNCTION VALUE 1) 2675.000 VARIABLE VALUE REDUCED COST X1 375.000000 0.000000 X2 250.000000 0.000000 X3 75.000000 0.000000 ROW SLACK OR SURPLUS DUAL PRICES 2) 0.000000 1.05

4、0000 3) 0.000000 0.625000 4) 0.000000 0.300000,The Computer Package of LP-LINDO,Input Given Data LINDO Model LINGO Model Solution Press Button Output,Using LINGO to Solve LP,The Computer Package of LP-LINGO,1 LINDO Model Input Given Data,max z=3x1+5x2+4x3 s. t. 2x1+3x2 1500 2x2+4x3 800 3x1+2x2+5x3 2

5、000 x1, x2, x3 0.,model: max=3*x1+5*x2+4*x3; 2*x1+3*x2=1500; 2*x2+4*x3=800; 3*x1+2*x2+5*x3=2000; end,The Computer Package of LP-LINGO,Remarks (與LINDO區(qū)別):,目標(biāo)函數(shù)中加等號(hào); 變量與系數(shù)之間用“*”; model: end可省略; 每個(gè)語(yǔ)句后面必須以分號(hào)結(jié)束.,The Computer Package of LP-LINGO,model: sets: endsets data: enddata Transferring Function and

6、 Computation end,! Define Set,!Define Data,The Computer Package of LP-LINGO,2 LINGO Model Input Given Data,model: !Beginning sets: !Definition of Set ve/1.3/:c,x; co/1.3/:b; ma(co,ve):a; endsets !注:集表達(dá)式:名稱/成員/:屬性 名稱(初始集):屬性,Set,The Computer Package of LP-LINGO,Data:,data:!Definition of Data c=3 5 4;

7、 b=1500 800 2000; a=2 3 0 0 2 4 3 2 5; enddata !注:數(shù)據(jù)的大小與集合定義中一致,分量中間用空格或逗號(hào)分開,數(shù)據(jù)結(jié)束后用分號(hào);,The Computer Package of LP-LINGO,Transferring Function,max=sum(ve(j):c(j)*x(j); for(co(i):sum(ve(j):a(i,j)*x(j)=b(i); Main Function: for(set(set_index_list)|condition:expression) sum(set(set_index_list)|condition:

8、expression) min(max)(set(set_index_list)|condition:expression),The Computer Package of LP-LINGO,3 Output,Global optimal solution found at iteration: 3 Objective value: 2675.000 Variable Value Reduced Cost C( 1) 3.000000 0.000000 C( 2) 5.000000 0.000000 C( 3) 4.000000 0.000000 X( 1) 375.0000 0.000000

9、 X( 2) 250.0000 0.000000 X( 3) 75.00000 0.000000,The Computer Package of LP-LINGO,B( 1) 1500.000 0.000000 B( 2) 800.0000 0.000000 B( 3) 2000.000 0.000000 A( 1, 1) 2.000000 0.000000 A( 1, 2) 3.000000 0.000000 A( 1, 3) 0.000000 0.000000 A( 2, 1) 0.000000 0.000000 A( 2, 2) 2.000000 0.000000 A( 2, 3) 4.

10、000000 0.000000 A( 3, 1) 3.000000 0.000000 A( 3, 2) 2.000000 0.000000 A( 3, 3) 5.000000 0.000000,The Computer Package of LP-LINGO,Row Slack or Surplus Dual Price 1 2675.000 1.000000 2 0.000000 1.050000 3 0.000000 0.6250000 4 0.000000 0.3000000,The Computer Package of LP-LINGO,The Computer Package of

11、 LP-MATLAB,If we want to get the value of the objective function at X: FVAL = CTX, then use X, fval=linprog( ).,Example 1,C=-5; -4; -6 A= 1 -1 1;3 2 4;3 2 0 b=20; 42; 30 lb=zeros(3,1),First, enter the coefficients,The Computer Package of LP-MATLAB,Next, call a linear programming routine. x, fval = linprog(C, A, b, , , lb); x = 0.0000 15.0000 3.0000 fval = -78.0000,The Computer Package of LP-MATLAB,Example 2,First, enter the coefficients,C=-2; -3; 5 A= -2 5 -

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論