数学建模实验答案

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

实验报告一 第二部分
x1 = [7 1 11 11 7 11 3 1 2 21 1 11 10]';
x2 = [26 29 56 31 52 55 71 31 54 47 40 66 68]';
x3 = [6 15 8 8 6 9 17 22 18 4 23 9 8]';
x4 = [60 52 20 47 33 22 6 44 22 26 34 12 12]';
y = [78.5 74.3 104.3 87.6 95.9 109.2 102.7 72.5 93.1 115.9 83.8 113.3 109.4]';
x = [ones(13,1) x1 x2 x3 x4];
[b,bint,r,rint,stats] = regress(y,x,0.05)

b =

62.4054
1.5511
0.5102
0.1019
-0.1441


bint =

-99.1786 223.9893
-0.1663 3.2685
-1.1589 2.1792
-1.6385 1.8423
-1.7791 1.4910


r =

0.0048
1.5112
-1.6709
-1.7271
0.2508
3.9254
-1.4487
-3.1750
1.3783
0.2815
1.9910
0.9730
-2.2943


rint =

-4.0390 4.0485
-3.2331 6.2555
-5.3126 1.9707
-6.5603 3.1061
-4.5773 5.0788
-0.5623 8.4132
-6.0767 3.1794
-6.8963 0.5463
-3.5426 6.2993
-3.0098 3.5729
-2.2372 6.2191
-4.1338 6.0797
-6.9115 2.3228


stats =

0.9824 111.4792 0.0000 5.9830


实验报告一 第三部分 82页第五题

x1 = [151.6 253.6 340.8 289.1 107.7 110.3 125.3 104.3 59.9 26.6 131.8 105.4 67.2 127.8 199.6 123.0 175.1]';
x2 = [162.8 61.3 123.8 39.1 138.3 117.3 93.6 75.8 68.2 27.7 64.9 130.9 50.0 151.1 174.3 73.7 141.1]';
x3 = [154.5 156.5 259.2 182.5 152.3 141.9 200.2 153.4 112.3 61.6 197.0 243.9 107.2 326.6 405.2 139.2 254.9]';
x4 = [39.5 21.2 49.4 22.8 0.4 31.8 14.4 12.6 13.5 4.9 14.4 17.0 19.7 27.9 27.9 15.1 33.3]';
x5 = [1.62 1.79 1.51 1.60 1.61 1.31 1.02 1.08 1.02 0.82 1.03 1.08 0.92 0.79 0.86 1.27 1.10]';
y = [6.29 6.71 6.32 6.95 6.29 4.73 4.63 4.85 4.84 4.82 4.76 4.80 4.83 4.21 4.23 5.33 4.39]';
x = [ones(17,1) x1 x2 x3 x4 x5];
[b,bint,r,rint,stats] = regress(y,x,0.05)

b =

3.4865
0.0067
0.0021
-0.0044
-0.0174
1.4803


bint =

1.2214 5.7516
-0.0048 0.0181
-0.0129 0.0171
-0.0151 0.0062
-0.0513 0.0165
-0.7608 3.7213


r =

0.4224
-0.1812
0.0762
0.2944
0.0911
-0.4968
-0.2613
-0.1912
0.0326
0.2420
-0.1423
0.1118
0.2462
0.3154
0.0532
-0.1319
-0.4807


rint =

0.0138 0.8311
-0.7111 0.3488
-0.3083 0.4607
-0.2228 0.8116
-0.2362 0.4183
-1.0171 0.0234
-0.9291 0.4066
-0.8880 0.5055
-0.6588 0.7240
-0.2787 0.7628
-0.8119 0.5273
-0.5545 0.7781
-0.3708 0.8632
-0.2534 0.8843
-0.4823 0.5886
-0.8391 0.5754
-1.0728 0.1114


stats =

0.9101 22.2595 0.0000 0.1061


实验报告一 第四部分 69页例题

>>x=[143 145 146 147 149 150 153 154 155 156 157 158 159 160 162 164];
>> y=[88 85 88 91 92 93 93 95 96 98 97 96 98 99 100 102]
>> plot(x,y,'*')
x1=[143 145 146 147 149 150 153 154 155 156 157 158 159 160 162 164]';
X=[ones(16,1) x1];
Y=[88 85

88 91 92 93 93 95 96 98 97 96 98 99 100 102]';
>> [b,bint,r,rint,stats]=regress(Y,X,0.05)

b =

-16.0730
0.7194


bint =

-33.7071 1.5612
0.6047 0.8340


r =

1.2056
-3.2331
-0.9524
1.3282
0.8895
1.1702
-0.9879
0.2927
0.5734
1.8540
0.1347
-1.5847
-0.3040
-0.0234
-0.4621
0.0992


rint =

-1.2407 3.6520
-5.0622 -1.4040
-3.5894 1.6845
-1.2895 3.9459
-1.8519 3.6309
-1.5552 3.8955
-3.7713 1.7955
-2.5473 3.1328
-2.2471 3.3939
-0.7540 4.4621
-2.6814 2.9508
-4.2188 1.0494
-3.0710 2.4630
-2.7661 2.7193
-3.1133 2.1892
-2.4640 2.6624


stats =

0.9282 180.9531 0.0000 1.7437

实验报告二 第三部分 第86页例2



c=[2;3;-5];
>> a=[-2,5,-1];b=-10;
>> aeq=[1,1,1];
>> beq=7;
>> x=linprog(-c,a,b,aeq,beq,zeros(3,1))
Optimization terminated.

x =

6.4286
0.5714
0.0000

>> value=c'*x

value =

14.5714
第86页例3

>> c=[2;3;1];
>> a=[1,4,2;3,2,0];
>> b=[8;6];
>> [x,y]=linprog(c,-a,-b,[],[],zeros(3,1))
Optimization terminated.

x =

0.8066
1.7900
0.0166


y =

7.0000

实验报告二 第四部分114页习题1


>> c=[5;5;8;2;6;3];
>> aeq=[1,1,1,1,1,1];
>> beq=140;
>> a=(-1)*[0.45,0.45,1.05,0.40,0.50,0.5;10,28,59,25,22,75;415,9065,2550,75,15,235;8,3,53,27,5,8;0.3,0.35,0.6,0.15,0.25,0.8];
>> b=(-1)*[6;25;17500;245;5.00];
>> uB=[40;40;40;20;40;40];
>> [x,y]=linprog(c,a,b,aeq,beq,zeros(6,1),uB)
Exiting: One or more of the residuals, duality gap, or total relative error
has stalled:
the dual appears to be infeasible (and the primal unbounded).
(The primal residual < TolFun=1.00e-008.)

x =

40.0000
25.1698
0.0000
20.0000
14.8302
40.0000


y =

574.8302


实验报告三、 第二部分


data=[0,0.8,1.4,2.0,2.4,3.2,4.0,4.8,5.4,6.0,7.0,8.0,10.0;0,0.74,2.25,5.25,8.25,15,21.38,26.25,28.88,30.6,32.25,33,35];
>> plot(data(1,:),data(2,:),'v')
>> x=data(1,:);y=data(2,:);
>> cftool
>> p=polyfit(x,y,4)

f(x) = p1*x^4 + p2*x^3 + p3*x^2 + p4*x + p5
Coefficients (with 95% confidence bounds):
p1 = 0.03047 (0.0251, 0.03584)
p2 = -0.6726 (-0.7789, -0.5664)
p3 = 4.383 (3.71, 5.055)
p4 = -3.567 (-5.088, -2.045)
p5 = 0.3132 (-0.7181, 1.345)

Goodness of fit:
SSE: 1.853
R-square: 0.9992
Adjusted R-square: 0.9987
RMSE: 0.4813
p =

0.0305 -0.6726 4.3829 -3.5665 0.3132
f(x) = p1*x^8 + p2*x^7 + p3*x^6 + p4*x^5 +
p5*x^4 + p6*x^3 + p7*x^2 + p8*x + p9
Coefficients (with 95% confidence bounds):
p1 = -6.696e-012 (-1.205e-011, -1.346e-012)
p2 = 7.822e-009 (1.615e-009, 1.403e-008)
p3 = -3.975e-006 (-7.105e-006, -8.445e-007)
p4 = 0.001148 (0.

0002513, 0.002044)
p5 = -0.206 (-0.3654, -0.04654)
p6 = 23.51 (5.486, 41.53)
p7 = -1667 (-2932, -401.7)
p8 = 6.71e+004 (1.67e+004, 1.175e+005)
p9 = -1.174e+006 (-2.046e+006, -3.016e+005)

Goodness of fit:
SSE: 0.004031
R-square: 1
Adjusted R-square: 1
RMSE: 0.06349

实验报告三 第三部分 140页第五题

data=[100,110,120,130,140,150,160,170,180,190;45,51,54,61,66,70,74,78,85,89];
>> plot(data(1,:),data(2,:),'v')
>> x=data(1,:);y=data(2,:);
>> cftool
>> p=polyfit(x,y,8)

data=[0,5,10,15,20,25,30,35,40,45,50,55;0,1.27,2.16,2.86,3.44,3.87,4.15,4.37,4.51,4.58,4.62,4.64];
>> plot(data(1,:),data(2,:),'v')
x=data(1,:);y=data(2,:);
cftool
p=polyfit(x,y,8)
Linear model Poly8:
f(x) = p1*x^8 + p2*x^7 + p3*x^6 + p4*x^5 +
p5*x^4 + p6*x^3 + p7*x^2 + p8*x + p9
Coefficients (with 95% confidence bounds):
p1 = -1.487e-012 (-8.801e-012, 5.827e-012)
p2 = 3.936e-010 (-1.218e-009, 2.005e-009)
p3 = -4.312e-008 (-1.882e-007, 1.02e-007)
p4 = 2.526e-006 (-4.339e-006, 9.391e-006)
p5 = -8.532e-005 (-0.0002678, 9.712e-005)
p6 = 0.001695 (-0.0009915, 0.004381)
p7 = -0.02228 (-0.04224, -0.002325)
p8 = 0.3328 (0.2752, 0.3904)
p9 = -0.0003007 (-0.03458, 0.03398)

Goodness of fit:
SSE: 0.0003482
R-square: 1
Adjusted R-square: 0.9999
RMSE: 0.01077



相关文档
最新文档