UWBIns/Code/Matlab/lib/gnss/sv_clock_bias.m

37 lines
817 B
Mathematica
Raw Permalink Normal View History

2025-04-16 20:15:33 +08:00
function dtr = sv_clock_bias(t, toc, a0, a1, a2, e, sqrtA, toe, Delta_n, M0)
% :
% a0 a1 a2 toc: 3 toc: ,
% dtr
dtr = a0+a1*(t-toc)+a2*(t-toc).^2;%t
F = -4.442807633e-10;
mu = 3.986005e14;
A = sqrtA^2;
cmm = sqrt(mu/A^3); % computed mean motion
tk = t - toe;
% account for beginning or end of week crossover
if (tk > 302400)
tk = tk-604800;
end
if (tk < -302400)
tk = tk+604800;
end
% apply mean motion correction
n = cmm + Delta_n;
% Mean anomaly
mk = M0 + n*tk;
% solve for eccentric anomaly
Ek = mk;
Ek = mk + e*sin(Ek);
Ek = mk + e*sin(Ek);
Ek = mk + e*sin(Ek);
% dsv s
dtr = dtr + F*e*sqrtA*sin(Ek);
end