gogps 利用广播星历解算卫星位置matlab函数satellite_orbits详细注解版
主要注释了广播星历计算GPS BDS卫星位置的。
function [satp, satv] = satellite_orbits(t, Eph, sat, sbas)% SYNTAX:
% [satp, satv] = satellite_orbits(t, Eph, sat, sbas);
%
% INPUT:
% t = clock-corrected GPS time
% Eph = ephemeris matrix
% sat = satellite index
% sbas = SBAS corrections
%
% OUTPUT:
% satp = satellite position (X,Y,Z)
% satv = satellite velocity
%
% DESCRIPTION:
% Computation of the satellite position (X,Y,Z) and velocity by means
% of its ephemerides.%----------------------------------------------------------------------------------------------
% goGPS v0.4.3
%
% Copyright (C) 2009-2014 Mirko Reguzzoni, Eugenio Realini
%----------------------------------------------------------------------------------------------
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%----------------------------------------------------------------------------------------------switch char(Eph(31))case 'G'Omegae_dot = goGNSS.OMEGAE_DOT_GPS; % OMEGAE_DOT_GPS = 7.2921151467e-5; GPS Angular velocity of the Earth rotation [rad/s]GPS卫星地球轨道的角速度case 'R'Omegae_dot = goGNSS.OMEGAE_DOT_GLO;%OMEGAE_DOT_GLO = 7.292115e-5;GLONASS Angular velocity of the Earth rotation [rad/s]case 'E'Omegae_dot = goGNSS.OMEGAE_DOT_GAL;%OMEGAE_DOT_GAL = 7.2921151467e-5; Galileo Angular velocity of the Earth rotation [rad/s]case 'C'Omegae_dot = goGNSS.OMEGAE_DOT_BDS;%OMEGAE_DOT_BDS = 7.292115e-5; BeiDou Angular velocity of the Earth rotation [rad/s]case 'J'Omegae_dot = goGNSS.OMEGAE_DOT_QZS;%OMEGAE_DOT_QZS = 7.2921151467e-5; QZSS Angular velocity of the Earth rotation [rad/s]otherwisefprintf('Something went wrong in satellite_orbits.m\nUnrecongized Satellite system!\n');Omegae_dot = goGNSS.OMEGAE_DOT_GPS;
end%consider BeiDou time (BDT) for BeiDou satellites北斗时和GPS时对其相差14秒,减去
if (strcmp(char(Eph(31)),'C'))t = t - 14;
end%GPS/Galileo/BeiDou/QZSS satellite coordinates computation
%伽利略的坐标系不一样要单独算,这几个系统的坐标系基本可以看做一样的
if (~strcmp(char(Eph(31)),'R'))%get ephemeridesroota = Eph(4); %轨道长半径的平方根ecc = Eph(6); %卫星轨道偏心率omega = Eph(7); %近地点角距 cuc = Eph(8); %升交距角u的余弦调和改正项的振幅 c是改正数 u是升交距角 c是余弦cus = Eph(9); %升交距角u的正弦调和改正项的振幅 c是改正数 u是升交距角 s是正弦crc = Eph(10); %卫星至地心的距离r的余弦调和改正项的振幅 r是卫星到地心的距离crs = Eph(11); %卫星至地心的距离r的余弦调和改正项的振幅 r是卫星到地心的距离i0 = Eph(12); %轨道倾角IDOT = Eph(13); %轨道倾角i的变化率cic = Eph(14);%轨道倾角的余弦调和改正项的振幅 i是轨道倾角 c是余弦cis = Eph(15);%轨道倾角的正弦调和改正项的振幅 i是轨道倾角 s是余弦Omega0 = Eph(16);%参考时刻升交点的赤经Omega_dot = Eph(17);%升交点赤经的变化率toe = Eph(18);%参考时刻time_eph = Eph(32);%当前观测时刻%SBAS satellite coordinate correctionsif (~isempty(sbas))%如果有SBAS星基增强dx_sbas = sbas.dx(sat);dy_sbas = sbas.dy(sat);dz_sbas = sbas.dz(sat);elsedx_sbas = 0;dy_sbas = 0;dz_sbas = 0;end%-------------------------------------------------------------------------------% ALGORITHM FOR THE COMPUTATION OF THE SATELLITE COORDINATES% (IS-GPS-200E)卫星坐标计算算法%-------------------------------------------------------------------------------%eccentric anomaly 偏近点角 (专业术语)[Ek, n] = ecc_anomaly(t, Eph);%cr = goGNSS.CIRCLE_RAD;cr = 6.283185307179600;%2πA = roota*roota; %semi-major axis 半长轴 (星历给出的是半长轴开根号)tk = check_t(t - time_eph); %time from the ephemeris reference epoch 距离历书参考时刻的δtfk = atan2(sqrt(1-ecc^2)*sin(Ek), cos(Ek) - ecc); %true anomaly 真近点角 (专业术语) 用偏近点角算真近点角phik = fk + omega; %argument of latitude 升交角距phik = rem(phik,cr); %对2π取余uk = phik + cuc*cos(2*phik) + cus*sin(2*phik); %corrected argument of latitude 用广播星历里的摄动参数进行摄动改正rk = A*(1 - ecc*cos(Ek)) + crc*cos(2*phik) + crs*sin(2*phik); %corrected radial distance 卫星矢径的改正ik = i0 + IDOT*tk + cic*cos(2*phik) + cis*sin(2*phik); %corrected inclination of the orbital plane 卫星轨道倾角的摄动改正%satellite positions in the orbital plane 计算卫星在轨道面坐标系中的位置%坐标原点位于地心,X轴指向升交点%卫星位置从此刻开始出现。。前面的程序在算计算轨道面坐标系中卫星位置所需的角度 和 半径 x1k = cos(uk)*rk; %。。不懂这个符号定义的,为啥要加个k。。大概懂了。。表示当前时刻y1k = sin(uk)*rk; %if GPS/Galileo/QZSS or MEO/IGSO BeiDou satellite 北斗的地球静止轨道卫星也要分开算if (~strcmp(char(Eph(31)),'C') || (strcmp(char(Eph(31)),'C') && Eph(1) > 5))%corrected longitude of the ascending node 观测瞬间升交点的经度LOmegak = Omega0 + (Omega_dot - Omegae_dot)*tk - Omegae_dot*toe;Omegak = rem(Omegak + cr, cr);%satellite Earth-fixed coordinates (X,Y,Z) 卫星在瞬时地球坐标系中的位置%已知升交点的大地经度L以及轨道平面的倾角i后,可通过两次旋转方便求得卫星在地固坐标系中的位置%卫星的轨道平面是斜着在地球坐标系里,先转个i,转平了,再转个经度,转到地球坐标系的x轴指向的经度,轨道平面内的x轴是指向升交点的xk = x1k*cos(Omegak) - y1k*cos(ik)*sin(Omegak);yk = x1k*sin(Omegak) + y1k*cos(ik)*cos(Omegak);zk = y1k*sin(ik);%apply SBAS corrections (if available)satp(1,1) = xk + dx_sbas;satp(2,1) = yk + dy_sbas;satp(3,1) = zk + dz_sbas;else %if GEO BeiDou satellite (ranging code number <= 5) %地球静止轨道确实该和倾斜轨道分开%corrected longitude of the ascending node 观测瞬间升交点的经度LOmegak = Omega0 + Omega_dot*tk - Omegae_dot*toe;Omegak = rem(Omegak + cr, cr);%satellite coordinates (X,Y,Z) in inertial system xgk = x1k*cos(Omegak) - y1k*cos(ik)*sin(Omegak);ygk = x1k*sin(Omegak) + y1k*cos(ik)*cos(Omegak);zgk = y1k*sin(ik);%store inertial coordinates in a vectorXgk = [xgk; ygk; zgk];%rotation matrices from inertial system to%CGCS2000从惯性坐标系转到中国大地2000坐标系Rx = [1 0 0;0 +cosd(-5) +sind(-5);0 -sind(-5) +cosd(-5)];oedt = Omegae_dot*tk;Rz = [+cos(oedt) +sin(oedt) 0;-sin(oedt) +cos(oedt) 0;0 0 1];%apply the rotationsXk = Rz*Rx*Xgk;xk = Xk(1);yk = Xk(2);zk = Xk(3);%store CGCS2000 coordinatessatp(1,1) = xk;satp(2,1) = yk;satp(3,1) = zk;end%-------------------------------------------------------------------------------% ALGORITHM FOR THE COMPUTATION OF THE SATELLITE VELOCITY (as in Remondi,% GPS Solutions (2004) 8:181-183 )%-------------------------------------------------------------------------------if (nargout > 1)Mk_dot = n;Ek_dot = Mk_dot/(1-ecc*cos(Ek));fk_dot = sin(Ek)*Ek_dot*(1+ecc*cos(fk)) / ((1-cos(Ek)*ecc)*sin(fk));phik_dot = fk_dot;uk_dot = phik_dot + 2*(cus*cos(2*phik)-cuc*sin(2*phik))*phik_dot;rk_dot = A*ecc*sin(Ek)*Ek_dot + 2*(crs*cos(2*phik)-crc*sin(2*phik))*phik_dot;ik_dot = IDOT + 2*(cis*cos(2*phik)-cic*sin(2*phik))*phik_dot;Omegak_dot = Omega_dot - Omegae_dot;x1k_dot = rk_dot*cos(uk) - y1k*uk_dot;y1k_dot = rk_dot*sin(uk) + x1k*uk_dot;xk_dot = x1k_dot*cos(Omegak) - y1k_dot*cos(ik)*sin(Omegak) + y1k*sin(ik)*sin(Omegak)*ik_dot - yk*Omegak_dot;yk_dot = x1k_dot*sin(Omegak) + y1k_dot*cos(ik)*cos(Omegak) - y1k*sin(ik)*ik_dot*cos(Omegak) + xk*Omegak_dot;zk_dot = y1k_dot*sin(ik) + y1k*cos(ik)*ik_dot;satv(1,1) = xk_dot;satv(2,1) = yk_dot;satv(3,1) = zk_dot;endelse %GLONASS satellite coordinates computation (GLONASS-ICD 5.1)time_eph = Eph(32); %ephemeris reference timeX = Eph(5); %satellite X coordinate at ephemeris reference timeY = Eph(6); %satellite Y coordinate at ephemeris reference timeZ = Eph(7); %satellite Z coordinate at ephemeris reference timeXv = Eph(8); %satellite velocity along X at ephemeris reference timeYv = Eph(9); %satellite velocity along Y at ephemeris reference timeZv = Eph(10); %satellite velocity along Z at ephemeris reference timeXa = Eph(11); %acceleration due to lunar-solar gravitational perturbation along X at ephemeris reference timeYa = Eph(12); %acceleration due to lunar-solar gravitational perturbation along Y at ephemeris reference timeZa = Eph(13); %acceleration due to lunar-solar gravitational perturbation along Z at ephemeris reference time%NOTE: Xa,Ya,Za are considered constant within the integration interval (i.e. toe ?}15 minutes)%integration stepint_step = 60; %[s]%time from the ephemeris reference epochtk = check_t(t - time_eph);%number of iterations on "full" stepsn = floor(abs(tk/int_step));%array containing integration steps (same sign as tk)ii = ones(n,1)*int_step*(tk/abs(tk));%check residual iteration step (i.e. remaining fraction of int_step)int_step_res = rem(tk,int_step);%adjust the total number of iterations and the array of iteration stepsif (int_step_res ~= 0)n = n + 1;ii = [ii; int_step_res];end%numerical integration steps (i.e. re-calculation of satellite positions from toe to tk)pos = [X Y Z];vel = [Xv Yv Zv];acc = [Xa Ya Za];for s = 1 : n%Runge-Kutta numerical integration algorithm%%step 1pos1 = pos;vel1 = vel;[pos1_dot, vel1_dot] = satellite_motion_diff_eq(pos1, vel1, acc, goGNSS.ELL_A_GLO, goGNSS.GM_GLO, goGNSS.J2_GLO, goGNSS.OMEGAE_DOT_GLO);%%step 2pos2 = pos + pos1_dot*ii(s)/2;vel2 = vel + vel1_dot*ii(s)/2;[pos2_dot, vel2_dot] = satellite_motion_diff_eq(pos2, vel2, acc, goGNSS.ELL_A_GLO, goGNSS.GM_GLO, goGNSS.J2_GLO, goGNSS.OMEGAE_DOT_GLO);%%step 3pos3 = pos + pos2_dot*ii(s)/2;vel3 = vel + vel2_dot*ii(s)/2;[pos3_dot, vel3_dot] = satellite_motion_diff_eq(pos3, vel3, acc, goGNSS.ELL_A_GLO, goGNSS.GM_GLO, goGNSS.J2_GLO, goGNSS.OMEGAE_DOT_GLO);%%step 4pos4 = pos + pos3_dot*ii(s);vel4 = vel + vel3_dot*ii(s);[pos4_dot, vel4_dot] = satellite_motion_diff_eq(pos4, vel4, acc, goGNSS.ELL_A_GLO, goGNSS.GM_GLO, goGNSS.J2_GLO, goGNSS.OMEGAE_DOT_GLO);%%final position and velocitypos = pos + (pos1_dot + 2*pos2_dot + 2*pos3_dot + pos4_dot)*ii(s)/6;vel = vel + (vel1_dot + 2*vel2_dot + 2*vel3_dot + vel4_dot)*ii(s)/6;end%transformation from PZ-90.02 to WGS-84 (G1150)satp(1,1) = pos(1) - 0.36;satp(2,1) = pos(2) + 0.08;satp(3,1) = pos(3) + 0.18;%satellite velocitysatv(1,1) = vel(1);satv(2,1) = vel(2);satv(3,1) = vel(3);
end
相关文章:
gogps 利用广播星历解算卫星位置matlab函数satellite_orbits详细注解版
主要注释了广播星历计算GPS BDS卫星位置的。 function [satp, satv] satellite_orbits(t, Eph, sat, sbas)% SYNTAX: % [satp, satv] satellite_orbits(t, Eph, sat, sbas); % % INPUT: % t clock-corrected GPS time % Eph ephemeris matrix % sat satellite…...

Oracle按照某一字段值排序并显示,相同的显示序号
Oracle按照某一字段值排序并显示,相同的显示序号 最近的工作遇到对于相同的字段,按照序号去显示值,并对相同的值进行排序 实验了半天,感觉满意的答案,分享给大家 第一种: ROW_NUMBER 语法: ROW_NUMBER() OVER (ORDER BY your_column) AS sequence_number 说明: 根据your_column…...

【Java基础】String详解
文章目录 String一、String 概述1、基本特性2、不可变性3、String、StringBuilder、StringBuffer 二、字符串 创建与内存分配1、字面量 / 双引号2、new关键字3、StringBuilder.toString()4、intern() 方法5、小结 三、字符串 拼接1、常量常量2、变量 拼接3、final变量 拼接4、拼…...

cmd命令
常用命令 查看电脑名称: hostname 查看网卡信息: ipconfig 快速打开网络设置界面: control.exe netconnections 或 rundll32.exe shell32.dll,Control_RunDLL ncpa.cpld 打开防火墙设置: wf.msc 指定网卡设置IP地址&#…...

《中文Python穿云箭量化平台二次开发技术11》股票基本信息获取分析及应用示例【前十大股东占股比例提取及分析】
《中文Python穿云箭量化平台二次开发技术11》股票基本信息获取分析及应用示例【前十大股东占股比例提取及分析】 《中文Python穿云箭量化平台》是纯Python开发的量化平台,因此其中很多Python模块,我们可以自己设计新的量化工具,例如自己新的行…...
OSINT技术情报精选·2024年9月第1周
OSINT技术情报精选2024年9月第1周 2024.8.15版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 1、中国信通院:《大模型落地路线图研究报告(2024年)》 近年来,大模型技术能力不断创出新高,产业应用持续走…...

51单片机应用开发---二进制、十六进制与单片机寄存器之间的关系(跑马灯、流水灯实例)
实现目标 1、掌握二进制与十六进制之间的转换 2、掌握单片机寄存器与二进制、十六进制之间的转换 3、掌握单片机驱动跑马灯、流水灯的原理 一、二进制与十六进制之间的转换 1、二进制 二进制(binary), 是在数学和数字电路中以2为基数的…...

信息安全工程师(6)网络信息安全现状与问题
一、网络信息安全现状 威胁日益多样化:网络攻击手段不断翻新,从传统的病毒、木马、蠕虫等恶意软件,到勒索软件、钓鱼攻击、DDoS攻击、供应链攻击等,威胁形式多种多样。这些攻击不仅针对个人用户,还广泛影响企业、政府等…...

亚数TrustAsia亮相第十四届智慧城市与智能经济博览会,入围“2024数据要素创新应用优秀成果”!
智博会 2024年9月6日至8日,由宁波市人民政府、浙江省经济和信息化厅、中国信息通信研究院、中国电子信息行业联合会、中国电信、中国移动、中国联通主办的2024世界数字经济大会暨第十四届智慧城市与智能经济博览会(以下简称“智博会”)在宁波…...

Linux基础开发环境(git的使用)
1.账号注册 git 只是一个工具,要想实现便捷的代码管理,就需要借助第三方平台进行操作,当然第三平台也是基于git 开发的 github 与 gitee 代码托管平台有很多,这里我们首选 Github ,理由很简单,全球开发者…...

VS Code终端命令执行后老是出现 __vsc_prompt_cmd_original: command not found
VS Code终端命令执行后老是出现 __vsc_prompt_cmd_original: command not found。 如下图(vscode终端中): 解决方案: 1、vim ~/.bashrc 2、在~/.bashrc里面加入命令:unset PROMPT_COMMAND 3、source ~/.bashrc...
春天(Spring Spring Boot)
基本概念 春天 Spring 是用于开发 Java 应用程序的开源框架,为解决企业应用开发的复杂性而创建。 Spring 的基本设计思想是利用 IOC(依赖注入)和 AOP (面向切面)解耦应用组件,降低应用程序各组件之间的耦…...

Oracle EBS AP预付款行分配行剩余预付金额数据修复
系统环境 RDBMS : 12.1.0.2.0 Oracle Applications : 12.2.6 问题情况 AP预付款已验证和自动审批但是未过账已经AP付款但是又撤消付款并且未过账问题症状 AP预付款暂挂: AP预付款行金额(等于发票金额)与分配行金额不相等: 取消AP预付款提示如下:...

【鸿蒙】HarmonyOS NEXT星河入门到实战7-ArkTS语法进阶
目录 1、Class类 1.1 Class类 实例属性 1.2 Class类 构造函数 1.3 Class类 定义方法 1.4 静态属性 和 静态方法 1.5 继承 extends 和 super 关键字 1.6 instanceof 检测是否实例 1.7.修饰符(readonly、private、protected 、public) 1.7.1 readonly 1.7.2 Private …...

Java设计模式—面向对象设计原则(六) ----->合成复用原则(CRP) (完整详解,附有代码+案例)
文章目录 3.6 合成复用原则(CRP)3.6.1 概述3.6.2 案列 3.6 合成复用原则(CRP) 合成复用原则(CRP):Composite Reuse Principle,CRP 又叫: 组合/聚合复用原则(Composition/Aggregate Reuse Principle,CARP)…...

java坏境搭建
目录 安装 步骤1 步骤2 步骤3 步骤4 环境变量 1、在桌面“计算机”或“此电脑”图标上右键,选择“属性”,进入控制面板的计算机系统页面后,点击“高级系统设置”,不同操作系统可能界面不同: 2、点击“环境变量”…...
C#中判断socket是否已断开的方法
代码如下: Socket s new Socket(..); if (s.Poll(-1, SelectMode.SelectRead)) {int nRead s.Receive();if (nRead 0){//socket连接已断开} }参考:C#中判断socket是否已断开的方法...
Python编程 - 异常处理与文件读写
目录 前言 一、异常处理 (一)关键字 (二)捕获多个异常 (三)自定义异常 (四)抛出异常 (五)总结 二、文件读写 (一)打开文件 &…...

【C++】c++ 11
目录 前言 列表初始化 std::initializer_list 右值引用和移动拷贝 左值和右值 左值引用和右值引用的区别 万能引用(引用折叠) 完美转发 默认成员函数控制 列表初始化 在C98中,标准允许使用花括号{}对数组或者结构体元素进行统一的列…...
uni-app 应用名称 跟随系统语言 改变
官方已确认BUG::https://ask.dcloud.net.cn/question/164804 { "name" : "%app.name%",//这里随便写,配置了 locales,name 就不生效了 "appid" : "", "description" : "", "versi…...

C++实现分布式网络通信框架RPC(3)--rpc调用端
目录 一、前言 二、UserServiceRpc_Stub 三、 CallMethod方法的重写 头文件 实现 四、rpc调用端的调用 实现 五、 google::protobuf::RpcController *controller 头文件 实现 六、总结 一、前言 在前边的文章中,我们已经大致实现了rpc服务端的各项功能代…...

均衡后的SNRSINR
本文主要摘自参考文献中的前两篇,相关文献中经常会出现MIMO检测后的SINR不过一直没有找到相关数学推到过程,其中文献[1]中给出了相关原理在此仅做记录。 1. 系统模型 复信道模型 n t n_t nt 根发送天线, n r n_r nr 根接收天线的 MIMO 系…...
Pinocchio 库详解及其在足式机器人上的应用
Pinocchio 库详解及其在足式机器人上的应用 Pinocchio (Pinocchio is not only a nose) 是一个开源的 C 库,专门用于快速计算机器人模型的正向运动学、逆向运动学、雅可比矩阵、动力学和动力学导数。它主要关注效率和准确性,并提供了一个通用的框架&…...
JS设计模式(4):观察者模式
JS设计模式(4):观察者模式 一、引入 在开发中,我们经常会遇到这样的场景:一个对象的状态变化需要自动通知其他对象,比如: 电商平台中,商品库存变化时需要通知所有订阅该商品的用户;新闻网站中࿰…...

【MATLAB代码】基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),附源代码|订阅专栏后可直接查看
文章所述的代码实现了基于最大相关熵准则(MCC)的三维鲁棒卡尔曼滤波算法(MCC-KF),针对传感器观测数据中存在的脉冲型异常噪声问题,通过非线性加权机制提升滤波器的抗干扰能力。代码通过对比传统KF与MCC-KF在含异常值场景下的表现,验证了后者在状态估计鲁棒性方面的显著优…...
jmeter聚合报告中参数详解
sample、average、min、max、90%line、95%line,99%line、Error错误率、吞吐量Thoughput、KB/sec每秒传输的数据量 sample(样本数) 表示测试中发送的请求数量,即测试执行了多少次请求。 单位,以个或者次数表示。 示例:…...
OD 算法题 B卷【正整数到Excel编号之间的转换】
文章目录 正整数到Excel编号之间的转换 正整数到Excel编号之间的转换 excel的列编号是这样的:a b c … z aa ab ac… az ba bb bc…yz za zb zc …zz aaa aab aac…; 分别代表以下的编号1 2 3 … 26 27 28 29… 52 53 54 55… 676 677 678 679 … 702 703 704 705;…...

【Veristand】Veristand环境安装教程-Linux RT / Windows
首先声明,此教程是针对Simulink编译模型并导入Veristand中编写的,同时需要注意的是老用户编译可能用的是Veristand Model Framework,那个是历史版本,且NI不会再维护,新版本编译支持为VeriStand Model Generation Suppo…...
LUA+Reids实现库存秒杀预扣减 记录流水 以及自己的思考
目录 lua脚本 记录流水 记录流水的作用 流水什么时候删除 我们在做库存扣减的时候,显示基于Lua脚本和Redis实现的预扣减 这样可以在秒杀扣减的时候保证操作的原子性和高效性 lua脚本 // ... 已有代码 ...Overridepublic InventoryResponse decrease(Inventor…...

VSCode 使用CMake 构建 Qt 5 窗口程序
首先,目录结构如下图: 运行效果: cmake -B build cmake --build build 运行: windeployqt.exe F:\testQt5\build\Debug\app.exe main.cpp #include "mainwindow.h"#include <QAppli...