基于MATLAB的改进导线网平差程序设计

合集下载

基于MATLAB的控制网平差程序设计--第六章源代码

基于MATLAB的控制网平差程序设计--第六章源代码

近似坐标计算的函数-calcux0y0函数(126页)function [x0,y0]=calcux0y0(x0,y0,e,d,sid,g,f,dir,s,t,az,pn,xyknow,xyunknow,point,aa,bb,cc)%本函数的作用是计算待定点的近似坐标format short; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% time=0;prelength=length(xyknow);non_orient=0;point_angle=0;while length(xyunknow)>0%考虑的计算方法有:1.极坐标;2.前方交会;3.测边交会;4.后方交会;%5.无定向导线的两种情况:(1)已知两个点;(2)分离的已知点与方位角;基本思路:%采用循环的方法逐一对每一个未知点进行以上各种方法条件的搜索,满足后即解算。

aa0=[];bb0=[];cc0=[];%记录搜索到两条观测边但需用户给顺序的点,注意要放在while 里面。

time=time+1; % 用于统计循环次数。

way=0;for i=xyunknow %依次循环向量中的各元素%============================================================= =====%方法1.极坐标条件搜索与计算-->way=1,基本思路:找到或求出一个方位角,找出一条边。

temp1=[]; temp2=[]; temp3=[]; temp4=[]; temp5=[]; temp6=[]; temp7=[]; temp8=[];temp9=[]; temp10=[];A=[];B=[];P=[];%第一步:寻找观测条件:两种情况:一是有已知方位角;二是由两个已知点及方向观测值推出方位角。

基于MATLAB的控制网平差程序设计--第四章源代码

基于MATLAB的控制网平差程序设计--第四章源代码

chkdat函数(72页)function [n1,k]=chkdat(sd,pn,n1)n=length(n1);k=0;for i=1:ni1=0;for j=1:sdif(n1(i)==pn(j))i1=1;n1(i)=j;break;endendif(i1==0)% fprintf(fit2,'%5d %5d\n',i,n1(i)k=1;endendreturnreadlevelnetdata函数(73页)function [ed,dd,sd,gd,pn,h0,k1,k2,h1,s]=readlevelnetdata global filename filepath;global ed dd sd pn gd h0 k1 k2 h1 s k11 k12;k1=[];k2=[];h=[];s=[];[filename,filepath]=uigetfile('*.txt','选择高程数据文件');fid1=fopen(strcat(filepath,filename),'rt');if(fid1==-1)msgbox('Input File or Path is not correct','Warning','warn');return;ended=fscanf(fid1,'%f',1);dd=fscanf(fid1,'%f',1);sd=ed+dd;gd=fscanf(fid1,'%f',1);pn=fscanf(fid1,'%f',sd);h0=fscanf(fid1,'%f',ed);h0(dd+1:ed+dd)=h0(1:ed);heightdiff=fscanf(fid1,'%f',[4,gd]);heightdiff=heightdiff';k1=heightdiff(:,1);%起点k2=heightdiff(:,2);%终点k11=heightdiff(:,1);%起点k12=heightdiff(:,2);%终点h1=heightdiff(:,3);%高差s=heightdiff(:,4);%距离fclose('all');%点号转换[k1,k01]=chkdat(sd,pn,k1);[k2,k02]=chkdat(sd,pn,k2);h0(1:dd)=20000;ie=0;while(1)%计算近似高程for k=1:gdi=k1(k);j=k2(k);if(h0(i)<1e4&h0(j)>1e4)h0(j)=h0(i)+h1(k);ie=ie+1;endif(h0(i)>1e4&h0(j)<1e4)h0(i)=h0(j)-h1(k);ie=ie+1;endendif(ie==dd)break;endendh0=reshape(h0,length(h0),1); returnbm1函数(75页)function id=bm1(gd,dd,k1,k2)%计算一维压缩存放的数组idid=[];for i=1:ddk=i;for j=1:gdi1=k1(j);i2=k2(j);if(i1==i&i2<k)k=i2;endif(i2==i&i1<k)k=i1;endendid(i)=k;endfor i=2:ddid(i)=id(i-1)+i-id(i)+1;endreturn一维压缩存储法方程平差(76页)global pathname filenameglobal ed dd sd pn gd h0 k1 k2 h1 s dh;p=1./s;id=bm1(gd,dd,k1,k2);mm=id(dd);a(1:mm)=0;b(1:dd)=0;for k=1:gd %形成法方程i=k1(k);j=k2(k);h1=h1(k)+h0(i)-h0(j);if(i<=dd)ii=id(i)-i;a(ii+i)=a(ii+i)+p(k);b(i)=b(i)-h1*p(k);endif(j<=dd)jj=id(j)-j;a(jj+j)=a(jj+j)+p(k);b(j)=b(j)+h1*p(k);if(i<=dd)if(i>=j)a(ii+j)=a(ii+j)-p(k);elsea(jj+i)=a(jj+i)-p(k);endendendenda=gs5(dd,a,id);%变带宽下三角紧缩存储高斯消元法dh=cy6(a,b,id,dd,1);%常数项约化与回代子程序dh(dd+1:ed+dd)=0;hm(dd+1:ed+dd)=0;for i=1:sdh(i)=h0(i)+dh(i);endvv=0;for i=1:gdL(i)=h(k2(i))-h(k1(i));v(i)=h(k2(i))-h(k1(i))-h1(i);vv=vv+v(i)*v(i)/s(i);endu=sqrt(vv/(gd-dd));for i=1:ddb(1:dd)=0;b(i)=1.0;b=cy6(a,b,id,dd,i);hm(i)=sqrt(b(i))*u;endwritelevelnetdata(pn,k1,k2,h1,v',L',h0,dh',h',hm',u);gs5函数(77页)function a=gs5(dd,a,id)%变带宽高斯消去法for i=1:ddii=id(i)-i;if(i-1==0)li=1-ii;elseli=id(ii-1)-ii+1;endfor j=li:ijj=id(j)-j;if(j-1)==0lj=1-jj;elselj=id(j-1)-jj+1;endlk=li;if(li<lj)lk=lj;endfor k=lk:j-1kk=id(k);a(ii+j)=a(ii+j)-a(ii+k)/a(kk)*a(jj+k);endendendreturncy6函数(78页)function b=cy6(a,b,id,dd,k1)%常数项约化与回代子程序for i=k1:ddii=id(i)-i;if(i==1)nd=id(i);elsend=id(i)-id(i-1);ende=0;for k=1:i-1if((i-k)<nd)e=e+a(ii+k)*b(k);endendb(i)=(b(i)-e)/(a(ii+i);endfor i=dd-1:-1:k1ii=id(i);for k=i+1:ddkk=id(k)-k;nk=id(k)-id(k-1);if(k-i<nk)b(i)=b(i)-a(kk+i)/a(ii)*b(k);endendendreturn上三角存储法方程平差程序(79页)mm=(dd+1)*dd/2;a(1:mm)=0;b(1:dd)=0;for k=1:gdi=k1(k);j=k2(k);h1=h1(k)+h0(i)-h0(j);if(i<=dd)ii=(i-1)*(dd-i/2);a(ii+i)=a(ii+i)+1/s(k);b(i)=b(i)+1./s(k)*h1;endif(j<=dd)jj=(j-1)*(dd-j/2);a(jj+j)=a(jj+j)+1/s(k);b(j)=b(j)-1./s(k)*h1;if(i<=dd)if(i<j)a(ii+j)=a(ii+j)-1/s(k);elsea(jj+i)=a(jj+i)-1/s(k);endendendenda=invsqr(a,dd);for i=1:dddh(i)=0;di=(i-1)*(dd-i/2);for j=1:dddj=(j-1)*(dd-j/2);if(j<i)dh(i)=dh(i)-a(dj+i)*b(j);elsedh(i)=dh(i)-a(di+j)*b(i);endendenddh(dd+1:ed+dd)=0;hm(dd+1:ed+dd)=0;for i=1:sdh(i)=h0(i)+dh(i);endvv=0;for i=1:gdL(i)=h(k2(i))-h(k1(i));v(i)=h(k2(i))-h(k1(i))-h1(i);vv=vv+v(i)*v(i)/s(i);enduw0=sqrt(vv/(gd-dd));for i=1:ddii=(i-1)*(dd-i/2);hm(i)=sqrt(a(ii+i))*uw0;endreturn输出数据函数(79页)function writelevelnetdata(pn,k1,k2,h1,v,L,h0,dh,h,hm,uw0)disp('待定点高程平差值及中误差:')disp('---点号----近似高程(m)-高程改正(m)-高程平差值(m)-中误差')[pn,h0,dh,h,hm]disp('高差观测值平差值:')disp('---点号------点号----观测高差(m)---高差改正(m)-平差高差(m)')[pn(k1),pn(k2),h1,v,L][filename1,pathname1]=uigetfile('*.txt','请选择输出文件');fid2=fopen(strcat(pathname1,filename1),'wt');if(fid2==-1)msgbox('Error by Opening Output File','Warning','warn');return;endfprintf(fid2,'待定点高程平差值及中误差:\n 点号--近似高程(m)--高程改正(m)-高程平差值(m)-中误差\n');fprintf(fid2,'%5d %10.4f %10.4f %10.4f %10.4f\n',[pn,h0,dh,h,hm]');fprintf(fid2,'高差观测值平差值:\n -点号---点号--观测高差(m)--高差改正(m)-平差高差(m)\n'); fprintf(fid2,'%5d %5d %10.4f %10.4f %10.4f\n',[pn(k1),pn(k2),h1,v,L]');fprintf(fid2,'单位权中误差:%10.4fm\n',uw0);% open(strcat(pathname1,filename1));fclose(fid2);return利用Matlab矩阵运算的平差程序(81页)function level3ticdisp('平差已经开始---->>>>')global ed dd sd pn gd h0 k1 k2 h1 s dh;[ed,dd,sd,gd,pn,h0,k1,k2,h1,s]=readlevelnetdata;[dh,h,V,L,uw0,uwh,uwl]=calculatelevelnet(ed,dd,sd,gd,pn,h0,k1,k2,h1,s);writelevelnetdata(pn,k1,k2,h1,V,L,h0,dh,h,uwh,uw0); %输出水准网解算结果yunxing=toc;disp(['平差过程的运行时间为',num2str(yunxing),'秒。

基于MATLAB的水准网平差程序设计与实现

基于MATLAB的水准网平差程序设计与实现

AP A—A pAo f 1 … + ln1 】 o +A pAl- 4 A 一P-A 一
A P =A pl+Af 1 +… +A l l l I o o f P1 p 一f
加入法方程系数矩 阵可逆 , 可得 :
X=一A A) A l ( P 一 p

2 最小二乘平差的计 算步骤 . 5 () 文件读取 已知 高程 和观测数据 ;2未知点近似高程计算 ; ) 1 从 ( ) ( 组 3 成法方 程式 ; ) 程系数 阵求 逆 ; ) 平差值计算 ; ) V及单 ( 法方 4 ( 高程 5 ( 残差 6 位 中误差 计算 ; ) 后成果( 平差值 、 (最 7 高程 高差平 差值及它们 的中误 差) 计算及输 出。
基 孑 MA L T AB昀水准 网 蓥程序设计与实项
郑 州市规 划勘 测设 计研 究 院 陈永 星
[ 摘


ቤተ መጻሕፍቲ ባይዱ ;
要] 本文首先讨论 了MA L B在测量平差 中的应 用现状 与在 国内外的研 究动 态, TA 对基 于间接平差的水准 网算 法进行 了分析 , 在
水准网 程序设计
X= X。+ 8 x
24精度估计 . 单位权 中误差为 :

其 中 , 为观 测值编 号 ; k h 是观测 高差 ; u 是观测 值 的平 差改正 数 , 叫残差 .,表示 高差两端点 的编号( 也 i 1j 即点号) z 3 分别表示观 ; 、 j 2 测 高差起 点和终点 的高程平差值 , 即平 差中的未知数 。实际平差 时还
±

要 引人 参数近似值 , 设 、 为 五 、 } _ 的近似值 , 、 , z 妇 为平差值 与 近似值 的差 , 也叫改 正数 , I= , z + 即z z十 而= ? , 入误差 代

使用Matlab进行电力系统分析和优化设计

使用Matlab进行电力系统分析和优化设计

使用Matlab进行电力系统分析和优化设计概述电力系统是现代社会运行的关键基础设施,对于电网的设计和运行进行分析和优化是保障电力供应的重要任务。

Matlab作为一种功能强大的工具和编程语言,被广泛应用于电力系统领域,能够提供一系列用于电力系统分析和优化设计的工具和函数。

1. 电力系统建模电力系统建模是进行电力系统分析和优化设计的基础。

在Matlab中,可以使用不同的方式进行电力系统建模,如节点模型、分支模型和网络模型。

节点模型是通过对电力系统网络进行节点和支路的描述,表示电力系统的拓扑和参数关系。

分支模型则是将电力系统分解为若干个支路,通过对每个分支进行建模计算。

网络模型则是将电力系统建模为一个整体,通过求解一组方程组来获得电力系统的节点电压和支路功率。

2. 电力系统分析电力系统分析是对电力系统运行状态和安全性进行评估和分析的过程。

在Matlab中,可以使用各种分析方法进行电力系统分析,例如潮流分析、短路分析、稳定性分析和谐波分析等。

潮流分析是用于求解电力系统的节点电压和支路功率分布的一种方法。

通过潮流分析,可以确定电力系统的潮流分布情况,找出潮流过载和电压偏差等问题,并提供相应的优化建议。

短路分析是用于评估电力系统在短路故障时的电流分布和保护措施的一种方法。

短路分析可以帮助确定电力系统的短路电流和设备额定电流的比较情况,从而评估电力系统的安全性和保护设备的合理性。

稳定性分析是用于评估电力系统在故障和变动负荷等情况下的稳定性和可靠性的一种方法。

通过稳定性分析,可以确定电力系统的动态响应和稳定裕度,提供相应的优化设计和控制建议。

谐波分析是用于评估电力系统中谐波电压和谐波电流的一种方法。

通过谐波分析,可以确定电力系统中谐波电压和谐波电流的谐波含量,找出谐波问题的根源,并提供相应的滤波器和接地措施。

3. 电力系统优化设计电力系统优化设计是在满足电力供应要求的前提下,通过合理配置和控制电力系统的各个元件,以提高系统的效率和可靠性。

实验三-利用matlab程序设计语言完成某工程导线网平差计算

实验三-利用matlab程序设计语言完成某工程导线网平差计算

实验三利用mat lab程序设计语言完成某工程导线网平差计算实验数据;某工程项目按城市测量规范(CJJ8-99)不设一个二级导线网作为首级平面控制网,主要技术要求为:平均边长200cm,测角中误差±8,导线全长相对闭合差<1/10000,最弱点的点位中误差不得大于5cm,经过测量得到观测数据,设角度为等精度观测值、测角中误差为山=±8秒,鞭长光电测距、测距中误差为m二± Vsmm,根据所学的‘误差理论与测量平差基础'提出一个最佳的平差方案,利用matlab完成该网的严密平差级精度评定计算;平差程序设计思路:1采用间接平差方法,12个点的坐标的平差值作为参数.利用matlab进行坐标反算,求出已知坐标方位角;根据已知图形各观测方向方位角;2计算各待定点的近似坐标,然后反算出近似方位角,近似边. 计算各边坐标方位角改正数系数;3确定角和边的权,角度权Pj=1 ;边长权Ps=100/S;4计算角度和边长的误差方程系数和常数项,列出误差方程系数矩阵 B,算出Nbb=B’ PB,W=B’ Pl,参数改正数 x=inv(Nbb)*W;角度和边长改正数V=Bx-l; 6建立法方程和解算x,计算坐标平差值,精度计算;程序代码以及说明:s10=;s20=;s30=;s40=;s50=;s60=;s70=;s80=;s90=;s100=;s110=;s120=;s130=;s140=; %已知点间距离Xa=;Ya二;Xb=;Yb=;Xc=;Yc=;Xd=;Yd=;Xe=;Ye=;Xf=;Yf=; %已知点坐标值a0=atand((Yb-Ya)/(Xb-Xa))+180;d0=atand((Yd-Yc)/(Xd-Xc));f0=atand((Yf-Ye)/(Xf-Xe))+360; %坐标反算方位角a1=a0+(163+45/60+4/3600)-180a2=a1+(64+58/60+37/3600)-180;a3=a2+(250+18/60+11/3600)-180;a4=a3+(103+57/60+34/3600)-180;a5=d0+(83+8/60+5/3600)+180;a6=a5+(258+54/60+18/3600)-180-360;a7=a6+(249+13/60+17/3600)-180;a8=a7+(207+32/60+34/3600)-180;a9=a8+(169+10/60+30/3600)-180;a10=a9+(98+22/60+4/3600)-180;a12=f0+(111+14/60+23/3600)-180;a13=a12+(79+20/60+18/3600)-180;a14=a13+(268+6/60+4/3600)-180;a15=a14+(180+41/60+18/3600)-180; %推算个点方位角 aa=[a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a12 a13 a14 a15]'X20=Xb+s10*cosd(a1);X30=X20+s20*cosd(a2);X40=X30+s30*cosd(a3);X50a=X40+s40*cosd(a4);X60=Xd+s50*cosd(a5);X70=X60+s60*cosd(a6);X80=X70+s70*cosd(a7);X90=X80+s80*cosd(a8);X100=X90+s90*cosd(a9);X50c=X100+s100*cosd(a10);X130二Xf+s110*cosd(a12);X140=X130+s120*cosd(a13);X150=X140+s130*cosd(a14);X50e=X150+s140*cosd(a15); %各点横坐标近似值X0=[X20 X30 X40 X60 X70 X80 X90 X100 X130 X140 X150 X50a X50c X50e]'Y20=Yb+s10*sind(a1);Y30=Y20+s20*sind(a2);Y40=Y30+s30*sind(a3);Y50a=Y40+s40*sind(a4);Y60=Yd+s50*sind(a5);Y70=Y60+s60*sind(a6);Y80=Y70+s70*sind(a7);Y90=Y80+s80*sind(a8);Y100=Y90+s90*sind(a9);Y50c=Y100+s100*sind(a10);Y130=Yf+s110*sind(a12);Y140=Y130+s120*sind(a13);Y150=Y140+s130*sind(a14);Y50e=Y150+s140*sind(a15); %个点从坐标近似值Y0=[Y20 Y30 Y40 Y60 Y70 Y80 Y90 Y100 Y130 Y140 Y150 Y50a Y50c Y50e]'P=[X0 Y0];X50=(X50a+X50c+X50e)/3Y50=(Y50a+Y50c+Y50e)/3s4二sqrt((Y40-Y50)"2+(X40-X50厂2);si二sqrt((Y100-Y50厂2+(X100-X50厂2);s14二sqrt((Y150-Y50)"2+(X150-X50厂2);A1=[cosd(a1) cosd(a2) cosd(a3) cosd(a4) cos(a5) cosd(a6) cosd(a7) cosd(a8) cosd(a9) cosd(a10) cosd(a12) cosd(a13) cosd(a14) cosd(a15)]';B11=[sind(a1) sind(a2) sind(a3) sind(a4) sin(a5) sind(a6) sind(a7) sind(a8) sind(a9) sind(a10) sind(a12) sind(a13) sind(a14) sind(a15)]';s=blkdiag(s10,s20,s30,s4,s50,s60,s70,s80,s90,s10',s110,s120,s130,s14);a=*inv(s)*B11b=*inv(s)*A1ab4=atand((Y50-Y40)/(X50-X40))+180;ab10=atand((Y50-Y100)/(X50-X100));ab14=atand((Y50-Y150)/(X50-X150))+360;m4=ab4-a3+180;m10=ab10-a9+180;m11=ab4-ab10;m15=ab14-a14+180;m16=ab10-ab14+360;m04=103+57/60+34/3600;m010=98+22/60+4/3600;m011=94+53/60+50/3600;m015=180+41/60+18/3600;m016=ab10-ab14+360;l=[0 0 0 m4-103-57/60-34/3600 0 0 0 0 0 m10-98-22/60-4/3600 m11-94-53/60-50/3600 0 0 0 m15T80-41/60T8/3600m16-103-23/60-8/3600 0 0 0 s40-s4 0 0 0 0 0 s100-s1 0 0 0 s140-s14]';e1=(abs(X20-Xb))/s10;e2=(abs(X30-X20))/s20;e3=(abs(X40-X30))/s30;e4=(abs(X50-X40))/s4;e5=(abs(X60-Xd))/s50;e6= (abs(X70-X60))/s60;e7=(abs(X80-X70))/s70;e8=(abs(X90-X80))/s80;e9=(abs(X100-X90))/s90;e10=(abs(X50-X100))/s1;e11=(abs(X130-Xf))/s110;e12=(abs(X140-X130 ))/s120;e13=(abs(X150-X140))/s130;e14=(abs(X50-X150))/s 14;e=[e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14]' m1=(abs(Y20-Yb))/s10;m2=(abs(Y30-Y20))/s20;m3=(abs(Y40-Y30))/s30;m4=(abs(Y50-Y40))/s4;m5=(abs(Y60-Yd))/s50;m6= (abs(Y70-Y60))/s60;m7=(abs(Y80-Y70))/s70;m8=(abs(Y90-Y80))/s80;m9=(abs(Y100-Y90))/s90;m10=(abs(Y50-Y100))/s1;m11=(abs(Y130-Yf))/s110;m12=(abs(Y140-Y130 ))/s120;m13=(abs(Y150-Y140))/s130;m14=(abs(Y50-Y150))/s 14;m=[m1 m2 m3 m4 m5 m6 m7 m8 m9 m10 m11 m12 m13 m14]' % 以上为求得误差方程系数B=[ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0%系数矩阵B0 0 ]P=blkdiag(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,100/s10,100/s 20,100/s30,100/s40,100/s50,100/s60,100/s70,100/s80,100/ s90,100/s100,100/s110,100/s120,100/s130,100/s140); %定义权矩阵Nbb二B'*P*BW=B'*P*l;x=inv(Nbb)*WV=B*x-l;inv(Nbb);Y=V'*P*V;O二sqrt(Y/6)*3600 %精度评定计算结果:平差值坐标X:+003 *Qx1= Qy1= Qx2= Qy2= ……Qx15= Qy15=。

基于 MATLAB 的导线网平差软件设计及误差椭圆的绘制

基于 MATLAB 的导线网平差软件设计及误差椭圆的绘制

0 引 言
在 计算机 技术 和空 间 技 术 的支 持 下 , 测 绘 学 科得 到
网平差 程序 。
本文在 上述 研究 成果 的基 础 上 , 利 用 间 接 平 差 实 现 导线 网平 差 的程 序设 计 , 以及 绘 制 导 线 网 网形 与 误 差 椭
了快 速发 展 , 观 测数 据 和估计 量 的类 型更 加 多样 化 , 而 测
平 差 原理 , 完 成 了间接 平 差软 件 设 计 , 实现 了 导 线 网平 差 , 以 及 导 线 网 网形 和 误 差 椭 圆 的 绘 制 , 并 通 过 实例 进 行
了验 证 分 析 。
关键词 : 导线 网; M A T L A B ; 间接 平 差 ; 误 差椭 圆 中图分类号 : P 2 0 7 . 1 文献标识码 : B 文章编号 : 1 6 7 2— 5 8 6 7 ( 2 0 1 4 ) 0 4— 0 0 9 8— 0 3
f o r e i t i s d i f i f c u l t t o u s e t r a d i t i o n a l p r o g r a mmi n g l a n g u a g e t o r e a l i z e t h e p r o ra g m a n d d r a w t h e e r r o r e l l i p s e .B a s e d o n MAT L AB p l a t —
f o r m, t h e p a p e r u s e s i t s s t r o n g c a p a c i t y o f c o m p u t a t i o n a n d v i s u li a z a t i o n a n l a y s i s f u n c t i o n t o a c h i e v e t h e p a r a me t e r a d j u s t me n t s o f t w a r e d e s i g n a c c o r d i n g t o t h e p a r a m e t e r a d j u s t m e n t p i r n c i p l e a n d t h e t r a v e r s e n e t w o r k a d j u s t m e n t nd a s h a p e , nd a d r a w i n g o f e r r o r e l l i p s e a r e

基于Matlab的导线网平差程序设计

基于Matlab的导线网平差程序设计

表 3 边数 据 结 构
Ta . D t tu t r n s l 3 a a sr c u e o l e b f i
广泛. 常情况 下 , 外 业 观测 数 据 量 大 , 据处 理 通 其 数 过程 中大多涉及 到矩 阵 的计 算 , 由于 导 线 网 网形 且 的不确定 性 , 因此其 程序设 计 非常 复 杂[. 文总结 1本 ] 导线 网的规律 , 计 出通 用数据 结 构 , 设 并基 于 Mal tb a 强大的矩阵计 算能力 , 编制 了导线网数据处理 程序.
表 1 点 表 数 据 结构
T b Da a s 1 t I fp i t a .1 t h l l ℃o o n s cl
表 13中分 别存 储在 pTa ,ie a ,n lT b - t b l T ba ge a n 矩阵中, 保存为. a 文件 , mt 程序运行时加载嘲.
传 递 到网 中每一条 边. 某角 度一 边方 位 已知 , 设 而另

边方 位未 知 , 由于两边 夹角 已知 , 可计 算 出未知 边
表 2 角 度 数 据 结 构
a . a a sr cu e o n ls T b 2 D t t u t r fa ge
的方位 . 1 示 为 4种 可能 情况 . 图 所
一 ±7 口 c - 4
函数迭代计算.
ed n
ed n
情 况 四 : = . 4 7 a . , =厂 = -c - 4
() 4
同理可得 , 已知右边方位角计算左边方位角 的 情 况 , 有 4 可 能性. 也 种 程序 根据 角度 两边 的端 点点
名 的关 系判断 以上 8种 情 况 , 用 相 应 的计 算 公 式 采 计算 未 知边方 位角 [. 3 ] 程 序在 获 得 未知 边 方 位 角后 , 计 算 结果 保 存 将 到边表相 应记 录 中. 然后 在角 度 表 中搜 索相 邻角 度 ,

MATLAB平差程序

MATLAB平差程序

function BJPC2ZB=[];ZJ=[];BC=[];%%format long[filename,filepath]=uigetfile('*.txt','选择平差文件:'); name=[filepath filename];fid1=fopen(name,'rt');if(fid1==-1)disp('文件未打开,请重试!');return;endn=fscanf(fid1,'%f',1);%输入边的个数b=fscanf(fid1,'%f',1);%输入多余观测个数E=fscanf(fid1,'%f',1);%输入测角中误差t=fscanf(fid1,'%f',1);%输入坐标个数ZB=fscanf(fid1,'%f',[2 t]);dms1=fscanf(fid1,'%f',[3 n+1]);BC=fscanf(fid1,'%f',[1 n]);T0=fscanf(fid1,'%f',1);T1=fscanf(fid1,'%f',1);fclose(fid1);dms=dms1';ZJ=dms2degrees(dms);%%if t==2T0=T0;%若告诉起始方位角就直接输入endif t==4 %若没有告诉起始方位角由坐标反算Xa=ZB(1,1);Xb=ZB(1,2);Ya=ZB(2,1);Yb=ZB(2,2);Tx=Xb-Xa; Ty=Yb-Ya;T0=atan(Ty/Tx)*180/pi;%对方位角的讨论if ((Tx>0)&&(Ty>0))T0;endif (((Tx<0)&&(Ty>0))||((Tx<0)&&(Ty<0)))T0=T0+180;endif ((Tx>0)&&(Ty<0))T0=T0+360;endif ((Tx==0)&&(Ty>0))T0=90;endif ((Tx==0)&&(Ty<0))T0=270;endif((Ty==0)&&(Tx>0))T0=0;endif ((Ty==0)&&(Tx<0))T0=180;endenda0=T0;x0=ZB(1,t/2);y0=ZB(2,t/2);A=[0,0];FWJ=[];%开始计算近似方位角J=1;while(J<=n+1)belta=ZJ(J);%讨论方位角if J==1a=a0+belta;elsea=a+belta;endif a>=180a=a-180;elsea=a+180;endif a>=360a=a-360;endFWJ(J)=a;J=J+1;endFWJ;%%J=1;%开始计算近似坐标Awhile(J<=n)if J==1A(1,1)=x0+BC(1)*cos(FWJ(1)*pi/180);A(2,1)=y0+BC(1)*sin(FWJ(1)*pi/180);elseA(1,J)=A(1,J-1)+BC(J)*cos(FWJ(J)*pi/180); A(2,J)=A(2,J-1)+BC(J)*sin(FWJ(J)*pi/180);endJ=J+1;endA;%%W=[];%开始计算闭合差if t==2T1=T1;endif t==4Xa=ZB(1,3);Xb=ZB(1,4);Ya=ZB(2,3);Yb=ZB(2,4);Tx=Xb-Xa; Ty=Yb-Ya;T1=atan(Ty/Tx)*180/pi;if ((Tx>0)&&(Ty>0))T1;endif (((Tx<0)&&(Ty>0))||((Tx<0)&&(Ty<0)))T1=T1+180;endif ((Tx>0)&&(Ty<0))T1=T1+360;endif ((Tx==0)&&(Ty>0))T1=90;endif ((Tx==0)&&(Ty<0))T1=270;endif((Ty==0)&&(Tx>0))T1=0;endif ((Ty==0)&&(Tx<0))T1=180;endendW(1,1)=-(FWJ(n+1)-T1)*3600;%以秒为单位W(2,1)=-(A(1,n)-ZB(1,t/2+1))*100;%以厘米为单位W(3,1)=-(A(2,n)-ZB(2,t/2+1))*100;W;%%XS=zeros(3,2*n+1);%开始计算系数阵,XS是系数阵e=n+1;while(e<=2*n+1)XS(1,e)=1;e=e+1;endf=1;while(f<=n)XS(2,f)=cos(FWJ(f)*pi/180);%纵坐标边长改正数的系数 XS(3,f)=sin(FWJ(f)*pi/180);%横坐标边长改正数的系数 f=f+1;endu=1;y0=A(2,n);x0=A(1,n);Y=[];X=[];y1=[];x1=[];while(u<=n+1)if u==1Y(1)=ZB(2,t/2);X(1)=ZB(1,t/2);elseY(u)=A(2,u-1);X(u)=A(1,u-1);endu=u+1;endy1=-1/2062.65*(y0-Y);%纵坐标转角改正数的系数x1=1/2062.65*(x0-X);%横坐标转角改正数的系数y1;x1;d=n+1;z=1;while(d<=2*n+1)XS(2,d)=y1(1,z);XS(3,d)=x1(1,z);d=d+1;z=z+1;endXS;%%r=[];h=1;while (h<=n)s=(5+5*BC(h)/1000)/10;%求中误差厘米为单位r(h)=E^2/s^2;%计算距离的权h=h+1;endaa=[];y=1;while(y<=n)aa(y)=r(y);%将距离的权赋给矩阵aay=y+1;endc=n+1;while(c<=2*n+1)aa(c)=1;%转角的权都是1c=c+1;endP=diag(aa);%形成权阵P;%%Q=inv(P);N=XS*Q*XS';N1=inv(N);K=inv(N)*W;V=Q*XS'*K;V;BC1=BC'+V(1:n)/100;%将改正数加到观测值以求平差边长(除一百统一单位)ZJ1=ZJ+V(n+1:2*n+1)/3600;%同上BC1;i=1;while (i<=n+1)ZJ2(i,1)=fix(ZJ(i));ZJ2(i,2)=fix((ZJ(i)-fix(ZJ(i)))*60);ZJ2(i,3)=((ZJ(i)-fix(ZJ(i)))*60-fix((ZJ(i)-fix(ZJ(i)))*60))*60;i=i+1;endZJ2;%%A1=[0,0];FWJ1=[];J=1;while(J<=n+1)belta=ZJ1(J);if J==1a=a0+belta;elsea=a+belta;endif a>=180a=a-180;elsea=a+180;endif a>=360a=a-360;endFWJ1(J)=a;J=J+1;endi=1;while (i<=n+1)FWJ3(i,1)=fix(FWJ(i));FWJ3(i,2)=fix((FWJ(i)-fix(FWJ(i)))*60);FWJ3(i,3)=((FWJ(i)-fix(FWJ(i)))*60-fix((FWJ(i)-fix(FWJ(i)))*60))*60;FWJ2(i,1)=fix(FWJ1(i));FWJ2(i,2)=fix((FWJ1(i)-fix(FWJ1(i)))*60);FWJ2(i,3)=((FWJ1(i)-fix(FWJ1(i)))*60-fix((FWJ1(i)-fix(FWJ1(i)))*60))*60; i=i+1;endFWJ3;FWJ2;%%J=1;%开始计算平差坐标A1while(J<=n)if J==1A1(1,1)=ZB(1,t/2)+BC1(1)*cos(FWJ1(1)*pi/180);A1(2,1)=ZB(2,t/2)+BC1(1)*sin(FWJ1(1)*pi/180);elseA1(1,J)=A1(1,J-1)+BC1(J)*cos(FWJ1(J)*pi/180);A1(2,J)=A1(2,J-1)+BC1(J)*sin(FWJ1(J)*pi/180);endJ=J+1;endA1;m=sqrt(V'*P*V/b);%测量精度单位权中误差。

学位论文—基于matlab测量平差程序设计-创新实践报告

学位论文—基于matlab测量平差程序设计-创新实践报告

创新实践报告实践名称:基于MATLAB测量平差程序设计系部名称:测绘工程学院专业班级:测绘工程11-6班学生姓名:学号:指导教师:xxx工程学院教务处制注:1、此报告为参考格式,各栏项目可根据实际情况进行调整;实验成绩以优(90~100)、良(80~89)、中(70~79)、及格(60~69)、不及格(60以下)五个等级评定。

附录1 外文参考文献原文参考文献一Improving oil fields recovery through real-time water flooding optimizationPamela Alessia Chiara MarescalcoPolitecnico di Torino, Land, Environment and GeoTechnologies Engineering Department,24, C.so Duca degli Abruzzi, 10129 Torino, ItalySUMMARYIncreasing oil recovery from reservoirs is a strong urge. One of the most effective ways to get the result iswater flooding and that’s why its application is nowadays widely used in the petroleum industry. Obviously,water flooding efficiency strongly depends on reservoir properties; this makes simulating a water injectionprocess a priori an extremely important step of the reservoir production strategy. Simulation is commonlydone adopting a finite difference (FD) simulation approach.This paper explores a different and complementary approach, represented by streamline-based simulation,coupled with a tool to optimize water flooding campaigns and to help quick decision making. Inthe present study, water flooding simulation is performed via two commercial software: an FD and astreamline-based simulator, to highlight advantages and disadvantages of both simulation techniques indescribing a water injection campaign and to exploit the two appr oaches’ uniqueness in parallel.The final goal of iteratively converging to the optimal water flooding scheme, which is the core of thepresent work, is achieved through a customized Matlab script. The generated automatic procedure showsits effectiveness in improving oil recovery, expediting decision making and saving time and FD simulationruns. A three steps workflow is outlined to get the best water flooding scheme for the examples shownbelow. Copyright q 2008 John Wiley & Sons, Ltd.Received 13 March 2008; Revised 1 September 2008; Accepted 8 November 2008KEY WORDS: water displacement optimization; FD simulation; streamline simulation; Matlab automatedroutine; real-time decision making; quantitative and iterative adjustment of water rates tobe injectedINTRODUCTIONIn the last decades water flooding has been widely applied in the petroleum field, both in mature and in newly developed fields, and its attractiveness lies in supporting the entire field pressureduring depletion and in improving the final oil recovery [1–3]. The techniqueconsists in injecting water with the purpose of displacing and therefore producing oil, especially if the reservoir lacks an underlying aquifer able to counterbalance the depletion and to drive oil to the producer wells.To really understand a water flooding process and to predict its efficiency, it is useful to simulate it a priori. This is usually done via finite difference (FD) simulation, which is able to describe any kind of existing reservoir very accurately, but unfortunately is not able to give enough details about the way the flow occurs throughout the field. Recent works [4, 5] have proposed a newly developed approach, based on streamline simulation, whose main attraction lies in providing information not obtainable from FD simulation and useful for the purpose of improving reservoir performances.In the present study, water flooding simulation is performed via two commercial software: an FDand a streamline-based simulator, to highlight advantages and disadvantages of both simulationtechniques in describing a water injection campaign and to exploit the two approaches’ uniquenessin parallel. If FD simulation is essential to checking the streamline simulation results, the streamlinebasedsimulator is, on the other hand, an ideal tool to perform a procedure able to optimizewater injection. Then, the core of the work and its innovative approach lies in exploiting the twosoftware features in conjunction with the application of a customized Matlab code developed inorder to elaborate all the streamline simulation outputs, to calculate the changes to be made to theproduction/injection constraints for the subsequent simulation run, so as to iteratively converge tothe optimal injection scheme for the reservoir under study. A three steps workflow is outlined toget the best water flooding scheme for the examples shown below.FD APPROACH VERSUS STREAMLINE SIMULATIONECLIPSE is a complete and complex simulator, whose attractiveness resides in being able todescribe any kind of reservoir, including geological complexity, formation features, and fluidproperties. The simulator is based on a time and spatial discretization and solves a three-dimensionalequation by assigning to all the parameters involved in the simulation a unique value, associated withthe entire cell, for every grid block. For models with a large number of cells, using FD relaxationcan be computationally heavy; therefore, a good balance must be kept between having sufficientaccuracy in describing the reservoir and keeping simulation time within reasonable limits [6].3DSL, on the other side, solves two different equations on two different grids and this is usuallyfaster than FD simulation, especially for large models: the pressure equation is solved implicitlyon the background grid (or pressure grid), whereas the saturation equation is solved explicitly onthe streamline grid. This involves a minor effect of grid refinement on the resultsof the simulation,time-step limitations not as severe, thanks to a better stability of the geometrical grid, numericaldiffusion easier to control, faster solutions with respect to FD approach [7].Streamline simulation solves mono-dimensional equations along streamlines, which means itsolves multiple streamlines in parallel, and the fluid transport, which for FD approach occursbetween grid cells [8], occurs along streamlines: this gives an immediate answer in terms of howthe streamlines (connecting injector and producer wells—to say, well pairs) are distributed, sothat the fluid trajectories and their rates at the wells are known at every time step [9, 10]. Thanksto the available information, the distribution of injected water volumes can be modified, and amore effective production strategy can be planned to maximize oil recovery [4, 5]. Same as for FDsimulation, when using streamline-based simulation a good balance must be maintained betweenpressure updates and computational speed.In conclusion, 3DSL is simpler from a reservoir description (includes both flow physics andpetro-physical/geological information) point of view, but it cannot take into account importantparameters such as capillary pressure or cross flow effects: moreover, fluid compressibility cannot beeasily taken into account and mass conservation errors may occur while mapping between pressuregrid and streamline grid therefore being incomplete or inadequate for most of real reservoirs. Everyfurther detail can be found in previous works [11]. THE IDEA OF THE STUDYIn this paper the use of the two software as complementary tools to optimize water injectionis shown: ECLIPSE appeared to be the most reliable software to simulate reservoir models andto be essential to verify 3DSL’s results accuracy upstream and downstream of the methodologydeveloped for this research, while 3DSL has been shown to be simpler and usually faster, providinginformation not obtainable by means of FD simulation, and which could be exploited to save atrial-and-error process trying to find the best injection schemeThe idea of the study resulted from previous works [12].The research presented here follows a three step workflow. In the first part of the study, thetwo software were used to simulate simple synthetic models. Once the results obtained from thetwo simulators were checked for consistency, a method was developed to exploit 3DSL’s features.The most interesting pieces of information available from 3DSL are the connections between wellpairs (injector-producer) and the rates at the wells and the connections. With this informatioavailable, the streamline simulator, coupled with Matlab, was involved into an automatic procedurethat reallocated water injected volumes in order to optimize water injection campaigns, for all the examined cases.This was gained by a customized Matlab script, writtenfor this specific purpose, which automaticallyinteracted with the streamline simulator, processed the input data supplied by the softwaregiving back new input rates to be used for the following simulation run. This was done for a fixednumber of runs to iteratively converge to the optimal injection scheme. From preliminary analyses[13] the procedure was shown to be effectiveEventually, in the third experimental phase, the last rates calculated from Matlab were inputinto ECLIPSE to check the procedure’s effectiveness and the added val ue in terms of oil recoveryimprovement.THE AUTOMATED PROCEDURE AND THE EXPERIMENTAL METHOD Let’s now focus on the second and main part of the experimental study which, as we said, consistedin writing a customized Matlab code. Streamline answers in terms of streamlines distribution(connecting injector and producer wells—or well pairs) and fluid rates at the wells are writtenat every time step in a 3DSL output file named ∗.WAF, which is crucial for the entire codingdescribed below and for its application.The endeavor of the Matlab customized code is the optimization of the displacement processthrough a gradual reallocation of injected water rates, carried out by increasing the water volumeinjected at the highly efficient connections and decreasing it at the poorly efficient connections.The term injection efficiency (for a well pair connection) stands for the ratio between offset oilproduced thanks to water displacement and the amount of water injected at a certain well. In ananalogue manner the injection efficiency of an injector well is the ratio between offset oil at allproducers connected to it and the total water injected at the same well. The approach used forthe current application was aimed at increasing the oil production through a better use of a givenwater volume available for injection. The Matlab code written for this purpose mainly works asfollows: the data needed for the procedure are read from 3DSL’s output ∗.WAF file and loadedinto Matlab environment, then they are processed throughout the code; eventually new rates forthe next simulation run are output to 3DSL. This is all done automatically with an approach aimedat maximizing oil production through a more efficient use of a given water volume available forthe injection [13]. The code steps are here summarized [12]:1st step consists in: establishing the number of iterations to be run for the procedure of ratereallocation and their duration; fixing the volume of water to be injected and the target liquid rate.2nd step consists in: running a ‘do nothing’ 3DSL simulation in order to choose a properstarting time for the entire procedure of rate reallocation (usually the reallocation startswhereas aproduction plateau starts).3rd step consists in: reading (within the Matlab environment, by means of functions coded onpurpose) from the ∗.WAF file: rates (total rate for each injector well, and partial rate for eachproduction well connected to the injector); time; name and number of injector or producer wellsand connections between them; number of existing connections in the model at any time step ofthe simulation.4th step consists in: calculating the injection efficiency for each well pair, for each injector well,and for the field (average injection efficiency).5th step consists in: calculating for each iteration and for each injector well a new rate:Qnew i=(1+wi )·qoldi (1)where i stands for the well, wi for the weight it has been assigned, and qoldi for the rate injectedat the well at the previous step.The average reference field injection efficiency (referred to as signed e) is a mean value:depending on its value, positive or negative weights are assigned to the efficient or inefficient connections.Once the maximum weight, minimum weight, minimum injection efficiency allowed, maximum injection efficiency awaited, and _ (which is the grade of the polynomial that interpolates the relation weight-efficiency) are fixed, the weights are evaluated as follows:where wmin is the minimum weight at the least efficiency, wmax is the maximum weight at thehighest efficiency, emin is the least acceptable injection efficiency, emax is the highest awaitedinjection efficiency.6th step consists in: calculating new rates for each well pair connection and, consequently, foreach injector; calculating for each injector the differences between the last known rates and thenew ones; determining the new total volume of water injected as a summation of the new rates atthe injectors; checking that the constraints on the total water volume available (x) are satisfied byFigure 1. Weighting functions (as from Equations (2) and (3)) for different values of exponent_.introducing a correction factor c:c=_x qnew i(4)7th step consists in: calculating new liquid rates (for each producing well the novel rate iscalculated by adding/subtracting the same amounts of water rate, _q±, calculated for the injectorwells connected to it), imposing that the constraints on the total liquid volume (y) are satisfiedthrough the correction factor c1:c1= _y qnew i(5)8th step consists in: making Matlab write a text file to be included in the 3DSL dataset,summarizing all the new rates and time information.9th step consists in: running the reallocation procedure, following the eight steps listed above,for as many iterations as initially fixed (well rates and time are updated at every _t).Both _t and the set of parameters chosen at the 5th step affect the final results.For all the examples shown here, to signed e was allotted the average field efficiency value, inorder to have a case sensitive value. At the same time, _ was put equal to 2 for all the exam inedcases, so that the weighting function would be nonlinear and the most significant changes in injection rates would occur far-off from the average efficiency, while only small changes would take place around the mean value (Figure 1).For the examples shown below, parameter sensitivities were performed in order to get the bestset for the application of the Matlab code.RESERVOIR MODELS DESCRIPTIONIn this paper two synthetic models and a real one are presented.The numbers of cells for the synthetic models are 20×20×1 for the first case, and 123×54×1for the second case. A uniform discretization of the volume was chosen to accurately describe the phases present in both models are water and oil, which is supposed to be dead oil. Both water and oil have the same viscosity, equal to 1 cp. Oil and water density are, respectively, 780 and1029kg/m3. Datum pressure is equal to 30 bars. For both models, water and liquid constraints are set equal, to let the displacement occur by voidagereplacement, and correspond to 80.000rm3/day and to 150.000rm3/day, respectively. For both models the reallocation procedure starts at day 730;the number of steps, whose duration is 730 days each, is equal to 10.Similarly a real field was tested. The model was available from ECLIPSE; a translation work was done to obtain a model written for 3DSL. The two models were then checked to verify the coherence of the main parameters. Once the match was gained, 3DSL model was used to apply the procedure. The real model, as shown in Figure 4(a, b), is divided into three regions by the presence of faultsFigure 4. (a) Faults divide model three into three regions and (b) model three has three different regions.Figure 5. Permeability (a) and porosity map (b). Model three.The number of cells is 68×71×23. The grid cells are not uniform. Permeability and porosity arehighly heterogeneous and range from 0 to 1315mD and from 4 to 27%, respectively (Figure 5(a, b)).The other model properties are summarized in Tables I and II.Table II. Model three: main parameters.Swi (three regions) 0.13; 0.29; 0.06RESULTSThe three models examined were all used for the three steps workflow related before.First of all, the match and coherence between the two models were always obtained. At thispoint no relevant discrepancies were observed between the two sets of results for thethree models.Figure 6(a, b) shows, respectively, oil and water cumulative production from the third model only,as an example.At a second stage, Matlab code was applied to each 3DSL model, starting from a certain moment in time, fixed at day 730 for all the three examples. Ten iterations were run, each of them lasting730 days, and the total time for the procedure to run was fixed so as to be compared with the base case ‘do nothing’ simulation run.As for the frequency of the injection update, the longer the time step is, the higher the rates injected/produced and the major the changes concerning the values of well pairs injection efficiencies during the time steps. For the present work the well pairs injection efficiencies were assumed to remain constant throughout the single time step. Shorter time steps would maybe more suitable to this hypothesis but, on the other hand, they would imply a much higher computational time. In a real field application it might be useful to try with medium time steps (i.e. 6 months),eventually shortening them if, by analyzing the real-time field data, an intervention would appear to be needed.Each model was then compared with its respective optimized case, as shown in Figures 7–9(a, b).The figures again show, respectively, oil and water cumulative production from the field for the three models in sequence. For all the models the generated methodology was shown to give good results and to carry advantages with respect to the mere base case.The two synthetic cases showed good results both in terms of a relevant improvement in oil recovery and of a significant reduction in water production (the results are summarized in Tables III–V). Figure 10(a, b) shows the displacement of model two at the end of the simulation,for the base case and for the reallocated rates case, respectively.The real case, which at the time of this research was a pure forecast example, since the reservoir was not producing, so no production history was available, showed to gain a certain amount of oil production, but in parallel a higher water production.At the third stage the final rates observed from the 3DSL ‘optimized’ case were input in ECLIPSE, to double check the effectiveness of the optimization for the specific case. Figure 11(a, b)P. A. C. MARESCALCOFigure 6. Match ECLIPSE versus 3DSL: oil (a) and water cumulative production (b). Model three.Figure 7. Base case versus reallocated rates case: oil (a) and watercumulative production (b). Model one.Figure 8. Base case versus reallocated rates case: oil (a) and watercumulative production (b). Model two.RECOVERY THROUGH REAL-TIME WATER FLOODING OPTIMIZATIONFigure 9. Base case versus reallocated rates case: oil (a) and water cumulative production (b). Model three shows oil and water cumulative production for the second synthetic model, obtained with ECLIPSE before and after the reallocation procedure.For the synthetic models, whose ECLIPSE results downstream of Matlab procedure are as good as expected, the methodology proved to be valid.Figure 10. Oil displaced at the end of the simulation run: base case(a) and reallocated rates case (b). Model two.Figure 11. Reallocated rates case versus base case, ECLIPSE check simulation run, oil(a) and water cumulative production (b). Model two As for the real case, the results at this stage are not as good as expected. In the next paragrapha few comments on this will be remarked.DISCUSSION AND CONCLUSIONSLooking at the results, it can be generally said that the Matlab code written for this study has added value to the reallocation procedure, making it reliable and attractive for itsapplication in the petroleum industry. Previous works [12] conducted for fields under production and the two simpler examples reported here undoubtedly proved that reallocating water to optimize waterinjection is effective both for models with simpler reservoir features (incompressible fluids, simple geology) and for more complex cases (compressible fluids, heterogeneous formation): an in creased oil production was observed together with a reduced water production.As stated in the previous paragraph, for the real model, the optimized case with respect tothe base case shows a good improvement in oil recovery, but a parallel higher water production:the field in fact had not yet been deployed, so no real-time production neither geological no rpetrophysical information was provided. The reservoir features and the specific values assigned to the main reservoir parameters were then simply estimated: the values assigned to model parameters were a choice among other equally valid assessments. Last but not the least, ECLIPSE’s results certainly depend on the large amount of modifications done with respect to the original ECLIPSE model, modification necessary in order to comply with 3DSL’s binding simplifying hypotheses at the time the model ‘translation’ was doneThe aim of the research work of developing a completely automatic procedure to find the best scheme for the volumes to be injected and of using 3DSL coupled with Matlab and ECLIPSE as complementary tools proved to be effective and valid. The entire work represents a real help when a quick decision on a water flooding arrangement has to be made, both for injection campaigns yet to plan or for injection operations to be adjusted.If a reallocation procedure was to be performed only by means of ECLIPSE, a trial-and-error procedure would be needed, with a considerable waste of computational time and simulation runs.On the other hand, 3DSL allows for more simulations in parallel, saving computational time and redundant simulations.The present research in the future can be extended to a real case with a known production history to calibrate the best injection scheme.附录2 外文参考文献翻译提高油田采收率通过实时水驱优化帕米拉·阿卢嘉勒都灵理工大学摘要:提高油藏的采收率是强烈的欲望。

基于Matlab优化和Ansoft Designer仿真的小型化宽带和差网络设计

基于Matlab优化和Ansoft Designer仿真的小型化宽带和差网络设计

2 Malb 电路 优 化 结 合 An otDe t a sf —
s n r电路 仿 真 设 计 i e g
2 1 Ma lb和 An o tDe i n r介 绍 . ta s f sg e
利用 微波 电路 C AD设计 软 件 来进 行 电路 设计 既可 避免 繁琐 复杂 的 计算 过 程 , 能 利用 软 件 强 大 又 的 电路优 化和 电磁 场 仿 真功 能 得 到最 佳 结 果 , 到 达 事半 功倍 的效 果 , 次设计 采用 了 Malb优 化结 合 本 t a An ot 件仿 真 的方 式 。 sf 软 Malb功 能强 大 , 供 了一 个 人 机交 互 的数 学 t a 提 系统环 境 , 以矩 阵作 为基本 的数据 结构 , 以大大 并 可
卢 中华 , 畅游 李
( 舶 重 工 集 团 公 司 7 3所 , 州 2 5 0 ) 船 2 扬 2 0 1
摘 要: 主要 介 绍 了用 Ma a 和A sf ei e软 件 优化 设计 由 带状 线 实现 的 和差 网络 , 后 给 出 了一ቤተ መጻሕፍቲ ባይዱ种 8 t b no D s nr l t g 最 ~
Ba e n M a l b Op i i a i n a d An o t De i n r S m u a i n sd o ta tm z to n s f s g e i l to
LU on — a, Zh g hu LICha g yo n— u
( e 7 3 I s i t fCS C, n z o 2 0 1 Ch n ) Th 2 n t u e o I Ya g h u 2 5 0 , i a t
C+D和 信 号 、 A+B一 ( - 仰 角 差 信 号 和 A+ C4 D) C一( +D 方 位差信 号 。下面 介绍 和差 网络 的设 计 B )

最新matlab导线网程序

最新matlab导线网程序

m a t l a b导线网程序课程编号:课程性质:MATLAB及其应用课程论文学院:测绘学院专业:测绘工程姓名:学号:目录一、题目内容 (3)二、程序编写思路 (4)1、数学模型 (4)2、程序解析 (4)三、程序运行结果 (5)四、程序源代码 (6)注:这是《误差理论与测量平差基础》这一课程在学习其基本原理之后为解决实际问题而编写的一个程序。

一、题目内容要求:对于给出的导线控制网图2 ,根据已知条件和观测数据,设计平差方案,编制平差程序,给出平差结果,评定精度。

题目:A 、B 为已知点,已知点坐标已给出如下。

为待定点。

同精度观测了24个角度 ,测角中误差 。

测量了17条边长 ,其观测结果及中误差列于表4中,试按间接平差法求: (1)平差后单位权中误差;(2) 14个待定点的的坐标平差值及中误差;(3)平差后 边的相对中误差。

已知点坐标:X A =730.024 ,Y A =126.040 ,111.855=X B ,232.172=YB表一:导线网角度观测值表二:导线网边长观测值及精度 141~P P 241~L L "10βσ=171~S S 17S2 195.782 14 8 136.578 11.7 14 119.1 10.93 184.984 13.6 9 112.502 10.6 15 123.94 11.1 4 110.036 10.5 10 131.074 11.5 16 122.84 11.1 5 163.147 12.8 11 140.88 11.9 17 139.46 11.8 6 219.482 14.9 12 132.608 11.5图一:二、程序编写思路1、数学模型◆函数模型 观测方程 L=BX+d 误差方程 V B l =x◆随机模型2X X X XD =Q 0σ◆方程的解与精度评定令 PB B N T BB = pl W B T= 法方程即为 0ˆ=-W xN BB 可得解为:W BB xN 1ˆ-= 故可得平差结果:xX V L LXˆˆ,ˆ0+=+= 从而解得单位权中误差为T20V PV /Rσ 2X XX X D=Q 0σ2、程序解析◆计算框图三、程序运行结果◆平差后单位权中误差: = 5.30 (由于程序取的先验单位权中误差为10,两者相比较,故可以认为这个结果是可以接受的)◆14个待定点的坐标平差值及中误差见下表: 表三:表七:◆平差后S17边的相对中误差为:253451四、程序源代码这是要输入的文件◆%%从文件中输入数据fid1=fopen('E:\学习\平差\S3.txt','rt');[S1,count]=fscanf(fid1,'%f ',[7 24]); %#ok<NASGU> fclose(fid1);S1=S1';fid2=fopen('E:\ \学习\平差\S4.txt','rt');[S2,count]=fscanf(fid2,'%f ',[5 17]);fclose(fid2);S2=S2';[S3]=convert(S1);[X0]=daoxian(S2,S3);[B,l,P]=BBll(X0,S2,S1,S3);x=inv(B'*P*B)*B'*P*l;X=X0'+x/1000;disp(X);◆%%计算B,l,P 矩阵function [B,l,P]=BBll(X0,S2,S1,S3) %#ok<DEFNU>X10=[730.024126.040855.111172.232];for i=1:1:7if i<2S=sqrt((X0(1)-X10(1))^2+(X0(2)-X10(2))^2); B(1,1)=(X0(1)-X10(1))/S;B(1,2)=(X0(2)-X10(2))/S;l(1,1)=1000*(S2(1,2)-S);elseif i>6S=sqrt((X10(1)-X0(11))^2+(X10(2)-X0(12))^2);B(i,11)=-(X10(1)-X0(11))/S; %#ok<AGROW>B(i,12)=-(X10(2)-X0(12))/S; %#ok<AGROW>l(i,1)=1000*(S2(7,2)-S); %#ok<AGROW>elseif i>1&&i<7S=sqrt((X0(2*i-1)-X0(2*(i-1)-1))^2+(X0(2*i)-X0(2*(i-1)))^2); B(i,2*(i-1)-1)=-(X0(2*i-1)-X0(2*(i-1)-1))/S; %#ok<AGROW>B(i,2*(i-1))=-(X0(2*i)-X0(2*(i-1)))/S; %#ok<AGROW>B(i,2*i-1)=(X0(2*i-1)-X0(2*(i-1)-1))/S; %#ok<AGROW>B(i,2*i)=(X0(2*i)-X0(2*(i-1)))/S; %#ok<AGROW>l(i,1)=1000*(S2(i,2)-S); %#ok<AGROW>endendfor i=8:1:16if i<9S=sqrt((X0(13)-X10(3))^2+(X0(14)-X10(4))^2);B(8,13)=(X0(13)-X10(3))/S;B(8,14)=(X0(14)-X10(4))/S;l(8,1)=1000*(S2(8,2)-S);elseif i>15S=sqrt((X10(3)-X0(27))^2+(X10(4)-X0(28))^2);B(16,27)=-(X10(3)-X0(27))/S;B(16,28)=-(X10(4)-X0(28))/S;l(16,1)=1000*(S2(16,2)-S);elseif i<16&&i>8S=sqrt((X0(2*(i-1)-1)-X0(2*(i-1)-3))^2+(X0(2*(i-1))-X0(2*(i-1)-2))^2);B(i,2*(i-1)-3)=-(X0(2*(i-1)-1)-X0(2*(i-1)-3))/S;B(i,2*(i-1)-1)=(X0(2*(i-1)-1)-X0(2*(i-1)-3))/S;B(i,2*(i-1)-2)=-(X0(2*(i-1))-X0(2*(i-1)-2))/S;B(i,2*(i-1))=(X0(2*(i-1))-X0(2*(i-1)-2))/S;l(i,1)=1000*((S2(i,2)-S));endendS=sqrt((X0(19)-X0(5))^2+(X0(20)-X0(6))^2);B(17,5)=-(X0(19)-X0(5))/S;B(17,19)=(X0(19)-X0(5))/S;B(17,6)=-(X0(20)-X0(6))/S;B(17,20)=(X0(20)-X0(6))/S;l(17,1)=1000*(S2(17,2)-S);row=206.265;for i=1:1:24[M1]=fangweijiao(S1(i,6),S1(i,5),X0);[M2]=fangweijiao(S1(i,6),S1(i,7),X0);if S1(i,7)>0B(17+i,2*S1(i,7)-1)=-row*M2(1);B(17+i,2*S1(i,7))=row*M2(2);endif S1(i,5)>0B(17+i,2*S1(i,5)-1)=row*M1(1);B(17+i,2*S1(i,5))=-row*M1(2);endif S1(i,6)>0B(17+i,2*S1(i,6)-1)=row*M2(1)-row*M1(1);B(17+i,2*S1(i,6))=-(row*M2(2)-row*M1(2));endL0=M2(3)-M1(3);if L0<0L0=360+L0;endl(17+i,1)=3600*(S3(i,2)-L0);endfor i=1:1:17P(i,i)=100/S2(i,3)^2; %#ok<AGROW>endfor i=18:41P(i,i)=1; %#ok<AGROW>endend◆%%单位转换function [S3]=convert(S1)for i=1:24S3(i,1)=S1(i,1);S3(i,2)=(S1(i,2)+S1(i,3)/60+S1(i,4)/3600); end◆%%计算坐标近似值function [X0]=daoxian(S2,S3) %#ok<FNDEF>X10=[730.024126.040855.111172.232];t=180+atand((X10(2)-X10(4))/(X10(1)-X10(3)));t1=t;for i=1:1:6if S2(i,5)>0t1=t1+S3(S2(i,4),2)+S3(S2(i,5),2)-180;elset1=t1+S3(S2(i,4),2)-180;endif t1<0t1=t1+360;endif i<2X0(1)=X10(1)+S2(1,2)*cosd(t1);X0(2)=X10(2)+S2(1,2)*sind(t1);endif i>=2X0(2*i-1)=X0(2*(i-1)-1)+S2(i,2)*cosd(t1);X0(2*i)=X0(2*(i-1))+S2(i,2)*sind(t1);endendt2=t;t2=t2-S3(12,2);if t2<0t2=t2+360;endfor i=8:1:15if i<9X0(2*(i-1)-1)=X10(3)+S2(i,2)*cosd(t2);X0(2*(i-1))=X10(4)+S2(i,2)*sind(t2);endif i>8t2=t2+S3(S2(i,4),2)-180; %#ok<NASGU>if t2<0t2=t2+360;endX0(2*(i-1)-1)=X0(2*(i-2)-1)+S2(i,2)*cosd(t2); X0(2*(i-1))=X0(2*(i-2))+S2(i,2)*sind(t2);endend◆%%计算方位角function [M]=fangweijiao(a,b,X0) %ÓÃ-1´ú±íAµã£¬ÓÃ0´ú±íBµãX10=[730.024126.040855.111172.232];if a>-1&&a<1X1=X10(1); %#ok<NASGU>Y1=X10(2); %#ok<NASGU>endif b>-1&&b<1X2=X10(1); %#ok<NASGU>Y2=X10(2); %#ok<NASGU>endif a>-2&&a<0X1=X10(3); %#ok<NASGU>Y1=X10(4); %#ok<NASGU>endif b>-2&&b<0X2=X10(3); %#ok<NASGU>Y2=X10(4); %#ok<NASGU>endif a>0X1=X0(2*a-1);Y1=X0(2*a);endif b>0X2=X0(2*b-1);Y2=X0(2*b);enddeltaX=X2-X1;deltaY=Y2-Y1;S=deltaX^2+deltaY^2;xishux=deltaY/S;xishuy=deltaX/S;if deltaX>0&&deltaY>0T=atand(deltaY/deltaX);endif deltaX<0&&deltaY>0T=180-atand(deltaY/(-deltaX));endif deltaX<0&&deltaY<0T=270-atand((-deltaX)/(-deltaY));endif deltaX>0&&deltaY<0T=360-atand(deltaY/(-deltaX));endM(1)=xishux;M(2)=xishuy;M(3)=T;end◆%%输出结果fid=fopen('C:\Documents and Settings\Administrator\桌面\输出结果2.txt','wt');fprintf(fid,'点号 X(m) Y(m) 中误差X(cm) 中误差Y(cm) 点位中误差 \n');fprintf(fid,' %d %11.4f %11.4f %5.4f %5.4f %5.4f\n',(jieguo2)');fclose(fid);◆关于matlab的画图的应用,由于本程序不需要用到,故,单独写了个程序如下:t=-3*pi:pi/10:3*pi; %自变量数组中,存在0值y=sin(t)./t; % 在t=0处,将产生非数。

一种基于matlab的改进的水准网平差程序设计与实现

一种基于matlab的改进的水准网平差程序设计与实现

Geomatics Science and Technology 测绘科学技术, 2019, 7(4), 179-185Published Online October 2019 in Hans. /journal/gsthttps:///10.12677/gst.2019.74024Design and Implementation of a Leveling Net Adjustment Program Based on MATLABLiangliang Li, Henglin Guo, Lihua WangCollege of Geomatics, Shandong University of Science and Technology, Qingdao ShandongReceived: Aug. 31st, 2019; accepted: Sep. 16th, 2019; published: Sep. 23rd, 2019AbstractIn order to calculate the leveling net data efficiently and accurately, by analyzing the data struc-ture of leveling net, a further improvement is made to the adjustment program of MATLAB leve-ling net. Based on the principle of indirect adjustment, GUI function is used to implement leveling network adjustment. It solves the problem that in the general MATLAB adjustment program, it needs to manually replace the name to adjust. The application of real data in the experiment proves the correctness and practicability of the program, which has certain reference and guiding significance for MATLAB mapping data processing.KeywordsLeveling Net Adjustment, Least Square Method, MATLAB一种基于MATLAB的改进的水准网平差程序设计与实现李亮亮,郭恒林,王利华山东科技大学测绘科学与工程学院,山东青岛收稿日期:2019年8月31日;录用日期:2019年9月16日;发布日期:2019年9月23日摘要为了高效准确地计算水准网数据,通过分析水准网的数据结构,对常规的MATLAB水准网平差程序做了进一步的改进,重点研究了已知水准点点名为字母的情况下,误差方程系数矩阵与常数项的建立方法。

实验一matlab完成水准网平差

实验一matlab完成水准网平差

实验一matlab完成水准网平差实验一 matlab完成水准网平差实验数据:水准网有2个已知点,3个未知点,7个测段。

已知点高程H1=5.016M H2=6.016h1=1.359; h2=2.009; h3=0.363; h4=1.012; h5=0.657; h6=0.238; h7=-0.595;S1=1.1 S2=1.7 S3=2.3 S4=2.7 S5=2.4 S6=1.4 S7=2.6求解(1)求个待定点高程,H5的高差中误差;3、4号点的高程中误差。

课程设计内容1、平差程序设计思路:使用间接平差法求解(1)由题意知必要观测数t=3,选取3、4、5号点高程X1、X2、X3为参数。

(2)误差方程:V1=x1v2=x2v3=x1v4=x2v5=x2-x1+h2-h1-h5v6=x3-x1v7=-x3(3)取1M 的观测高程为单位权观测,即 p=1/s;(4)求法方程:Nbbx-W=0 Nbb=b’pbW=b’pl(5)求的平差值x=Nbb^-1*W L=l+V V=bx-l (6)高差权函数式:k=-x1+x2(6)求中误差:单位权中误差δ0,协因数阵Nbb^-1.求得中误差δ2、平差程序流程代码说明:h1=1.359;h2=2.009;h3=0.363;h4=1.012;h5=0.657;h6=0.238;h7=-0.595;H1=5.016H2=6.016h=[h1 h2 h3 h4 h5 h6 h7]'s=[1.1 1.7 2.3 2.7 2.4 1.4 2.6]'B=[1 0 0 ;0 1 0;1 0 0;0 1 0 ; -1 1 0 ; -1 0 1 ;0 0 -1 ] p=diag(1./s)l=[0;0;4;3;7;2;0]W=B'*p*lNbb=B'*p*Bx=inv(Nbb)*WV=(B*x-l)H=h+V/1000Q=inv(Nbb)n=7;t=3;j=V'*p*Vd= sqrt(j/4)f=[-1 1 0]'q=f'*Q*fD=d*sqrt(q)D1=d*sqrt(Q)(3) 平差程序流程代码说明: clc cleardisp(‘观测高差,单位m’)h1=1.359;h2=2.009;h3=0.363;h4=1.012;h5=0.657;h6=0.238;h7=-0.595;H1=5.016 % 已知点高程,单位mH2=6.016 % 已知点高程,单位mh=[h1 h2 h3 h4 h5 h6 h7]'s=[1.1 1.7 2.3 2.7 2.4 1.4 2.6]' %S是线路长度disp(‘系数矩阵B、l’)B=[1 0 0 ;0 1 0;1 0 0;0 1 0 ; -1 1 0 ;-1 0 1 ;0 0 -1 ]p=diag(1./s) %定义权阵l=[0;0;4;3;7;2;0]W=B'*p*lNbb=B'*p*Bdisp(‘参数的解’)x=inv(Nbb)*WV=(B*x-l) % 误差方程(mm)。

基于MATLAB的水准网和测边网平差程序设计

基于MATLAB的水准网和测边网平差程序设计

基于MATLAB的水准网和测边网平差程序设计摘要MATLAB是目前在研究机构广泛应用的一种数值计算及图形工具软件,它的特点是语法结构简明、数值计算高效、图形功能完备,特别适合非专业编程员完成数值计算、科学试验处理等任务。

以往的测量数据处理方法需要编制特定的处理矩阵运算程序,而且程度复杂,难度大。

本文介绍一种基于MATLAB的水准网和测边网的程序设计方法,与其它算法语言相比,具有编程简单,运算速度快的特点。

文中分别阐述了水准网和测边网程序的理论基础、实现步骤和运行结果。

通过实例的分析,总结出利用MATLAB对测量数据处理有很大的应用价值,它缩短了编程的时间,提高工作效率。

关键词:MATLAB;水准网;测边网;程序设计ABSTRAC TMATLAB is one species of numerical-values calculation and graphic tools software which is widely used to apply at research institutions at present. The particularities are: concise grammar-structure、highly efficient in numerical values calculating、complete function of graphs、especially it is adapted to evildoing professional programmer to accomplish the tasks that are numerical-values calculating and scientific experiments treating. The ancient methods of measured data-processing need establishing special proceedings of treating matrices operation, moreover, it is complex and greatly difficult.This article introduces one programming method dealing with leveling and measuring edge network based on MATLAB. Compared with other algorithm language, it has particularities which are simply programming and quickly operating. The article separately expatiate the theories basics、realizing steps and running results at leveling and measuring edge network. With the analysis of examples, it has prodigious application value in measured data-processing by use of MATLAB. Moreover, it shortens programming time and improves working effectiveness.Key words:MATLAB;leveling network;measuring edge network;programming目录绪论 (4)1. MATLAB软件简介 (5)2.MATLAB 在测量平差中的应用 (6)2.1测量平差原理的概述 (6)2.2平差程序总体方案 (7)3.1程序的功能 (8)3.2水准模型网的间接平差 (8)3.2.1 “权”值的确定 (8)3.2.2 水准路线的平差计算 (9)3.2.3 精度评定 (11)3.3水准网间接平差程序信息设计 (11)3.4 水准网程序与使用说明 (12)3.4.1 水准网程序流程图 (12)3.4.2 水准网程序的使用 (12)3.5案例 (13)4. 测边网平差程序设计 (15)4.1数学模型 (15)4.1.1 误差方程和法方程的组成 (15)4.1.2 边长观测的权 (15)4.1.3 解算法方程 (16)4.1.4 精度评定 (19)4.2 测边网平差信息设计 (20)4.2.1 主要的技术要求 (21)4.3利用MATLAB的绘图语句绘制网图 (21)4.4测边网程序和使用说明 (22)4.5 程序代码说明: (23)4.6程序的使用算例 (25)结论 (29)致谢 (30)参考文献 (31)附录一 (32)附录二 (36)附录三 (46)绪论作为一名测量技术人员,如果不掌握一门PC机编程语言与便携计算工具,要想提高测量工作的效率几乎寸步难行。

基于Matlab的导线网平差程序设计_李建章

基于Matlab的导线网平差程序设计_李建章

第29卷 第4期2010年8月兰州交通大学学报J ou rnal of Lanzh ou Jiaotong UniversityV ol.29N o.4A ug.2010 文章编号:1001-4373(2010)04-0088-03基于M atlab的导线网平差程序设计*李建章(兰州交通大学土木工程学院,甘肃兰州 730070)摘 要:导线网数据量大,网形复杂多变,其数据处理过程大多涉及到矩阵的计算.利用VC、VB等编程语言进行导线网程序的开发,算法比较复杂.基于M atlab平台,利用其强大的矩阵处理能力,设计出导线网数据结构,此基础上进行导线网平差程序的设计与开发,减小了代码编写的工作量.关键词:导线网;数据结构;平差;程序设计中图分类号:P209 文献标志码:A 导线网网形灵活多变,在城市测量中应用非常广泛.通常情况下,其外业观测数据量大,数据处理过程中大多涉及到矩阵的计算,且由于导线网网形的不确定性,因此其程序设计非常复杂[1].本文总结导线网的规律,设计出通用数据结构,并基于Matlab 强大的矩阵计算能力,编制了导线网数据处理程序. 1 导线网数据结构设计导线网由导线点、导线边和角度3类要素构成,其中导线边包括起点和终点,角度包括左边和右边.要使程序能对于任意形状的导线网进行处理,首先需要设计数据结构,以存储相关数据.这些数据包括起算数据、观测数据和网形各要素连接关系等,它们都是导线网各要素的属性值.本文用3个表来存储各要素,如表1-3所示.表1 点表数据结构Tab.1 Data structure of points序号字段类型备注1点名称整型2初始纵坐标浮点3初始横坐标浮点4已知点标志整型1为已知点,0为未知点5平差纵坐标浮点6平差横坐标浮点表2 角度数据结构Tab.2 Data structure of angles序号字段类型备注1角度编号整型2左边整型3右边整型4角度浮点度分秒表3 边数据结构Tab.3 Data structure of lines序号字段类型备注1导线边编号整型2起点整型3终点整型4边长浮点5方位浮点弧度6纵坐标增量浮点7横坐标增量浮点 表1-3中分别存储在ptTab,lineTab,angleTab 矩阵中,保存为.mat文件,程序运行时加载[2].2 近似坐标计算近似坐标的计算是导线网平差中关键的一个环节.其精度直接影响到后续平差计算的点位精度和迭代平差工作量大小.近似坐标计算包括近似方位角的计算和近似坐标的计算两个步骤.2.1 近似方位角计算近似方位角的计算以角度为单位,将已知方位传递到网中每一条边.设某角度一边方位已知,而另一边方位未知,由于两边夹角已知,可计算出未知边的方位.图1所示为4种可能情况.图1 方位角计算4种情况Fig.1 Four situation of azimuth angle calculation*收稿日期:2010-04-06作者简介:李建章(1974-),男,甘肃会宁人,讲师.第4期李建章:基于M atlab 的导线网平差程序设计假定已知左边方位角为fw 1,夹角为α,则以上4种情况下右边的方位角f w r 讨论如下.情况一:fw r =fw 1+α(1)情况二:fw r =fw 1+α(2)情况三:fw r =fw 1±π+α(3)情况四:fw r =fw 1±π+α(4)同理可得,已知右边方位角计算左边方位角的情况,也有4种可能性.程序根据角度两边的端点点名的关系判断以上8种情况,采用相应的计算公式计算未知边方位角[3].程序在获得未知边方位角后,将计算结果保存到边表相应记录中.然后在角度表中搜索相邻角度,搜索条件是:该角度的一边必须是上一角度的一边,而另一边不是上一角度的一边.查询到满足条件的角度后,判断其是否为截至角(两边方位已知),如否则计算出该角度未知边方位,重复前面的步骤直至某一截至角停止.然后在边表中查询有无近似方位未知的边,如有,再次执行以上步骤,直至边表中所有边近似方位计算完毕,这个过程可以通过一个函数自身迭代来实现.程序流程如图2所示.图2 计算近似方位流程图Fig .2 Flow chart of calculating azimuth angle计算导线边方位的子程序如下所示:functio n [ptT ab ,angleT ab ,lineT ab ,ok ]=g etfw0(pt -T ab ,ang le T ab ,lineT ab )[baindex ]=getanglebeg in (angleT ab ,line Tab );%查找起算角[ok ,ptT ab ,line T ab ,ang le T ab ]=caculateFW0(baindex ,ptT ab ,line Tab ,ang le Tab );%由起算角往前传递方位.if no t (fwisok (lineTab ))%判断有没有方位未知的导线边 [ptT ab ,ang leT ab ,lineT ab ,ok ]=getfw 0(ptT ab ,a n -gleT ab ,lineT ab ); %函数迭代计算.end end2.2 近似坐标计算通过2.1计算,所有导线边的近似方位计算完毕,此时可以利用每条边的边长和近似方位计算其坐标增量,这个过程只需要在边表中循环计算即可.然后以导线边为单位,从起始边出发,将已知坐标传递到各未知点.所谓起始边即该边一端点坐标已知,另一端点坐标未知.利用导线边坐标增量计算未知点坐标,然后查找相邻边,判断其是否为截至边(两端点坐标皆知),如否,计算未知点坐标.重复查找计算直至截至边,然后程序在点表中判断有无近似坐标未知的点,如有,则重复以上步骤,否则程序退出.这个过程和2.1中计算方位角的过程是类似的,因此不再列出程序流程图和代码.3 误差方程系数矩阵计算导线网观测值有角度和边长两种类型,一个观测值可列出一个误差方程.因此程序需分别读取角度表和导线边表中每个记录来计算误差方程系数矩阵B 、常数项矩阵l 和权阵P .3.1 利用观测角度计算误差方程系数矩阵设某角度观测值为ang le ,其左边近似方位、左边长、左边起点点名,左边起点点序号,左边终点点名,左边终点点序号,左边坐标增量分别为:lfw ,ls ,lbname ,lbindex ,lename ,leindex ,ldetx ,ldety ,同理对应右边各项为:rfw ,rs ,rbname ,rbindex ,rename ,reindex ,rdetx ,rdety .由图1可知,各观测角度两边的方向有4种情况,为简化程序,首先将其全部转化为情况1.设转换后左导线边起、终点序号分别为tem lbindex ,tem -leindex .右导线边起、终序点号分别为tem rbindex ,temreindex .如下是图1第三种情况的转换代码.if lename ==rbname temlbindex =leinde x ; temleindex =lbinde x ; tem rbindex =rbindex ; tem reindex =reindex ; lde tx =(-1)*lde tx ; lde ty =(-1)*lde ty ; rdetx =rdetx ;89兰州交通大学学报第29卷 rdety =rdety ; lfw =lfw +pi (); rfw =rfw ;end设该角度序号为index .又左边起点、终点和右边起点、终点的未知数序号分别为:lbcontrindex ,le -contrindex ,rbco ntrindex ,recontrindex .则B (index ,(2×leco ntrindex -1))=ρΔy L 1000s 2L B (index ,(2×leco ntrindex ))=-ρΔx L1000s 2L B (index ,(2×reco ntrindex -1))=-ρΔy R1000s 2RB (index ,(2×reco ntrindex ))=-ρΔx R1000s 2RB (index ,(2×lbcontrindex -1))=ρΔy R 1000s 2R -ρΔy L1000s 2L B (index ,(2×lbcontrindex ))=-ρΔx R 1000s 2R +ρΔx L1000s 2L angle 0=r f w -l f wl (index ,1)=(angle 0-ang le )×180×3600πP (index ,index )=1[4]上述各点如为已知点,则对应系数为0.未知点序号为所有待求点的排列序号,用于控制误差方程系数在B 矩阵中的列位置.3.2 利用观测边长计算误差方程系数矩阵设某观测边坐标增量为Δx ,Δy ,观测边长为S ,S 0=Δx 2+Δy 2,则B (index ,(2×lbco ntrindex -1))=-ΔxS 0(5)B (index ,(2×lbco ntrindex ))=-ΔyS 0(6)B (index ,(2×leco ntrindex -1))=ΔxS 0(7)B (index ,(2×lecontrindex ))=ΔyS 0(8)l (index ,1)=1000×(S 0-S )(9)P (index ,index )=S100[5](10)其中已知点对应项系数为0,其中index 为观测边序号,观测边序号是该边在边表中序号加上角度观测值个数.lbcontrindex 和leco ntrindex 为该边起点、终点的未知点序号.以上过程需要一个循环语句即可完成.4 结束语本文基于Matlab 开发了导线网平差程序,算法简单,编程工作量小[6].对于测绘专业类似计算问题如三角网、水准网等的程序设计有一定的借鉴意义.由于篇幅的限制,本文没有论述其他相关处理过程的算法,包括利用误差方程迭代计算获取最优解、度分秒和弧度互化、边点要素属性的查询等,这些算法在M atlab 中实现相对比较容易.参考文献:[1] 汪自军,陈圣波,臧立娟,等.导线网数据处理系统关键技术及其实践[J ].微计算机信息,2008(2):216-218.[2] 李建章.基于M a tlab 的水准网平差程序设计[J ].兰州交通大学学报,2009,28(3):29-31.[3] 武艳强,黄立人,江在森.导线网平差中近似坐标的无限定推算方法[J ].测绘通报,2006(12):12-15.[4] 武汉大学测绘学院测量平差学科组.误差理论与测量平差基础[M ].武汉:武汉大学出版社,2003:102-125.[5] 姚德新.土木工程测量学教程[M ].北京:中国铁道出版社,2003:67-68.[6] 薄志义,曹福生.程序寻找支导线网计算路径的研究[J ].测绘科学,2007(9):68-69.Adjustment Programming of Traverse Network on the Basis of MatlabLI Jian -zhang(Sch ool of Civil En gineering ,Lanzhou Jiaotong University ,Lanzh ou 730070,China )A bstract :H aving large data and complex shape ,the data pro cessing of traverse netw o rk involves matrix cal -culation .It 's mo re difficult to prog ram on o ther prog ramming lang uages like VC and VB .In the e ssay ,the data structure o f traverse netw ork is desig ned by utilizing the matrix dispo sal capability of M atlab ,and thenthe prog ram that has the adv antag es of being simple in algo rithm is finished .Key words :trave rse ne tw ork ;data structure ;adjustment ;pro gramming90。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
A b s t r a c t : Wi t h t h e r a p i d d e v e l o p m e n t o f t h e m o d e r n s o c i e t y , t h e v a r i o u s c o n s t r u c t i o n p r o j e c t s m o r e a n d m o r e t o t h e l a r g e—s c a l e d e —
Ad j u s t me n t B a s e d o n MAT L AB
W ANG P e n g—l e i
( X i a n U n i v e r s i t y o f S c i e n c e A n d T e c h n o l o g y , X i a n 7 1 0 0 5 4 , C h i n a )
p l e t e t h e a d j u s t m e n t o f t r a v e r s e n e t w o r k b se a d o n i n d i r e c t a d j u s t me n t a n d i n d i r e c t a d j u s t m e n t w i t h r e s t i r c t i o n s .
王 鹏 磊
( 西安科技大学 , 陕西 西安 7 1 0 0 5 4 )
摘 要: 随着现代社会 的快速发展 , 各项 建设工程越 来越 向大型化发展 , 导线 网的布设 与施测也 越 来越 复 杂 , 其 精度要 求也越来越 高。但是 , 传统 的导 线网平差程序 难 以解算一 些特 殊 的导线 网数据 , 如导线 网 中加 测 陀螺 定
中图分类号 : P 2 0 7
文献标 识码 : B
文章编号 : 1 6 7 2— 5 8 6 7 ( 2 0 1 4 ) 0 4— 0 1 9 8— 0 4
I mp r o v e d Pr o g r a m De s i g n o f Tr a v e r s e Ne t wo r k
向边、 导线网 中部 分点位 只有距 离观测或 角度 观测值 等。本文鉴 于 MA T L A B在 处理数据 方 面的优 势 , 基 于间接 平差和 附有限制条件 的间接 平差两种平 差模型 , 实现 了对各种类型导线 网的平差处理。
关键 词 : MA T L A B; 导线 网; 间接 平 差
第3 7卷 第 4期
2 0 理 信 息
GE oMA Tl CS& S P AT l A L l NFO RMA T l l oN T EC HNoL oGY
Vo 1 . 3 7, No . 4
Ap r .,2 01 4
基 于 MA T L A B 的 改 进 导 线 网 平 差 程 序 设 计
w o r k d a t a,s u c h a s t r a v e r s e n e t wo r k b y me a s u in r g t h e g y r o s c o p i c d i r e c t e d e d g e ,t r a v e r s e n e t w o r k i n w h i c h s o me p o i n t s o n l y f r o m d i s — t a n c e o r a n g l e o f o b s e r v a t i o n s .I n t h i s p a p e r ,i n v i e w o f t h e a d v a n t a g e s o f MAT L AB i n t h e p r o c e s s i n g o f d a t a, I u s e d MA T L AB t o c o m—
v e l o p me n t ,t h e l a y o u t o f a n d c o n s t r u c t i o n s u r v e y o f t r a v e r s e n e t w o r k i s a l s o mo r e a n d mo r e c o mp l e x,i t s a c c u r a c y r e q u i r e me n t s ls a o
Ke y w o r d s : L MA T L A B; t r a v e s r e n e t w o r k ; i n d i r e c t a d j u s t m e n t
0 引

1 ・ 1 间接 平 差
间接平 差 的基 础方 程为 : V= 一z; B PV=0;
g e t t i n g h i g h e r a n d h i g h e r .H o w e v e r , t h e t r a d i t i o n a l t r a v e r s e n e t w o r k a d j u s t m e n t p r o g r a m c a n n o t c a l c u l a t e s o me s p e c i a l t r a v e r s e n e t —
相关文档
最新文档