Before we begin to give some information take a look at this YouTube video which explains GPS.
In order for your phone to be able to give you an accurate time and Google Maps to give you accurate directions live, your phone needs access to GPS. For GPS to be able to work there are 24 satellites that are orbiting the earth. The satellites are sending signals that are picked up by phones. But one cannot get enough information with a signal from one satellite; there need to be at least 4 satellites giving your phone information. The reason that you need four satellites is because when there is information being sent to your phone from the GPS there is a range, a circle, which is being sent to your phone. Thus there is a large area that your phone could potentially be in. So if we add another circle to this circle then your phone could be where the two intersect. Now you would think that three circles would be enough but unfortunately there is a large amount of error when we use three circles, thus we use four circles which make our error much smaller.
The purpose of this part of the project was to create a program that gave us the results that were in the book.
To start we took the partial derivative of (x-An)2+(y-Bn)2+(z-Cn)2-[c(tn-d)]2 . We did this because once we had this partial derivative all of the partial were the same except the constants that were given to us.
First, we foiled out the equation (x-An)2 because it would be the same for all of the following terms except -[c(tn-d)]2 , which we also foiled out, the work is below.
(x-An)2 = (x-An)(x-An)
= x2-xAn-xAn+An2
= x2-2xAn+An2
Then we foiled out -[c(tn-d)]2 :
(-1)[c(tn-d)]2=(-1)c2(tn-d)(tn-d)
=(-1)c2(tn2-tnd-tnd+d2)
=(-1)(c2tn2-c2tnd-c2tnd+c2d2)
=-c2tn2+c2tnd+c2tnd-c2d2
=-c2tn2+2c2tnd-c2d2
We hard coded both of the matrices that were needed for part 1 and are pictured below.
The following matrix was our fmatrix:
\(\left\lgroup \matrix{(x - A_1)^2 + (y - B_1)^2 + (z - C_1)^2 - [c(t_1 - d)]^2\cr (x - A_2)^2 + (y - B_2)^2 + (z - C_2)^2 - [c(t_2 - d)]^2 \cr (x - A_3)^2 + (y - B_3)^2 + (z - C_3)^2 - [c(t_3 - d)]^2 \cr (x - A_4)^2 + (y - B_4)^2 + (z - C_4)^2 - [c(t_4 - d)]^2} \right\rgroup\)
The following matrix was our jmatrix :
\(\left\lgroup \matrix{2(x - A_1) & 2(y - B_1) & 2(z - C_1)^2 & 2(t_1 - d)c^2\cr 2(x - A_2) & 2(y - B_2) & 2(z - C_2) &2(t_2 - d)c^2 \cr 2(x - A_3) & 2(y - B_3) & 2(z - C_3) & 2(t_3 - d)c^2 \cr 2(x - A_4) & 2(y - B_4) & 2(z - C_4) & (2t_4 - d)c^2} \right\rgroup\)
Here you will find the code formulated and used in part one of this project. And here is the output that MATLAB gave us when we ran our code, it can be seen that our numbers converge to what we wanted which was, (-41.77271,-16.78919,6370.0596,-3.201566x10-3).
Here we were using a different approach to get the same results as part 1. We want to get all of our x, y and z in terms with d so that we can create a quadratic equation in terms of d and solve for d.
We were told to subtract the last 3 equations from the first equation which is pictured in the following:
\(\star\) Note that we only show the work of one equation because we will get the same results from equation one subtracting any of the last 3 equations. \(\star\)
Equation 1: (x-A1)2+(y-B1)2+(z-C1)2-[c(t1-d)]2=0
Equation 2: (x-A2)2+(y-B2)2+(z-C2)2-[c(t2-d)]2=0
Equation 3: (x-A3)2+(y-B3)2+(z-C3)2-[c(t3-d)]2=0
Equation 4: (x-A4)2+(y-B4)2+(z-C4)2-[c(t4-d)]2=0
Equation 1 - Equation n = (x-A1)2+(y-B1)2+(z-C1)2-[c(t1-d)]2-((x-An)2+(y-Bn)2+(z-Cn)2-[c(tn-d)]2)
= x2-2xA1+A12+y2-2yB1+B12+z2-2zC1+C12-c2t12+2c2t1d-c2d2-(x2-2xAn+An2+y2-2yBn+Bn2+z2-2zCn+Cn2-c2tn2+2c2tnd-c2d2)
= x2-2xA1+A12+y2-2yB1+B12+z2-2zC1+C12-c2t12+2c2t1d-c2d2-x2+2xAn-An2-y2+2yBn-Bn2-z2+2zCn-Cn2+c2tn2-2c2tnd+c2d2
= -2xA1+A12-2yB1+B12-2zC1+C12-c2t12+2c2t1d+2xAn-An2+2yBn-Bn2+2zCn-Cn2+c2tn2-2c2tnd
Once we did this for each equation we separated out all of the variables; meaning we grouped the x's, the y's, and the z's together, all other variables were grouped in a variable called w. After we did our grouping our equations would look like the following equation:
Then, given the following equation, we could solve for x in terms of d if we used the following equation, a similar variation was used to find y and z:
We can note that the determinant is linear in its columns and that a matrix with a repeated column has a determinant equal to 0. On Matlab, we programmed this to happen. Here is the code which gave us the two values of d. Here is the output that we got from the code. It can be seen that we have two d values; it might not be clear why this is happening, we plugged our values that we solved for into a quadratic equation and that gives us two values. Based on our part 1 answer we wanted the d which was the same as that, that value is the one that is on earth, while the other is the one that is not on earth.
Here is the other coordinate, the far-from earth coordinate, that we found when running the code (-39.748599316186116, -134.2299342734114, 9407.685086166990, 0.185102160926643).
This part of the project was testing the conditioning of the GPS problem.
We first defined the satellite positions (Ai,Bi,Ci) from the spherical coordinates (\(\rho\),\(\phi_i\),\(\theta_i\)) . Where:
We were given the following:
1. \(\rho\) = 26570, We chose to go with the existing GPS.
2. i = 1,2,3,4
2a. 0 \(\le\) \(\phi_i\) \(\le\) \(\frac{\pi}{2}\)
We chose our \(\phi_i\) 's to be the following:
\(\phi_1\) = \(\frac{\pi}{8}\)
\(\phi_2\) = \(\frac{\pi}{4}\)
\(\phi_3\) = \(\frac{3\pi}{8}\)
\(\phi_4\) = \(\frac{\pi}{2}\)
2b. 0 \(\le\) \(\theta_i\) \(\le\) 2\(\pi\)
We chose our \(\theta_i\) 's to be the following:\(\theta_1\) = \(\frac{\pi}{2}\)
\(\theta_2\) = \(\pi\)
\(\theta_3\) = \(\frac{3\pi}{2}\)
\(\theta_4\) = 2\(\pi\)
\(\star\) Note that the \(\phi\) coordinate is restricted so that the four satellites are also restricted to only the upper hemisphere on the globe.\(\star\)
We then set x = 0, y = 0, z = 6370, and d = 0.0001 and calculated the corresponding satellite range, Ri = \(\sqrt {A^2_i+B^2_i+(C_i - 6370)^2}\) and the travel times, ti = d+\(\frac{R_i}{c}\) .
For this project for our error magnification factor ,or EMF is defined a little differently than what we learned in Math 446.
We want our time in the atomic clocks to be within 10-8seconds correct.
We were given that the EMF is dimensionless and defined as follows in this project:
When thinking about the EMF, we should also think about the condition number, which is defined in this problem to be the maximum error magnification factor for all the \(\Delta\)ti's that are less than or equal to 10-8.
This part of the project asked two questions:
First, what is the maximum position error that was found, in meters?
We found the maximum position error was found to be (0.001639568100726,-0.008003050328785, -0.016414542529674) km , which means that it is (1.639568100726,-8.003050328785, -16.414542529674) m , as the question asked for, because this is where our EMF was at its greatest.
Second, we were to estimate the condition number of the problem based on the EMF's that we computed.
We found the estimated condition number to be the maximum EMF, which was 5.475302029125845.
Below is a chart which shows the types of changes we had in our \(\Delta\)ti 's:
Here you will find the code that we used in part four of this project. And here is the output that MATLAB gave us when we ran our code.
In this part of the project we did the same as in Part 4 except we chose all of our \(\phi_i\) 's to be within 5% of one another. And we chose all of our \(\theta_i\) 's to be within 5% of one another.
Here is the lists of our \(\phi_i\) values and our \(\theta_i\) values:
We chose our \(\phi_i\) 's to be the following:
\(\phi_1\) = \(\frac{.79\pi}{2}\)
\(\phi_2\) = \(\frac{.80\pi}{2}\)
\(\phi_3\) = \(\frac{.81\pi}{2}\)
\(\phi_4\) = \(\frac{.82\pi}{2}\)
And we chose our \(\theta_i\) 's to be the following:
\(\theta_1\) = \(\frac{.7\pi}{3}\)
\(\theta_2\) = \(\frac{.72\pi}{3}\)
\(\theta_3\) = \(\frac{.73\pi}{3}\)
\(\theta_4\) = \(\frac{.74\pi}{3}\)
Here is the code and the output when we solved with the same input error as in step 4. And here is the code and output when we solved without the same input error as in step 4.
Below is a chart which has the EMF results when we had the same input error:
In this part of the project we had two problems to solve:
First, to find the maximum position error, which we found to be (-2.902180612409708,-14.844924887349775,-17.263736104476266)km or as the question asked (-2902.180612409708,-14844.924887349775,-17263.736104476266)m , this again is where we had the greatest EMF value.
Second, to find the EMF, which we found to be 5.758562513429296e+03.
It can be seen that the tightly packed satellites have a MUCH larger EMF number. Which means that the error associated with the tightly packed satellites is higher.
A comparison that can be done is by subtracting the triplet of the loosely packed satellites from the tightly bunched satellites which gives us:
= |(-2902.180612409708,-14844.924887349775,-17263.736104476266)|-|(1.639568100726,-8.003050328785,-16.414542529674)|
=(2902.180612409708,14844.924887349775,17263.736104476266)-(1.639568100726,8.003050328785,16.414542529674)
=(2900.54104430898,14836.92183702099,17247.32156194659)
It can be concluded that the difference between the two is a huge difference.
In this part of the project we decided whether or not adding more satellites would reduce the GPS error and condition number or not.
In this part of the project we had two problems to solve:
First, what was a good initial vector?
A good initial vector was the one that was defined in the book since we went with the current GPS, which was the vector, (0,0,6370,0.0001).
Second, to find the maximum GPS position error and estimate the condition number, which we found to be 42.644162817265929, which is associated with 5 satellites.
Here you will find the code and output that was used in part 6.
\(\star\) Note that we did not do every combination of addition and subtraction because there were too many combinations,212 combinations, with 12 satellites. \(\star\)
It can be seen from our numbers that were presented above, the four unbunched satellites, part 4, gave us a better result than the four bunched satellites, part 5. It can also be seen that as we added more satellites, more towards the 10, 11 and 12 range that there would be more accuracy due to the smaller EMF numbers. Again we should note that if we wanted to do this more accurately we would need to do all variations of addition and subtraction to know that maximum EMF.
Parts 1,2, 4, and 6 completed by all.
Part 5 completed by Pat Collier and Chelsea Brunson.
Introduction and Webpage completed by Chelsea Brunson.