运筹学实验资料报告材料

上传人:仙*** 文档编号:101826569 上传时间:2022-06-05 格式:DOC 页数:48 大小:66.50KB
返回 下载 相关 举报
运筹学实验资料报告材料_第1页
第1页 / 共48页
运筹学实验资料报告材料_第2页
第2页 / 共48页
运筹学实验资料报告材料_第3页
第3页 / 共48页
点击查看更多>>
资源描述
word运筹学实验报告专 业: 班 级: 姓 名: 学 号: 指导教师: 数学与应用数学专业2015-12-18实 验 目 录一、实验目的3二、实验要求3三、实验容31、 线性规划32、 整数规划63、 非线性规划134、 动态规划145、 排队论19四、需用仪器设备26五、MATLAB优化工具箱使用方法简介26六、LINGO优化软件简介26七、实验总结27一、实验目的1、 会利用适当的方法建立相关实际问题的数学模型;2、 会用数学规划思想及方法解决实际问题;3、 会用排队论思想及方法解决实际问题;4、 会用决策论思想及方法解决实际问题;5、 掌握MATLAB、LINGO等数学软件的应用;二、 实验要求1、 七人一组每人至少完成一项实验容;2、 每组上交一份实验报告;3、 每人进行12分钟实验演示;4、 实验成绩比例: 出 勤:40% 课堂提问:20% 实验报告:30% 实验演示:10%。三、 实验容1、 线性规划例运筹学74页14题 Min z=-2x1-x2s.t. 2x1+5x260 x1+x218 3x1+x244 X210 X1,x20用matlab运行后得到以下结果:the program is with the linear programmingPlease input the constraints number of the linear programming m=6m = 6Please input the variant number of the linear programming n=2n = 2Please input cost array of the objective function c(n)_T=-2,-1c = -2 -1Please input the coefficient matrix of the constraints A(m,n)=2,5;1,1;3,1;0,1;-1,0;0,-1A = 2 5 1 1 3 1 0 1 -1 0 0 -1Please input the resource array of the program b(m)_T=60,18,44,10,0,0b = 60 18 44 10 0 0Optimization terminated.The optimization solution of the programming is:x =The optimization value of the programming is:opt_value =LINDO程序在命令窗口键入以下容:max -2x-ysubject to2x+5y=60x+y=183x+y=44y=10end按solve键在reports window出现:Global optimal solution found. Total solver iterations: 0 Variable Value Reduced Cost Row Slack or Surplus Dual Price2、 整数规划课本第二章79页1题 Max z=100x1+180x2+70x3 s.t. 40x1+50x2+60x310000 3 x1+6x2+ 2x3600 x1130 X280x3200 x1 x2 x30程序运行及结果:biprogramtheprogramiswiththebinarylinearprogrammingPleaseinputtheconstraintsnumberoftheprogrammingm=5m=5Pleaseinputthevariantnumberoftheprogrammingn=5n=5Pleaseinputcostarrayoftheobjectivefunctionc(n)_T=100,180,70c=10018070PleaseinputthecoefficientmatrixoftheconstraintsA(m,n)=40,50,60;3,6,2;1,0,0;0,1,0;0,0,1A=405060362100010001Pleaseinputtheresourcearrayoftheprogramb(m)_T=10000;600;130;80;200b=1000060013080200Optimizationterminated.Theoptimizationsolutionoftheprogrammingis:x=000Theoptimizationvalueoftheprogrammingis:opt_value= 0程序名:intprogram b程序说明:%theprogrammiswiththeintegerlinearprogrammingusebranchandboundmethod!%这个程序是用分支定界法解决整数规划问题%pleaseinputtheparametersinthemainfunctioninthemandwinows%请在命令窗口输入这个主要定义函数的参数functionx,f=ILp(c,A,b,vlb,vub,x0,neqcstr,pre)%minf=c*x,s.t.A*x=b,vlb=x=vub%f的最小值等于c的转置乘以x,A乘以x小于等于b,x大于等于vlb小于等于vub%thevectorsofxisrequiredasintegersaswhole%x是整个的整数需要%x0istheinitialization,isalsook%x0是初始值,也可以是。%neqcstristhenumberofequationalconstraints,when0canbedelete%neqcstr是平均约束条件的数目,当0能删除时%preistheconciserate%pre是简明率%xistheintegeroptimizationandfistheoptimalvalue%x是整数规划,f是最优值%ifnargin8,pre=0;%narginisthefactuallyinputvariantsnumber(这个参数是实际输入的变量个数)ifnargin7,neqcstr=0;ifnargin6,x0=;ifnargin5,vub=;ifnarginpre);mtemp=length(temp2);ifisempty(temp2)x_f_b=xtemp;ftemp;vlb;vub;whilej=mmi=1;whilei=mtemp%ifx_f_b(nvars+1,j)pre);ifisempty(templ2)xall=xall,xtemp;fall=fall,ftemp;fvub=min(fvub,fall);elseifftemp=fvubx_f_b=x_f_b,xtemp;ftemp;vlbl;vubl;endendend%ifx_f_b(nvars+1,j)pre);ifisempty(tempr2)xall=xall,xtemp;fall=fall,ftemp;fvub=min(fvub,fall);elseifftempmmbreakend%theendbecausethebreak(因为中断而结束)temp0=round(xint(:,j);temp1=floor(xint(:,j);temp2=find(abs(xint(:,j)-temp0)pre);mtemp=length(temp2);end%theendofwhile(结束当前)else%correspondthesecondif(符合第一个如果)x=xtemp;f=ftemp;end%theendofsecondif(第二个如果的结束)%5ifisempty(fall)fmin=min(fall);nmin=find(fall=fmin);x=xall(:,nmin);f=fmin;endelse%correspondthefirstif(符合第一个如果)x=nan*ones(1,nvars);end LINDO程序例99页第6题第二问在命令窗口键入以下容:max -11x1-4x2st-x1+2x2=45x1+2x2=162x1-x2 In fminunc at 265Optimization terminated: relative infinity-norm of gradient less than options.TolFun.x = 1.0e-006 *fval =4、 动态规划程序名: dynamic; dynfun1_1, dynfun1_2, dynfun1_3;例180页第一题程序说明:dynamic程序:% the programm is with the dynamic programming use the recurisive method for the last to first% this is the main function of the methodfunctionp_opt,fval,u=dynprog(x,DecisFun,ObjFun,TransFun)% the function is to solve the dynamic example in the textbook% x is the situation variant and its column number represent the stage situation% subfunction DecisFun(k,x) is to solve the decision variant of k stage variant x % subfunction ObjFun(k,x,u) is to stage index function% subfunction TransFun(k,x,u) is the stage transformation function,u is the corresponding decision variant% p_opt has four output,the first is the number of the stage,the second is the optimal road of decision% the third is the optimal stategies of the decision ,the forth is the index function group.% fval is a column vector,is to represent the optimal value correspend to the initial stage is x % k=length(x(1,:);f_opt=nan*ones(size(x);d_opt=f_opt;t_vubm=inf*ones(size(x);x_isnan=isnan(x);t_vub=inf;% to caculate the teminate valuestmp1=find(x_isnan(:,k);tmp2=length(tmp1);for i=1:tmp2 u=feval(DecisFun,k,x(i,k); tmp3=length(u);for j=1:tmp3 tmp=feval(ObjFun,k,x(tmp1(i),k),u(j);if tmp=t_vub f_opt(i,k)=tmp; d_opt(i,k)=u(j); t_vub=tmp;endendend% recurisivefor ii=k-1:-1:1 tmp10=find(x_isnan(:,ii); tmp20=length(tmp10);for i=1:tmp20 u=feval(DecisFun,ii,x(i,ii); tmp30=length(u);for j=1:tmp30 tmp00=feval(ObjFun,ii,x(tmp10(i),ii),u(j); tmp40=feval(TransFun,ii,x(tmp10(i),ii),u(j); tmp50=x(:,ii+1)-tmp40; tmp60=find(tmp50=0);if isempty(tmp60),if nargin5 tmp00=tmp00+f_opt(tmp60(1),ii+1);if tmp00x=nan*ones(3,5);x(1,1)=1;x(1:3,2)=(2:4);x(1:2,3)=5,6;x(1:3,4)=(7:9);x(1,5)=10; p,f=dynamic(x,dynfun2_1,dynfun2_2,dynfun2_3)得到以下结果:p = 1 1 3 2 2 3 5 1 3 5 7 2 4 7 10 3 5 10 10 0f = 8该结果表明 最短路线为1 3 5 7 10最短路程为85排队论程序:queue 程序及结果如下:queuethe program is with queueing theoryPlease input the system pattern:M/M/1/inf=1,M/M/1/k=2,M/M/c/inf=3,M/M/c/m/m=4! Pattern=2Pt = 2(该数字表示选择M/M/1/k系统)Please input the average arrival number in unit time lapta=10lapta = 10Please input the average service number in unit time mu=30mu = 30Please input the parameter k=2k = 2输出结果如下:The service intensity(Untruth) of the system is:ru =The average queue length is:L =(平均队长)The average waiting length is:Lq =(平均等待队长)The lost possibility is:p_k =The average lost customer number in unit time is:lapta_L =The truth average arrival customer number in unit time is:lapta_e =The average delay time is:W =(平均逗留时间)The average waiting time is:Wq =(平均等待时间)The average service intensity(efficent and truth) of the system is:ru_e =若按照甲方案,则如下结果:the program is with queueing theoryPlease input the system pattern:M/M/1/inf=1,M/M/1/k=2,M/M/c/inf=3,M/M/c/m/m=4! Pattern=2Pt = 2Please input the average arrival number in unit time lapta=10lapta = 10Please input the average service number in unit time mu=30mu = 30Please input the parameter k=3k = 3输出结果如下:The service intensity(Untruth) of the system is:ru =The average queue length is:L =The average waiting length is:Lq =The lost possibility is:p_k =The average lost customer number in unit time is:lapta_L =The truth average arrival customer number in unit time is:lapta_e =The average delay time is:W =The average waiting time is:Wq =The average service intensity(efficent and truth) of the system is:ru_e =the program is with queueing theoryPlease input the system pattern:M/M/1/inf=1,M/M/1/k=2,M/M/c/inf=3,M/M/c/m/m=4! Pattern=2Pt = 2Please input the average arrival number in unit time lapta=10lapta = 10Please input the average service number in unit time mu=40mu = 40Please input the parameter k=2k = 2输出结果如下:The service intensity(Untruth) of the system is:ru =The average queue length is:L =The average waiting length is:Lq =The lost possibility is:p_k =The average lost customer number in unit time is:lapta_L =The truth average arrival customer number in unit time is:lapta_e =The average delay time is:W =The average waiting time is:Wq =The average service intensity(efficent and truth) of the system is:ru_e =the program is with queueing theoryPlease input the system pattern:M/M/1/inf=1,M/M/1/k=2,M/M/c/inf=3,M/M/c/m/m=4! Pattern=2Pt = 2Please input the average arrival number in unit time lapta=30lapta = 30Please input the average service number in unit time mu=30mu = 30Please input the parameter k=2k = 2输出结果如下:The service intensity(Untruth) of the system is:ru = 1The average queue length is:L = 1The average waiting length is:Lq =The lost possibility is:p_k =The average lost customer number in unit time is:lapta_L = 10The truth average arrival customer number in unit time is:lapta_e = 20The average delay time is:W =The average waiting time is:Wq =The average service intensity(efficent and truth) of the system is:ru_e =四、需用仪器设备 PC i5、 windows XP、MATLABR2007a、LINGO11五、 MATLAB优化工具箱使用方法简介MATLAB优化工具箱具有强大的科学计算能力,在工程设计领域 得到了广泛的应用.简要介绍了MATLAB优化工具箱,通过对MATtAB优化工具箱中fmincon函数的语法进行分析,提出了结构优化设计的通用求解 方法.首先,合理设置优化目标函数和约束条件.然后,使用MATLAB优化工具箱进行编程计算.结果显示,与其他方法相比,使用MATLAB优化工具箱进 行优化,不仅可以提高计算精度,而且可以减少计算时间.因此,在结构工程设计领域有较强的实际应用价值.六、 LINGO优化软件简介lingo是用来求解线性和非线性优化问题的简易工具。LINGO置了一种建立最优化模型的语言,可以简便地表达大规模问题,利用LINGO高效的求解器可快速求解并分析结果。Lingo 是使建立和求解线性、非线性和整数最佳化模型更快更简单更有效率的综合工具。Lingo 提供强大的语言和快速的求解引擎来阐述和求解最佳化模型。Lingo 实际上还是最优化问题的一种建模语言,包括许多常用的函数可供使用者建立优化模型时调用,并提供与其他数据文件(如文本文件、Excel电子表格文件、数据库文件等)的接口,易于方便地输入、求解和分析大规模最优化问题。七、 实验总结通过此次运筹学实验,我对于运筹学的学习方面有极大的收获,在这一周的实验过程中,不仅对运筹学的有关知识有了进一步的掌握,而且学会了通过建立模型解决实际生活中的相关问题.在对问题的分析、建模、求解过程中锻炼了我们的思考能力,同时提高了分析、解决问题的能力,也更加了解和熟悉了xcel规划求解的强大功能,提高了我们的计算机应用水平。 同时,我在此次试验中也存在一些不可避免的问题和不足。例如,在进行线性规划实验时,由于对空格键的作用和*的忽视,曾出现过多次错误提示,而没能运行出结果,最终经过对实验资料的详细阅读及多次的反复试验得到了实验结果;在列约束条件时粗心大意出现差错,导致最终结果的错误从而影响实际问题解决的效果,因此,我们在这方面应该加以注意和改正,在进行建模求解时细心耐心。在进行实验的过程中,使得我对matlab的操作更加熟练。学会了操作懂得了一些运筹学的运用,结合实际生活解决问题。所以,通过这次实验,不仅对运筹学的有关知识有了进一步的掌握,同事对在自己的计算机操作水准也有了很大的提高。这次实验让我懂得了运筹学在电脑的应用,让我对运输与数学相结合的应用理解更深了。在这一系列的操作过程中,不仅可以体会到数学问题求解的严谨和规,同时也有对运筹学解决问题的喜悦。 最后,课程的学习很快过去,但它对我们掌握运筹学建模问题的要求却并没有随课程的结束而结束。此次实验课的学习提高了我们的技能,为以后的学习和工作打下了坚实的基础。签字:评分:;应用理学院 数学与应用数学专业2015年 12 月 18 日48 / 48
展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 管理文书 > 施工组织


copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!