基于MatrixVB的测量平差程序设计与实现
VB测量平差程序设计讲稿
Case 0 '读入观测值文件Text1.Visible = FalseCommonDialog1.ShowOpenfname = CommonDialog1.FileName '将用户在"打开"对话框中选择的文件名对变量fname赋值If fname <> "" Then '若无此判断当对话框中选择取消时、下面赋值语句将出错Set ts = fso.OpenTextFile(fname) '将fname作为文本文件打开,并设置句柄j = 0: k = 0: p = 0: h = 0'j是测站数累计变量,k是已知点累计变量,l(j)、ns(j)分别是方向值、边长累积计数Do While ts.AtEndOfLine <> True '前测型循环,进入循环的条件是没有读到文件结束尾B = ts.ReadLine '读一行,置入bB = Trim(B): i = 1: '删除B可能有的前导和尾随空格,i是工作变量,m(i) = InStr(B, ",") '查行中第一个逗号的左数位置,并保存在整形数组变量m(i)Do While m(i) <> 0 '前测型Do... Loop循环,成立条件是该行字符串中有逗号tr(i) = Mid(B, m(i - 1) + 1, m(i) - m(i - 1) - 1) '提取指定位置开始的指定数目字符。
i = i + 1m(i) = InStr(m(i - 1) + 1, B, ",") '从上一个找到的逗号位置起,查找下一个逗号的位置LoopIf m(i) = 0 And i > 1 Then tr(i) = Right(B, Len(B) - m(i - 1)) '处理一行中最后一个逗号后的字符串'以下部分是将存储在数组变量m(i)中的字符分类存放到方向、边长、已知坐标、网型信息等数组中If p = 0 Then '读到的是文件第一行。
基于VB语言的施工测量应用程序设计
Shell App.Path & "\DATA\qt\ 位于圆曲线斜交盖梁 长度和两端点桩号及座标计算 .EXE", vbNormalFocus End Sub Private Sub hgljs_Click() Shell App.Path & "\DATA\qt\ 缓和曲线盖梁长度计 算 .EXE", vbNormalFocus End Sub Private Sub hpjs_Click() Shell App.Path & "\DATA\lx\ 高速公路超高横坡计 算 .EXE", vbNormalFocus End Sub Private Sub jyszpc_Click() Shell App.Path & "\DATA\pc\ 简易水准平差 .EXE", vbNormalFocus End Sub Private Sub LXSJPC1_Click() Shell App.Path & "\DATA\zh\ 菱 形 三 角 平 差 (1). EXE", vbNormalFocus End Sub Private Sub LXSJPC2_Click() Shell App.Path & "\DATA\zh\ 菱 形 三 角 平 差 (2). EXE", vbNormalFocus End Sub Private Sub mnuaboat_Click() frmAbout.Show 1 End Sub Private Sub mnuend_Click() End End Sub Private Sub pqxjs_Click() Shell App.Path & "\DATA\lx\ 平 曲 线 计 算 .EXE", vbNormalFocus End Sub Private Sub razhrjs_Click() Shell App.Path & "\DATA\qt\ 卵形线与钻桩或路基 计算 .EXE", vbNormalFocus End Sub Private Sub sbspc_Click() Shell App.Path & "\DATA\pc\ 三 边 锁 严 密 条 件 平 差 .EXE", vbNormalFocus End Sub Private Sub sjspc_Click() Shell App.Path & "\DATA\pc\ 三角锁严密平差 .EXE", vbNormalFocus
基于MatLab的测量平差课程教学方法探讨
872019年4月总第311期ISSN1672-1438CN11-4994/T基于MatLab 的测量平差课程教学方法探讨王俊锋 贾文祥黄河交通学院交通工程学院 河南焦作 454950摘 要:针对测量平差课程理论性强、公式多、计算难度大等特点,传统的教学方法难以取得理想的教学效果。
通过分析测量平差教学中存在的问题,提出将MatLab 应用到测量平差课程教学中;并举例说明借助MatLab 在测量数据处理方面的优越性和实用性,有利于加深学生对知识的理解,提高学生的实践和创新能力,使测量平差教学达到良好效果。
关键词:MatLab ;测量平差;教学方法;教学实践作者简介:王俊锋,工学硕士,助教;贾文祥,工学硕士,助教。
测量平差是测绘工程专业一门必修的专业基础核心课程,为测绘类专业领域内其他课程提供数据处理的基础。
本课程是测绘学科的基础理论,对该课程掌握的好坏直接关系到测绘人才培养的质量[1]。
测量平差课程涉及高等数学、线性代数、概率论与数理统计以及测量学基础等课程知识,是应用数学理论与计算方法在测量数据处理中的典型应用,这也导致了该课程具有理论性强、公式推导多、计算难度大的特点[2],给教学带来了较大的困难。
因此,除了对平差基本原理和方法的讲授,测量平差课程教学要偏重对工程实践能力的培养,这要求必须在知识的传授方法上进行改革[3,4]。
随着计算机技术不断被引入测量领域,近几年部分高校已经将测量平差软件应用到测量平差课程的教学过程中,取得了一些成效。
但绝大部分测量平差软件只关注原始数据的输入和结果的输出,缺少平差计算过程,并不适合进行教学[5]。
MatLab 是一款高性能数值运算软件[6],具有强大的矩阵运算、绘图、数据分析和可视化、动态仿真等功能,能拓宽学生知识面,培养创新思维[7],功能强大的统计工具箱和简单的编程语言可以方便地进行测量数据处理。
将MatLab 应用于教学可以节省课堂授课时间,学生在实践过程中也易于加深理解,使测量平差课程教学达到很好的效果。
基于VB的间接平差程序设计
毕业论文论文题目基于VB的间接平差程序设计专业班级工程测量学生姓名黄晓伟指导教师王克晓完成时间2015年5月5日重庆能源职业学院重庆能源职业学院毕业设计(论文)指导教师评语评语:成绩:指导教师签名:年月日重庆能源职业学院毕业设计(论文)答辩记录目录摘要 (1)1 引言 (2)1.1 现状分析 (2)1.2 目的及意义 (3)1.3 研究内容 (4)2 Visual Basic编程语言概述 (5)2.1 Visual Basic简介 (5)2.2Visual Basic程序设计简述 (8)3 间接平差 (25)4.1 平差软件整体展示 (29)5算例演算 (32)5.1水准网间接平差 (32)6 结论 (34)测量平差是测绘类专业的一门重要的专业基础课程,是用于观测数据处理的一门应用数学。
但是因为其计算量比较大,这变使大家在学习和使用的时候感觉十分头疼。
虽然有很多简化了的平差算法,比如高斯约化法,但是这些算法一方面会影响计算精度,另一方面也不能有效的减少计算量。
平差计算是利用最小二乘原理消除观测值与起算数据之间的矛盾,求出各待定元素的平差值并评定精度。
而在经典测量平差中,主要研究四种平差模型方程(条件平差、间接平差、附有未知参数的条件平差和附有限制条件的间接平差)的列立和求解,其牵涉到大量的矩阵运算,传统的人工计算工作量很大。
随着计算机的出现,矩阵运算就变得轻松,而且计算机的运行速度快,精度高,特别是对于具有大量矩阵运算,计算机轻松解决。
前提是要编好相应的程序代码。
本文运用visual basic语言编制了一个平差软件,主要对水准网和附合导线进行了平差的编制和软件程序界面的设计,实现的功能主要有对水准网数据和附合导线数据的平差计算,当然为了平差后能使用数据,本软件还设计了数据输出的功能,使界面更友好,方便用户使用。
关键词:水准网间接平差,visual basic ,visual basic界面设计(GUI)1.1 现状分析Visual Basic是一种由微软公司开发的包含协助开发环境的事件驱动编程语言。
基于VB精确评定平面度误差
(上接第 249 页) [3]Vincent Beau, Mark Singer, Reduced resolution and scale space for dominant feature detection in contours , Pattern Recognition[J], 2001, 34(2): 287- 297. [4]朱亚云,方承远. Windows 环境下实现实时数据采集的可行性 [J].上海理工大学学报.1999, 21(2):153- 158 [5]严蔚敏,吴伟民.数据结构[M].清华大学出版社.1992. [6]张永强,李学东,刘富军.应变实验数据采集与处理系统的硬件 设计与实现[J]微计算机信息.2005,1:65- 66 [7]杨琨超,毕荣.电力电缆(电线)及附件生产加工工艺与质量检 测标准实用手册[M].安徽文化音像出版社. 2003. 作 者 简 介: 李 涛(1980- ), 男 , 湖 北 荆 门 人 , 湖 北 黄 石 理 工 学 院 机 电工程学院教师, 主要从事智能测控方面的研究工作, 硕士;田 晓君(1969- ), 男 , 湖 北 浠水 人 , 湖 北黄 石 理 工学 院 机 电工 程 学 院 教师, 主要从事智能测控方面的研究工作, 硕士。 (435003 湖 北 黄 石 黄 石 理 工 学 院 机 电 工 程 系) 李 涛 田 晓 君 通讯地址:(435003 湖北黄石 黄石理工学院机电工程系)李涛
本 文 作 者 创 新 点 : 基 于 VB 编 程 语 言 , 采 用 分 区 排 序 算 法 , 设计了数据处理软件, 实现了平面度误差的精确评定。 参考文献: [1] 中华人民共和国国家质量监督检验检疫总局.《GB/T11337- 2004 平面度误差检测》[S].北京:中国标准出版社.2005.1- 32 [2]张善钟,于瀛洁,张之江.直线度平面度测量技术[M].北京:中 国计量出版社.1997 [3]罗世民,杨春辉.基于 VB 的凸轮机构的参数化设计及其动画 仿真[J]微计算机信息, 2005,26:155- 158 作者 简 介:隋 文 涛 ( 1977- ) , 男 ( 汉 族 ) , 山 东 烟 台 人 , 山 东 理 工 大 学 讲 师 , 硕士 , 研 究 方向:测 控 技术 和 机 械自 动 化;张宇 ( 1950- ) , 男( 汉族) , 山东淄博人, 山东理工大学教授, 研究方向:测量和质 量控制。
MatrixVB在测量数据处理中的应用
MatrixVB在测量数据处理中的应用林永秋,福建省建筑科学研究院 350025,[摘要] 本文介绍了MatrixVB的主要功能以及引用方式~并且重点介绍了在测量数据处理中比较重要的两个方面~即矩阵运算以及图形处理。
通过本文的实例可以发现~在VB中加载了MatrixVB插件之后~使得程序代码编写的负担大大减轻。
MATLAB和VB具有较好的互补性~采用MatrixVB和VB混合编程~既保留了MATLAB强大的矩阵运算图形处理等功能~又集成了VB高级语言界面友好易于编译等优点。
说明了采用MatrixVB和VB混合编程在测量数据处理中具有较好的实用价值。
[关键词] MatrixVB MATLAB VB 测量数据处理矩阵运算图形处理The application of matrixvb in measurement data processingLin YongqiuAbstract: This paper has introduced key functions and citation method of MatrixVB, highlighted two aspects which are more important in surveying data processing, namely matrix operation and graphic processing. It can be found that through these examples in this paper, after loading Matrix in VB, the burden of compiling program code can be reduced greatly. MATLAB and VB have good complementarity. Using both of them for mixed programming, it has reserved the advantaged of both MATLAB and VB. It enjoys the strong matrix operation and graphicprocessing functions of MATLAB and friendly interface and easinessto compile of VB. So the conclusion that the mixed programming using MatrixVB and VB has good practicability in surveying data processing can be drawn.Keywords:MatrixVB,MATLAB,VB, Surveying Data Processing, MatrixOperation, Graphic Processing。
水准网平差(VB代码)
误差理论与测量平差础)课程设计报告系(部):土木工程系实习单位:山东交通学院班级:测绘084学生姓名:田忠星学号080712420带队教师:夏小裕﹑周宝兴时间:10 年12 月13 日到10 年12 月19 日山东交通学院目录:1.摘要P32.概述P33.水准网间接平差程序设计思路P3—P44.平差程序流程图P4—P65.程序源代码及说明P7—P236.计算结果P23—P267.总结P26—P27一:摘要在测量工作中,为了能及时发现错误和提高测量成果的精度,常作多余观测,这就产生了平差问题。
在一个平差问题中,当所选的独立参数X?的个数等于必要观测数t 时,可将每个观测值表达成这t 个参数的函数,组成观测方程,这种以观测方程为函数模型的平差方法,就是间接平差。
二:概述:该课程设计的主要目是对水准网进行间接平差,在输入数据后依次计算高程近似值﹑误差方程和平差计算。
三:水准网间接平差程序设计思路1.根据平差问题的性质,选择t 个独立量(既未知点的高程)作为参数X?2.将每一个观测量的平差值(既观测的高程差值)分别表达成L L V3.由误差方程系数 B 和自由项组成法方程,法方程个数等于参数的个数t ;4. 解算法方程,求出参数X?,计算参数(高程)的平差值X?=X0 +x? ;5.由误差方程计算V,求出观测量(高差)平差值L L V 6.评定精度单位权中误差平差值函数的中误差四:平差程序流程图1. 已知数据的输入 需要输入的数据包括水准网中已知点数﹑未知点数以及这些点 的点号, 已知高程和高差观测值﹑距离观测值。
程序采用文件方 式进行输入,约定文件输入的格式如下: 第一行:已知点数﹑未知点数﹑观测值个数 第二行:点号(已知点在前,未知点在后) 第三行:已知高程(顺序与上一行的点号对应) 第四行:高差观测值,按“起点点号,终点点号。
高差观测值, 距离观测值”的顺序输入。
本节中使用的算例的数据格式如下2,3,7 1,2,3,4,5 5.016,6.016 1,3,1.359,1.11,4,2.009,1.7 2,3,0.363,2.3 2,4,1.012,2.7 3,4,0.657,2.4 3,5,0.238,1.4 5,2,-0.595,2.6 2.平差计算过程V TPV rV TPVnus(1)近似高程的计算。
基于VB的测量程序设计的研究
基于VB的测量程序设计的研究摘要:随着测绘技术的不断发展,计算机在现代测绘学科中的应用越来越广泛,已经深入到从理论研究到实际生产的方方面面。
本文是以MircoSoft公司的VisualBasic6.0开发的“地形图分幅与编号”测量程序为例来进行介绍的。
关键字:VB语言;测量程序;图幅分幅一、VB语言的特点简介目前使用较多的高级语言有Visual Basic、Visual FoxPro、Visual C++、Java 等,它们各有特点,分别适用于不同的领域。
从应用角度上讲VB简单易用、方便迅速、功能强大、应用广泛,适合测绘专业人员使用;也非常适合作为入门语言来学习。
VB语言的特点:(1)具有面相对对象的可视化设计工具:在VB中,应用面向对象的程序设计方法(OOP),把程序和数据封装起来视为一个对象,每个对象都是可视的,程序员在设计时,只需根据界面设计的要求,用现有的工具直接在屏幕上“画”出窗口、菜单、按钮、滚动条等不同类型的对象,并为每个对象设置属性。
(2)事件驱动的编程机制事件驱动是非常适合图形用户界面的编程方式。
事件掌握着程序有运行的方向,每个事件都能驱动一段程序的运行。
程序员只需编写相应用户动作的代码,而各个动作之间不一定有联系。
这样的应用程序代码一般较短,所以既易于编写又易于维护。
(3)提供易学易用的应用程序集成开发环境在VB集成开发环境中,用户可以设计界面、编写代码、调试程序,直至把应用程序编译成可执行文件在Windows中运行,使用户在友好的环境中工作。
(4)结构化的程序语言设计VB具有丰富的数据类型和结构优化程序结构,而且简单易学。
此外作为一种程序设计语言,VB还有许多的独到之处:①强大的数值和字符串处理功能。
②丰富的图形指令,可方便地绘制各种图形③提供静态和动态数组,有利于简化内存管理。
④过程可递归调用,使程序更为简练。
⑤支持随机文件访问和顺序文件访问。
⑥提供了一个可供应用程序调用的包含多种类型的图标库。
VB开发水准测量平差软件的方法
VB开发水准测量平差软件的方法摘要:本文介绍了应用Visual Basic6.0开发的水准测量平差软件的方法。
通过软件自动生成EXCEL格式的水准测量平差计算表格进行数据处理,快速、准确计算出待求点的高程。
关键词:VB;数据处理;水准测量水准测量平差计算就是对合格的高差予以调整。
将闭合差以相反的符号按与各段水准路线长度(或按测站数)成正比的办法调整到各段高差上,求出改正后的高差再推算高程。
手工计算速度慢、工作效率低,同时易出现计算错误,而Visual Basic6.0是一种简单易学的可视化语言,用其进行编程计算就显得方便灵活。
本文结合作者工作的实践,详细地介绍了用VB开发水准测量平差软件的方法及应用。
1.VB语言的特点(1).面向对象和可视化的程序设计。
(2).事件驱动的运行机制。
(3).结构化的程序设计语言。
(4).多种数据库访问能力。
(5).提供了功能完备的应用程序集成开发环境。
(6).方便使用的联机帮助功能。
2.水准测量平差计算的方法(1).计算高差闭合差fh。
fh=Σh测 -(H终-H始)fh允=±20(按四等水准测量限差)fh≤fh允(合格)fh允—允许闭合差;Σh测—实测的各段高差和;H始—起点高程;H终—终点高程;(2).计算高差改正数Vi。
Σn —总测站数或路线总长度(km);ni —分段测站数或分段路线长度(km);(3).计算改正后高差h改i。
h改i=h测¬ + Vi(4).计算待求点高程Hi。
Hi=Hi-1+ h改i3.软件的开发原理首先在VB中设计了一个固定的界面(图3.1),添加相应功能键及数据输入文本框,通过输入相应的数据,利用VB编程实现自动生成电子表格;通过VB操作电子表格里数据进行平差计算。
根据不同的平差方法,本软件设置按距离进行平差和按测站数进行平差两种计算方法。
图3.1水准测量平差软件界面3.1参数输入方式数据输入设计成两种方式;一种是先建立文本格式(txt)的参数文件,通过编写程序代码实现直接读取数据。
基于 VB环境下水准网平差 程序设计研究
A,P1,P2,P3 (已 知 点 和 未 知 点 点 名 )
64.382
(已知点 A 高程)
A,P1,1.315,2.4 (观测值起点,终点,高差,水平距离)
2.2 未 知 点 近 似 高 程 推 算 观测数据输入 后,程 序 就 通 过 循 环 搜 索 含 有 未
X = (A P A ) A P L m×1
T
-1 T
n×m n×n n×m
n×m n×n n×1
(6)
其中P 为衡量观测高差之间相对精度的权 阵 ,通 常 由 观 测 高 差 的 水 平 距 离 或 测 站 数 决 定 ,即 :
Pi
=
1 Si
(7)
熿S11 0 0
燄
P = m·chm
…
1 Si
0
图 2 程 序 界 面
3.1 未 知 点 初 始 高 程 推 算 代 码
For i= 1To un //un为未知点个数// For j= 1To hn //hn为已知点个数// If pointbegan(j)= nn + i And pointend(j)< nn + i Then //已 知 点 和 未 知 点 判 断// Hknown(nn+i)= Hknown(en(j))- H(j)//推算未 知 点 近 似 高 程// Exit For End If If pointend(j)= nn + i And pointbegan(j)< nn + i Then Hknown(nn +i)= Hknown(be(j))+ H(j) Exit For End If Next j Next i
间 接 平 差 模 型 是 进 行 水 准 网 平 差 、三 角 网 平 差 、GPS数 据 后 处 理 等 过 程 中 经 常 用 到 的 模 型 。 因 为 简 接 平 差 具 有 参 数 求 解 简 单 、易 于 编 程 实 现 等 优 点 。Visual Basic 语 言 是 一 种 面 向 对 象 的 可 视 化 语 言 ,程 序 界 面 友 好 ,适 合 测 量 程 序 的 编 写 。 因 此 ,本 文 论 述 了 工 程 当 中 经 常 用 到 的 三 四 等 水 准 网 平 差 的 原 理 ,并 着 重 阐 述 了 基 于 VB 环 境 下 程 序 实 现 的 方 法 ,并 用 实 例 验 证 了 可行性。
基于MatrixVB的水准网平差程序设计
基于MatrixVB的水准网平差程序设计摘要:本文首先介绍了MatrixVB的一些基本功能和应用,然后简要阐述了水准网平差程序的设计方法和步骤,最后利用VB6.0和MatrixVB实现水准网平差程序的设计。
关键词:VB6.0;MatrixVB;测量平差程序设计;水准网平差1引言目前,在测量平差程序设计中经常要利用矩阵计算,程序设计者往往将矩阵的计算编制成基于数组的函数模块,在需要时直接调用之,这些模块的设计、调试工作量大不说,在调用前还需要重新定义各数组的大小,使用起来比较麻烦;这里介绍了一个基于MATLAB的的组件MatrixVB,它具有强大的矩阵计算、图形图像处理、最优化运算等功能,结合VB6.0进行测量程序的设计,程序步骤清晰,计算结果可靠,可以节约大量的程序设计时间,是一种很好的测量程序设计方法。
2MatrixVB介绍MatrixVB是由Mathtools公司提供的一个COM组件,它提供了很多有效的类似MATLAB算法,特别是其矩阵计算功能,在测量平差程序设计中可以发挥巨大的作用。
2.1MatrixVB的安装在安装盘上找到MatrixVB安装文件,双击后按照安装向导安装,安装完毕后注册动态链接库mMatrix.dll,其方法为是在电脑的“开始—运行”菜单中输入命令“regsvr32mMatrix.dll”即可。
2.2VB开发程序的前期准备打开VB6.0,建立VB程序,然后一定要在“Project—References”下选上“MMatrix”,见下图这样配置后在开发过程中就可以使用矩阵的一些运算符了,如矩阵求逆B=inv(A)等;2.3VB6.0中数组在MatrixVB中的应用在vb6.0中定义的数组可以通过mabs()、CreateMatrix()等转化为MatrixVB中的矩阵,当然在MatrixVB环境下,可以默认将VB6.0中的数组转化为MatrixVB矩阵,即能直接把数组当作矩阵来使用。
平面和高程控制测量VB程序设计报告
题目:习题7.1平面和高程控制网平差蒲浡轩测绘C101班106684余数7一、设计思路题目为:平面控制网和高程控制网的平差1、流程图2、界面设计上面为开始主程序,在该页面进行高程控制网平差,点击平面控制启动下面的程序页面进行平面控制网平差。
2、功能设计通过菜单实现程序的各个功能,通过菜单启动Common Dialog Control控件输入txt文档,读取txt里面的高程或平面控制网数据,然后点击各个计算菜单进行平差计算二、算法及代码实现1、Form1代码:Dim strFileName As StringDim nn%, un%, tn%, hn% '已知点个数,未知点个数,总点数,观测值个数Dim Pname() As String '点名数组Dim Hknown() As Double '已知高程数组,存放已知点高程和高程近似值Dim bE%(), en%() '观测值的起点和终点编号数组,存储的是点序号Dim h#(), s#() '高差观测值数组和距离观测值数组Dim a#(), x#(), P#(), L#() '间接平差的系数阵、解向量、权阵和常数向量'高程平差计算Private Sub mnuAdj_Click()Dim i%, j%ReDim x(1 To un)InAdjust a, P, L, x '调用间接平差的通用过程求解'计算并显示高程平差结果txtShow.Text = txtShow.Text & "平差计算结果:" & vbCrLftxtShow.Text = txtShow.Text & "点号初始高程(m) 高程改正数(m) 平差后高程(m)" & vbCrLfFor i = 1 To untxtShow.Text = txtShow.Text & Pname(nn + i) & " " & Format(Hknown(nn + i), "0.0000")Hknown(nn + i) = Hknown(nn + i) + x(i)txtShow.Text = txtShow.Text & " " & Format(x(i), "0.0000") & " " & Format(Hknown(nn + i), "0.0000") & vbCrLfNext itxtShow.Text = txtShow.Text & vbCrLf'计算并显示单位权中误差--------->>精度评定部分应该也包含在间接平差模块里,一起来调用' Dim dblT As Double' dblT = 0' For i = 1 To un'' Next iEnd SubPrivate Sub mnuCalc_Click(Index As Integer)Form1.Visible = FalsefrmMain.Visible = TrueEnd Sub'误差方程Private Sub mnuEqu_Click()Dim i%, j%ReDim a(1 To hn, 1 To un), L(1 To hn), P(1 To hn, 1 To hn)'对每个观测值列误差方程For i = 1 To hnIf en(i) > nn Then a(i, en(i) - nn) = 1 '若终点未知,则给终点对应的系数矩阵元素赋值If bE(i) > nn Then a(i, bE(i) - nn) = -1 '若起点未知,则给起点对应的系数矩阵元素赋值L(i) = -(Hknown(en(i)) - Hknown(bE(i)) - h(i)) '根据起终点计算常数项P(i, i) = 1 / s(i) '以距离的倒数为权 Next i'显示误差方程txtShow.Text = txtShow.Text & " 列立的误差方程:" & vbCrLfFor i = 1 To hnFor j = 1 To untxtShow.Text = txtShow.Text & a(i, j) & " "Next jtxtShow.Text = txtShow.Text & " " & Format(L(i), "0.0000") & vbCrLfNext itxtShow.Text = txtShow.Text & "权矩阵:" & vbCrLfFor i = 1 To hnFor j = 1 To hntxtShow.Text = txtShow.Text & P(i, j) & " "Next jtxtShow.Text = txtShow.Text & vbCrLfNext iEnd SubPrivate Sub mnuHeight_Click()'计算近似高程Dim i%, j%For i = 1 To unFor j = 1 To hnIf bE(j) = nn + i And en(j) < nn + i Then '找到一个起点相同且终点已知的观测值Hknown(nn + i) = Hknown(en(j)) - h(j)Exit ForEnd IfIf en(j) = nn + i And bE(j) < nn + i Then '找到一个终点相同且起点已知的观测值Hknown(nn + i) = Hknown(bE(j)) + h(j)Exit ForEnd IfNext jNext i'显示近似高程计算结果txtShow.Text = txtShow.Text & " 近似高程计算结果: " & vbCrLf For i = 1 To untxtShow.Text = txtShow.Text & Pname(i + nn) & ":" & Format(Hknown(i + nn), "0.000") & vbCrLfNext iEnd Sub'打开高程文件Private Sub mnuHOpen_Click()Dim i As Integer '循环变量Dim strT1 As String, strT2 As StringCDg1.Filter = "文本文件(*.txt)|*.txt|所有文件(*.*)|*.*"CDg1.ShowOpen '打开对话框strFileName = CDg1.FileName '获得选中的文件名和路径Open strFileName For Input As #1 '打开文件Input #1, nn, un, hn '读入已知点个数,未知点个数,观测值个数tn = nn + unReDim Pname(1 To tn), Hknown(1 To tn)ReDim h(1 To hn), s(1 To hn), bE(1 To hn), en(1 To hn)For i = 1 To tn '读入点名Input #1, Pname(i)Next iFor i = 1 To nn '读入已知高程Input #1, Hknown(i)Next iFor i = 1 To hn '读入各观测值Input #1, strT1, strT2, h(i), s(i)bE(i) = Order(strT1): en(i) = Order(strT2) '给起终点数组排序Next i'显示读入的数据txtShow.Text = txtShow.Text & "读入的水准网数据:" & vbCrLf txtShow.Text = txtShow.Text & " 已知点" & nn & "个,未知点" & un & "个,观测值" & hn & "个。
基于MatrixVB的测量平差程序设计与实现
基于MatrixVB的测量平差程序设计与实现李沛鸿;江红兵;王劲松;刘伟【期刊名称】《北京测绘》【年(卷),期】2012(000)004【摘要】基于MATLAB的组件MatrixVB小巧灵活,具有强大的矩阵运算能力,结合VB6.0简洁美观的可视化编程,开发出测量数据平差程序,充分利用了各自的优点,提高了计算效率,在实际工程应用中具有实用价值。
%The MatrixVB component based on MATLAB is small and flexible, and it has strong capability of matrix corn puting. Developing survey data adjustment program withVB6.0 which is a kind o[ simple and visual programming tool makes full use of their advantages, improves the computational efficiency. It has practical value in engineering applica tions.【总页数】5页(P14-18)【作者】李沛鸿;江红兵;王劲松;刘伟【作者单位】江西理工大学建筑与测绘工程学院,江西赣州341000;江西理工大学建筑与测绘工程学院,江西赣州341000;广东交通职业技术学院,广东广州510650;广东交通职业技术学院,广东广州510650【正文语种】中文【中图分类】P208【相关文献】1.基于Excel的单一导线智能平差程序在矿山测量中的应用 [J], 盖侨侨;朱金秀2.基于Dijkstra算法的复杂水准路线自动组网严密平差程序设计与实现 [J], 黄祥雄;廖超明;覃胜凤;周聪林3.基于Dijkstra算法的复杂水准路线自动组网严密平差程序设计与实现 [J], 黄祥雄;廖超明;覃胜凤;周聪林4.基于Matlab《测量平差》课程程序设计 [J], 王家胜;张芬芳5.基于Matlab的测量平差程序设计与实现 [J], 杨宏斌;孟福军;岳胜如因版权原因,仅展示原文概要,查看原文内容请购买。
学位论文—基于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 外文参考文献翻译提高油田采收率通过实时水驱优化帕米拉·阿卢嘉勒都灵理工大学摘要:提高油藏的采收率是强烈的欲望。
基于 VB 的水准网经典平差系统的开发与应用
基于 VB 的水准网经典平差系统的开发与应用张广宇;欧阳兆灼;那福超;杨帆【摘要】根据水准网数据特征,按已知数据、观测数据以及水准网边和点的相对位置关系设计了数据组织结构。
基于间接平差模型,在VB环境下设计开发了水准网平差系统。
选取了一组水准网数据,计算了水准网的高程平差值、高程中误差、高差平差值和高差中误差,并与已有计算结果作了对比,验证了程序编制的正确性和系统运行的可靠性。
%On the basis of the data structuredesigned ,according to the known data ,observation data and the relation of points and lines by the characteristics of the leveling net .Using VB to code ,designes and developes an adjustment system of levelling net ,based on indirect adjustment model .Choosing a set of levelling net data to calculate adjusted value and mean square error of elevation and elevation difference ,and makes a comparison with existing results ,and verification the validity of the programming and the reliability of the system .【期刊名称】《中国矿业》【年(卷),期】2014(000)0z2【总页数】4页(P354-357)【关键词】水准网;间接平差;中误差;VB;高差【作者】张广宇;欧阳兆灼;那福超;杨帆【作者单位】中国地质大学北京地球科学与资源学院,北京100083; 中国地质调查局沈阳地质调查中心,辽宁沈阳110034;中国地质调查局沈阳地质调查中心,辽宁沈阳110034;中国地质调查局沈阳地质调查中心,辽宁沈阳110034;中国地质调查局沈阳地质调查中心,辽宁沈阳110034【正文语种】中文【中图分类】P207水准测量是建立高程控制的一种常规方法,也是高精度沉降监测的主要手段之一。
MatrixVB在测量数据处理中的应用
福建建设科 技 2010 N o 3
建筑勘测
M at rix VB 在测量数据处理中的应用
林永秋 ( 福建省建筑科学研究院
[摘 要]
350025)
本文介绍了 M atr ix VB 的主要功能以及引用方式 , 并且重点介绍了在测量数据处 理中比较重 要的两个方 面 , 即 矩
阵运算以 及图 形处理 。 通过本 文的 实例 可以发 现 , 在 VB 中 加载 了 M atrix V B 插件 之后 , 使 得程 序代码 编写 的负担 大大 减轻 。 M A T L AB 和 V B 具有较好的互补性 , 采用 M atr ixV B 和 V B 混合编程 , 既保留了 M A T L A B 强大的 矩阵运 算图形 处理等 功能 , 又 集成了 V B 高级语言界面 友好易于编译等优点 。 说明了采用 M atr ix V B 和 VB 混合编程在测量数据处理中具有较好的实用价值 。 [ 关键词 ] M atrixV B M A T L AB V B 测量数据处理 矩阵运算 图形处理
M at rix V B pow er( a, b) tim es( a, b) rdivide( a, b) ldivide( a, b) m mod( a, b) plus( a, b) minus( a, b) uminus ( a) 命
3 MatrixVB 在矩阵运算方面的应用 在测量数据处理 中 , 经常涉 及 到矩 阵的 大量 运算。 M a t rix V B 包括像操作矩阵 一样操 作 V B 中 数组的 功能 , 可 以把 这些功能函数 整合 到 VB 程序 中。 V B 中 和 M atrixV B 中 算 术运算符的对比如表格 表1
作者简介 : 林永秋 ( 1982- ) 男 , 测绘工程专业 , 助理工程师。
基于MATLAB和VB的平面度、圆度、球度形状误差评定的软件设计
基于MATLAB和VB的平面度、圆度、球度形状误差评定的软件设计孟亮【摘要】形状误差是实际形状相对其理想形状的偏差,关系着工件的质量,针对平面度、圆度、球度等不同的形状误差,先后出现了许多新的算法.采用计算简便、运算速度快、广泛应用于各种形状误差的评定的最小二乘法;运用MATLAB语言编写误差的计算程序,在Visual Basic环境下开发了软件系统的用户界面程序,同时编写VB与MATLAB之间的接口程序,完成这两种软件之间的调用.通过与现有最小区域法的计算结果相比较验证程序的正确性,便于在工程实际中推广应用.%Form error refers to the deviation between an actual shape and its ideal shape. It is related to the work piece quality. Aiming at the different form deviations of flatness,circularity,sphericity and so on,there have appeared a lot of new algorithms. The least square method, which is simple at calculation,fast at computing,and is widely applied to various form errors is utilized in the article. The calculation program for errors is coded in MATLAB language. The software system UI program is developed under Visual Basic environment. At the meantime interface programs between VB and MATLAB are written to fulfill the calling between the two kinds of software. By comparing against the calculation result of the present minimum zone method, the correctness of the program is verified, which facilitates its promotion and application in engineering practices.【期刊名称】《计算机应用与软件》【年(卷),期】2012(029)004【总页数】4页(P75-78)【关键词】最小二乘法;平面度误差;圆度误差;球度误差【作者】孟亮【作者单位】新疆油田公司采气一厂新疆克拉玛依834007【正文语种】中文【中图分类】TP3170 引言在高科技、现代化生产的今天,我们对产品的高质量提出了更高的要求。
VB测量平差程序的设计讲稿
Case 0 '读入观测值文件Text1.Visible = FalseCommonDialog1.ShowOpenfname = CommonDialog1.FileName '将用户在"打开"对话框中选择的文件名对变量fname赋值If fname <> "" Then '若无此判断当对话框中选择取消时、下面赋值语句将出错Set ts = fso.OpenTextFile(fname) '将fname作为文本文件打开,并设置句柄j = 0: k = 0: p = 0: h = 0'j是测站数累计变量,k是已知点累计变量,l(j)、ns(j)分别是方向值、边长累积计数Do While ts.AtEndOfLine <> True '前测型循环,进入循环的条件是没有读到文件结束尾B = ts.ReadLine '读一行,置入bB = Trim(B): i = 1: '删除B可能有的前导和尾随空格,i是工作变量,m(i) = InStr(B, ",") '查行中第一个逗号的左数位置,并保存在整形数组变量m(i)Do While m(i) <> 0 '前测型Do... Loop循环,成立条件是该行字符串中有逗号tr(i) = Mid(B, m(i - 1) + 1, m(i) - m(i - 1) - 1) '提取指定位置开始的指定数目字符。
i = i + 1m(i) = InStr(m(i - 1) + 1, B, ",") '从上一个找到的逗号位置起,查找下一个逗号的位置LoopIf m(i) = 0 And i > 1 Then tr(i) = Right(B, Len(B) - m(i - 1)) '处理一行中最后一个逗号后的字符串'以下部分是将存储在数组变量 m(i)中的字符分类存放到方向、边长、已知坐标、网型信息等数组中If p = 0 Then '读到的是文件第一行。
VB开发测量应用程序的体会
VB开发测量应用程序的体会
杨东升
【期刊名称】《矿山测量》
【年(卷),期】2010(000)005
【摘要】文章作者结合Visual Basic 6.0的可视化编程语言在测量软件编程方面的应用,详细叙述了用Visual Basic 6.0实现全站仪采集数据格式与各种计算机制图软件展点数据格式的转换过程,结合自己的工作经验,介绍了南方测绘仪器公司基于AutoCAD平台技术开发的CASS系统综合性数字化测图软件的使用方法和技巧.【总页数】2页(P35-36)
【作者】杨东升
【作者单位】抚顺矿业集团东岩地质测绘勘察有限公司,辽宁,抚顺,113006
【正文语种】中文
【中图分类】P209
【相关文献】
1.VB在CAI教学软件开发中的技术探讨--VB应用程序的优化 [J], 李姣军;何丰;王培容
2.基于VB语言的施工测量应用程序设计 [J], 王杰
3.基于VB的直齿圆柱齿轮参数测量应用程序的研究与实现 [J], 陈哲;陈文兵;阳复建
4.用VB开发测量应用程序的经验总结 [J], 孙维兵;赵旭;曾广华
5.基于VB开发测量应用程序的几点体会 [J], 王艳慧;曹红杰;吴原华
因版权原因,仅展示原文概要,查看原文内容请购买。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
实 际测量 工程 中 , 量 平差 是 非 常 重要 的一 测 项工 作 , 制 网 测 量 数 据 的平 差 处 理 必 不 可 少 。 控 然 而平差 处理 过程 中的计 算 往 往 比较复 杂 , 及 涉 矩 阵运算 , 别是 网形 复 杂 、 阵 非 对 角 、 特 权 观测 量
值 ;2 评 定测 量 的精 度 。 ()
增 多 即矩 阵增 大 时 , 算 尤其 繁 琐 。 目前 市场 上 计 成熟 的商业平 差软 件 很 多 , 一般 都 需 要 准备 特 但
定 格式 的数 据 文 件 , 计 算 的过 程 完 全 封 装 , 将 包 括条 件 方 程 、 差 方 程 的 列 立 都 不 需 要 用 户 关 误
2 1 年 第 4期 02
. 京测绘 . 北
1 5
和采用 事 件 驱 动 方 式 的 结 构 化 高 级 程 序 设 计 语
・
北京 测 绘 ・
21 0 2年 第 4期
基于 Mar V ti B的测量平差程序设计 与实现 x
李 沛鸿 江红兵 王 劲松 刘 伟。
(. 西 理 工 大 学 建 筑 与测 绘 工程 学 院 , 西 赣 州 31 0 ;. 东交 通 职 业技 术 学 院 , 东 广 州 5 0 5 ) 1江 江 4002广 广 16 0
有 实 用价 值 。
[ 键 词 ] Mar VB V 60 测 量 平 差 ; 关 tx B . ; i 函数 模 型 ; 方 图 直 [ 图分 类 号 ] P 0 中 28 [ 献标 识码 ] B 文 [ 章 编 号 ] 1 0 — 3 0 (0 2 0 —5 文 0 7 0021)4
[ 摘 要 ] 基 于 MA AB的 组 件 Mar V 小巧 灵 活 , 有 强 大 的 矩 阵运 算 能 力 , 合 VB . TL ti B x 具 结 6 0简 洁 美
观 的 可视 化 编 程 , 发 出测 量 数 据 平 差 程 序 , 分 利 用 了各 自的 优 点 , 高 了计 算 效 率 , 实 际 工 程 应 用 中具 开 充 提 在
平差 中的几个量 : 1 观测 值 个数 n ( ) 要 () ;2 必
观测 数 t能 够 唯 一 确 定 一 个 几 何 模 型所 必要 的 :
元 素的个 数 ; 3 多 余 观 测数 r 多余 必 要 观 测 的 () :
观测 量个 数 , 叫“ 又 自由度” r: - t , = =n 。
差方法 。
A + W 一 0
人 员 往往还 需要 根据 项 目研 究 的实 际 需 求 , 自主
开发平 差程 序 。
在《 隧道施 工 自动监 测 及 安 全 风 险预 警 系 统 研究 》 目的研 究 中 , 了 更 好 掌 握 隧 道 工 程 中 项 为 洞 内平面 控 制 导 线 网、 高程 控 制 水 准 网、 角 三 测
的平 差方 法就 是 间接平差 L 。 3 ]
矩 阵计算 能力 、 B . V 6 0简 单高 效 可视 化 编程 以及 通用 的 E cl 格 数 据 输人 模 式 , 发 并 应 用 了 xe表 开
此测 量 平 差 程 序 。其 具 有 简 洁 明 了、 操 作 、 易 能
较好 联 系工程 实 际等 特 点 , 平差 计算效 果 良好 。
v — B兰 一 z 其数 学模 型 为 : ̄ n 1
D 一
1 平 差 的 基 础 及 模 型
测量 平差 是在 多 余 观 测 的基 础 上 , 据一 定 依 的数学模 型 和某 种平 差 原 则 , 观测 结 果 进 行合 对 理 的调 整 , 而求 得 一组 没 有 矛 盾 的最 可 靠 结果 从 并 评定 精度 。其 任务 是 : 1 对有 误 差 的 观测 值 , ()
一:一 P 一 Q 三
平 差准则Mar V ti B+V 6 0测量 平差 程 序 x B. 开发 的环境和思路
Viu l ai 6 0 一种 可视 化 的 、 向对 象 s a B s . 是 c 面
消除 它们 之 间 的 不 符 值 , 出未 知 量 的 最 或 然 求
利 于计 算者 了解 平差 的 内部 过程 , 就 不 容 易发 也 现 错误 , 因此 在 某 些 工 程 科 研 项 目研 究 中 , 究 研
其 相互 间统计 相关 性质 的模 型)1。 [ ]
条 件平差 : 几何 模 型 中有 r 多余 观 测 , 个 产生
r 条 件 方 程 , r 条 件 方 程 为 函数 模 型 的平 个 以 个
[ 稿 日期 ] 2 1 — 0 — 1 收 02 2 9
[ 金项 目] 广 东 省 交 通 运 输 厅科 技 项 目 , 目编 号 2 1 -0 -0 4 基 项 0 0 2 2 [ 作者 简 介] 李 沛 鸿 ( 94 )男 , 族 , 授 , 要 从 事精 密工 程 测 量 、 量 数 据 采 集 和处 理 、 S教 学 和 科 研 工 作 。 16一 , 汉 教 主 测 GI
角 网的平 差 过 程 , 目组 利 用 Mar VB强 大 的 项 ti x
其 数 学模 型为 :
一
P一
间接平 差 : 定 t 独立 的参 数 , 每个 观 测 选 个 将 值分 别表 示成这 t 独 立 参数 的 函数 , 成 观测 个 组 方程 , 这种 以观 测方 程 ( 误 差 方 程 ) 函数 模 型 或 为
平差 的数 学模 型 : 数 学 关 系 描述 几 何 模 型 用 的几 何关 系 和 内在联 系 。主要 有 函数 模 型 ( 述 描 观测 量 与未 知量 间 的数 学 函 数 关 系 的模 型 ) 随 、
机模 型 ( 描述 平差 问题 中 的随 机量 ( 观 测 量 ) 如 及
心 , 一方 面大大 减 轻 了计 算 量 ; 另 一方 面 , 这 但 不