1、数学建模实验三实验3实验报告2013326601054 夏海浜 13信科1班完成教材(2013高教版)实验;1、P190 题目1、2;1、x=0.1,0.8,1.3,1.9,2.5,3.1;y=1.2,1.6,2.7,2.0,1.3,0.5;y2=interp1(x,y,2.0,linear)y2=interp1(x,y,2.0,cubic)y2 = 1.8833y2 =1.8844x=0:4;y=0:4;2、z=4,0,-4,0,4 3,2,-2,2,3 2,1,0,1,2 3,2,-2,2,3 4,0,-4,0,4;subplot(1,2,1)mesh(x,y,z)x1=0:0.1:4;y
2、1=0:0.1:4;x2,y2=meshgrid(x1,y1);z1=interp2(x,y,z,x2,y2,cubic);subplot(1,2,2)mesh(x1,y1,z1);2、P 194 题目1、2;1、x=1.2,1.8,2.1,2.4,2.6,3.0,3.3;y=4.85,5.2,5.6,6.2,6.5,7.0,7.5;p4=polyfit(x,y,4)p5=polyfit(x,y,5)p6=polyfit(x,y,6)x1=1.2:0.05:3.3;y1=polyval(p4,x1);y2=polyval(p5,x1);y3=polyval(p6,x1);plot(x,y,*r
3、,x1,y1,-b,x1,y2,-b,x1,y3,-b)p4 = 0.4161 -4.1390 15.0681 -22.2101 16.0963p5 = 0.8825 -9.8538 42.4484 -87.5648 87.1388 -28.7370p6 = -2.0107 29.0005 -170.6763 523.2180 -878.3092 763.9307 -263.4667p4 = 0.4161 -4.1390 15.0681 -22.2101 16.0963p5 = 0.8825 -9.8538 42.4484 -87.5648 87.1388 -28.7370p6 = -2.01
4、07 29.0005 -170.6763 523.2180 -878.3092 763.9307 -263.46672、fun=inline(c(1)*exp(-c(2)*(t-c(3).2),c,t);t=0:1:24;T=15,14,14,14,14,15,16,18,20,22,23,25,28,31,32,31,29,27,25,24,22,20,18,17,16;c=lsqcurvefit(fun,0,0,0,t,T)norm(feval(fun,c,t)-T)2p2=polyfit(t,T,2);p3=polyfit(t,T,3);p4=polyfit(t,T,4);t1=0:0.
5、1:24;y1=polyval(c,t1)y2=polyval(p2,t1);y3=polyval(p3,t1);y4=polyval(p4,t1);plot(t,T,*r,t1,y2,-b,t1,y3,-b,t1,y4,-b,t,feval(fun,c,t),-b) Untitled3Solver stopped prematurely.lsqcurvefit stopped because it exceeded the function evaluation limit,options.MaxFunEvals = 300 (the default value).c = 2.2181 -0
6、.0000 -436.6246ans = 749.8210y1 = Columns 1 through 10 -436.6246 -436.6024 -436.5358 -436.4249 -436.2697 -436.0700 -435.8261 -435.5377 -435.2050 -434.8279 Columns 11 through 20 -434.4065 -433.9407 -433.4305 -432.8760 -432.2771 -431.6339 -430.9463 -430.2143 -429.4380 -428.6173 Columns 21 through 30 -
7、427.7522 -426.8428 -425.8890 -424.8909 -423.8484 -422.7615 -421.6303 -420.4547 -419.2348 -417.9705 Columns 31 through 40 -416.6618 -415.3088 -413.9114 -412.4696 -410.9835 -409.4530 -407.8782 -406.2590 -404.5954 -402.8875 Columns 41 through 50 -401.1352 -399.3385 -397.4975 -395.6121 -393.6824 -391.70
8、83 -389.6898 -387.6270 -385.5198 -383.3683 Columns 51 through 60 -381.1724 -378.9321 -376.6475 -374.3185 -371.9451 -369.5274 -367.0653 -364.5589 -362.0081 -359.4129 Columns 61 through 70 -356.7734 -354.0895 -351.3613 -348.5887 -345.7717 -342.9104 -340.0047 -337.0546 -334.0602 -331.0214 Columns 71 th
9、rough 80 -327.9383 -324.8108 -321.6389 -318.4227 -315.1621 -311.8571 -308.5078 -305.1141 -301.6761 -298.1937 Columns 81 through 90 -294.6669 -291.0958 -287.4803 -283.8205 -280.1163 -276.3677 -272.5748 -268.7375 -264.8558 -260.9298 Columns 91 through 100 -256.9594 -252.9447 -248.8856 -244.7821 -240.6
10、343 -236.4421 -232.2056 -227.9247 -223.5994 -219.2297 Columns 101 through 110 -214.8157 -210.3574 -205.8547 -201.3076 -196.7161 -192.0803 -187.4002 -182.6756 -177.9068 -173.0935 Columns 111 through 120 -168.2359 -163.3339 -158.3876 -153.3969 -148.3618 -143.2824 -138.1586 -132.9905 -127.7779 -122.521
11、1 Columns 121 through 130 -117.2198 -111.8742 -106.4843 -101.0500 -95.5713 -90.0483 -84.4809 -78.8691 -73.2130 -67.5125 Columns 131 through 140 -61.7676 -55.9784 -50.1448 -44.2669 -38.3446 -32.3779 -26.3669 -20.3115 -14.2118 -8.0677 Columns 141 through 150 -1.8792 4.3536 10.6308 16.9524 23.3183 29.7
12、285 36.1832 42.6822 49.2255 55.8133 Columns 151 through 160 62.4454 69.1218 75.8426 82.6078 89.4173 96.2712 103.1695 110.1121 117.0991 124.1304 Columns 161 through 170 131.2061 138.3262 145.4906 152.6994 159.9525 167.2501 174.5919 181.9782 189.4088 196.8837 Columns 171 through 180 204.4030 211.9667
13、219.5748 227.2272 234.9239 242.6651 250.4506 258.2804 266.1546 274.0732 Columns 181 through 190 282.0362 290.0435 298.0951 306.1911 314.3315 322.5163 330.7454 339.0189 347.3367 355.6989 Columns 191 through 200 364.1054 372.5564 381.0516 389.5913 398.1753 406.8037 415.4764 424.1935 432.9549 441.7607
14、Columns 201 through 210 450.6109 459.5055 468.4444 477.4276 486.4552 495.5272 504.6436 513.8043 523.0093 532.2588 Columns 211 through 220 541.5526 550.8907 560.2732 569.7001 579.1714 588.6870 598.2469 607.8512 617.4999 627.1930 Columns 221 through 230 636.9304 646.7122 656.5383 666.4088 676.3237 686
15、.2829 696.2865 706.3344 716.4267 726.5634 Columns 231 through 240 736.7444 746.9698 757.2395 767.5537 777.9121 788.3150 798.7622 809.2537 819.7896 830.3699 Column 241 840.99463、P 198 题目1、2;1、(1),(2),(4);function y=f(x)y=(1/sqrt(2*pi)*exp(-x.*x./2) I=quad(f,0,1)y = 5.0000 5.1358 5.2716 5.5000 5.7284
16、5.8642 6.0000y = 5.0679 5.2037y = 5.3858 5.6142y = 5.7963 5.9321I = 5.5000(2)function y=g(x)y=exp(sin(x) I=quad(f,0,pi/2)y = 5.0000 5.2133 5.4266 5.7854 6.1442 6.3575 6.5708y = 5.1066 5.3199y = 5.6060 5.9648y = 6.2508 6.4641I = 9.0877(4)function y=f(x)y=1/(5+x) I=quad(f,-1,1)y = 4.0000 4.2716 4.5432 5.0000 5.4568 5.7284 6.0000y = 4.1358 4.4074y = 4.7716 5.2284y = 5.5926 5.8642I = 102、f=inline(exp(-(x.2+y.2)./(x+y),x,y);y=dblquad(f,0,4,1,2)y = 0.0689
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1