水准网平差程序的设计与实现课程设计书Word文档格式.docx
- 文档编号:13768152
- 上传时间:2022-10-13
- 格式:DOCX
- 页数:60
- 大小:488.50KB
水准网平差程序的设计与实现课程设计书Word文档格式.docx
《水准网平差程序的设计与实现课程设计书Word文档格式.docx》由会员分享,可在线阅读,更多相关《水准网平差程序的设计与实现课程设计书Word文档格式.docx(60页珍藏版)》请在冰豆网上搜索。
2
+2.009
HB=36.000
3
+0.363
4
-0.640
5
+0.657
6
+1.000
7
+1.650
三、关键问题描述
(要求:
对程序实现过程中所涉及的关键问题,请给出详细的求解与算法实现模型。
)
3.1未知点近似高程计算
X1=HA+h1=36.359;
X2=HA+h2=37.009;
X3=HB+h4=35.360;
3.2误差方程列立
V1=x1-(h1-X1+HA)=x1-0;
V2=x2-(h2-X2+HA)=x2-0;
V3=-x1-(h3-X1+HB)=-x1-4;
V4=x3-(h4-X3+HB)=x3-0;
V5=-x1+x2-(h5-X2+X1)=-x1+x2-7;
V6=x1-x3-(h6-X1+X3)=x1-x3-1;
V7=x2-x3-(h7-X2+X3)=x2-x3-1;
注意:
(x和X的区别)
3.3法方程构建与解算
由上式可得:
B=[1,0,0]L=[0]P=[2]
0,1,002
-1,0,041
0,0,101
-1,1,072
1,0,-112
0,1,-111
法方程:
BTPBx-BTPL=0
注(BT指的是B的转置)
3.4精度估计
由法方程得出的x回代到V中,得到V的值。
再利用σo=√VTPV/(n-t)得出中误差,
再由σi=σo√QXiXi,可得各个点位中误差。
其中QXX是BTPB的逆。
3.5程序设计流程图
四、算法运行结果与分析
由所给数据和所得到的中误差以及其他测量平差值,这个结果还比较合适
五、小结
通过水准网程序设计,我知道加深了我对数据结构这一门课的知识的掌握。
特别是对我测绘专业的内容有所联系,更加激发我去学习它的动力。
在这次设计中,我遇到了不少问题,例如,在对误差方程的编写中,不懂得如何把其系数矩阵提取出来,通过向同学咨询我终于懂了。
我对c++中类的设计不熟练,导致很多次程序没法运行。
不过,通过查找书籍材料,我还是把它设计好了。
虽然设计略微简单,但是原理我已经了解,我相信,以后即使做更复杂的设计,只要给我足够的时间,我可以做出更好地设计。
六、附录(完整代码)
按照代码所属文件不同分别附上,且代码须有完整注释。
#include<
iostream.h>
stdlib.h>
iomanip.h>
math.h>
#definemax50
classCMatrix
{
public:
CMatrix(){row=0;
column=0;
};
//默认构造函数
CMatrix(inti,intj){row=i;
column=j;
}//构造函数一
CMatrix(constCMatrix&
m);
//复制构造函数
~CMatrix(void){/*cout<
<
"
谢谢使用,矩阵所占空间以释放!
endl;
*/}//默认析构函数
CMatrix&
operator=(constCMatrix&
//赋值运算符
booloperator==(constCMatrix&
//比括较运算符
booloperator!
=(constCMatrix&
CMatrixoperator+(constCMatrix&
//加运算符
CMatrixoperator-(constCMatrix&
//减运算符
operator+=(constCMatrix&
//自加运算符
operator-=(constCMatrix&
//自减运算符
CMatrixoperator-();
//取负数
operator*(constCMatrix&
//乘法运算符
voidinput();
//输入矩阵
voidoutputMatrix();
//输出该矩阵
voidsetValue(introw,intcolumn,doublevalue){A[row-1][column-1]=value;
}//设置(i,j)的值
doublegetValue(introw,intcolumn)const{returnA[row-1][column-1];
}//设置行、列的值
voidsetRow(constinti){row=i;
}
intgetRow()const{returnrow;
voidsetColunm(constinti){column=i;
intgetColumn()const{returncolumn;
}
change(inti,intj);
//交换矩阵的行
transpose();
//矩阵转置
inverse();
//矩阵求逆
voidfind(int&
f)const;
//判断该矩阵是否可用于迭代求解
friendvoidjocabi(constCMatrix&
a);
//迭代求解
voidlzys();
//列主元素法求解
voidsolve();
//可逆线性矩阵求解
voidqxnh();
//曲线拟合
private:
//成员变量
doubleA[max][max];
introw;
//行
intcolumn;
//列
voidCMatrix:
:
input()//输入
{cout<
开始输入矩阵值:
inti,j;
doublez;
for(i=0;
i<
row;
i++)
{cout<
请输入第"
i+1<
行的值:
for(j=0;
j<
column;
j++)
{cin>
>
z;
A[i][j]=z;
}
cout<
CMatrix:
CMatrix(constCMatrix&
m)//复制构造函数
{inti,j;
m.row;
for(j=0;
m.column;
this->
A[i][j]=m.A[i][j];
CMatrix&
CMatrix:
operator=(constCMatrix&
m)//赋值运算符
{
inti,j;
{
A[i][j]=m.A[i][j];
return*this;
boolCMatrix:
operator==(constCMatrix&
m)//比括较运算符
{inti,j,k;
{for(j=0;
if(this->
A[i][j]=m.A[i][j])k=1;
elsek=0;
if(k=1)returntrue;
elsereturnfalse;
operator!
if(k=0)returntrue;
CMatrixCMatrix:
operator+(constCMatrix&
m)//加运算符
{inti,j;
if((this->
row==m.row)&
&
(this->
column==m.column))
{for(i=0;
for(j=0;
j++)
this->
A[i][j]+=m.A[i][j];
else{cout<
此两矩阵不能相加,请检查!
operator-(constCMatrix&
m)//减运算符
this->
A[i][j]-=m.A[i][j];
operator+=(constCMatrix&
m)//自加运算符
A[i][j]=2*m.A[i][j];
operator-=(constCMatrix&
m)//自减运算符
A[i][j]=m.A[i][j]-m.A[i][j];
find(int&
f)const
{inti;
thi
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 水准 网平差 程序 设计 实现 课程设计