• 大小: 47KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-12
  • 语言: Matlab
  • 标签: Matlab  

资源简介

本程序设计了GPS卫星仿真器,以及采用GPS卫星对用户进行定位,还包括了如何读取Renix格式的GPS导航电文

资源截图

代码片段和文件信息

%%%%% gps constellation emluator %%%%%%
clear
% constant defination%                 
pi=3.1415926;
a=26609e3;            %轨道长半轴长,单位已经换算为 m
e=0.006;              %轨道的偏心率
i_0=55*pi/180;          %基准时间t_0的轨道倾角
% gpa 采用的椭球参数 %
a_e=6378137;          %地球椭球的长半径
f_e=1/298.257223563;  %地球椭球体扁率
e_2=2*f_e-f_e^2;      %GPS参考椭球第一偏心率的平方

%测站在大地坐标系中的经纬度数据经度L纬度B高度H %
station=[118;32;300];
station(11)=station(11)*pi/180;%完成弧度转换
station(21)=station(21)*pi/180;

L=station(11);
B=station(21);
H=station(31);
%计算椭球的卯酉圈曲率半径N
W=sqrt(1-e_2*sin(B)^2);
N=a_e/W;
%将测站在大地坐标系下的坐标转换为地球坐标系的空间直角坐标[xpypzp]
xp=(N+H)*cos(B)*cos(L);
yp=(N+H)*cos(B)*sin(L);
zp=(N*(1-e_2)+H)*sin(B);
%求系数阵h
h(11)=-sin(B)*cos(L);
h(12)=-sin(B)*sin(L);
h(13)=cos(B);

h(21)=-sin(L);
h(22)=cos(L);
h(23)=0;

h(31)=cos(B)*cos(L);
h(32)=cos(B)*sin(L);
h(33)=sin(B);

E0=15;
mu=3.986008e14;       %开普勒常数,单位为m3/s2
w_ie=7.292115147e-5;  %地球自转平均角速率,单位rad/s
% 卫星轨道参数矩阵epoch:2007-04-01 14:21:46,第一列卫星标号1~30,第二列升交点赤经W_0,第三列平近点角距M_0 %
sate=[1 12.4664 313.6181;2 13.2561 99.1277;3 10.4480 41.9519;4 12.4727 289.5653;5 11.6077 116.5486;6 10.5432 209.4507;
      7 65.1275 73.1881;8 66.9823 101.9770;9 68.3454 286.8979;10 73.1479 200.4810;11 70.2154 77.1527;
      12 125.5712 295.1060;13 128.3618 285.5386;14 131.8240 123.7737;15 131.3074 44.5724;16 130.3997 73.6977;
      17 186.9655 97.3078;18 188.4401 98.7626;19 184.9619 319.1793;20 194.1995 55.7345;21 190.8460 172.0155;
      22 253.5063 46.1491;23 251.3094 346.3001;24 241.0610 333.6671;25 252.3879 163.3319;26 250.2394 231.0366;
      27 311.8862 334.8484;28 309.8682 287.5291;29 312.8828 146.8152;30 313.3067 94.0084];
%w=;                    %近地点角
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t_0=0;                %星历的参考历元
t_k=0;                %仿真时间单位s
a3=a^3;
n=sqrt(mu/a3);       % n=(2*pi)/T=sqrt(mu/a3)应用了开普勒第三定律
i=1;
r=1;
for j=1:30
     sate(j3)=sate(j3)*pi/180;%平近点角
     sate(j2)=sate(j2)*pi/180;%升交点赤经
end
s=43201;
dot_step=300;
q=0;
while t_k    q=q+1;        %各个矩阵的行数表示量
    t_k
    t(q1)=t_k;
    j=1;            % 卫星标号
    while j<=30     %各个矩阵的列数表示量
          M_k(qj)=sate(j3)+n*(t_k-t_0);    
       %%%%%%%%%%%%% 求偏近点角 E_k %%%%%%%%%%%%% 
          Et_1(qj)=M_k(qj);
          t_end=1;  
          while(t_end)
              Et(qj)=M_k(qj)+e*sin(Et_1(qj));        
              delta_E(qj)=Et(qj)-Et_1(qj);
              Et_1(qj)=Et(qj);
              if abs(delta_E(qj))<=1.0e-6
                 E_k(qj)=Et(qj);  
                 t_end=0;
              end 
          end 
       %%%%%%%%%%%%%% 求真近点角 f 的值 %%%%%%%%%%
          %A=(cos(E_k(qj))-e)/(1-e*cos(E_k(qj)));          %% f 的余弦
          A=cos(E_k(qj))-e;               %分母一定是是大于0的数所以只取分子来做判断
          %B=(sin(E_k(qj))*sqrt(1-e^2))/(1-e*cos(E_k(qj)));%% f 的正弦
          B=sqrt(1-e^2)*sin(E_k(qj));

         if (A==0)
             f(qj)=pi/2;    

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       7760  2008-01-09 15:24  GPS\gps_constellation_emluator\gps_constellation_emluator.m

     文件       3241  2007-12-06 21:41  GPS\gps_constellation_emluator\gps_satellite_distribute.m

     文件       8488  2007-12-06 21:37  GPS\gps_constellation_emluator\gps_satellite_distribute1.fig

     文件       8488  2007-12-06 21:41  GPS\gps_constellation_emluator\gps_satellite_distribute2.fig

     文件       8392  2007-12-06 21:41  GPS\gps_constellation_emluator\gps_satellite_distribute3.fig

     文件       9528  2007-12-04 14:01  GPS\gps_constellation_emluator\PDOP_Value.fig

     文件      10896  2007-12-04 14:01  GPS\gps_constellation_emluator\Plane_Orbit.fig

     文件      11896  2007-12-04 14:00  GPS\gps_constellation_emluator\Space_Orbit.fig

     文件       8464  2007-12-04 14:00  GPS\gps_constellation_emluator\visible_satellite.fig

     目录          0  2007-12-06 21:42  GPS\gps_constellation_emluator

     文件      15048  2008-03-26 17:03  GPS\gps_kalman\gps_kalman.m

     目录          0  2008-03-24 09:52  GPS\gps_kalman

     文件      13279  2007-12-08 21:05  GPS\gps_kalman_zsy\gps_kalman_zsy.m

     目录          0  2007-12-06 15:11  GPS\gps_kalman_zsy

     文件      12756  2008-03-22 09:38  GPS\gps_position\gps_position.m

     目录          0  2008-03-22 09:10  GPS\gps_position

     文件      19446  2008-01-16 15:03  GPS\read_data\brdc3330.07n

     文件      19446  2008-01-16 15:26  GPS\read_data\brdc3470.07n

     文件       1421  2008-01-16 15:13  GPS\read_data\eph.dat

     文件       1421  2008-01-16 15:28  GPS\read_data\eph1.dat

     文件       1132  2008-01-16 15:28  GPS\read_data\Read_eph.m

     目录          0  2008-01-16 15:28  GPS\read_data

     目录          0  2008-03-21 21:32  GPS

----------- ---------  ---------- -----  ----

               161320                    24


评论

共有 条评论