博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
轨道六根数 matlab,[转载]卫星的 两行星历 及转化为轨道六根数的MATLAB程序
阅读量:6887 次
发布时间:2019-06-27

本文共 1557 字,大约阅读时间需要 5 分钟。

%

function [oe,epoch,yr,M,E,satname] = TLE2oe(fname);

% fname is a filename string for a file containing

% a two-line element set (TLE)

% oe is a 1/6 matrix containing the orbital elements

% [a e i Om om nu]

% yr is the two-digit year

% M is the mean anomaly at epoch

% E is the eccentric anomaly at epoch

% satname is the satellite name

%

% Calls Newton iteration function file EofMe.m

function

[oe,epoch,yr,M,E,satname] = TLE2oe(file1.txt);

% Open the file

up and scan in the elements

fid =

fopen(fname, 'r');

A = fscanf(fid,'%13c%*s',1);

B =

fscanf(fid,'%d%6d%*c%5d%*3c%2d%f%f%5d%*c%*d%5d%*c%*d%d%5d',[1,10]);

C = fscanf(fid,'%d%6d%f%f%f%f%f%f',[1,8]);

fclose(fid);

satname=A;

% The value of

mu is for the earth

mu = 3.986004415e5;

% Calculate

2-digit year (Oh no!, look out for Y2K bug!)

yr =

B(1,4);

% Calculate

epoch in julian days

epoch = B(1,5);

%ndot = B(1,6);

% n2dot = B(1,7);

% Assign

variables to the orbital elements

i =

C(1,3)*pi/180; % inclination

Om =

C(1,4)*pi/180; % Right Ascension of the Ascending Node

e =

C(1,5)/1e7; % Eccentricity

om =

C(1,6)*pi/180; % Argument of periapsis

M =

C(1,7)*pi/180; % Mean anomaly

n = C(1,8)*2*pi/(24*3600); % Mean

motion

% Calculate the

semi-major axis

a = (mu/n^2)^(1/3);

% Calculate the

eccentric anomaly using mean anomaly

E = EofMe(M,e,1e-10);

% Calculate

true anomaly from eccentric anomaly

cosnu = (e-cos(E)) / (e*cos(E)-1);

sinnu = ((a*sqrt(1-e*e)) / (a*(1-e*cos(E))))*sin(E);

nu = atan2(sinnu,cosnu);

if (nu<0), nu=nu+2*pi; end

% Return the

orbital elements in a 1x6 matrix

oe = [a e i Om om nu];

转载地址:http://ditbl.baihongyu.com/

你可能感兴趣的文章
书摘---创业36条军规7:业务的五个问题
查看>>
Linux学习-第三节课
查看>>
activemq搭建和使用
查看>>
java语言实现将mysql的linestring、point 数据类型解析成double类型
查看>>
TCP三次握手和四次挥手
查看>>
Nginx动态添加模块
查看>>
WPF和Silverlight概述(1)
查看>>
java笔记:第4章 流程控制
查看>>
《Python从小白到大牛》第8章 控制语句
查看>>
pxe自动安装系统 (linux)
查看>>
cacti关于1000M网卡的监控
查看>>
我的友情链接
查看>>
详解 Spotlight on Unix 监控Linux服务器
查看>>
docker 安装及简单配置
查看>>
关于大数据和古中国的一丝小想法随笔(续)
查看>>
十二年IT职业生涯心得--致我们终将逝去的青春(连载)
查看>>
我的友情链接
查看>>
初学Redis(2)——用Redis作为Mysql数据库的缓存
查看>>
使用Jersey构建图片服务器 有回显图片功能
查看>>
SQL 去重
查看>>