根据卫星轨道参数(Two Line Element)模拟星下点轨迹

最方便获取的卫星轨道参数是北美防空司令部(NORAD)发布的两行根数(Two Line Element)

 主要根数记录在第二行:(inclination)轨道倾角,升交点经度,轨道偏心率,近地点角距,平近点角,(mean motion)平运动速率。

星下点轨迹绘制

以GAOFEN5参数为例,半长轴等于地球半径+轨道高度。

 

 

clc
close all
clear all
%%
W_EARTH =7.29e-5; %地球自转速度
GGC =3.986e5;%地球引力常数
%轨道六根数
a =(6371 + 705)*1e3; %地球半径
e =0.003123; %轨道偏心率
i =98.2358*pi/180; %轨道倾角
w =75.3926*pi/180; %轨道近地点幅角
RAAN =192.8991*pi/180; %升交点赤经

T = 2*pi*sqrt((a^3)/GGC);
N_T=fix(86400*0.2/T);%绘制近地轨道星下点,周期远小于24h   86400s=24h
%轨道真近点角计算
Ts= 5; %采样时间间隔 s
t =0:Ts:fix(N_T*T); %采样时间点
tp =0; 
n =sqrt(GGC/a^3); %卫星平运动时间
M =n*(t-tp);%星平近点角
f =M+(2*e-e^3/4)*sin(M)+1.25*e^2*sin(2*M)+13/12*e^3*sin(3*M);%轨道真近点角
%%
Rz_RAAN =[cos(RAAN) -sin(RAAN) 0;sin(RAAN) cos(RAAN) 0; 0 0 1];
Rz_w =[cos(w) -sin(w) 0;sin(w) cos(w) 0;0 0 1];
Rx_i =[1 0 0;0 cos(i) -sin(i);0 sin(i) cos(i)]; %坐标转换矩阵
R =a*(1-e^2)./(1+e*cos(f));%卫星距地心的距离,考虑f的离散值
r_sv =[R;R;R].*[cos(f);sin(f);zeros(1,size(f,2))];%卫星在轨道坐标系中的坐标
r_so =Rz_RAAN*Rx_i*Rz_w*r_sv;%卫星在地心惯性坐标系中的坐标
x_so =r_so(1,:);%卫星在地心惯性坐标系的分量
y_so =r_so(2,:);%卫星在地心惯性坐标系的分量
z_so =r_so(3,:);%卫星在地心惯性坐标系的分量
%卫星纬度delta,大于0为北纬
delta =atan(z_so./sqrt(x_so.^2+y_so.^2))*180/pi;
%卫星经度delta,大于180为西经
for m=1:1:size(r_so,2)
    if(r_so(1,m)<0)
        alpha(m) =180+atan(r_so(2,m)/r_so(1,m))*180/pi;
    else if (r_so(2,m)>0)
            alpha(m) =atan(r_so(2,m)/r_so(1,m))*180/pi;
         else
             alpha(m) =360+atan(r_so(2,m)/r_so(1,m))*180/pi;
        end
    end
      
end
%%
 figure(1)                           %out 
 axis([-180 180 -90 90]) 
 set(gcf,'outerposition', get(0,'screensize')); 
 geoshow('landareas.shp', 'FaceColor', [1 1 1]); 
 grid on 
 hold
alpha1 =rem((alpha-W_EARTH*t*180/pi+N_T*360),360);
for m=1:1:size(r_so,2)
if alpha1(m)>180
          alpha1(m)=alpha1(m)-360;
end;
% alpha1(m)=-alpha1(m);
end
plot(alpha1,delta,'.');
plot(115.25,39.26,'*')
grid;
xlabel('卫星经度');
ylabel('卫星纬度');
%%

matlab代码绘制的结果与在线绘制的相同。 

在线绘制星下点轨迹

北美防空司令部 Two-Line Element

### 使用MATLAB与STK集成以获得卫星地面轨迹)的据 为了实现这一目标,可以利用AGI公司提供的工具包——Astro Toolbox以及STK/MATLAB接口。该过程涉及创建一个连接到STK的COM对象,在MATLAB环境中运行并请求所需据。 #### 创建COM对象并与STK交互 首先启动STK应用程序并通过`actxserver`函建立链接: ```matlab stkApp = actxserver('AgStkObjectLibrary.Application'); ``` 设置STK不显示界面以便于批处理操作[^1]: ```matlab stkApp.Visible = false; ``` 接着访问根目录下的据库管理器准备加载场景文件或新建一个场景: ```matlab root = stkApp.Personality2; newScenarioName = 'MySatelliteScenario'; root.NewScenario(newScenarioName); scenario = root.CurrentScenario; ``` 定义时间范围用于后续分析,这里假设时间段是从当前时刻起的一天内: ```matlab startTime = datestr(now,'yyyy-mm-dd') + ' 00:00:00'; % Start at midnight today stopTime = datestr(now+1/365,'yyyy-mm-dd') + ' 00:00:00';% Stop after one day timePeriod = sprintf('%s : %s', startTime, stopTime); scenario.SetTimePeriod(timePeriod); ``` 向场景中添加卫星,并指定其TLE参数作为轨道描述方式之一(此处仅为示意): ```matlab satellite = scenario.Children.Add(stkObjects_e.stkObjects_Satellite); nameOfSatellite = 'ExampleSat'; satellite.Name = nameOfSatellite; tleData = ['ISS (ZARYA)' ... '1 25544U 98067A 23061.53840422 .00001442 00000-0 28403-4 0 9998'... '2 25544 51.6442 13.6311 0003848 54.6222 42.6244 15.49404906341424']; [satellite.DataProviders.Item('Two Line Element Set').Exec(tleData)]; ``` 最后一步是提取卫星坐标信息。这可以通过查询卫星位置属性完成,再转换成地理经纬度表示形式: ```matlab accessQuery = satellite.Accesses.GetAccessBetween(satellite, 'CentralBody$Earth'); for i=1:length(accessQuery.Intervals) intervalStart = accessQuery.GetIntervals(i).Interval.Start; intervalStop = accessQuery.GetIntervals(i).Interval.Stop; epochVector = CreateEpochVector(intervalStart,intervalStop,60); % Sample every minute for j=1:length(epochVector) currentEpoch = epochVector(j); positionResult = satellite.PositionAndVelocity.QueryAt(currentEpoch); latLonAlt = ConvertEciToLatLon(positionResult.Position); fprintf('%.2f %.2f\n',latLonAlt.Latitude,latLonAlt.Longitude); end end function vec = CreateEpochVector(startStr,endStr,sampleRateSec) startNum = datenum(datetime(startStr,'InputFormat','yyyy-MM-dd HH:mm:ss')); endNum = datenum(datetime(endStr,'InputFormat','yyyy-MM-dd HH:mm:ss')); stepSizeDays = sampleRateSec/(24*60*60); vec = arrayfun(@(n)datestr(n),startNum:stepSizeDays:endNum,'UniformOutput',false)'; end function llh = ConvertEciToLatLon(eciPosition) % This function converts ECI coordinates to Latitude Longitude Altitude. % For simplicity this example assumes a spherical Earth model and does not account for rotation or other effects. r = norm(eciPosition); phi = atan2(sqrt(sum(eciPosition([1 2]).^2)), eciPosition(3)); lambda = atan2(eciPosition(2),eciPosition(1)); Re = 6378; % Radius of the earth in kilometers assuming WGS84 ellipsoid parameters could be used instead h = r - Re; llh.Latitude = radtodeg(phi-pi()/2); llh.Longitude = radtodeg(lambda); llh.Altitude = h; end ``` 上述脚本展示了如何初始化STK环境、导入卫星轨道(TLE),并且遍历整个仿真周期内的每一分钟来计算对应的位置
评论 7
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值