資源描述:
《數學建模lingo優(yōu)化建模必要軟件.doc》由會員上傳分享,免費在線閱讀,更多相關內容在工程資料-天天文庫。
1、LINDO、LINGO入門教程要學好用這兩個軟件最好的辦法就是學習他們自帶的HELP文件。下面擬舉數例以說明這兩個軟件的最基本用法(例子均選自張瑩《運籌學基礎》)。例1.(選自《運籌學基礎》P54.汽油混合問題,線性規(guī)劃問題)一種汽油的特性可用兩個指標描述:其點火性用“辛烷數”描述,其揮發(fā)性用“蒸汽壓力”描述。某煉油廠有四種標準汽油,設其標號分別為1,2,3,4,其特性及庫存量列于下表1中,將上述標準汽油適量混合,可得兩種飛機汽油,某標號為1,2,這兩種飛機汽油的性能指標及產量需求列于表2中。問應如何根據庫存情況適量混合各種
2、標準汽油,使既滿足飛機汽油的性能指標,而產量又為最高。表1標準汽油辛烷數蒸汽壓力(g/cm^2)庫存量1107.57.11*10^(-2)380000293.011.38*10^(-2)262200387.05.69*10^(-2)4081004108.028.45*10^(-2)130100(1g/cm^2=98Pa)表2飛機汽油辛烷數蒸汽壓力(g/cm^2)產量需求(L)1>=91<=9.96*10^(-2)越多越好2>=100<=9.96*10^(-2)>=250000建模過程 略(詳見《運籌學基礎》P54—55)目標
3、函數:maxz=x1+x2+x3+x4 約束條件:x5+x6+x7+x8>=250000x1+x5<=380000x2+x6<=265200x3+x7<=408100x4+x8<=1301002.85x1-1.42x2+4.27x3-18.49x4>=02.85x5-1.42x6+4.27x7-18.49x8>=016.5x1+2.0x2-4.0x3+17x4>=07.5x5-7.0x6-13.0x7+8.0x8>=0xj>=0(j=1,2...,8)下面我們就用LINDO來解這一優(yōu)化問題。輸入語句:max(不區(qū)分大小寫)
4、x1+x2+x3+x4ST(大寫或寫subjectto)x5+x6+x7+x8>=250000x1+x5<=380000x2+x6<=265200x3+x7<=408100x4+x8<=1301002.85x1-1.42x2+4.27x3-18.49x4>=02.85x5-1.42x6+4.27x7-18.49x8>=016.5x1+2.0x2-4.0x3+17x4>=07.5x5-7.0x6-13.0x7+8.0x8>=0end然后再按運算符鍵即可得結果。LINDO是規(guī)定Xj非負的,我們可發(fā)現輸入方式與我們的數學書寫的形式
5、基本一致,運算后,計算機會問您是否需要靈敏度分析,我們選擇是,結果如下:LPOPTIMUMFOUNDATSTEP6OBJECTIVEFUNCTIONVALUE1)933400.0VARIABLEVALUEREDUCEDCOSTX1161351.7343750.000000X2265200.0000000.000000X3408100.0000000.000000X498748.2656250.000000X5218648.2656250.000000X60.0000000.000000X70.0000000.000000X8
6、31351.7343750.000000ROWSLACKORSURPLUSDUALPRICES2)0.000000-1.0000003)0.0000001.0000004)0.0000001.0000005)0.0000001.0000006)0.0000001.0000007)0.0000000.0000008)43454.0000000.0000009)3239024.2500000.00000010)1890675.8750000.000000NO.ITERATIONS=6RANGESINWHICHTHEBASISIS
7、UNCHANGED:OBJCOEFFICIENTRANGESVARIABLECURRENTALLOWABLEALLOWABLECOEFINCREASEDECREASEX11.0000000.0000001.154137X21.000000INFINITY0.000000X31.000000INFINITY0.000000X41.0000000.0000000.000000X50.0000001.1541370.000000X60.0000000.000000INFINITYX70.0000000.000000INFINITY
8、X80.0000000.0000000.000000RIGHTHANDSIDERANGESROWCURRENTALLOWABLEALLOWABLERHSINCREASEDECREASE2250000.000000186222.062500234752.9843753380000.00000