% -----------------------------------------------------------------------------
%
% procedure sgp4init
%
% this procedure initializes variables for sgp4.
%
% Author:
% Jeff Beck
% beckja@alumni.lehigh.edu
% 1.0 (aug 7, 2006) - update for paper dav
% original comments from Vallado C++ version:
% author : david vallado 719-573-2600 28 jun 2005
%
% inputs :
% satn - satellite number
% bstar - sgp4 type drag coefficient kg/m2er
% ecco - eccentricity
% epoch - epoch time in days from jan 0, 1950. 0 hr
% argpo - argument of perigee (output if ds)
% inclo - inclination
% mo - mean anomaly (output if ds)
% no - mean motion
% nodeo - right ascension of ascending node
%
% outputs :
% satrec - common values for subsequent calls
% return code - non-zero on error.
% 1 - mean elements, ecc >= 1.0 or ecc < -0.001 or a < 0.95 er
% 2 - mean motion less than 0.0
% 3 - pert elements, ecc < 0.0 or ecc > 1.0
% 4 - semi-latus rectum < 0.0
% 5 - epoch elements are sub-orbital
% 6 - satellite has decayed
%
% locals :
% CNODM , SNODM , COSIM , SINIM , COSOMM , SINOMM
% Cc1sq , Cc2 , Cc3
% Coef , Coef1
% cosio4 -
% day -
% dndt -
% em - eccentricity
% emsq - eccentricity squared
% eeta -
% etasq -
% gam -
% argpm - argument of perigee
% ndem -
% inclm - inclination
% mm - mean anomaly
% nm - mean motion
% perige - perigee
% pinvsq -
% psisq -
% qzms24 -
% rtemsq -
% s1, s2, s3, s4, s5, s6, s7 -
% sfour -
% ss1, ss2, ss3, ss4, ss5, ss6, ss7 -
% sz1, sz2, sz3
% sz11, sz12, sz13, sz21, sz22, sz23, sz31, sz32, sz33 -
% tc -
% temp -
% temp1, temp2, temp3 -
% tsi -
% xpidot -
% xhdot1 -
% z1, z2, z3 -
% z11, z12, z13, z21, z22, z23, z31, z32, z33 -
%
% coupling :
% getgravconst
% initl -
% dscom -
% dpper -
% dsinit -
% sgp4 -
%
% references :
% hoots, roehrich, norad spacetrack report #3 1980
% hoots, norad spacetrack report #6 1986
% hoots, schumacher and glover 2004
% vallado, crawford, hujsak, kelso 2006
% ----------------------------------------------------------------------------*/
function [satrec] = sgp4init(whichconst, satrec, xbstar, xecco, epoch, ...
xargpo, xinclo, xmo, xno, xnodeo);
% /* ------------------------ initialization --------------------- */
% /* ----------- set all near earth variables to zero ------------ */
satrec.isimp = 0; satrec.method = 'n'; satrec.aycof = 0.0;
satrec.con41 = 0.0; satrec.cc1 = 0.0; satrec.cc4 = 0.0;
satrec.cc5 = 0.0; satrec.d2 = 0.0; satrec.d3 = 0.0;
satrec.d4 = 0.0; satrec.delmo = 0.0; satrec.eta = 0.0;
satrec.argpdot = 0.0; satrec.omgcof = 0.0; satrec.sinmao = 0.0;
satrec.t = 0.0; satrec.t2cof = 0.0; satrec.t3cof = 0.0;
satrec.t4cof = 0.0; satrec.t5cof = 0.0; satrec.x1mth2 = 0.0;
satrec.x7thm1 = 0.0; satrec.mdot = 0.0; satrec.nodedot = 0.0;
satrec.xlcof = 0.0; satrec.xmcof = 0.0; satrec.nodecf = 0.0;
% /* ----------- set all deep space variables to zero ------------ */
satrec.irez = 0; satrec.d2201 = 0.0; satrec.d2211 = 0.0;
satrec.d3210 = 0.0; satrec.d3222 = 0.0; satrec.d4410 = 0.0;
satrec.d4422 = 0.0; satrec.d5220 = 0.0; satrec.d5232 = 0.0;
satrec.d5421 = 0.0; satrec.d5433 = 0.0; satrec.dedt = 0.0;
satrec.del1 = 0.0; satrec.del2 = 0.0; satrec.del3 = 0.0;
satrec.didt = 0.0; satrec.dmdt = 0.0; satrec.dnodt = 0.0;
satrec.domdt = 0.0; satrec.e3 = 0.0; satrec.ee2 = 0.0;
satrec.peo = 0.0; satrec.pgho = 0.0; satrec.pho = 0.0;
satrec.pinco = 0.0; satrec.plo = 0.0; satrec.se2 = 0.0;
satrec.se3 = 0.0; satrec.sgh2 = 0.0; satrec.sgh3 = 0.0;
satrec.sgh4 = 0.0; satrec.sh2 = 0.0; satrec.sh3 = 0.0;
satrec.si2 = 0.0; satrec.si3 = 0.0; satrec.sl2 = 0.0;
satrec.sl3 = 0.0; satrec.sl4 = 0.0; satrec.gsto = 0.0;
satrec.xfact = 0.0; satrec.xgh2 = 0.0; satrec.xgh3 = 0.0;
satrec.xgh4 = 0.0; satrec.xh2 = 0.0; satrec.xh3 = 0.0;
satrec.xi2 = 0.0; satrec.xi3 = 0.0; satrec.xl2 = 0.0;
satrec.xl3 = 0.0; satrec.xl4 = 0.0; satrec.xlamo = 0.0;
satrec.zmol = 0.0; satrec.zmos = 0.0; satrec.atime = 0.0;
satrec.xli = 0.0; satrec.xni = 0.0;
% sgp4fix - note the following variables are also passed directly via satrec.
% it is possible to streamline the sgp4init call by deleting the "x"
% variables, but the user would need to set the satrec.* values first. we
% include the additional assignment in case twoline2rv is not used.
satrec.bstar = xbstar;
satrec.ecco = xecco;
satrec.argpo = xargpo;
satrec.inclo = xinclo;
satrec.mo = xmo;
satrec.no = xno;
satrec.nodeo = xnodeo;
% /* -------------------- wgs-72 earth constants ----------------- */
% // sgp4fix identify constants and allow alternate values
global tumin mu radiusearthkm xke j2 j3 j4 j3oj2
[tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2] = getgravc( whichconst );
ss = 78.0 / radiusearthkm + 1.0;
qzms2t = ((120.0 - 78.0) / radiusearthkm)^4;
x2o3 = 2.0 / 3.0;
% sgp4fix divisor for divide by zero check on inclination
% the old check used 1.0 + cos(pi-1.0e-9), but then compared it to
% 1.5 e-12, so the threshold was changed to 1.5e-12 for consistancy
temp4 = 1.5e-12;
satrec.init = 'y';
satrec.t = 0.0;
[ainv, ao, satrec.con41, con42, cosio, cosio2, einv, eccsq,...
satrec.method, omeosq, posq, rp, rteosq, sinio,...
satrec.gsto, satrec.no]...
= initl(...
satrec.ecco, epoch, satrec.inclo, satrec.no,...
satrec.satnum);
satrec.error = 0;
if (rp < 1.0)
% printf("# *** satn%d epoch elts sub-orbital ***\n", satn);
satrec.error = 5;
end
if ((omeosq >= 0.0 ) | ( satrec.no >= 0.0))
satrec.isimp = 0;
if (rp < (220.0 / radiusearthkm + 1.0))
satrec.isimp = 1;
end
sfour = ss;
qzms24 = qzms2t;
perige = (rp - 1.0) * radiusearthkm;
% /* - for perigees below 156 km, s and qoms2t are altered - */
if (perige < 156.0)
sfour = perige - 78.0;
if (perige < 98.0)
sfour = 20.0;
end
qzms24 = ((120.0 - sfour) / radiusearthkm)^4.0;
sfour = sfour / radiusearthkm + 1.0;
end
pinvsq = 1.0 / posq;
tsi = 1.0 / (ao - sfour);
satrec.eta = ao * satrec.ecco * tsi;
etasq = satrec.eta * satrec.eta;
eeta = satrec.ecco * satrec.eta;
psisq = abs(1.0 - etasq);
coef = qzms24 * tsi^4.0;
coef1 = coef / psisq^3.5;
cc2 = coef1 * satrec.no * (ao * (1.0 + 1.5 * etasq + eeta *...
(4.0 + etasq)) + 0.375 * j2 * tsi / psisq * satrec.con41 *...
(8.0 + 3.0 * etasq * (8.0 + etasq)));
satrec.cc1 = satrec.bstar * cc2;
cc3 = 0.0;
if (satrec.ecco > 1.0e-4)
cc3 = -2.0 * coef * tsi * j3oj2 * satrec.no * sinio / satrec.ecco;
end
satrec.x1mth2 = 1.0 - cosio2;
没有合适的资源?快使用搜索试试~ 我知道了~
matlab.zip_Matlab 航天_aerospace matlab_matlab_matlab 软件_航天
共193个文件
m:188个
dat:4个
out:1个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 150 浏览量
2022-09-22
23:25:17
上传
评论 1
收藏 274KB ZIP 举报
温馨提示
航天计算基础软件,matlab程序,包含基础的航天计算软件
资源推荐
资源详情
资源评论
收起资源包目录
matlab.zip_Matlab 航天_aerospace matlab_matlab_matlab 软件_航天 (193个子文件)
iau00x.dat 167KB
iau00y.dat 133KB
iau00s.dat 7KB
nut80.dat 5KB
sgp4init.m 14KB
iau00xys.m 13KB
ex3_1415.m 13KB
anglesg.m 12KB
sgp4.m 12KB
dsinit.m 12KB
moonrise.m 10KB
convtime.m 10KB
twoline2rv.m 10KB
anglesl.m 10KB
kepler.m 9KB
ex2_5.m 9KB
dscom.m 8KB
lambertu.m 8KB
fundarg.m 8KB
rv2coe.m 8KB
lambertb.m 7KB
dspace.m 7KB
anglesdr.m 7KB
quartic.m 7KB
quintic.m 7KB
sunriset.m 7KB
dpper.m 7KB
rngaz.m 6KB
truemean.m 6KB
ex4_1.m 6KB
ex7_34.m 6KB
testmat.m 5KB
pkepler.m 5KB
ex7_2.m 5KB
mincomb.m 5KB
precess.m 5KB
onetang.m 5KB
rv2razel.m 5KB
cubic.m 5KB
iau00i2f.m 5KB
iau00f2i.m 5KB
debug7.m 5KB
rv2tradc.m 5KB
newtonm.m 4KB
debug6.m 4KB
eq2rv.m 4KB
initl.m 4KB
sun.m 4KB
razel2rv.m 4KB
doubler.m 4KB
nutation.m 4KB
gibbs.m 4KB
hgibbs.m 4KB
coe2rv.m 4KB
moon.m 4KB
rendz.m 4KB
ijk2lle.m 4KB
satfov.m 3KB
findtof.m 3KB
sunill.m 3KB
biellip.m 3KB
sidereal.m 3KB
eci2ecef.m 3KB
debug2.m 3KB
rv2flt.m 3KB
ecef2eci.m 3KB
cubicspl1.m 3KB
sight.m 3KB
ijk2llb.m 3KB
flt2rv.m 3KB
newtonnu.m 3KB
ijk2ll.m 3KB
quartbln.m 3KB
polarm.m 3KB
testlam.m 3KB
ex7_1.m 3KB
hohmann.m 3KB
rvs2raz.m 3KB
pathm.m 3KB
checkhit.m 3KB
rv2eq.m 3KB
eci2pef.m 3KB
eci2hill.m 3KB
quadric.m 3KB
pef2eci.m 3KB
debug3.m 3KB
dolam.m 3KB
seebatt.m 3KB
teme2ecef.m 3KB
ecef2teme.m 3KB
combined.m 3KB
getgravc.m 3KB
ex10_3.m 2KB
kbatt.m 2KB
nodeonly.m 2KB
newtone.m 2KB
hill2eci.m 2KB
invjday.m 2KB
days2mdh.m 2KB
hillsr.m 2KB
共 193 条
- 1
- 2
资源评论
Kinonoyomeo
- 粉丝: 77
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功