速度矢量 matlab,matlab实现位置/速度矢量的轨道元素

Orbital Elements from Position/Velocity Vectors

vec2orbElem(rs,vs,mus) converts positions (rs) and velocities (vs)

of bodies with gravitational parameters (mus) to Keplerian orbital elements.

INPUTS:

rs: 3n x 1 stacked initial position vectors:

[r1(1);r1(2);r1(3);r2(1);r2(2)r2(3);...;rn(1);rn(2);rn(3)]

or 3 x n matrix of position vectors.

vs: 3n x 1 stacked initial velocity vectors or 3 x n matrix

mus: gravitational parameters (G*m_i) where G is the

gravitational constant and m_i is the mass of the ith body.

if all vectors represent the same body, mus may be a

scalar.

OUTPUTS:

a: semi-major axes

e: eccentricities

E: eccentric anomalies

I: inclinations

omega: arguments of pericenter

Omega: longitudes of ascending nodes

P: orbital periods

tau: time of periapsis crossing

A, B: orientation matrices (see Vinti, 1998)

All units must be complementary, i.e., if positions are in AUs, and

time is in days, dx0 must be in AU/day, mus must be in

AU^3/day^2 (these are the units in solarSystemData.mat).

The data in solarSystemData.mat was downloaded from JPL's System Web

Interface (http://ssd.jpl.nasa.gov/?horizons). It includes

positions for the planets, the sun and pluto (because I went to

grade school before 2006). Positions for planets with moons are for

the barycenters.

Example:

%solar system oribtal elements

ssdat = load('solarSystemData.mat');

rs = ssdat.p0(1:end-3) - repmat(ssdat.p0(end-2:end),9,1);

vs = ssdat.v0(1:end-3) - repmat(ssdat.v0(end-2:end),9,1);

mus = ssdat.mus(1:9) + ssdat.mus(10);

[a,e,E,I,omega,Omega,P,tau,A,B] = vec2orbElem(rs,vs,mus);

%convert back:

r = A*diag(cos(E) - e) + B*diag(sin(E));

rdot = (-A*diag(sin(E))+B*diag(cos(E)))*...

diag(sqrt(mus(:).'.*a.^-3)./(1 - e.*cos(E)));

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值