Need method for trilateration of 3 GPS satellites

1. Jan 30, 2012

tribaljunkie

Can someone please shed some light on the exact method for finding the two points at which the spheres created by the GPS signals from 3 different satellites intersect? I have been working on a uni project for 4 days now and still can't get this relatively simple part of my MATLAB code to work. I realise the 4th satellite is for a time error, but that's not part of my report, i just have the position of that to select the intersection point with the range closest to the pseudorange from the 4th satellite.

the data i have is 4 satellite positions and their corresponding pseudoranges.

if someone could give me the mathematical method, or if you're able even the MATLAB process required as im a bit rusty with it.

any help much appreciated, cheers.

2. Jan 31, 2012

tribaljunkie

after a bit more research iv found i need to use the non linear least squares method in MATLAB, but still having trouble coding it.

if the ranges from the satellites were perfect i could use the simultaneous equations

0 = (ri_ia(1,1)-ri_is1(1,1))^2+(ri_ia(2,1)-ri_is1(2,1))^2+(ri_ia(3,1)-ri_is1(3,1))^2 - rho_1^2;
0 = (ri_ia(1,1)-ri_is2(1,1))^2+(ri_ia(2,1)-ri_is2(2,1))^2+(ri_ia(3,1)-ri_is2(3,1))^2 - rho_2^2;
0 = (ri_ia(1,1)-ri_is3(1,1))^2+(ri_ia(2,1)-ri_is3(2,1))^2+(ri_ia(3,1)-ri_is3(3,1))^2 - rho_3^2;
0 = (ri_ia(1,1)-ri_is4(1,1))^2+(ri_ia(2,1)-ri_is4(2,1))^2+(ri_ia(3,1)-ri_is4(3,1))^2 - rho_4^2;

where ri_ia is the receiver position (1x3 vector), ri_is is the satellite position (1x3 vector) and rho is the corresponding range from receiver to satellite (scalar). Also rho includes unavoidable errors.

as the measurements are not exact i must use the least squares approach minimising the error dri_ia.

dri_ia1 = (ri_ia(1,1)-ri_is1(1,1))^2+(ri_ia(2,1)-ri_is1(2,1))^2+(ri_ia(3,1)-ri_is1(3,1))^2 - rho_1^2;
dri_ia2 = (ri_ia(1,1)-ri_is2(1,1))^2+(ri_ia(2,1)-ri_is2(2,1))^2+(ri_ia(3,1)-ri_is2(3,1))^2 - rho_2^2;
dri_ia3 = (ri_ia(1,1)-ri_is3(1,1))^2+(ri_ia(2,1)-ri_is3(2,1))^2+(ri_ia(3,1)-ri_is3(3,1))^2 - rho_3^2;
dri_ia4 = (ri_ia(1,1)-ri_is4(1,1))^2+(ri_ia(2,1)-ri_is4(2,1))^2+(ri_ia(3,1)-ri_is4(3,1))^2 - rho_4^2;

thing is i have no idea how to get matlab to do this for me, could anyone lend a hand. i know the function is LSQNONLIN but i am not experienced enough with matlab to understand the help file and implement it.

any help would be great, thanks.