At this stage the following quantities should be available:
From these quantities the following 4 unknowns are to be solved: the receiver coordinates Xr, Yr and Zr, and the receiver clock error Cr. The relation between the known quantities and the unknown quantities are given by Pythagoras' theorem:
Prs + Cr + Es = sqrt{(Xr - Xs)^2 + (Yr - Ys)^2 + (Zr - Zs)^2}; s = 1 , ... , n
with Es the lump sum of all remaining model errors (SV clock error, iono- and tropo delay) and unmodelled errors (such as multipath error and receiver noise) in the pseudoranges Prs.
To solve these n equations, first linearize:
Prs + Cr + Es = Rrs + dX * (Xr - Xs) / Rrs + dY * (Yr - Ys) / Rrs + dZ *
(Zr - Zs) / Rrs ;
s = 1 , ... , n
with Rrs the distance between the receiver and satellite s, calculated with the apProximated receiver position coordinates, and dX, dY, dZ the updates to these coordinates.
The n equations can be re-arranges as follows:
[(Xr - Xs) / Rrs] * dX + [(Yr - Ys) / Rrs] * dY + [(Zr - Zs) / Rrs] * dZ
- Cr = Prs - Rrs + Es ;
s = 1 , ... , n
To solve this set of n equations with 4 unknowns is a standard least squares
Problem, which is treated in any textbook on applied math. In case n equals
4, the Es's are set to zero.
The Procedure is as follows:
Click here to inspect, or download the Turbo Pascal Procedure 'solve' It's a procedure within my program to calculate receiver position from raw data. It is an example of an implementation of the above described steps. I made it for demonstration purposes, certainly not for efficiency and speed. The implementation of the least squares solution is VERY basic textbook and according mathematicians may be numerically unstable! However, it serves its demonstration purposes (and I use it for real-world problems without difficulty). You'll find stable and efficient procedures in math toolkits for your programming language.