# Satellite navigation solution

Satellite navigation solution for the receiver's position (geopositioning) involves an algorithm. In essence, a GNSS receiver measures the transmitting time of GNSS signals emitted from four or more GNSS satellites (giving the pseudorange) and these measurements are used to obtain its position (i.e., spatial coordinates) and reception time.
The following are expressed in inertial-frame coordinates.

## The solution illustrated

* Essentially, the solution shown in orange, $\scriptstyle ({\hat {\boldsymbol {r}}}_{\text{rec}},\,{\hat {t}}_{\text{rec}})$, is the intersection of light cones.
* The posterior distribution of the solution is derived from the product of the distribution of propagating spherical surfaces. (See animation.)

## Calculation steps

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

## The GPS case

* For Global Positioning System (GPS), the non-closed-form equations in step 3 result in
    $\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 $\scriptstyle E_{i}$ is the orbital eccentric anomaly of satellite $i$, $\scriptstyle M_{i}$ is the mean anomaly, $\scriptstyle e_{i}$ is the eccentricity, and $\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 $\scriptstyle t_{i}$ and $\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:
$\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}}$
* Tropospheric delay should not be ignored, while the Global Positioning System (GPS) specification doesn't provide its detailed description.

## The GLONASS case

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