QQ登录

只需要一步,快速开始

 注册地址  找回密码
查看: 3780|回复: 1
打印 上一主题 下一主题

运筹学第三版(刁在钧)光盘中的内容

[复制链接]
字体大小: 正常 放大
mnpfc 实名认证      会长俱乐部认证 

131

主题

38

听众

1万

积分

升级  0%

  • TA的每日心情
    开心
    2018-12-4 08:49
  • 签到天数: 282 天

    [LV.8]以坛为家I

    邮箱绑定达人 新人进步奖 最具活力勋章 风雨历程奖 元老勋章

    群组2010MCM

    群组数学建模

    群组中国矿业大学数学建模协会

    群组华中师大数模协会

    群组Mathematica研究小组

    跳转到指定楼层
    1#
    发表于 2009-12-31 14:14 |只看该作者 |倒序浏览
    |招呼Ta 关注Ta |邮箱已经成功绑定
    第二章 线性规划

    本章, 我们介绍三种解决线性规划问题的软件:

    第一种: MATLAB软件中的optimization toolbox中的若干程序;

    第二种: LINDO软件;

    第三种: LINGO软件.

    1. MATLAB程序说明程序名: lprogram执行实例:

    file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image002.gif

    在命令窗口的程序执行过程和结果如下:

    the program is with the linear programming

    Please input the constraints number of the linear programming m=7

    m =7

    Please input the variant number of the linear programming n=4

    n =4

    Please input cost array of the objective function c(n)_T=[-2,-1,3,-5]'

    c =
    , h; `6 ~4 R! x) h3 U-2


    ; {% D1 X" S4 r8 |-1


    / K7 X& H4 w7 o. p" D3

    - M$ {$ ~1 `8 y( h
    -5

    Please input the coefficient matrix of the constraints A(m,n)=[1,2,4,-1;2,3,-1,1;

    1,0,1,1;-1,0,0,0;0,-1,0,0;0,0,-1,0;0,0,0,-1]

    A =! U3 \0 M. ?$ I  t! Y( V
    1- ]$ X" @/ ?6 N$ r, j) W
    2
    - J* V+ w. ]  b" K4# X2 L- U  Y9 K4 }$ T7 v6 i' c
    -1

    1 [7 v. D9 e. k
    24 n7 l; ~9 W8 R
    3
    & x# N2 |1 D, `+ m-1, f) o% t/ G: t# W$ N  m1 i
    1

    ( Z; C) I# V3 I4 t4 \) h9 Y4 T
    1! c# Q1 G& ]- A/ \
    0
    . z3 a# |* m+ J8 C/ q9 q/ |1' \( A$ q0 I2 K' n# E
    1


    5 Y. q; d1 r4 |, [& J4 Y6 d-1
    : Y/ O$ o$ U5 ~1 N7 U08 C- c" \! h8 J
    08 M0 J6 k8 P# B8 ^' X
    0


      ?  l* L; r( R3 a0
    ! e! c( P, U+ S( M-1
    7 \: F, {- G4 Y+ O0: r! e8 o2 G8 X# q8 J8 Q
    0


    & g8 l$ J0 Z* e% _9 V7 I8 u* p0& K3 N- X, D" z; ]; O2 F
    04 A* Q3 y. h; P% q$ I
    -1
    , _. C/ J  q+ q+ o1 N0 e& O0


    ! _% q( f; u. Q% L0& [( h% s( J: ]% [
    02 d3 ?+ V! }7 y. Q) D" T$ ?
    0
    & X) f# H6 {9 k1 n9 i-1

    Please input the resource array of the program b(m)_T=[6,12,4,0,0,0,0]'

    b =
    % Q6 p; L) Q8 v* J& b1 g; ^: H6


    ' D/ o, A3 V$ z0 c4 F( x& V12


    ( L) \/ k" p2 d6 ^" r. q( g% B# O4


    . o# E" Z& l) Q+ z0


    0 N' O& Y6 l" n7 ], [( K0


    9 C) @( n' [) l9 Z: l. i0

    ! Q* O% @3 T9 U. E
    0

    Optimization terminated successfully.

    The optimization solution of the programming is:

    x =
    ( Y& Y8 ^" c9 s  Q0.0000


    * M) j9 ^' E& e/ z$ K% U, e2 J2.6667


    7 G+ X6 C2 [' b-0.0000

    8 ?- C1 Q4 C1 H) D  V9 S
    4.0000

    The optimization value of the programming is:

    opt_value = -22.6667

    : 红色字表示计算机的输出结果.

    程序的相关知识:

    Solve a linear programming problem

    file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image003.gif

    where f, x, b, beq, lb, and ub are vectors and A and Aeq are matrices.

    相关的语法:

    x = linprog(f,A,b,Aeq,beq)

    x = linprog(f,A,b,Aeq,beq,lb,ub)

    x = linprog(f,A,b,Aeq,beq,lb,ub,x0)

    x = linprog(f,A,b,Aeq,beq,lb,ub,x0,options)

    [x,fval] = linprog(...)

    [x,fval,exitflag] = linprog(...)

    [x,fval,exitflag,output] = linprog(...)

    [x,fval,exitflag,output,lambda] = linprog(...)

    解释:

    linprog solves linear programming problems.

    x = linprog(f,A,b) solves min f'*x such that A*x <= b.

    x = linprog(f,A,b,Aeq,beq) solves the problem above while additionally satisfying the equality constraints Aeq*x = beq. Set A=[] and b=[] if no inequalities exist.

    x = linprog(f,A,b,Aeq,beq,lb,ub) defines a set of lower and upper bounds on the design variables, x, so that the solution is always in the range lb <= x <= ub. Set Aeq=[] and beq=[] if no equalities exist.

    x = linprog(f,A,b,Aeq,beq,lb,ub,x0) sets the starting point to x0. This option is only available with the medium-scale algorithm (the LargeScale option is set to 'off' using optimset). The default large-scale algorithm and the **x algorithm ignore any starting point.

    x = linprog(f,A,b,Aeq,beq,lb,ub,x0,options) minimizes with the optimization options specified in the structure options. Use optimset to set these options.

    [x,fval] = linprog(...) returns the value of the objective function fun at the solution x: fval = f'*x.

    [x,lambda,exitflag] = linprog(...) returns a value exitflag that describes the exit condition.

    [x,lambda,exitflag,output] = linprog(...) returns a structure output that contains information about the optimization.

    [x,fval,exitflag,output,lambda] = linprog(...) returns a structure lambda whose fields contain the Lagrange multipliers at the solution x.

    2LINDO 程序说明程序名:linear执行实例:

    file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image005.gif

    在命令窗口键入以下内容:

    max 10x+15y !也可以直接解决min问题

    subject to

    x<10

    y<12

    x+2y<16

    end
    ( Q1 a" X0 I  {0 e* z# ?!注释符号; 系统默认为自变量>0, 若不要求用free命令.

    $ m0 |* k, k3 F$ I/ M& f4 s
    !在出来report windows之前可选择显示对此规划进行灵敏度分析等

    solve, reports window中出现以下内容:

    LP OPTIMUM FOUND AT STEP
    ; _& B. O' i' d2 c2

    ' [7 Y: }0 Z% A5 u
    OBJECTIVE FUNCTION VALUE

    . A2 d7 k/ T  e/ r
    1)
    ! s/ j6 A) ?8 e145.0000


    : h! H+ V4 o# ]VARIABLE" q0 W, i! d4 C* S2 j) y
    VALUE: x( r& n  l. C
    REDUCED COST


    : ~# Q+ y/ {/ ]% ]X
    ! D1 R, G- {0 V5 I) f5 K2 L; \10.000000! X% H  o% Z! n9 |
    0.000000

    7 Y; Y+ t' \8 E$ B$ j1 d" \6 K
    Y
    # O/ S% l: K1 T" D  ]5 o3.000000
    + r. r- E, ?4 |0.000000


    $ |1 l; V( W$ u, `- Q( QROW& g; @" J$ n" W4 L5 q4 j
    SLACK OR SURPLUS
    ) e* x# S7 c- x+ n" EDUAL PRICES

    # A& E, h' u" G5 A8 T
    2)
    5 I: M# L& J$ o: U( I2 c1 D0.000000
    ! q6 D1 H) t% ~& j; a2 ~) i; N, }2.500000

    2 p; h, d+ {9 R: e9 b
    3)
    9 E/ Y. v7 n4 B9 F9.000000
    2 P: R. X7 B9 @0.000000


    : ]5 R+ w, h! z( j, g4 j" _4)
    * C! }8 T! H& A& q3 u+ k0.000000
      l1 f7 ~3 B7 j5 j% n7.500000


    4 @0 ?2 z- {8 l( O3 NNO. ITERATIONS=
    4 T/ q/ |) j! l% e1 ]- Z, g# a$ r2

    - l) F: ?6 v, c$ |) ?" C  {( ^% Y
    RANGES IN WHICH THE BASIS IS UNCHANGED:


    # p8 w3 K+ L% R0 X$ O9 WOBJ COEFFICIENT RANGES

    0 v/ t/ U) `- E1 @7 n4 K( c
    VARIABLE. H3 u- |/ p( ?9 o3 h5 ^6 K
    CURRENT0 r7 H8 a9 D/ F* {$ z$ J" I1 c8 c; r/ R
    ALLOWABLE
    5 z; @! e+ G/ w% q  j3 z" b; D0 hALLOWABLE


    $ K" p# W; L' V! s' W  WCOEF
    & M  T+ _, R" K5 q% U' ~( L0 JINCREASE
    % ]8 h" J' [! T7 ?$ V; ]4 lDECREASE

    9 z1 `4 a6 a5 h2 Q! h
    X- W: H+ e: E% B
    10.000000% N- \+ i3 B1 _  o) h0 {
    INFINITY: A1 H$ J* o5 W8 f7 x1 _5 |
    2.500000


    - U5 w3 m+ w3 f; [% y" YY& ?$ Y7 X- w6 _/ ]: W; @8 {3 s
    15.000000
    ) f' O1 ]( I# ~9 i7 n' i5.000000
    : t: c+ z* z+ ^- ^: R' ~5 H- K15.000000

    7 s. y+ k+ h/ H: e5 Z, L! |
    RIGHTHAND SIDE RANGES


    , ^1 F% W  N  \( }' oROW/ B: I% I  w, b5 h
    CURRENT
      z+ ]! G& `* vALLOWABLE3 D) D8 N# v3 J3 L! H
    ALLOWABLE

    5 v" O3 V) w! O. L/ u! a, n
    RHS
    ' a2 v+ r* R1 J% H  e$ b. QINCREASE
    5 t* B' e+ A( D. @; [# d" P% BDECREASE


    / w/ I; X& K( e$ k7 u) q
    % K4 R$ ^1 @7 M7 w! f2. @/ }# H2 n* y# q% {
    10.000000: Y8 F& q: }* b, m# M9 k" W" V) f
    6.000000
    : l6 t% j; {5 n' h  H4 j. O10.000000


    6 @- p6 n; i2 U" O# A5 ^% @% d8 E3
      K' O  r, V/ G$ B; m12.000000
    1 }, n" S8 J/ \+ O$ f; a& FINFINITY! R, o5 d7 c4 R0 _8 o& d
    9.000000


    ! i' W+ n" g1 S6 g4
    7 E) |& J( Q3 O1 e7 L16.000000
    4 t. q/ Z+ [8 Y/ R% [18.000000- Z4 B2 F  R& ~$ J  F, b6 V" H# Q
    6.000000

    3LINGO 程序说明3.1 程序名: linearp1(求极小问题)linearp1运行实例:

    file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image007.gif

    model window中输入以下语句:

    min=5*x1+21*x3;

    x1-x2+6*x3-x4=2;

    x1+x2+2*x3-x5=1;

    按运行按钮在solution
    7 F( N: p3 Z/ Q. r2 b4 Nreport
    窗口得到以下结果:


    ) r  F# Z! c2 M1 H+ t' k, p
    Global optimal solution found at iteration:' w$ U4 {# H: s& c
    2

    ! K3 q& B; ^4 @& E; g9 ^9 X
    Objective value:4 R) ]" h, o2 i$ k: _
    7.750000


    " J5 w* l; p& v' J1 \Variable- B5 f. e9 }' k9 S
    Value0 g. v) T" M- u$ i- X. E
    Reduced Cost

    ( P. z# r7 R2 }1 W
    X1
    " K& f: Q3 n1 w- k" L' o) f) X0.5000000
    1 @1 ^6 |; T4 ]' s0.000000

    + X. c7 o1 |8 }4 z: E+ r
    X3
    , X" D9 Y* o7 O- X! Y0.2500000
    * B3 m' f: P/ E$ ]0 R9 a, b  o0.000000


    ! U% C" q; d" a( ~$ [6 w: q1 T5 Q: `+ d  b! j; @* P0 P
    X2
    , ^6 A" ~$ f6 C2 {- N3 p( K0.0000006 H4 ~4 I4 f( q2 |% v
    0.5000000

    " }+ B5 g4 M4 M* k
    X4
    # c) y# _. w1 }1 \0.000000
    , P* {/ M1 z& W5 [6 ]2.750000

    * I* Y9 _' k$ N0 F5 F
    X5
    ( E# W: P! ^  P0.000000: k3 B& K4 ~8 A" m% Y1 L  H
    2.250000

    4 U& U: H' y( G0 y
    Row- b% h; t; m2 x& t" h% M6 e; D
    Slack or Surplus- S: D& V) _2 `" T
    Dual Price


    3 _" P6 Z# Z8 E' B$ k1/ m5 c& T+ T& K: x% Q3 ]0 \0 d0 T
    7.750000
    . U% q! p, h/ M% U9 G& P-1.000000


    8 Q8 Z% J2 [4 I# |/ W" l; E7 F6 o4 E2
    ; `7 P+ ~  F- }+ h. e! \: K0.000000
    " n4 d3 ]1 O9 s. @$ }, J) S-2.750000

    / l3 P% J* Y. d: s( H6 X
    38 w% E$ K3 O- o
    0.000000
    % m, T1 H# h2 A1 z8 [-2.250000

    3.2 程序名: linearp2(求极大问题)linearp2运行实例:

    file:///C:/DOCUME~1/ADMINI~1/LOCALS~1/Temp/msohtml1/01/clip_image009.gif

    model window中输入以下语句:

    max=100*x+150*y;( D3 S3 C. q  K/ ~7 P8 {
    ! this is a commnent;

    x<=100;

    y<=120;

    x+2*y<=160;

    按运行按钮在solution report 窗口得到以下结果:

      Global optimal solution found at iteration:- @& D8 p+ q4 v& H/ N
    2


    / X  c8 L; t1 v% A9 l+ Y) lObjective value:
    7 X7 x' M  v2 t# n5 K8 I) K& \3 ?. v1 Z, C& B
    14500.00


    * v* L9 x8 j6 yVariable
    3 @8 K: T' Y. B/ S0 z8 GValue
    3 x" W9 _) [' c5 GReduced Cost


    1 x; q1 E0 B9 E2 R0 I1 _X6 b8 b- a+ R1 j- j) g8 w3 U
    100.0000
    9 w* j: z/ v7 f4 }0.000000

    " C) C( \9 i3 b# C$ @+ m
    Y
    / o" U9 j& C; F# l# e0 L% k' A30.00000
      \9 E: _" o1 w+ Y3 B( b0 P9 l0.000000


    & C( h) R6 Z0 t6 J: e6 NRow
    ; c/ f6 l& G+ f  Z3 O3 mSlack or Surplus) u' L# b  T! e5 N) |, U
    Dual Price

    9 s4 P- `. W8 Y
    1& d4 T9 i+ j6 I9 f* j' y
    14500.00
    8 k8 O+ \0 ^/ E0 d; x1 w$ l6 J1.000000

    ) D* O' k2 u5 E. r
    2$ x9 Y! X* t' Z8 M) T
    0.000000. W; Y5 L% t0 x; P6 ~3 D8 s
    25.00000


    - p  q) R  R5 u" ^5 S30 Q0 r" ^  s6 y4 y: E% i( X/ g
    90.000002 Y8 l$ g# o: ^
    0.000000

    4
    4 m$ p# R# {/ D( {0.0000008 i* l; f+ H5 ]; t" c& j
    3 x0 C* H0 f6 p+ D4 Y2 R
    75.00000

    第二章 线性规划.doc

    62.5 KB, 下载次数: 14, 下载积分: 体力 -2 点

    zan
    转播转播0 分享淘帖0 分享分享0 收藏收藏1 支持支持0 反对反对0 微信微信
    loooog12 实名认证       

    1

    主题

    3

    听众

    412

    积分

    升级  37.33%

  • TA的每日心情

    2013-8-16 10:51
  • 签到天数: 1 天

    [LV.1]初来乍到

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 注册地址

    qq
    收缩
    • 电话咨询

    • 04714969085
    fastpost

    关于我们| 联系我们| 诚征英才| 对外合作| 产品服务| QQ

    手机版|Archiver| |繁體中文 手机客户端  

    蒙公网安备 15010502000194号

    Powered by Discuz! X2.5   © 2001-2013 数学建模网-数学中国 ( 蒙ICP备14002410号-3 蒙BBS备-0002号 )     论坛法律顾问:王兆丰

    GMT+8, 2026-8-3 01:41 , Processed in 0.447162 second(s), 60 queries .

    回顶部