数模论坛

 找回密码
 注-册-帐-号
搜索
热搜: 活动 交友 discuz
查看: 5021|回复: 6

[求助]matlab中的linprog

[复制链接]
发表于 2005-8-18 05:05:31 | 显示全部楼层 |阅读模式
< ><FONT face="Times New Roman">c=[-750 -600 -430 -390</FONT></P>
< ><FONT face="Times New Roman">-1250 -600 -530 -490</FONT></P>
< ><FONT face="Times New Roman">-1000 -650 -480 -240</FONT></P>
<P ><FONT face="Times New Roman">-700 -550 -480 -340];</FONT></P>
<P ><FONT face="Times New Roman">A=[1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0;</FONT></P>
<P ><FONT face="Times New Roman">0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0;</FONT></P>
<P ><FONT face="Times New Roman">0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0;</FONT></P>
<P ><FONT face="Times New Roman">0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1 ]; </FONT></P>
<P ><FONT face="Times New Roman">b=[10,16,11,18];</FONT></P>
<P ><FONT face="Times New Roman"> <p></p></FONT></P>
<P ><FONT face="Times New Roman">Aeq=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0;</FONT></P>
<P ><FONT face="Times New Roman">0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0;</FONT></P>
<P ><FONT face="Times New Roman">0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0;</FONT></P>
<P ><FONT face="Times New Roman">0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1];</FONT></P>
<P ><FONT face="Times New Roman">beq=[9,17,10,5];</FONT></P>
<P ><FONT face="Times New Roman">vlb=[1,2,2,1,2,2,2,3,2,2,2,1,1,2,1,0];</FONT></P>
<P ><FONT face="Times New Roman">vub=[3,inf,inf,inf,5,inf,inf,inf,2,inf,inf,inf,2,8,inf,0];</FONT></P>
<P ><FONT face="Times New Roman">[x,lam]=linprog(c,A,b, Aeq, beq,vlb,vub)</FONT></P>
<P ><FONT face="Times New Roman">说明:本程序能运行,但是部分结果不对,找不出那里有问题,所以求助各位高手</FONT></P>
<P >结果如下:</P>
<P >Optimization terminated.</P>
<P >x =</P>
<P >    1.0000<BR>    6.0000<BR>    2.0000<BR>    1.0000<BR>    5.0000<BR>    3.0000<BR>    5.0000<BR>    3.0000<BR>    2.0000<BR>    6.0000<BR>    2.0000<BR>    1.0000<BR>    1.0000<BR>    2.0000<BR>    1.0000<BR>         0</P>
<P ><BR>lam =</P>
<P > -2.7740e+004</P>
<P >X指人员安排,安排方案正确</P>
<P >LAM应该等于-2.7150e+004</P>
 楼主| 发表于 2005-8-18 17:22:25 | 显示全部楼层
<>怎么没人回复啊,不是说弱者是能够博得同情的吗</P>
发表于 2005-8-19 06:25:57 | 显示全部楼层
<>也不来点注解啊?</P>
 楼主| 发表于 2005-8-19 08:04:33 | 显示全部楼层
<>我不是不想来点注解啊,但题目很长啊,如果说对符号的注解就不必了吧,</P>
<>知道用linprog 的估计都明白了</P>
 楼主| 发表于 2005-8-19 08:11:34 | 显示全部楼层
<>我把题目放上去吧,估计很多人看过了<B>人员安排问题</B></P>
<><B></B>E公司”是一家从事电力工程技术的中美合资公司,现有41个专业技术人员,其结构和相应的工资水平分布如表1所示。表1 公司的人员结构及工资情况</P>
<P>
<TABLE medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1>

<TR>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left><FONT face="Times New Roman"> <p></p></FONT></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>高级工程师<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>工程师<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>助理工程师<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>技术员<p></p></P></TD></TR>
<TR>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>人  数<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>日工资(元)<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>9<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>250<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>17<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>200<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>10<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>170<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>5<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>110<p></p></P></TD></TR></TABLE>目前,公司承接有4个工程项目,其中2项是现场施工监理,分别在A地和B地,主要工作在现场完成;另外2项是工程设计,分别在C地和D地,主要工作在办公室完成。由于4 个项目来源于不同客户,并且工作的难易程度不一,因此,各项目的合同对有关技术人员的收费标准不同,具体情况如表2所示。表2 不同项目和各种人员的收费标准<p></p></P>
<P>为了保证工程质量,各项目中必须保证专业人员结构符合客户的要求,具体情况如表3 所示:表3:各项目对专业技术人员结构的要求<p></p></P>
<P>
<TABLE medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1>

<TR>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left><FONT face="Times New Roman"> <p></p></FONT></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>A<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>B<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>C<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>D<p></p></P></TD></TR>
<TR>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>高级工程师<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>工程师<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>助理工程师<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>技术员<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>总计<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>1~3<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥1<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≤10<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.2pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>2~5<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥3<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≤16<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥1<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≤11<p></p></P></TD>
<TD windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: #ece9d8; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: #ece9d8; WIDTH: 85.25pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent; mso-border-left-alt: solid windowtext .5pt; mso-border-top-alt: solid windowtext .5pt" vAlign=top width=114>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>1~2<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>2~8<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≥1<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>--<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>≤18<p></p></P></TD></TR></TABLE></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>说明:<p></p></P>
<P 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l7 level1 lfo2; tab-stops: list 21.0pt" align=left>l        表中“1~3”表示“大于等于1,小于等于3”,其他有“~”符号的同理;<p></p></P>
<P 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l7 level1 lfo2; tab-stops: list 21.0pt" align=left>l        项目D,由于技术要求较高,人员配备必须是助理工程师以上,技术员不能参加;<p></p></P>
<P 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l7 level1 lfo2; tab-stops: list 21.0pt" align=left>l        高级工程师相对稀缺,而且是质量保证的关键,因此,各项目客户对高级工程师的配备有不能少于一定数目的限制。各项目对其他专业人员也有不同的限制或要求;<p></p></P>
<P 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l7 level1 lfo2; tab-stops: list 21.0pt" align=left>l        各项目客户对总人数都有限制;<p></p></P>
<P 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; mso-list: l7 level1 lfo2; tab-stops: list 21.0pt" align=left>l        由于C、D两项目是在办公室完成,所以每人每天有50元的管理费开支。<p></p></P>
<P 0cm 0cm 0pt; TEXT-ALIGN: left" align=left>由于收费是按人工计算的,而且4个项目总共同时最多需要的人数是10+16+11+18=55,多于公司现有人数41。因此需解决的问题是:如何合理的分配现有的技术力量,使公司每天的直接收益最大?并写出相应的论证报告。<p></p></P>
林与 该用户已被删除
发表于 2005-8-19 21:17:52 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
 楼主| 发表于 2005-8-22 00:09:22 | 显示全部楼层
<>我会了,谢谢各位了,以后有什么问题还请各位高手多多指教!!!!!</P>
您需要登录后才可以回帖 登录 | 注-册-帐-号

本版积分规则

小黑屋|手机版|Archiver|数学建模网 ( 湘ICP备11011602号 )

GMT+8, 2024-11-27 10:40 , Processed in 0.058485 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表