为了正常的体验网站,请在浏览器设置里面开启Javascript功能!
首页 > 单纯形

单纯形

2010-12-15 5页 doc 326KB 25阅读

用户头像

is_977036

暂无简介

举报
单纯形运筹学实验报告 实验一、线性规划求解 (1)​ 实验目的 1. 线性规划求解的单纯形法的编程实现 2.掌握使用matlab、Lingo、Excel的线性规划求解功能求解线性规划问题。 (二)实验内容 P45 1.6 (1)-(4),或 1.9,或1.10,或1.11 单纯形法编程如下: function [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) % A,b are the matric in A*x=b % c is the matrix in max z=c*x % A...
单纯形
运筹学 实验一、线性规划求解 (1)​ 实验目的 1. 线性规划求解的单纯形法的编程实现 2.掌握使用matlab、Lingo、Excel的线性规划求解功能求解线性规划问。 (二)实验内容 P45 1.6 (1)-(4),或 1.9,或1.10,或1.11 单纯形法编程如下: function [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) % A,b are the matric in A*x=b % c is the matrix in max z=c*x % A1 is the matric in simplex table % m is the numbers of row in A and n is the con number in A % n1 is the nubers of artificial variables,and artificial variables are default as the last % n1 variables in x. % cb is the worth coefficient matrix for basic variables % xx is the index matrix for basic variables % B1 is the invers matrix for the basic matrix in simplex table.The initial % matrix is default as the last m con in the matrix A. x=zeros(n,1); z=0; B1=A1(:,n-m+1:n); sgma1=c-(cb*B1)*A; [masg,kk]=max(sgma1); k=kk(1); flg=0; ll=0; while (masg>0)&&(ll<20) ll=ll+1; thita=1000+zeros(m,1); for i=1:m if A1(i,k)>0 thita(i)=A1(i,k)\b(i); end end [r8,c8]=find(thita>999); if sum(c8)> A=[1,2,1,0,0;4 0 0 1 0;0 4 0 0 1]; A1=A; b=[8;16;12]; c=[2 3 0 0 0]; m=3; n=5; cb=[0 0 0]; xx=[3,4,5]; >> n1=0; 调用以下: >> [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) 二. A=[1,4,2,-1,0,1,0;3 2 0 0 -1 0 1]; A1=A; b=[8;6]; c=[-2 -3 -1 0 0 -10000,-10000]; m=2; n=7; n1=2; cb=[-1000,-1000]; xx=[6,7]; [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) 三. A=[1 1 1 0 1 0;2 -5 1 -1 0 1]; A1=A; b=[7;10]; c=[2 3 -5 0 -10000 -10000]; m=2; n=6; n1=2; cb=[-1000 -1000]; xx=[5,6]; [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) 四. A=[5 3 1 1 0 0 ;-5 6 15 0 1 0;2 1 1 0 0 1]; A1=A; b=[9;15;5]; c=[10 15 12 0 0 0]; m=3; n=6; n1=0; cb=[0 0 0]; xx=[0]; [x,z,flg,sgma]=simplexfun(A,A1,b,c,m,n,n1,cb,xx) 实验小结:通过matlab程序的编写, 掌握了单纯形法的编程实现。
/
本文档为【单纯形】,请使用软件OFFICE或WPS软件打开。作品中的文字与图均可以修改和编辑, 图片更改请在作品中右键图片并更换,文字修改请直接点击文字进行修改,也可以新增和删除文档中的内容。
[版权声明] 本站所有资料为用户分享产生,若发现您的权利被侵害,请联系客服邮件isharekefu@iask.cn,我们尽快处理。 本作品所展示的图片、画像、字体、音乐的版权可能需版权方额外授权,请谨慎使用。 网站提供的党政主题相关内容(国旗、国徽、党徽..)目的在于配合国家政策宣传,仅限个人学习分享使用,禁止用于任何广告和商用目的。

历史搜索

    清空历史搜索