Based on least square method to solve GPS receiver position from raw data of a GPS device, we follow this algorithm :

Init:

Choose a starting user position. (Latitude: 45.49| Longitude: -73.56 | Altitude: 21m) (Montreal)

Choose an initial receiver clock bias cbu (cbu=0)

Iteration 1:

- Compute SV position in ECEF based on ephemeris data
- Correct SV position due to earth rotation by applying a rotation matrix to the SV pos calculated above
- Compute the Azimuth and Elevation of the SV used below in ionosphere and troposphere algo.
- Correct the pseudoranges by calculating:
- SV clock bias using the algorithm described in project appendix
- Ionosphere clock bias using the algorithm described in project appendix
- Troposphere clock bias using the algorithm described in project appendix

- Compute a coarse estimate to the receiver position [X Y Z] in ECEF and Receiver clock bias Cbu based on the assumptions of transit time tau and intial user position guess. (Least square method).

Iteration 2:

- New Receiver time: Ttrc = Ttrc + (Cbu/c)
- New Transit time: tau= (pseudorange+ cbu)/c
- Update GPS transmission time: Ttr= Ttrc -tau
- Re do step 1 to 5 with the newly corrected Ttr and tau to obtain a finer estimate of the user position

Note: The solution converge after doing iteration 2 with more precise measurements, increasing the number of iterations do not have any effect since the solution converged from iteration 2.

Satellite vehicule (Azimuth and Elevation) related to user position in center of the circle. In our case 6 Satellites are visible

**The best solution is to select an optimal set of the tracked Satellite vehicule (SV) to minimize a desired DOP factor.**

- With all our 6 SV we have the following DOP factors:

GDOP |
HDOP |
VDOP |
PDOP |

4.63 |
3.33 |
1.93 |
3.85 |

Generally GDOP factor range **from 2 to 3** depending on SV geometry but it can be larger than 3 especially in condition where there is not a clear view of the sky down to the Horizon. This seems to be our case.

More details are in the article by Sam van Leeuwen (GPS Point Position Calculation).

and (Farrell, Jay. *Aided navigation: GPS with high rate sensors*. McGraw-Hill, Inc., 2008) Chap 8.