Global Positioning System Reference
In-Depth Information
%p97 1.m This program corrects satellite position and called
by program 9 7
function outp = sat corr(satp1, userp)
[m, n] = size(satp1);
outp = satp1;
Omegadot e = 7.2921151467e-5;
c = 299792458;
for k = 1:m,
x = satp1(k, 1);
y = satp1(k, 2);
z = satp1(k, 3);
r = satp1(k, 6);
%Corrected Radius
i = satp1(k, 7);
%Corrected Inclination
phi = satp1(k, 8);
%Argument of Latitude
omeger = satp1(k, 9);
xp=r*cos(phi); %In-plane x position
yp=r*sin(phi); %In-plane y position
xr = userp(1); yr = userp(2); zr = userp(3);
err = 1000;
while err > 1,
xold=x;yold=y;zold=z;
tprop = ((x - xr) ^2+(y-yr)^2+(z-zr)^2)^
0.5/c;
Omega p = omeger - Omegadot e * tprop;
x = xp * cos(Omega p) - yp * cos(i) * sin(Omega p);
y = xp * sin(Omega p) + yp * cos(i) * cos(Omega p);
z = yp * sin(i);
err = ((x - xold) ^ 2 + (y - yold)^2+(z-zold) ^ 2) ^
0.5;
end
outp(k, 1:3) = [x y z];
end
Search WWH ::




Custom Search