您好,欢迎访问三七文档
1.下表是近两个世纪美国人口的统计数据。试根据此数据建立一个人口增长模型,并利用所得模型预测2010年美国的人口(单位为百万)。年1850186018701880189019001910192019301940人口23.231.438.650.262.975.99591.972105.711123.203131.699年195019601970198019902000人口150.697179.329203.212226.505249.633281.422解:建立一次线性拟合程序:year=[1850:10:2000]num=[23.231.438.650.262.975.99591.972105.711123.203131.699150.697179.329203.212226.505249.633281.422]p1=polyfit(year,num,1)num2010=polyval(p1,2010)运行结果:year=Columns1through6185018601870188018901900Columns7through12191019201930194019501960Columns13through161970198019902000num=Columns1through723.200031.400038.600050.200062.900075.995091.9720Columns8through14105.7110123.2030131.6990150.6970179.3290203.2120226.5050Columns15through16249.6330281.4220p1=1.0e+003*0.0017-3.1231num2010=270.1000建立二次线性拟合程序:year=[1850:10:2000]num=[23.231.438.650.262.975.99591.972105.711123.203131.699150.697179.329203.212226.505249.633281.422]p1=polyfit(year,num,2)num2010=polyval(p1,2010)运行结果:year=Columns1through71850186018701880189019001910Columns8through141920193019401950196019701980Columns15through1619902000num=Columns1through923.200031.400038.600050.200062.900075.995091.9720105.7110123.2030Columns10through16131.6990150.6970179.3290203.2120226.5050249.6330281.4220p1=1.0e+004*0.0000-0.00262.3192num2010=306.3376由以上结果可知:二次线性拟合更加符合实际。2.有两个煤厂A1和A2每月进煤量分别为60吨和100吨,联合供应三个居民区B1、B2、B3。三个居民区每月对煤的需求量分别为50吨、70吨、40吨。试建立数学模型回答如何分配供煤量使运输量达到最小。煤厂与居民区之间的距离关系如下从A1到B1为10km;A1到B2为5km;A1到B3为6km;A2到B1为4km;A2到B2为8km;A2到B3为12km。解:设煤厂A1向居民区B1,B2,B3的运输量分别为X1,X2,X3;煤厂A2向居民区B1,B2,B3的运输量分别X4,X5,X6.可建立以下线性规划模型:minz=10X1+5X2+6X3+4X4+8X5+12X6程序:C=[10564812];A=[111000;000111];B=[60;100];Aeq=[100100;010010;001001];beq=[50;70;40];vlb=[0;0;0;0;0;0];vub=[50;70;40;50;70;40];[x,fval]=linprog(C,A,B,Aeq,beq,vlb,vub)运行结果:x=0.000020.000040.000050.000050.00000.0000fval=940.0000所以煤厂A1向居民区B1,B2,B3的运输量分别为0,20,40;煤厂A2向居民区B1,B2,B3的运输量分别50,50,0,有供煤量使运输量达到最小940.6,,2,1,01006546032140637052504X1..iXiXXXXXXXXXXXts3.在冷却过程中,物体的温度在任何时刻变化的速率大致正比于它的温度与周围介质温度之差,这一结论称为牛顿冷却定律,该定律同样用于加热过程。一个煮硬了的鸡蛋有98℃,将它放在18℃的水池里,5分钟后,鸡蛋的温度为38℃,假定没有感到水变热,问鸡蛋达到20℃,还需多长时间?解:拟合函数,然后有函数得到结果。X1=98,y1=0;x2=38,y2=300;x3=20,y3=?程序:x=[9838];y=[0,300];n=1;P=polyfit(x,y,n)P=-5490p=[-5490];x=linspace(100,0);v=polyval(p,x)plot(x,v)title('Figure20:-5x+490')运行结果:P=-5490v=Columns1through7-10.0000-4.94950.10105.151510.202015.252520.3030Columns8through1425.353530.404035.454540.505145.555650.606155.6566Columns15through2160.707165.757670.808175.858680.909185.959691.0101Columns22through2896.0606101.1111106.1616111.2121116.2626121.3131126.3636Columns29through35131.4141136.4646141.5152146.5657151.6162156.6667161.7172Columns36through42166.7677171.8182176.8687181.9192186.9697192.0202197.0707Columns43through49202.1212207.1717212.2222217.2727222.3232227.3737232.4242Columns50through56237.4747242.5253247.5758252.6263257.6768262.7273267.7778Columns57through63272.8283277.8788282.9293287.9798293.0303298.0808303.1313Columns64through70308.1818313.2323318.2828323.3333328.3838333.4343338.4848Columns71through77343.5354348.5859353.6364358.6869363.7374368.7879373.8384Columns78through84378.8889383.9394388.9899394.0404399.0909404.1414409.1919Columns85through91414.2424419.2929424.3434429.3939434.4444439.4949444.5455Columns92through98449.5960454.6465459.6970464.7475469.7980474.8485479.8990Columns99through100484.9495490.0000答案:当温度变为20℃时需要490s.4.欲造一个无盖长方体容器,已知底部造价为每平方3元,侧面造价为每平方1.5元。现想用36元造一个容积最大的容器,试建立数学模型求它的尺寸。解:本题为非线性规划问题,假设设计的尺寸为:长X1,宽为X2,高为X3,体积为V,费用为W。则体积V=X1*X2*X3;费用W=3*X1*X2+1.5*2*(X2*X3+X1*X3)数学模型:MaxV(X)=X1*X2*X3;s.t.:W=12;X1,X2,X30;程序:1.先建立M文件fun4.m定义目标函数:functionf=fun4(X);f=-X(1)*X(2)*X(3);2.再建立M文件mycon.m定义非线性约束:function[g,ceq]=mycon(x)g=[3*X(1)*X(2)+3*X(2)*X(3)+3*X(1)*X(3)-36];ceq=[];3.主程序youh3.m为:X0=[1;1;1];vlb=[];vub=[];[x,fval]=fmincon('fun4'X0,[],[],[],[],vlb,vub,'mycon');fmax=-fval运行结果:x=222fval=-8f=8所以当长、宽、高都为2m时满足要求。
本文标题:数学建模习题
链接地址:https://www.777doc.com/doc-6499016 .html