# GNSS positioning calculation

The global navigation satellite system (GNSS) positioning for receiver's position is derived through the calculation steps, or algorithm, given below. In essence, a GNSS receiver measures the transmitting time of GNSS signals emitted from four or more GNSS satellites and these measurements are used to obtain its position (i.e., spatial coordinates) and reception time.

## Calculation steps

1. A global-navigation-satellite-system (GNSS) receiver measures the apparent transmitting time, ${\displaystyle \displaystyle {\tilde {t}}_{i}}$, or "phase", of GNSS signals emitted from four or more GNSS satellites (${\displaystyle \displaystyle i\;=\;1,\,2,\,3,\,4,\,..,\,n}$ ), simultaneously.[1]
2. GNSS satellites broadcast the messages of satellites' ephemeris, ${\displaystyle \displaystyle {\boldsymbol {r}}_{i}(t)}$, and intrinsic clock bias (i.e., clock advance), ${\displaystyle \displaystyle \delta t_{{\text{clock,sv}},i}(t)}$[clarification needed] as the functions of (atomic) standard time, e.g., GPST.[2]
3. The transmitting time of GNSS satellite signals, ${\displaystyle \displaystyle t_{i}}$, is thus derived from the non-closed-form equations ${\displaystyle \displaystyle {\tilde {t}}_{i}\;=\;t_{i}\,+\,\delta t_{{\text{clock}},i}(t_{i})}$ and ${\displaystyle \displaystyle \delta t_{{\text{clock}},i}(t_{i})\;=\;\delta t_{{\text{clock,sv}},i}(t_{i})\,+\,\delta t_{{\text{orbit-relativ}},\,i}({\boldsymbol {r}}_{i},\,{\dot {\boldsymbol {r}}}_{i})}$, where ${\displaystyle \displaystyle \delta t_{{\text{orbit-relativ}},i}({\boldsymbol {r}}_{i},\,{\dot {\boldsymbol {r}}}_{i})}$ is the relativistic clock bias, periodically risen from the satellite's orbital eccentricity and Earth's gravity field.[2] The satellite's position and velocity are determined by ${\displaystyle \displaystyle t_{i}}$ as follows: ${\displaystyle \displaystyle {\boldsymbol {r}}_{i}\;=\;{\boldsymbol {r}}_{i}(t_{i})}$ and ${\displaystyle \displaystyle {\dot {\boldsymbol {r}}}_{i}\;=\;{\dot {\boldsymbol {r}}}_{i}(t_{i})}$.
4. In the field of GNSS, "geometric range", ${\displaystyle \displaystyle r({\boldsymbol {r}}_{A},\,{\boldsymbol {r}}_{B})}$, is defined as straight range, or 3-dimensional distance,[3] from ${\displaystyle \displaystyle {\boldsymbol {r}}_{A}}$ to ${\displaystyle \displaystyle {\boldsymbol {r}}_{B}}$ in inertial frame (e.g., Earth-centered inertial (ECI) one), not in rotating frame.[2]
5. The receiver's position, ${\displaystyle \displaystyle {\boldsymbol {r}}_{\text{rec}}}$, and reception time, ${\displaystyle \displaystyle t_{\text{rec}}}$, satisfy the light-cone equation of ${\displaystyle \displaystyle r({\boldsymbol {r}}_{i},\,{\boldsymbol {r}}_{\text{rec}})/c\,+\,(t_{i}-t_{\text{rec}})\;=\;0}$ in inertial frame, where ${\displaystyle \displaystyle c}$ is the speed of light. The signal time of flight from satellite to receiver is ${\displaystyle \displaystyle -(t_{i}\,-\,t_{\text{rec}})}$.
6. The above is extended to the satellite-navigation positioning equation, ${\displaystyle \displaystyle r({\boldsymbol {r}}_{i},\,{\boldsymbol {r}}_{\text{rec}})/c\,+\,(t_{i}\,-\,t_{\text{rec}})\,+\,\delta t_{{\text{atmos}},i}\,-\,\delta t_{{\text{meas-err}},i}\;=\;0}$, where ${\displaystyle \displaystyle \delta t_{{\text{atmos}},i}}$ is atmospheric delay (= ionospheric delay + tropospheric delay) along signal path and ${\displaystyle \displaystyle \delta t_{{\text{meas-err}},i}}$ is the measurement error.
7. The Gauss–Newton method can be used to solve the nonlinear least-squares problem for the solution: ${\displaystyle \displaystyle ({\hat {\boldsymbol {r}}}_{\text{rec}},\,{\hat {t}}_{\text{rec}})\;=\;\arg \min \phi ({\boldsymbol {r}}_{\text{rec}},\,t_{\text{rec}})}$, where ${\displaystyle \displaystyle \phi ({\boldsymbol {r}}_{\text{rec}},\,t_{\text{rec}})\;=\;\sum _{i=1}^{n}(\delta t_{{\text{meas-err}},i}/\sigma _{\delta t_{{\text{meas-err}},i}})^{2}}$. Note that ${\displaystyle \displaystyle \delta t_{{\text{meas-err}},i}}$ should be regarded as a function of ${\displaystyle \displaystyle {\boldsymbol {r}}_{\text{rec}}}$ and ${\displaystyle \displaystyle t_{\text{rec}}}$.
8. The posterior distribution of ${\displaystyle \displaystyle {\boldsymbol {r}}_{\text{rec}}}$ and ${\displaystyle \displaystyle t_{\text{rec}}}$ is proportional to ${\displaystyle \displaystyle \exp(-{\frac {1}{2}}\phi ({\boldsymbol {r}}_{\text{rec}},\,t_{\text{rec}}))}$, whose mode is ${\displaystyle \displaystyle ({\hat {\boldsymbol {r}}}_{\text{rec}},\,{\hat {t}}_{\text{rec}})}$. Their inference is formalized as maximum a posteriori estimation.
9. The posterior distribution of ${\displaystyle \displaystyle {\boldsymbol {r}}_{\text{rec}}}$ is proportional to ${\displaystyle \displaystyle \int _{-\infty }^{\infty }\exp(-{\frac {1}{2}}\phi ({\boldsymbol {r}}_{\text{rec}},\,t_{\text{rec}}))\,dt_{\text{rec}}}$.

## The GPS case

${\displaystyle \scriptstyle {\begin{cases}\scriptstyle \Delta t_{i}(t_{i},\,E_{i})\;\triangleq \;t_{i}\,+\,\delta t_{{\text{clock}},i}(t_{i},\,E_{i})\,-\,{\tilde {t}}_{i}\;=\;0,\\\scriptstyle \Delta M_{i}(t_{i},\,E_{i})\;\triangleq \;M_{i}(t_{i})\,-\,(E_{i}\,-\,e_{i}\sin E_{i})\;=\;0,\end{cases}}}$

in which ${\displaystyle \scriptstyle E_{i}}$ is the orbital eccentric anomaly of satellite ${\displaystyle i}$, ${\displaystyle \scriptstyle M_{i}}$ is the mean anomaly, ${\displaystyle \scriptstyle e_{i}}$ is the eccentricity, and ${\displaystyle \scriptstyle \delta t_{{\text{clock}},i}(t_{i},\,E_{i})\;=\;\delta t_{{\text{clock,sv}},i}(t_{i})\,+\,\delta t_{{\text{orbit-relativ}},i}(E_{i})}$.

• The above can be solved by using the bivariate Newton–Raphson method on ${\displaystyle \scriptstyle t_{i}}$ and ${\displaystyle \scriptstyle E_{i}}$. Two times of iteration will be necessary and sufficient in most cases. Its iterative update will be described by using the approximated inverse of Jacobian matrix as follows:

${\displaystyle \scriptstyle {\begin{pmatrix}t_{i}\\E_{i}\\\end{pmatrix}}\leftarrow {\begin{pmatrix}t_{i}\\E_{i}\\\end{pmatrix}}-{\begin{pmatrix}1&&0\\{\frac {{\dot {M}}_{i}(t_{i})}{1-e_{i}\cos E_{i}}}&&-{\frac {1}{1-e_{i}\cos E_{i}}}\\\end{pmatrix}}{\begin{pmatrix}\Delta t_{i}\\\Delta M_{i}\\\end{pmatrix}}}$

## The GLONASS case

• The GLONASS ephemerides don't provide clock biases ${\displaystyle \scriptstyle \delta t_{{\text{clock,sv}},i}(t)}$, but ${\displaystyle \scriptstyle \delta t_{{\text{clock}},i}(t)}$.

## Note

• In the field of GNSS, ${\displaystyle \scriptstyle {\tilde {r}}_{i}\;=\;-c({\tilde {t}}_{i}\,-\,{\tilde {t}}_{\text{rec}})}$ is called pseudorange, where ${\displaystyle \scriptstyle {\tilde {t}}_{\text{rec}}}$ is a provisional reception time of the receiver. ${\displaystyle \scriptstyle \delta t_{\text{clock,rec}}\;=\;{\tilde {t}}_{\text{rec}}\,-\,t_{\text{rec}}}$ is called receiver's clock bias (i.e., clock advance).[1]
• Standard GNSS receivers output ${\displaystyle \scriptstyle {\tilde {r}}_{i}}$ and ${\displaystyle \scriptstyle {\tilde {t}}_{\text{rec}}}$ per an observation epoch.
• The temporal variation in the relativistic clock bias of satellite is linear if its orbit is circular (and thus its velocity is uniform in inertial frame).
• The signal time of flight from satellite to receiver is expressed as ${\displaystyle \scriptstyle -(t_{i}-t_{\text{rec}})\;=\;{\tilde {r}}_{i}/c\,+\,\delta t_{{\text{clock}},i}\,-\,\delta t_{\text{clock,rec}}}$, whose right side is round-off-error resistive during calculation.
• The geometric range is calculated as ${\displaystyle \scriptstyle r({\boldsymbol {r}}_{i},\,{\boldsymbol {r}}_{\text{rec}})\;=\;|\Omega _{\text{E}}(t_{i}\,-\,t_{\text{rec}}){\boldsymbol {r}}_{i,{\text{ECEF}}}\,-\,{\boldsymbol {r}}_{\text{rec,ECEF}}|}$, where the Earth-centred, Earth-fixed (ECEF) rotating frame (e.g., WGS84 or ITRF) is used in the right side and ${\displaystyle \scriptstyle \Omega _{\text{E}}}$ is the Earth rotating matrix with the argument of the signal transit time.[2] The matrix can be factorized as ${\displaystyle \scriptstyle \Omega _{\text{E}}(t_{i}\,-\,t_{\text{rec}})\;=\;\Omega _{\text{E}}(\delta t_{\text{clock,rec}})\Omega _{\text{E}}(-{\tilde {r}}_{i}/c\,-\,\delta t_{{\text{clock}},i})}$.
• The line-of-sight unit vector of satellite observed at ${\displaystyle \scriptstyle {\boldsymbol {r}}_{\text{rec,ECEF}}}$ is described as: ${\displaystyle \scriptstyle {\boldsymbol {e}}_{i,{\text{rec,ECEF}}}\;=\;-{\frac {\partial r({\boldsymbol {r}}_{i},\,{\boldsymbol {r}}_{\text{rec}})}{\partial {\boldsymbol {r}}_{\text{rec,ECEF}}}}}$.
• The satellite-navigation positioning equation may be expressed by using the variables ${\displaystyle \scriptstyle {\boldsymbol {r}}_{\text{rec,ECEF}}}$ and ${\displaystyle \scriptstyle \delta t_{\text{clock,rec}}}$.
• The nonlinearity of the vertical dependency of tropospheric delay degrades the convergence efficiency in the Gauss–Newton iterations in step 7.
• The above notation is different from that in the Wikipedia articles, 'Position calculation introduction' and 'Position calculation advanced', of Global Positioning System (GPS).

3. ^ 3-dimensional distance is given by ${\displaystyle \displaystyle r({\boldsymbol {r}}_{A},\,{\boldsymbol {r}}_{B})=|{\boldsymbol {r}}_{A}-{\boldsymbol {r}}_{B}|={\sqrt {(x_{A}-x_{B})^{2}+(y_{A}-y_{B})^{2}+(z_{A}-z_{B})^{2}}}}$ where ${\displaystyle \displaystyle {\boldsymbol {r}}_{A}=(x_{A},y_{A},z_{A})}$ and ${\displaystyle \displaystyle {\boldsymbol {r}}_{B}=(x_{B},y_{B},z_{B})}$ represented in inertial frame.