资源描述
卫星定位技术与方法
--根据广播星历参数计算卫星坐标作业报告
指导教师: 熊 永 良
班 级: 测 绘 二 班
学生姓名: 段 海 东
学生学号: 2 0 0 8 0 7 8 3
作业日期: 2010 年 12月 08 日
目 录
一. 已知数据 2
二. 计算步骤 2
1.平均角速度 (mean angular speed) 2
2.规化时刻(normal time) 3
3.平近点角(mean anomaly) 3
4.偏近点角(eccentric anomaly) 3
5.真近点角(true anomaly) 3
6.升交距角(argument of ascending node) 3
7. 轨道向径(Orbital radius) 3
8. 扰动改正(Perturbed correction) 4
10.卫星在升交点轨道直角坐标系中的坐标 4
11. 升交点经度(Longitude of ascending node) 5
三. 源程序 5
四. 程序运行结果 14
七.作业体会 15
根据广播星历参数计算卫星坐标
一. 已知数据: 根据以下的广播星历参数计算UTC2004年1月30日8点0分00秒—20分00秒,每隔一分钟的PRN7的卫星坐标。Compute the coordinate of PRN7 with interval of 1 minute.
Navigation data:
卫星导航文件格式:
二. 计算步骤:The steps for satellite coordinates
1.平均角速度 (mean angular speed):
Dn由广播星历获得, GM=3.986005e+14
2.规化时刻(normal time):
t0已知(由广播星历获得),t为GPS周秒
3.平近点角(mean anomaly):
M0已知(由广播星历获得)
4.偏近点角(eccentric anomaly):
迭代求解:初始值取E=M,以弧度为单位
5.真近点角(true anomaly):
6.升交距角(argument of ascending node):
w近地点角距(argument of perigee)
7. 轨道向径(Orbital radius):
8. 扰动改正(Perturbed correction):
• 升交角距(Argument of ascending node)
•
• 轨道向径(Orbital radius)
• 轨道顷角(Orbital inclination)
是升交角距 (the argument of ascending node)
9. 改正后升交角距、轨道向径、轨道倾角
改正后升交角距(Corrected argument of ascending nod)
改正后的轨道向径(Corrected orbital radius)
改正后的轨道倾角(Corrected orbital inclination)
10.卫星在升交点轨道直角坐标系中的坐标:如下图所示
11. 升交点经度(Longitude of ascending node):如下图所示
12. 在地固坐标系中的卫星位置(Expressed in spheric coordinate system)
三. 源程序:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Text.RegularExpressions;
namespace Test
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
listView1.Columns.Add("序号", 40);
listView1.Columns.Add("星历内容", 130);
listView1.Columns.Add("导航数据", 130);
listView1.GridLines = true; //显示表格线
listView1.View = View.Details;//显示表格细节
listView1.HeaderStyle = ColumnHeaderStyle.Clickable;//对表头进行设置
listView2.Columns.Add("时间", 60);
listView2.Columns.Add("x坐标", 150);
listView2.Columns.Add("y坐标", 150);
listView2.Columns.Add("z坐标", 150);
listView2.GridLines = true; //显示表格线
listView2.View = View.Details;//显示表格细节
listView2.HeaderStyle = ColumnHeaderStyle.Clickable;//对表头进行设置
}
private void button1_Click(object sender, EventArgs e)
{
//读取相对路径
string str1 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
string filename = str1 + "navigation data.txt ";
//读取卫星广播星历文件
StreamReader myreader = new StreamReader(filename, Encoding.Default);
string myinfo = myreader.ReadToEnd();
myreader.Close();
//把卫星广播星历里的D改为e,以便后续计算
string mystring = myinfo;
string myinfor = mystring;
myinfor = mystring.Replace("D", "e");
//把数据分开读入到一个数组中存储
string[] split = new string[] { " " };
string[] arrs = myinfor.Split(split, StringSplitOptions.RemoveEmptyEntries);
double[] M = new double[arrs.Length];
//星历代码
string[] N = new string[arrs.Length];
N[0] = "PRN"; N[1] = "Yer"; N[2] = "Mon"; N[3] = "day"; N[4] = "H"; N[5] = "M"; N[6] = "sec"; N[7] = "a0"; N[8] = "a1"; N[9] = "a2";
N[10] = "IODE"; N[11] = "Crs"; N[12] = "delta-n"; N[13] = "M0";
N[14] = "Cuc"; N[15] = "e"; N[16] = "Cus"; N[17] = "sqrt(a)";
N[18] = "t0e"; N[19] = "Cic"; N[20] = "omega0"; N[21] = "Cis";
N[22] = "i0"; N[23] = "Crc"; N[24] = "omega"; N[25] = "omega-spot";
N[26] = "IDOT"; N[27] = "Codes on L2 channel"; N[28] = "GPS Week"; N[29] = "L2 P data flag";
N[30] = "SV accuracy"; N[31] = "SV health"; N[32] = "TGD"; N[33] = "IODC Issue of Data";
N[34] = "Transmission time of message";
//把卫星广播星历读入到数组中
for (int i = 0; i < arrs.Length; i++)
{
ListViewItem li = new ListViewItem();
li.Text = (i + 1).ToString();
li.SubItems.Add(N[i]);
li.SubItems.Add(arrs[i]);
listView1.Items.Add(li);
M[i] = double.Parse(arrs[i]);
}
double t0e=460800.00;
double t;
double[] XK = new double[21];
double[] YK = new double[21];
double[] ZK = new double[21];
for (int l = 0; l < 21;l++ )
{
//计算平均角速度
double GM = 3986004.418e008;
double n, n0;
n0 = Math.Sqrt(GM / (Math.Pow(M[17], 6)));
n = M[12] + n0;
//规划时刻
t=t0e+l*60;
double tk = t-t0e;
double Mk = M[13] + n * tk;
// 迭代计算平近点角的计算
double Ek, Ek1;
Ek = Mk;
Ek1 = Mk + M[15] * Math.Sin(Ek);
do
{
Ek = Ek1;
Ek1 = Mk + M[15] * Math.Sin(Ek);
}
while (Math.Abs(Ek1 - Ek) > 1e-15);
//计算真近点角
double Vk = Math.Atan(((Math.Sqrt(1 - M[15] * M[15]) * Math.Sin(Ek))) / (Math.Cos(Ek) - M[15]));
//反正切值的象限处理
double A1 = Math.Atan(((Math.Sqrt(1 - M[15] * M[15]) * Math.Sin(Ek))));
double A2 = Math.Cos(Ek) - M[15];
if (Vk < 0)
{
if (A1 < 0 && A2 > 0)
{
Vk += 2 * Math.PI;
}
if (A1 > 0 && A2 < 0)
{
Vk += Math.PI;
}
}
else
{
if (A1 <= 0 && A2 <= 0)
Vk = Vk + Math.PI;
}
//计算升交角距
double fk = Vk + M[24];
//摄动改正值的计算
double du = M[14] * Math.Cos(2 * fk) + M[16] * Math.Sin(2 * fk);
double dr = M[23] * Math.Cos(2 * fk) + M[11] * Math.Sin(2 * fk);
double di = M[19] * Math.Cos(2 * fk) + M[21] * Math.Sin(2 * fk);
//摄动改正
double uk = fk + du;
double rk = Math.Pow(M[17], 2) * (1 - M[15] * Math.Cos(Ek)) + dr;
double ik = M[22] + di + M[26] * tk;
//计算卫星在升交点轨道直角坐标系的坐标
double xk = rk * Math.Cos(uk);
double yk = rk * Math.Sin(uk);
//计算升交点经度
double we = 7.2921151467e-05;
double jdt = M[20] + (M[25] - we) * tk - we * M[18];
//卫星在地固坐标系中的空间直角坐标
XK[l] = xk * Math.Cos(jdt) - yk * Math.Cos(ik) * Math.Sin(jdt);
YK[l] = xk * Math.Sin(jdt) + yk * Math.Cos(ik) * Math.Cos(jdt);
ZK[l] = yk * Math.Sin(ik);
}
//输出卫星在地固坐标系中的空间直角坐标
for (int i = 0; i < 21; i++)
{
ListViewItem list = new ListViewItem();
list.Text = "第" + i.ToString() + "分钟";
list.SubItems.Add(XK[i].ToString());
list.SubItems.Add(YK[i].ToString());
list.SubItems.Add(ZK[i].ToString());
listView2.Items.Add(list);
}
}
private void button2_Click(object sender, EventArgs e)
{
//读取相对路径
string str1 = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
string filename = str1 + "navigation data.txt ";
//读取卫星广播星历文件
StreamReader myreader = new StreamReader(filename, Encoding.Default);
string myinfo = myreader.ReadToEnd();
myreader.Close();
//把卫星广播星历里的D改为e,以便后续计算
string mystring = myinfo;
string myinfor = mystring;
myinfor = mystring.Replace("D", "e");
//把数据分开读入到一个数组中存储
string[] split = new string[] { " " };
string[] arrs = myinfor.Split(split, StringSplitOptions.RemoveEmptyEntries);
//星历代码
string[] N = new string[arrs.Length];
N[0] = "PRN"; N[1] = "Yer"; N[2] = "Mon"; N[3] = "day"; N[4] = "H"; N[5] = "M"; N[6] = "sec"; N[7] = "a0"; N[8] = "a1"; N[9] = "a2";
N[10] = "IODE"; N[11] = "Crs"; N[12] = "delta-n"; N[13] = "M0";
N[14] = "Cuc"; N[15] = "e"; N[16] = "Cus"; N[17] = "sqrt(a)";
N[18] = "t0e"; N[19] = "Cic"; N[20] = "omega0"; N[21] = "Cis";
N[22] = "i0"; N[23] = "Crc"; N[24] = "omega"; N[25] = "omega-spot";
N[26] = "IDOT"; N[27] = "Codes on L2 channel"; N[28] = "GPS Week"; N[29] = "L2 P data flag";
N[30] = "SV accuracy"; N[31] = "SV health"; N[32] = "TGD"; N[33] = "IODC Issue of Data";
N[34] = "Transmission time of message";
//把卫星广播星历文件内容输出到listView进行查看
for (int i = 0; i < arrs.Length; i++)
{
ListViewItem li = new ListViewItem();
li.Text = (i + 1).ToString();
li.SubItems.Add(N[i]);
li.SubItems.Add(arrs[i]);
listView1.Items.Add(li);
}
}
}
}
四. 程序运行结果:
星历内容的读取、显示:
卫星坐标计算结果:
运行界面:
作业体会:此次作业,收获颇多。起初由于自己的疏忽,在真近点角的计算时忘了处理象限,导致做后的结果都差了一个负号,所以不管做什么都得认真、细心;想要做好一件事情,必须有百分百的投入,有足够的专注度;发现自己对GPS卫星定位技术与方法这方面知识越来越感兴趣,以后要多加学习。
由于教材上、老师的课件上都有明细的计算步骤,作业起来很方便,不容易出错,经过计算,发现程序运行出来的卫星坐标结果与教材上给的坐标有较大的差距,这个差距达到几十米,检查程序也没有发现问题,问了班上几个同学,他们也都说存在这样的问题,所以,恳请老师给予指点。
16
展开阅读全文