Mathematica的数值模拟法计算具体问题为:通过两个数据二次线性回归y=b0+b1x+b2x^2测得二次项系数b2,标准差Sb2,;如何用数值模拟法测出y或Sx对b2/Sb2的影响有多大就是有个源代码给我发过来也好

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/09 03:48:02

Mathematica的数值模拟法计算具体问题为:通过两个数据二次线性回归y=b0+b1x+b2x^2测得二次项系数b2,标准差Sb2,;如何用数值模拟法测出y或Sx对b2/Sb2的影响有多大就是有个源代码给我发过来也好
Mathematica的数值模拟法计算
具体问题为:
通过两个数据二次线性回归y=b0+b1x+b2x^2测得二次项系数b2,标准差Sb2,;如何用数值模拟法测出y或Sx对b2/Sb2的影响有多大
就是有个源代码给我发过来也好 我看着改一改

Mathematica的数值模拟法计算具体问题为:通过两个数据二次线性回归y=b0+b1x+b2x^2测得二次项系数b2,标准差Sb2,;如何用数值模拟法测出y或Sx对b2/Sb2的影响有多大就是有个源代码给我发过来也好
tV1 = {};
tV2 = {};
tdata1 = {.003394511,.003350113,.003298160,.003245895,.003180386,\
.003114193,.003053291,.002968749,.002944187,.002900259,\
.002868830,.002809518,.002779967,.002761163};
tdata2 = {.003394511,.003350113,.003298160,.003245895,.003180386,\
.003114193,.003053291,.002968749,.002944187,.002900259,\
.002868830,.002809518,.002779967,.002761163};
Vdata2 = {8.651024539,8.488999457,8.305484018,8.119696253,
7.893572074,7.654443226,7.420578905,7.166265974,7.064759028,
6.887552572,6.763884909,6.570882962,6.415096959,6.340359304};
i = 14;
While[i >= 1,AppendTo[tV1,{tdata1[[i]],Vdata2[[i]]}]; i = i - 1];
Print["实验结果数据组:"]
tV1
g1 = ListPlot[tV1,AxesOrigin -> {0.0027,6.3},
PlotStyle -> {Red,PointSize[0.02]}];
tV1 = Fit[tV1,{1,t},t];
g2 = Plot[tV1,{t,0.00275,.0034},PlotStyle -> {Blue}];
Print["实验结果点分布和拟合效果图"]
Show[g1,g2]
Print["实验拟合公式:"]
tV1
b01 = tV1[[1]];
b11 = tV1[[2]]/t;
i = 14;
Print[]
Print["温度项加入-0.000005~0.000005度的随机误差,模拟读温度时的不确定性"]
While[i >= 1,
tdata2[[i]] = tdata2[[i]] + .00001 RandomReal[] - 0.000005;
i = i - 1];
tsb = 0;
i = 14;
While[i >= 1,tsb = tsb + (tdata2[[i]] - tdata1[[i]])^2; i = i - 1];
tsb = Sqrt[tsb/14];
i = 14;
While[i >= 1,AppendTo[tV2,{tdata2[[i]],Vdata2[[i]]}]; i = i - 1];
Print[]
Print["模拟结果数据组:"]
tV2
g3 = ListPlot[tV2,AxesOrigin -> {0.0027,6.3},
PlotStyle -> {Green,PointSize[0.02]}];
tV2 = Fit[tV2,{1,t},t];
g4 = Plot[tV2,{t,0.00275,.0034},PlotStyle -> {Orange}];
Print["模拟结果点分布和拟合效果图"]
Show[g3,g4]
Print["模拟后拟合公式:"]
tV2
b02 = tV2[[1]];
b12 = tV2[[2]]/t;
Show[g1,g2,g3,g4]
Print["模拟截距"]
Print[b02]
Print["模拟斜率"]
Print[b12]