数学建模答题模板

合集下载

数学建模技能大赛-决赛选答题(附答案)

数学建模技能大赛-决赛选答题(附答案)

【C1】U2合唱团在17分钟内得赶到演唱会场,途中必需跨过一座桥,四个人从桥的同一端出发,你得帮助他们到达另一端,天色很暗,而他们只有一只手电筒。

一次同时最多可以有两人一起过桥,而过桥的时候必须持有手电筒,所以就得有人把手电筒带来带去,来回桥两端。

手电筒是不能用丢的方式来传递的。

四个人的步行速度各不同,若两人同行则以较慢者的速度为准。

Bono需花1分钟过桥,Edge需花2分钟过桥,Adam需花5分钟过桥,Larry需花10分钟过桥。

他们要如何在17分钟内过桥呢?【C2】共有三类药,分别重1g,2g,3g,放到若干个瓶子中,现在能确定每个瓶子中只有其中一种药,且每瓶中的药片足够多,能只称一次就知道各个瓶子中都是盛的哪类药吗?如果有4类药呢?5类呢?N类呢(N可数)?如果是共有m个瓶子盛着n类药呢(m,n为正整数,药的质量各不相同但各种药的质量已知)?你能只称一次就知道每瓶的药是什么吗?注:当然是有代价的,称过的药我们就不用了。

【A3】周雯的妈妈是豫林水泥厂的化验员。

一天,周雯来到化验室做作业。

做完后想出去玩。

"等等,妈妈还要考你一个题目,"她接着说,"你看这6只做化验用的玻璃杯,前面3只盛满了水,后面3只是空的。

你能只移动1只玻璃杯,就便盛满水的杯子和空杯子间隔起来吗?" 爱动脑筋的周雯,是学校里有名的"小机灵",她只想了一会儿就做到了。

请你想想看,"小机灵"是怎样做的?【C4】假设有一个池塘,里面有无穷多的水。

现有2个空水壶,容积分别为5升和6升。

问题是如何只用这2个水壶从池塘里取得3升的水。

【C5】据说有人给酒肆的老板娘出了一个难题:此人明明知道店里只有两个舀酒的勺子,分别能舀7两和11两酒,却硬要老板娘卖给他2两酒。

聪明的老板娘毫不含糊,用这两个勺子在酒缸里舀酒,并倒来倒去,居然量出了2两酒,聪明的你能做到吗?【B6】假设排列着100个乒乓球,由两个人轮流拿球装入口袋,能拿到第100个乒乓球的人为胜利者。

数学建模万能模板4问题分析

数学建模万能模板4问题分析

四、问题分析:房产开发计划问题涉及房地价、建材成本、销售计划、折旧计算等方面的问题。

综合考虑各方面的因素,为使利润最大化,必须合理安排每月的建房数目。

公司所需要考虑的各影响因素之间的关系如下图所示:观察上图分析可知:如果将大量建房放在前面的月份,会增加折旧费用;但如果将大量建房安排在后面的月份,便会因为建材价格的上涨而增加建造成本;同时,单月建房数不宜过多,否则会造成可变成本大幅增加,引起亏本(【附录1】);但单月建房数目也不宜太少,否则预定建造计划将无法完成。

这些因素是互相影响的,即既是矛盾的又是联系的。

这些因素之间存在着一个权衡值,决定了我们所求的最大利润。

据以上分析:我们分别建立了用于确定可变成本、固定成本、销售费用和折旧费用的模型,并在此基础上建立了以最大利润为目标的单目标规划函数。

三、问题分析和基本思路2.1 问题分析和建模思路考虑问题的题设和要求,我们要解决的是出版社的资源优化配置问题。

资源优化配置问题是一类典型的规划问题。

对于规划问题的求解步骤基本是:第一步,找目标函数;第二步,找约束条件;第三步,对规划函数进行求解。

对题目仔细地分析后,我们确定当前经济效益和潜在经济效益为出版社资源配置的目标函数。

当前经济效益可以比较容易地用分配到的书号数表示出来,难点是潜在经济效益的表达。

我们分析关系,建立了顾客满意度量化描述潜在经济效益的模型。

当前经济效益和潜在效益描述好了,我们的目标函数也就形成了。

约束条件的寻找相对比较容易,不过我们能从题目中得到的明显约束条件很少,可想而知本题有隐含的约束条件需要自己去挖掘。

如果约束条件能够起到有效的约束作用,唯一剩下的就是借助计算机对规划模型进行最优求解。

此外,为了目标函数和约束条件的顺利表述。

我们在正式模型建立之前,做了大量完整而系统的模型准备工作,用量化的语言理清了各部分之间的关系。

2.2 思路流程图下面的思路流程图是我们文章结构的一个缩影,它完整而形象的反映了我们文章的建模思路。

数学建模基础问题与答案!(有答案)

数学建模基础问题与答案!(有答案)
x2=[100,110,90,150,210,150,250,270,300,250];
y=[102,100,120,77,46,93,26,69,65,85]';
x=[ones(10,1),x1',x2'];
[b,bint,r,rint,stats]=regress(y,x);
b,bint,stats,
%%%%改进,建立二元多项式
x(:,1)=[];
rstool(x,y)
结果
这是一个多元回归问题。若设回归模型是线性的,即设 用regress(y,x,alpha)求回归系数。得
b =
66.5176
0.4139
-0.2698
bint =
-32.5060 165.5411
-0.2018 1.0296
-0.4611 -0.0785
Y=[708 793 958 1278 1467 1704 1904 1904 1987 2021 2213 2536 2960]';
n=length(x);
X=[ones(n,1) x];
[b,bint,r,rint,stats]=regress(Y,X);
b,bint,stats
%残差图
rcoplot(r,rint)
S =
R: [3x3 double]
df: 11
normr: 7.2162
模型为:
方法3程序(t3_3.m)
x=17:2:29;x=[x,x];
y=[20.48,25.13,26.15 30,26.1,20.3,19.35,24.35,28.11,26.3,31.4,26.92,25.7,21.3];
是否重点:重点

(完整版)数学建模模拟试题及答案

(完整版)数学建模模拟试题及答案

数学建模模拟试题及答案一、填空题(每题 5 分,共 20 分)1.一个连通图能够一笔画出的充分必要条件是.2. 设银行的年利率为 0.2,则五年后的一百万元相当于现在的万元.3. 在夏季博览会上,商人预测每天冰淇淋销量N 将和下列因素有关:(1) 参加展览会的人数n; (2)气温T 超过10o C;(3)冰淇淋的售价p .由此建立的冰淇淋销量的比例模型应为 .4. 如图一是一个邮路,邮递员从邮局 A 出发走遍所有 A长方形街路后再返回邮局 .若每个小长方形街路的边长横向均为 1km,纵向均为 2km,则他至少要走 km .二、分析判断题(每题 10 分,共 20 分)1. 有一大堆油腻的盘子和一盆热的洗涤剂水。

为尽量图一多洗干净盘子,有哪些因素应予以考虑?试至少列出四种。

2. 某种疾病每年新发生 1000 例,患者中有一半当年可治愈 .若 2000 年底时有1200 个病人,到 2005 年将会出现什么结果?有人说,无论多少年过去,患者人数只是趋向 2000 人,但不会达到 2000 人,试判断这个说法的正确性 .三、计算题(每题 20 分,共 40 分)1. 某工厂计划用两种原材料A, B 生产甲、乙两种产品,两种原材料的最高供应量依次为 22 和 20 个单位;每单位产品甲需用两种原材料依次为 1 、1 个单位,产值为 3 (百元);乙的需要量依次为 3、1 个单位,产值为 9 (百元);又根据市场预测,产品乙的市场需求量最多为 6 个单位,而甲、乙两种产品的需求比不超过 5: 2,试建立线性规划模型以求一个生产方案,使得总产值达到最大,并由此回答:(1) 最优生产方案是否具有可选择余地?若有请至少给出两个,否则说明理由 .(2) 原材料的利用情况 .2. 两个水厂A1 , A2将自来水供应三个小区B1 , B2 , B3 , 每天各水厂的供应量与各小区的需求量以及各水厂调运到各小区的供水单价见下表 .试安排供水方案,使总供水费最小?四、 综合应用题(本题 20 分)某水库建有 10 个泄洪闸,现在水库的水位已经超过安全线,上游河水还在不断地流入 水库.为了防洪,须调节泄洪速度 .经测算,若打开一个泄洪闸, 30 个小时水位降至安全线, 若打开两个泄洪闸, 10 个小时水位降落至安全线 .现在,抗洪指挥部要求在 3 个小时内将水 位降至安全线以下,问至少要同时打开几个闸门?试组建数学模型给予解决 .注:本题要求按照五步建模法给出全过程 .小区 单价/元水厂A1A供应量 / t170B34B11 07 1B26数学建模 06 春试题模拟试题参考解答一、填空题(每题 5 分,共 20 分)1. 奇数顶点个数是 0 或 2;2. 约 40.1876 ;3. N = Kn(T10) / p, (T > 10 0 C), K 是比例常数; 4. 42.二、分析判断题(每题 10 分,共 20 分)1. 解: 问题与盘子、水和温度等因素直接相关,故有相关因素:盘子的油腻程度,盘子的温度,盘子的尺寸大小;洗涤剂水的温度、浓度; 刷洗地点 的温度等.注:列出的因素不足四个,每缺一个扣 2.5 分。

数学建模答题攻略

数学建模答题攻略

一、数学建模的概念数学建模主要是指对现实世界中的诸问题抽象出事物系统的主要特征关系,建立起相应的能反映其本质属性的某种数学结构。

二、模型思想应用举例1、方程模型例1.某煤矿某一年产煤总量中,除每年以一定数量作为民用、出口等非工业用途外,其余留作工业用煤,按照该年度某一工业城市的工业用煤总量为标准计算,可供这样的三个工业城市用六年,四个这样的城市用五年(当然每年都要除去非工业用煤的那一个定量),问如果只供一个城市的工业用煤,可以用多少年?解:设该煤矿该年度产煤总量为x,每年非工业用煤量为y,该工业城市该年工业用煤量为z,并设只供这样一个城市工业用煤可用p年,由题意得方程组:由①与②得y=2z……④,从①、③、④三式中消去x、y、z,得p=10所以:如果只供一个城市的工业用煤,可以用10年。

▲分析题意,找出各个量之间的联系,转化为方程模型(联立方程),解出未知数,回答原命题。

2、不等式模型例2.建筑学规定,民用住宅的窗户面积必须小于地板面积,但按照采光标准,窗户面积与地板面积的比值应不小于10%,并且这个比值越大,住宅采光条件就越好。

问同时增加相等的窗户面积和地板面积,住宅的采光条件是变好还是变坏,请说明理由。

分析:这是一个环境优化问题,不妨设原住宅的窗户面积和地板面积分别为a、b(平方单位),同时增加的面积为m(平方单位),则问题可转化为在约束条件:a<b≤10a及m>0下,比较与的大小,易知:<,故采光条件应该是变好了。

▲将生活中的不等关系,分类考虑建立一个或多个数学不等式模型,使实际问题得到解决 .三、练习某林场去年底森林木材存量为a,从今年起以每年25%的增长率生长,同时每年冬天要砍伐一定量的木材,为了实现经过20年达到森林木材存量翻两番(是最初的四倍)的目标,求每年砍伐量x。

(取lg2=0.3)四、小结与作业1、请同学们归纳模型思想解题的基本思路;2、请同学们课后找一个环境应用问题,并建立数学模型;3、某渔场养的鱼,第一年鱼的重量增长率200%,以后每年的重量增长率都是前一年的一半,(I) 当饲养4年后,鱼的重量是原来的多少倍?(II) 如果由于某种原因每年损失预计重量的10%,那么经过多少年后,鱼的总重量开始减少?。

数学建模模拟试题与答案

数学建模模拟试题与答案

数学建模模拟试题及答案一、填空题(每题 5 分,共 20 分)1.若 y z, z x, 则 y 与x的函数关系是.2.在超级市场的收银台有两条队伍可选择,队 1 有m1个顾客,每人都买了n1件商品,队 2 有m2个顾客,每人都买了n2件商品,假设每个人付款需p 秒,而扫描每件商品需t 秒,则加入较快队 1 的条件是.3.马尔萨斯与罗捷斯蒂克两个人口增长模型的主要区别是假设了4.在研究猪的身长与体重关系时,我们通过与已知其相关性质的的弹性梁作的方法建立了模型 .二、分析判断题(每小题15 分,满分 30 分)1. 要为一所大学编制全校性选修课程表,有哪些因素应予以考虑?试至少列出 5 种.2.一起交通事故发生 3 个小时后,警方测得司机血液中酒精的含量是56 /100( mg / ml ), 又过两个小时,含量降为 40 / 100(mg / ml ), 试判断,当事故发生时,司机是否违反了酒精含量的规定(不超过80/100 (mg / ml ) .(提示:不妨设开始时刻为t0,C (t) 表示t时刻血液中酒精的浓度,则依平衡原理,在时间间隔 [ t,t t ] 内酒精浓度的改变量为C (t t ) C (t)kC(t)t其中 k0 为比例常数,负号则表示了浓度随时间的推移是递减的. )三、计算题(每题25 分,满分50 分)1.一个毛纺厂使用羊毛、兔毛和某种纤维生产甲、乙两种混纺毛料,生产一个单位产品甲需要的三种原料依次为3、2、8 个单位,产值为580 元;生产一个单位产品乙需要的三种原料依次为2、 3、5 个单位,产值为680 元,三种原料在计划期内的供给量依次为90、30 和 80 单位 . 试建立线性规划模型以求一个生产方案,使得总产值达到最大,并由此回答:(1)最优生产方案是否具有可选择余地?若有请至少给出两个,否则说明理由.( 2)原材料的利用情况.2.三个砖厂 A1 , A2 , A3向三个工地 B1 , B2 , B3供应红砖.各砖厂的供应量与各工地的需求量以及各砖厂调运红砖到各工地的单价见表. 试安排调运方案,使总费用最小?工地B1B2B3供应量 / 万块砖厂A11064170A2756200A3839150需求量 / 万块160180180数学建模模拟试题(一)参考答案一、填空题(每题 5 分,共 20 分)1.y kx, k 是比例常数;2.m1 ( p n1 t) m2 ( p n2t) ;3.增长率是常数还是人口的递减函数;4.类比 .二、分析判断题(每小题15 分,满分30 分)1.问题涉及到时间、地点和人员三大因素,故应该考虑到的因素至少有以下几个:(1)教师:是否连续上课,对时间的要求,对多媒体的要求和课程种类的限制等;( 2)学生:是否连续上课,专业课课时与公共基础课是否冲突,选修人数等;(3)教室:教室的数量,教室的容纳量,是否具备必要的多媒体等条件;(每个因素 3 分)2.设 C (t) 为t时刻血液中酒精的浓度,则浓度递减率的模型应为C /kC ,其通解是 C (t) C (0) e kt , 而 C (0)由题设可知 C(3)56,C(5) 40,就是所求量 .故有C (0)e 3 k56 和 C (0)e 5 k40,由此解得e2 k56 / 40k 0.17 C (0) 56e3 k94.可见在事故发生时,司机血液中酒精的浓度已经超出了规定.三、计算题(每题25 分,满分 50 分)1.设 x1 , x2表示甲、乙两种产品的产量,则有原材料限制条件:3x1 2 x290,2x13x230,8x15x280,目标函数满足max z 580x 1 680x 2 ,合在一起便是所求线性规划模型:max z 580x 1680x 2 , 3x 1 2x 2 90, 2x 1 3x 2 30, 8x 1 5x 2 80,x j 0, j1,2.( 1)使用图解法易得其最优生产方案只有一组(这是因为所有约束条件所在直线的斜率与目标函数直线的斜率均不相等),从而最优方案没有可选择余地 . 计算知:最优解为 X *( 45 , 40)T ,7 7 目标值为 max z 53300(万元) . 7( 2)利用图解法求解中只用到了后两个约束条件,故羊毛有剩余量,将解代入可检验而知羊毛有 592单位的剩余量 .72. 本问题是一个产销平衡的运输问题,可以利用表上作业法直接求解,首先确定初始方案:工地单价/ 百元B 1B 2B 3供应量 /万块170砖厂A 1 10160 630410 170 A 2 7 5150 6 200 A 38 3 9 150需求量 / 万块160180180其次对方案进行最优性检验:11= 10-4+6-7=5 > 0 , 12= 6-4+6-5=3 > 0,31= 8-7+5-3=3 > 0,33= 9-3+5-6=5 > 0,故上述方案已是最优方案,即总运费最低的调运方案为:1701603010B3,A3150B2A1B3,A2B1,A2B2,A2总费用为 4170 7 160530610 3 1502460 (百元).。

数学建模 建模答案.docx

数学建模 建模答案.docx

programi :(1) function [accum, varargout] = CircularHough_Grd(img, radrange, varargin) %Detect circular shapes in a grayscale image. Resolve their center %positions and radii.%% [accum, circen, cirrad, dbg_LMmask] = CircularHough_Grd(% img, radrange, grdthres, fltr4LM_R, multirad, fltr4accum)% Circular Hough transform based on the gradient field of an image.% NOTE: Operates on grayscale images, NOT B/W bitmaps.% NO loops in the implementation of Circular Hough transform,% which means faster operation but at the same time larger% memory consumption.%%%%%%%%% INPUT: (img, radrange, grdthres, fltr4LM_R, multirad, fltr4accum) % % img: A 2-D grayscale image (NO B/W bitmap)%% radrange: The possible minimum and maximum radii of the circles% to be searched, in the format of% [minimum radius , maximum_radius] (unit: pixels)% **NOTE**: A smaller range saves computational time and% memory.%% grdthres: (Optional, default is 10, must be non-negative)% The algorithm is based on the gradient field of the% input image. A thresholding on the gradient magnitude% is performed before the voting process of the Circular% Hough transform to remove the Uniform intensity'% (sort-of) image background from the voting process.% In other words, pixels with gradient magnitudes smaller% than 'grdthres' are NOT considered in the computation.% **NOTE**: The default parameter value is chosen for% images with a maximum intensity close to 255. For cases% with dramatically different maximum intensities, e.g.% 10-bit bitmaps in stead of the assumed 8-bit, the default% value can NOT be used. A value of 4% to 10% of the maximum% intensity may work for general cases.%% fltr4LM_R: (Optional, default is 8, minimum is 3)% The radius of the filter used in the search of local% maxima in the accumulation array. To detect circles whose% shapes are less perfect, the radius of the filter needs% to be set larger.%% multirad: (Optional, default is 0.5)% In case of concentric circles, multiple radii may be% detected corresponding to a single center position. This% argument sets the tolerance of picking up the likely% radii values. It ranges from 0.1 to 1, where 0.1% corresponds to the largest tolerance, meaning more radii % values will be detected, and 1 corresponds to the smallest % tolerance, in which case only the "principal" radius will% be picked up.%% fltr4accum: (Optional. A default filter will be used if not given)% Filter used to smooth the accumulation array. Depending % on the image and the parameter settings, the accumulation % array built has different noise level and noise pattern% (e.g. noise frequencies). The filter should be set to an% appropriately size such that ifs able to suppress the% dominant noise frequency.%%%%%%%%% OUTPUT: [accum, circen, cirrad, dbg_LMmask]%% accum: The result accumulation array from the Circular Hough% transform. The accumulation array has the same dimension % as the input image.%% circen: (Optional)% Center positions of the circles detected. Is a N-by-2% matrix with each row contains the (x, y) positions% of a circle. For concentric circles (with the same center% position), say k of them, the same center position will% appear k times in the matrix.%% cirrad: (Optional)% Estimated radii of the circles detected. Is a N-by-1% column vector with a one-to-one correspondance to the% output tircen*. A value 0 for the radius indicates a% failed detection of the circle's radius.%% dbg_LMmask: (Optional, for debugging purpose)% Mask from the search of local maxima in the accumulation % array.%%%%%%%%%% EXAMPLE #0:% rawimg = imread('TestImg_CHT_a2.bmp');% tic;% [accum, circen, cirrad] = CircularHough_Grd(rawimg, [15 60]);% toe;% figure(l); imagesc(accum); axis image;% title(,Accumulation Array from Circular Hough Transfbrm,);% figure(2); imagesc(rawimg); colormap(,gray,); axis image;% hold on;% plot(circen(:,l), circen(:,2), *r+');% for k = 1 : size(circen, 1),% DrawCircle(circen(k, 1), circen(k,2), cirrad(k), 32,,b」);% end% hold off;% title([*Raw Image with Circles Detected% '(center positions and radii marked)*]);% figure(3); surf(accum, 'EdgeColoF, hone'); axis ij;% title('3-D View of the Accumulation Array*);%% COMMENTS ON EXAMPLE #0:% Kind of an easy case to handle. To detect circles in the image whose% radii range from 15 to 60. Default values for arguments 'grdthres',% 'fltr4LM_R', 'multirad* and ,fltr4accum, are used.%%%%%%%%%% EXAMPLE #1:% rawimg = imread('TestImg_CHT_a3.bmp');% tic;% [accum, circen, cirrad] = CircularHough_Grd(rawimg, [15 60], 10, 20);% toe;% figure(l); imagesc(accum); axis image;% title(,Accumulation Array from Circular Hough Transfbrm,);% figure(2); imagesc(rawimg); colormap('gray'); axis image;% hold on;% plot(circen(:,l), circen(:,2), T+');% for k = 1 : size(circen, 1),% DrawCircle(circen(k, 1), circen(k,2), cirrad(k), 32, 'b-');% end% hold off;% title([*Raw Image with Circles Detected% '(center positions and radii marked)*]);% figure(3); surf(accum, 'EdgeColoF, hone'); axis ij;% title(*3-D View of the Accumulation Array*);%% COMMENTS ON EXAMPLE #1:% The shapes in the raw image are not very good circles. As a result,% the profile of the peaks in the accumulation array are kind of% 'stumpy', which can be seen clearly from the 3-D view of the% accumulation array, (As a comparison, please see the sharp peaks in % the accumulation array in example #0) To extract the peak positions % nicely, a value of 20 (default is 8) is used for argument 'fltr4LM_R', % which is the radius of the filter used in the search of peaks.%%%%%%%%%% EXAMPLE #2:% rawimg = imread(,TestImg_CHT_b3 .bmp1);% fltr4img = [1 1 1 1 1; 1 2 2 2 1; 1 2 4 2 1; 1 2 2 2 1; 1 1 1 1 1];% fltr4img = fltr4img / sum(fltr4img(:));% imgfltrd = filter2( fltr4img , rawimg );% tic;% [accum, circen, cirrad] = CircularHough_Grd(imgfltrd, [15 80], 8, 10); % toe;% figure(l); imagesc(accum); axis image;% title(,Accumulation Array from Circular Hough Transfbrm,);% figure(2); imagesc(rawimg); colormap('gray'); axis image;% hold on;% plot(circen(:,l), circen(:,2), T+');% for k = 1 : size(circen, 1),% DrawCircle(circen(k, 1), circen(k,2), cirrad(k), 32, 'b-');% end% hold off;% title([*Raw Image with Circles Detected% '(center positions and radii marked)*]);%% COMMENTS ON EXAMPLE #2:% The circles in the raw image have small scale irregularities along % the edges, which could lead to an accumulation array that is bad for % local maxima detection. A 5-by-5 filter is used to smooth out the % small scale irregularities. A blurred image is actually good for the % algorithm implemented here which is based on the image's gradient % field.%%%%%%%%%% EXAMPLE #3:% rawimg = imread('TestImg_CHT_c3.bmp');% fltr4img = [1 1 1 1 1; 1 2 2 2 1; 1 2 4 2 1; 1 2 2 2 1; 1 1 1 1 1];% fltr4img = fltr4img / sum(fltr4img(:));% imgfltrd = filter2( fltr4img , rawimg );% tic;% [accum, circen, cirrad]=...% CircularHough_Grd(imgfltrd, [15 105], 8, 10, 0.7);% toe;% figure(l); imagesc(accum); axis image;% figure(2); imagesc(rawimg); colormap(,gray,); axis image;% hold on;% plot(circen(:,l), circen(:,2), *r+');% for k = 1 : size(circen, 1),% DrawCircle(circen(k, 1), circen(k,2), cirrad(k), 32,,b」);% end% hold off;% title([*Raw Image with Circles Detected% '(center positions and radii marked)*]);%% COMMENTS ON EXAMPLE #3:% Similar to example #2, a filtering before circle detection works for% noisy image too. 'multirad* is set to 0.7 to eliminate the false% detections of the circles* radii.%%%%%%%%%% BUG REPORT:% This is a beta version. Please send your bug reports, comments and% suggestions to pengtao@ . Thanks.%%%%%%%%%%% INTERNAL PARAMETERS:% The INPUT arguments are just part of the parameters that are used by% the circle detection algorithm implemented here. Variables in the code% with a prefix ,prm_, in the name are the parameters that control the% judging criteria and the behavior of the algorithm. Default values for% these parameters can hardly work for all circumstances. Therefore, at% occasions, the values of these INTERNAL PARAMETERS (parameters that% are NOT exposed as input arguments) need to be fine-tuned to make% the circle detection work as expected.% The following example shows how changing an internal parameter could% influence the detection result.% 1. Change the value of the internal parameter 'prm LM LoBndRa* to 0.4% (default is 0.2)% 2. Run the following matlab code:% fltr4accum = [1 2 1; 2 6 2; 1 2 1];% fltr4accum = fltr4accum / sum(fltr4accum(:));% rawimg = imread(,Frame_0_0022jportion.jpg,);% tic;% [accum, circen] = CircularHough_Grd(rawimg,...% [4 14], 10, 4, 0.5, fltr4accum);% toe;% figure(l); imagesc(accum); axis image;% title(*Accumulation Array from Circular Hough Transform*);% figure(2); imagesc(rawimg); colormap(,gray,); axis image;% hold on; plot(circen(:,l), circen(:,2), "); hold off;% title('Raw Image with Circles Detected (center positions marked)*);% 3. See how different values of the parameter 'prm LM LoBndRa* could % influence the result.% Author: Tao Peng% Department of Mechanical Engineering% University of Maryland, College Park, Maryland 20742, USA% pengtao@% Version: Beta Revision: Mar. 07, 2007%%%%%%%% Arguments and parameters %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Validation of argumentsif ndims(img)〜=2 || 〜isnumeric(img),error(*CircularHough_Grd: "img" has to be 2 dimensionaf);endif 〜all(size(img) >= 32),erro^'CircularHough Grd: "img" has to be larger than 32-by-32');endif numel(radrange)〜=2 || -isnumeric(radrange),error([*CircularHough_Grd: "radrange" has to be \ ...'a two-element vector1]);endprm_r_range = sort(max( [0,0;radrange( 1 ),radrange(2)]));% Parameters (default values)prmgrdthres = 10;prmfltrLMR = 8;prmmultirad = 0.5;funccompucen = true;funccompuradii = true;% Validation of argumentsvapgrdthres = 1;if nargin > (1 + vap_grdthres),if isnumeric(varargin{vap grdthres}) && ...varargin(vap grdthres} (1) >= 0,prm_grdthres = varargin {vapgrdthres} (1);elseerror(['CircularHough_Grd: "grdthres" has to be'a non-negative number1]);endendvap_fltr4LM = 2; % filter for the search of local maximaif nargin > (1 + vap_fltr4LM),if isnumeric(varargin{vap_fltr4LM}) && varargin{vap_fltr4LM}(1) >= 3, prmfltrLMR = varargin{vap_fltr4LM} (1);elseerror([,CircularHough_Grd: n fltr4LM_R n has to belarger than or equal to 3']);endendvap_multirad = 3;if nargin > (1 + vap multirad),if isnumeric(varargin{vap_multirad}) && ...varargin{vap multirad}(1) >= 0.1 && ...varargin {vap multirad} (1) <= 1,prmmultirad = varargin {vap_mul tirad} (1);elseerror(['CircularHough_Grd: "multirad" has to be'within the range [0.1, 1]*]);endendvap_fltr4accum = 4; % filter for smoothing the accumulation arrayif nargin > (1 + vap_fltr4accum),if isnumeric(varargin{vap_fltr4accum}) && ...ndims(varargin{vap_fltr4accum}) == 2 && ...all(size(varargin {vap_fltr4accum}) >= 3),fltr4accum = varargin {vap_fltr4accum};elseerror(['CircularHough_Grd: n fltr4accum n has to be \ ...*a 2-D matrix with a minimum size of 3-by-3']);endelse% Default filter (5-by-5)fltr4accum = ones(5,5);fltr4accum(2:4,2:4) = 2;fltr4accum(3,3) = 6;end func_compu_cen = (nargout > 1 );func_compu_radii = (nargout > 2 );% Reserved parametersdbg on = false; % debug information dbgbfigno = 4;if nargout > 3, dbg on = true; end%%%%%%%% Buildingaccumulation array %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Convert the image to single if it is not of% class float (single or double) img_is_double = isa(img, double');if ~(img_is_double || isa(img, 'single')),imgf = single(img);end% Compute the gradient and the magnitude of gradientif img_is_double,[grdx, grdy] = gradient(img);else[grdx, grdy] = gradient(imgf);endgrdmag = sqrt(grdx.A2 + grdy.A2);% Get the linear indices, as well as the subscripts, of the pixels% whose gradient magnitudes are larger than the given threshold grdmasklin = find(grdmag > prm_grdthres);[grdmask_ldxl, grdmask_IdxJ] = ind2sub(size(grdmag), grdmasklin);% Compute the linear indices (as well as the subscripts) of% all the votings to the accumulation array.% The Matlab function 'accumarray* accepts only double variable, % so all indices are forced into double at this point.% A row in matrix ,lin2accum_aJ, contains the J indices (into the % accumulation array) of all the votings that are introduced by a % same pixel in the image. Similarly with matrix linZaccum aP. rr_41inaccum = double( prm_r_range );linaccum_dr = [ (-rr_41inaccum(2) + 0.5) : -rr_41inaccum(l),... (rr_41inaccum(l) + 0.5) : rr_41inaccum(2)];lin2accum_aJ = floor(...double(grdx(grdmasklin)./grdmag(grdmasklin)) * linaccum_dr + ...repmat( double(grdmask_IdxJ)+0.5 , [ 1 ,length(linaccum_dr)])...);lin2accum_al = floor(...double(grdy(grdmasklin)./grdmag(grdmasklin)) * linaccum dr + ...repmat( double(grdmask_IdxI)+0.5 , [1 ,length(linaccum_dr)])...);% Clip the votings that are out of the accumulation arraymask_valid_a J al =...lin2accum_aJ > 0 & lin2accum_aJ < (size(grdmag,2) + 1) & ...Iin2accum_al > 0 & lin2accum_al < (size(grdmag,l) + 1);mask_valid_aJaI_reverse =〜mask_valid_aJaI;lin2accum_aJ = lin2accum_aJ .* maskvalida J al + maskvalidaJ alreverse;lin2accum_al = lin2accum_al .* mask_valid_aJaI + mask_valid_aJaI_reverse;clear mask_valid_aJ alre verse;% Linear indices (of the votings) into the accumulation arraylin2accum = sub2ind( size(grdmag), lin2accum_al, lin2accum_aJ );lin2accum_size = size( lin2accum );lin2accum = reshape( lin2accum, [numel(lin2accum),l]);clear lin2accum_al lin2accum_aJ;% Weights of the votings, currently using the gradient maginitudes% but in fact any scheme can be used (application dependent)weight4accum =...repmat( double(grdmag(grdmasklin)) , [lin2accum_size(2), 1 ]) .* ...mask_valid_aJ al(:);clear mask_valid_aJaI;% Build the accumulation array using Matlab function 'accumarray'accum = accumarray( lin2accum , weight4accum );accum = [ accum ; zeros( numel(grdmag) - numel(accum), 1 )];accum = reshape( accum, size(grdmag));%%%%%%%% Locating local maxima in the accumulation array %%%%%%%%%%%%% Stop if no need to locate the center positions of circlesif ~func_compu_cen,return;endclear lin2accum weight4accum;% Parameters to locate the local maxima in the accumulation array% — Segmentation of 'accum' before locating LM prmuseaoi = true;prm_aoithres_s = 2;prm aoiminsize = floor(min([ min(size(accum)) * 0.25,... prm_r_range(2) * 1.5 ]));% — Filter for searching for local maxima prmfltrLMs = 1.35;prm fltrLM r = ceil( prm fltrLM R * 0.6 );prm fltrLM npix = max([ 6, ceil((prm_fltrLM_R/2)A 1.8)]);% — Lower bound of the intensity of local maximaprm LM LoBndRa = 0.2; % minimum ratio of LM to the max of'accum'% Smooth the accumulation arrayfltr4accum = fltr4accum / sum(fltr4accum(:));accum = filter2( fltr4accum, accum );% Select a number of Areas-Of^Interest from the accumulation array if prmuseaoi, % Threshold value for 'accum1prm_llm_thresl = prm_grdthres * prm_aoithres_s;% Thresholding over the accumulation array accummask = ( accum > prm llm thres 1 );% Segmentation over the mask[accumlabel, accum nRgn] = bwlabel( accummask, 8 );% Select AOIs from segmented regionsaccumAOI = ones(0,4);for k = 1 : accum nRgn,accumrgn lin = find( accumlabel = k);[accumrgn_ldxl, accumrgn_IdxJ]=...ind2sub( size(accumlabel), accumrgn lin);rgn top = min( accumrgn ldxl);rgn bottom = max( accumrgn_ldxl);rgn left = min( accumrgn ldxJ );rgn_right = max( accumrgn ldxJ );% The AOIs selected must satisfy a minimum sizeif ((rgn_right - rgn_left + 1) >= prm_aoiminsize && ...(rgn_bottom - rgn top + 1) >= prm aoiminsize ),accumAOI = [ accumAOI;...rgn top, rgn bottom, rgn left, rgn right ];endendelse% Whole accumulation array as the one AOIaccumAOI = [1, size(accum,l), 1, size(accum,2)];end% Thresholding of 'accum' by a lower boundprm LM LoBnd = max(accum(:)) * prm LM LoBndRa;% Build the filter for searching for local maxima fltr4LM = zeros(2 * prm_fltrLM_R + 1);[mesh4fLM_x, mesh4fLM_y] = meshgrid(-prm_fltrLM_R : prm fltrLM R);mesh4fLM_r = sqrt( mesh4fLM_x.A2 + mesh4fLM_y.A2 );fltr4LM_mask =...(mesh4fLM_r > prm_fltrLM_r & mesh4fLM_r <= prm fltrLM R );fltr4LM = fltr4LMfltr4LM_mask * (prm fltrLM s / sum(fltr4LM_mask(:)));if prm_fltrLM_R >= 4,fltr4LM_mask = ( mesh4fLM_r < (prm_fltrLM_r - 1));elsefltr4LM_mask = ( mesh4fLM_r < prm fltrLM r );endfltr4LM = fltr4LM + fltr4LM mask / sum(fltr4LM_mask(:));% **** Debug code (begin)if dbg_on,dbg_LMmask = zeros(size(accum));end% **** Debug code (end)% For each of the AOIs selected, locate the local maximacircen = zeros(0,2);fbrk = 1 : size(accumAOI, 1),aoi = accumAOI(k,:); % just for referencing convenience% Thresholding of 'accum* by a lower boundaccumaoi_LBMask =...(accum(aoi(l):aoi(2), aoi(3):aoi(4)) > prm LM LoBnd );% Apply the local maxima filtercandLM = conv2( accum(aoi( 1):aoi(2), aoi(3):aoi(4)),...fltr4LM, 'same*);candLM mask = ( candLM > 0 );% Clear the margins of 'candLM mask*candLM_mask([l :prm_fltrLM_R, (end-prm_fltrLM_R+l):end], :) = 0;candLM mask(:, [l:prm_fltrLM_R, (end-prm_fltrLM_R+l):end]) = 0;% **** Debug code (begin)if dbg_on,dbg_LMmask(aoi( 1 ):aoi(2), aoi(3):aoi(4))=...dbg_LMmask(aoi( 1 ):aoi(2), aoi(3):aoi(4)) + ...accumaoi LBMask + 2 * candLM mask;end% **** Debug code (end)% Group the local maxima candidates by adjacency, compute the% centroid position for each group and take that as the center% of one circle detected[candLM label, candLM nRgn] = bwlabel( candLM_mask, 8 );fbr ilabel = 1 : candLM nRgn,% Indices (to current AOI) of the pixels in the groupcandgrp masklin = find( candLM label == ilabel);[candgrp_ldxl, candgrp_IdxJ]=...ind2sub( size(candLM label), candgrp masklin );% Indices (to 'accum') of the pixels in the groupcandgrp_ldxl = candgrp_ldxl + ( aoi(l) - 1 );candgrp IdxJ = candgrp IdxJ + ( aoi(3) - 1 );candgrp_idx2acm =...sub2ind( size(accum) , candgrp ldxl, candgrp IdxJ );% Minimum number of qulified pixels in the groupif sum(accumaoi_LBMask(candgrp_masklin)) < prm_fltrLM_npix, continue;end% Compute the centroid positioncandgrp_acmsum = sum( accum(candgrp_idx2acm));cc_x = sum( candgrp IdxJ .* accum(candgrp_idx2acm) ) / ...candgrpacmsum;cc_y = sum( candgrp_ldxl .* accum(candgrp_idx2acm) ) / ...candgrpacmsum;circen = [circen; cc_x, cc_y];endend% **** Debug code (begin)if dbg_on,figure(dbg bfigno); imagesc(dbg LMmask); axis image;title(*Generated map of local maxima1);if size(accumAOI, 1) == 1,figure(dbg_bfigno+1);surf(candLM, 'EdgeColor1, hone'); axis ij;title(,Accumulation array after local maximum filtering*);endend% **** Debug code (end)%%%%%%%% Estimation of the Radii of Circles %%%%%%%%%%%%% Stop if no need to estimate the radii of circlesif ~func_compu_radii,varargout{l} = circen;return;end% Parameters for the estimation of the radii of circlesfltr4SgnCv=[2 1 1];fltr4SgnCv = fltr4SgnCv / sum(fltr4SgnCv);% Find circle's radius using its signature curve cirrad = zeros( size(circen,l), 1 );for k = 1 : size(circen,l),% Neighborhood region of the circle for building the sgn. curve circen_round = round( circen(k,:));SCvR IO = circen_round(2) - prm_r_range(2) - 1;ifSCvR_IO<l,SCvR_I0= 1;endSCvRIl = circen_round(2) + prm_r_range(2) + 1;if SCvR Il > size(grdx,l),SCvRIl = size(grdx,l);endSCvR JO = circen round(l) - prm_r_range(2) - 1;ifSCvR_JO<l,SCvRJO = 1;endSCvRJ 1 = circenround(l) + prm_r_range(2) + 1;if SCvR Jl > size(grdx,2),SCvRJl = size(grdx,2);end% Build the sgn. curveSgnCvMat_dx = repmat( (SCvR J0:SCvR J 1) - circen(k,l),...[SCvRJl - SCvRJO +1,1]);SgnCvMat_dy = repmat( (SCvR_IO:SCvR_Il)' - circen(k,2),...[1 , SCvRJl - SCvRJO + 1]);SgnCvMat_r = sqrt( SgnCvMat dx .A2 + SgnCvMat_dy .A2 );SgnCvMatrpl = round(SgnCvMatr) + 1;f4SgnCv = abs(...double(grdx(SCvR_IO:SCvR_Il, SCvRJO:SCvRJ 1)) .* SgnCvMat_dx + ...double(grdy(SCvR_IO:SCvR Il, SCvR JO:SCvR J 1)) .* SgnCvMat dy...)./ SgnCvMat r;SgnCv = accumarray( SgnCvMat rp 1(:) , f4SgnCv(:));SgnCv_Cnt = accumarray( SgnCvMat rp 1 (:) , ones(numel(f4SgnCv), 1));SgnCv_Cnt = SgnCv_Cnt + (SgnCv_Cnt == 0);SgnCv = SgnCv ./ SgnCv_Cnt;% Suppress the undesired entries in the sgn. curve% ― Radii that correspond to short arcsSgnCv = SgnCv .* ( SgnCv_Cnt >= (pi/4 * [O:(numel(SgnCv_Cnt)-1 )]*));% ― Radii that are out of the given rangeSgnCv( 1 : (round(prm_r_range( 1))+1) ) = 0;SgnCv( (round(prm_r_range(2))+1) : end ) = 0;% Get rid of the zero radius entry in the arraySgnCv = SgnCv(2:end);% Smooth the sgn. curveSgnCv = filtfilt( fltr4SgnCv , [1] , SgnCv );% Get the maximum value in the sgn. curveSgnCv_max = max(SgnCv);if SgnCv_max <= 0,cirrad(k) = 0;continue;end% Find the local maxima in sgn. curve by 1st order derivatives% ― Mark the ascending edges in the sgn. curve as Is and% ― descending edges as OsSgnCv AscEdg = ( SgnCv(2:end) - SgnCv(l:(end-l)) ) > 0;% ― Mark the transition (ascending to descending) regionsSgnCv LMmask = [ 0; 0; SgnCv_AscEdg(l:(end-2)) ] & (〜SgnCv_AscEdg);SgnCv LMmask = SgnCvLMmask & [ SgnCv_LMmask(2:end); 0 ];% Incorporate the minimum value requirementSgnCvLMmask = SgnCvLMmask & ...(SgnCv(l:(end-l)) >= (prm_multirad * SgnCv_max));% Get the positions of the peaksSgnCv LMPos = sort( find(SgnCv_LMmask));% Save the detected radiiif isempty(SgnCvLMPos),cirrad(k) = 0;elsecirrad(k) = SgnCvLMPos(end);for i radii = (length(SgnCv LMPos) - 1) : -1 : 1,circen = [ circen; circen(k,:)];cirrad = [ cirrad; SgnCv_LMPos(i_radii)];endendend% Outputvarargout{l} = circen;varargout{2} = cirrad;if nargout > 3,varargout{3} = dbg_LMmask;endprograms:programs:2 function DrawCircle (x, y, r, nseg, S)% Draw a circle on the current figure using ploylines%% DrawCircle (x, y, r, nseg, S)% A simple function for drawing a circle on graph.%% INPUT: (x, y, r, nseg, S)% x, y: Center of the circle% r: Radius of the circle% nseg: Number of segments for the circle% S: Colors, plot symbols and line types%% OUTPUT: None%% BUG REPORT:% Please send your bug reports, comments and suggestions to% pengtao@glue. umd. edu . Thanks.% Author: Tao Peng% Department of Mechanical Engineering% University of Maryland, College Park, Maryland 20742, USA % pengtao@glue. umd. edu% Version: alpha Revision: Jan. 10, 2006theta = 0 : (2 * pi / nseg) : (2 * pi);pline_x 二r * cos(theta) + x;pline_y 二r * sin(theta) + y;plot (pline_x, pline_y, S);3function testiml二imread (' image 1. jpg');% rawimg = imread(,TestImg_CHT_c3. bmp J);rawimg=rgb2gray(iml);tic;[accum, circen, cirrad] = CircularHough_Grd(rawimg, [20 30], 5,50);circentoe;figure(1) ; imagesc(accum); axis image;title (J Accumulation Array from Circular Hough Transform,); figure (2) ; imagesc (rawimg) ; colormap (J gray,) ; axis image; hold on;plot (circen(:, 1), circen(:, 2), ' r+');for k = 1 : size (circen, 1),DrawCircle (circen (k, 1), circen (k, 2), cirrad (k), 32, ' b-'); end hold off; title(f Raw Image with Circles Detected ...'(center positions and radii marked)']);figure (3); surf(accum, ' EdgeColor,, ' none5); axis ij; title (J 3-D View of the Accumulation Array');附带图像image 1. jpg直接运行test.m即可得到上方的结果!当然方法是活的,只要合理即可行。

数学建模复习题__西北农林科大学计算机系

数学建模复习题__西北农林科大学计算机系

10级计算机《数学模型》复习资料西北农林科大学计算机专业相信这些都是重点的东西,大家一定要认真复习,争取考好数模,祝大家考试顺利第一部分(简答题)1.叙述模型和数学模型的概念,并举例说明.(1)模型是指为了某个特定的目的将原型的某一部分信息简缩、提炼而构造的原型替代物。

(2)对某一实际问题应用数学语言和方法,通过抽象、简化、假设等对这一实际问题近似刻划所得的数学结构,称为此实际问题的一个数学模型.2.写出数学建模过程流程图;数学建模过程流程图为:3.建立数学模型的基本步骤有哪些?1.模型准备(背景、目的、现象、数据、特征)2.模型假设(合理性、简化性.但过份简单、过份详细都不对,或反映不了原问题或无法表达模型,要充分发挥想象力、洞察力、判断力,不断修改或补充假设)3.模型构成(建立数学结构)4.模型求解(包括推理、证明、数学地或数值地求解)5.模型分析(数学意义分析、合理性分析、误差分析、灵敏性分析)6.模型检验(接受实际检验、往往在假设上)7.模型应用(取决于建模的目的)4.写出5个数学模型按照应用领域分类的模型名称.按模型的应用领域分类 数学模型 ⎪⎪⎪⎪⎪⎩⎪⎪⎪⎪⎪⎨⎧再生资源利用模型水资源模型城镇规划模型生态模型环境模型(污染模型)交通模型人口模型5.写出5个按照建立数学模型的数学方法分类的模型名称.按建模的数学方法分类数学模型 ⎪⎪⎪⎪⎪⎩⎪⎪⎪⎪⎪⎨⎧规划论模型概率模型组合数学模型图论模型微分方程模型几何模型初等数学模型6.写出5个数学模型按照建模目的分类的模型名称.按建模目的来分类 数学模型 ⎪⎪⎪⎪⎩⎪⎪⎪⎪⎨⎧控制模型决策模型优化模型预报模型分析模型描述模型7. 长方形椅子摆放问题、人口问题(习题8)、习题9.{这些以小题形式出现}(1)椅子摆放问题认真看书,要知道模型的假设和模型。

(6-7页)(2)人口问题也要知道模型是怎么建的,两种模型,指数增长和阻滞增长(9-13页)(3)习题8和习题9的解答过程如下(考小题,这里大家要理解是如何做的)(23页)8. 假定人口的增长服从这样的规律:时刻t 的人口为)(t x ,单位时间人口的增量与)(t x x m -成正比(其中m x 为最大容量).试建立模型并求解.作出解的图形并与指数增长模型、阻滞增长模型的结果比较.解:现考察某地区的人口数,记时刻t 的人口数为()t x (一般()t x 是很大的整数),且设()t x 为连续可微函数.又设()00|x t x t ==.任给时刻t 及时间增量t ∆,因为单位时间人口增长量与)(t x x m -成正比, 假设其比例系数为常数r .则t 到t t ∆+人口的增量为:()()()t t x x r t x t t x m ∆-=-∆+)(.两边除以t ∆,并令0→∆t ,得到⎪⎩⎪⎨⎧=-=0)0()(x x x x r dt dx m 解为rt m m e x x x t x ---=)()(0如图实线所示,当t 充分大时 m x它与Logistic 模型相近.0xt9.为了培养想象力、洞察力和判断力,考察对象时除了从正面分析外,还常常需要从侧面或反面思考.试尽可能迅速回答下面问题:(1) 某甲早8:00从山下旅店出发,沿一条路径上山,下午5:00到达山顶并留宿.次日早8:00沿同一路径下山,下午5:00回到旅店.某乙说,甲必在两天中的同一时刻经过路径中的同一地点.为什么?(2) 37支球队进行冠军争夺赛,每轮比赛中出场的每两支球队中的胜者及轮空者进入下一轮,直至比赛结束.问共需进行多少场比赛,共需进行多少轮比赛.如果是n 支球队比赛呢?解:(1)方法一:以时间t 为横坐标,以沿上山路径从山下旅店到山顶的行程x 为纵坐标,第一天的行程)(t x 可用曲线(I )表示 ,第二天的行程)(t x 可用曲线(I I )表示,(I )(I I )是连续曲线必有交点),(000d t p ,两天都在0t 时刻经过0d 地点.方法二:设想有两个人, )一人上山,一人下山,同一天同时出发,沿同一路径,必定相遇. 0dt早8 0t 晚5方法三:我们以山下旅店为始点记路程,设从山下旅店到山顶的路程函数为)(t f (即t 时刻走的路程为)(t f ),同样设从山顶到山下旅店的路函数为)(t g ,并设山下旅店到山顶的距离为a (a >0).由题意知:,0)8(=f a f =)17(,a g =)8(,0)17(=g .令)()()(t g t f t h -=,则有0)8()8()8(<-=-=a g f h ,0)17()17()17(>=-=a g f h ,由于)(t f ,)(t g 都是时间t 的连续函数,因此)(t h 也是时间t 的连续函数,由连续函数的介值定理,]17,8[0∈∃t ,使0)(0=t h ,即)()(00t g t f =.(2)36场比赛,因为除冠军队外,每队都负一场;6轮比赛,因为2队赛1轮,4队赛2轮,32队赛5轮. n 队需赛1-n 场,若k k n 221≤-π,则需赛k 轮.8.传染病模型、战争模型、房室模型、军备竞赛模型.注:这几个模型大家要能够理解模型是如何建立的要写得出相应的模型,一定要记得住写得出。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

例:某公司有6个仓库,库存货物总数分别为60,55,51,43,41,52,现有8个客户各要一批货,数量分别为35,37,22,32,41,32,43,38.各仓库到8个客户处得单位货物运价见下表。

问题分析:本问题中,各仓库的供应总量为302个单位,需求量为280个单位,为一个供需不平衡问题。

目标函数为运输费用,约束条件有两个:分别是供应方和需求方的约束。

解: 引入决策变量ij x ,代表着从第i 个仓库到第j 个客户的货物运量,用符号ij c 表示从第i 个仓库到第j 个客户的单位货物运价,i a 表示第i 个仓库的最大供货量,j d 表示第j 个客户的订货量。

则本问题的数学模型为:
68
11
min ij ij i j z c x ===∑∑
s.t 8
1
61,1,2,6,1,2,,80,1,2,6,1,2,,8ij i j ij j i ij x a i x d j x i j ==⎧
≤=⋅⋅⋅⎪


≤=⋅⋅⋅⎨⎪
⎪≥=⋅⋅⋅=⋅⋅⋅⎪⎩∑∑
模型求解:用LINGO 语言编写程序(程序见题后附录),运行得到以下求解结果:
以下省略了其他变量的具体数值。

计算结果表明:目标函数值为664.00,最优运输方案见下表
【参考文献】
[1]李大潜,中国大学生数学建模竞赛(第三版)[M],北京:高等教育出版社,2009
[2]叶其孝,大学生数学建模竞赛辅导教材(五)[M],长沙:湖南教育出版社,2008
[3]袁新生,邵大宏,郁时炼.LINGO和EXCEL在数学建模中的应用[M],北京:科学出版社,2007
附录:LINGO程序
model:
sets:
wh/w1..w6/:ai;vd/v1..v8/:dj;
links(wh,vd):c,x;
endsets
data:
ai=60,55,51,43,41,52;
dj=35,37,22,32,41,32,43,38;
c=6,2,6,7,4,2,5,9
4,9,5,3,8,5,8,2
5,2,1,9,7,4,3,3
7,6,7,3,9,2,7,1
2,3,9,5,7,2,6,5
5,5,2,2,8,1,4,3;
enddata
min=@sum(links(i,j):c(i,j)*x(i,j));
@for(wh(i):@sum(vd(j):x(i,j))<=ai(i));
@for(vd(j):@sum(wh(i):x(i,j))=dj(j)); end。

相关文档
最新文档