您好,欢迎访问三七文档
估算瑞士国土面积姓名宋宇班级能动54学号2140001009一、实验问题为了算出瑞士的国土面积,首先对瑞士地图作如下测量:以由西向东方向为x轴,由南到北方向为y轴,选择方便的原点,并将从最西边界点到最东边界点在轴上的区间适当地划分为若干段,在每个分点的y方向测出南边界点和北边界点的y1坐标和y2,这样就得到了表中的数据(单位mm)。地图的比例:1:2222,试由测量数据计算瑞士国土的近似面积,与它的精确值41288km比较。x=[7.0,10.5,13.0,17.5,34,40.5,44.5,48,56,61,68.5,76.5,80.5,91,96,101,104,106,111.5,118,123.5,136.5,142,146,150,157,158]y1=[44,45,47,50,50,38,30,30,34,36,34,41,45,46,43,37,33,28,32,65,55,54,52,50,66,66,68]y2=[44,59,70,72,93,100,110,110,110,117,118,116,118,118,121,124,121,121,121,122,116,83,81,82,86,85,68]二、问题分析此题是计算面积的问题,可以将地图分为两段曲线,运用定积分算出面积,由于给了一系列的点,那么可以拟合函数方法建立方程,最终解决问题。三、实验目的掌握数据插值的思想方法,获得瑞士的近似地图,熟悉常用的分段线性插值和样条插值的使用方法。四、实验内容1分段线性插值(1)Matlab程序x=[7.0,10.5,13.0,17.5,34,40.5,44.5,48,56,61,68.5,76.5,80.5,91,96,101,104,106,111.5,118,123.5,136.5,142,146,150,157,158]y1=[44,45,47,50,50,38,30,30,34,36,34,41,45,46,43,37,33,28,32,65,55,54,52,50,66,66,68]y2=[44,59,70,72,93,100,110,110,110,117,118,116,118,118,121,124,121,121,121,122,116,83,81,82,86,85,68]plot(x,y1,'k.','markersize',10)axis([0,200,0,200])grid;holdont=7:158;u=interp1(x,y1,t);plot(t,u)plot(x,y2,'k.','markersize',10)u=interp1(x,y2,t);plot(t,u)S=trapz(x,y2)-trapz(x,y1);S=S*2222^2/1000000;n=(S-41288)/S;fprintf('S=%.2f,n=%.2f\n',S,n)(2)插值图(3)结果S=42406.33,n=0.032样条插值法(1)Matlab程序x=[7.0,10.5,13.0,17.5,34,40.5,44.5,48,56,61,68.5,76.5,80.5,91,96,101,104,106,111.5,118,123.5,136.5,142,146,150,157,158]y1=[44,45,47,50,50,38,30,30,34,36,34,41,45,46,43,37,33,28,32,65,55,54,52,50,66,66,68]y2=[44,59,70,72,93,100,110,110,110,117,118,116,118,118,121,124,121,121,121,122,116,83,81,82,86,85,68]plot(x,y1,'k.','markersize',10)axis([0,200,0,200])grid;holdont=7:158;u=spline(x,y1,t);plot(t,u)plot(x,y2,'k.','markersize',10)u=spline(x,y2,t);plot(t,u)S=trapz(x,y2)-trapz(x,y1);S=S*2222^2/1000000;n=(S-41288)/S;fprintf('S=%.2f,n=%.2f\n',S,n)(2)插值图(3)结果S=42406.33,n=0.03五、实验结论分段插值与样条插值算出的结果相同,面积为42406.33平方公里,百分误差为0.03,但从图可看出,比起分段线性插值法,样条式插值法更好个模拟了地图的形状,所以,使用样条式插值发更合理。六、实验总结掌握了数据插值的思想方法,获得瑞士的近似地图,熟悉常用的分段线性插值和样条插值的使用方法,获得了这建立数学模型了思想。
本文标题:估算瑞士国土面积
链接地址:https://www.777doc.com/doc-5740936 .html