MATH 447: Project 2

MATH 447 Project 2

GPS, Conditioning, and Nonlinear Least Squares

Project 2 MATLAB Code

Instructions and background information for project 2

Ahmad Amin, Omar Safsaf, Joshua Cho

Background information

For this project, we applied a multivariate Newton's method to solve for the locations (x,y,z coordinates) of a near earth, and far from earth GPS receiver, as well as the correct time from the satellite's clock (d). Furthermore, we reused the multivariate newton method to solve for the receiver locations of 4 new unbunched satellites, and then altered the transmission time of those four satellites by a change of 10e-8, to find the overall condition numbers, and changes in receiver positions due to the nano change in transmission time. We then repeated the same process for four bunched satellites. Finally, we added 3 more satellites to our investigation, and used a Guass-Newton approach to solve for the positions of the reciever, and repeated the same proccesses of collecting data on the condition numbers, and maximum change in positions that resulted from slight changes in transmission times. The following equations had been provided beforehand, and essentially help solve for the true intersection points of three spheres (from three satellites), which is consequently the location of the GPS receiver (equations are written in MATLAB syntax):

Further discussion of the reality check is below.


Problem 1.)

Multivariate Newton's Method Code

For problem 1, we used the systems of equations we were provided with, as well as derived partial derivatives to find the locations of both a near-earth and far-from-earth GPS receiver. We found that iterating through the multivariate Newton's method four times was enough to determine the location of the reciever, as well as the difference in time between the satellite clocks and receiver clock. Our implementation of the method takes in 4 initial guesses for the location and time, as well as 4 satelite locations. The locations are fed in as vectors which are later indexed for their x,y,z coordinates, as well as atomic clock time, so that they could be used to solve for the location and time of the GPS receiver. With the initial four satellites having locations at (15600, 7540, 20140), (18760, 2750, 18610), (17610, 14630, 13480), (19170, 610, 18390) in km, and measured time intervals (0.07074, 0.07220, 0.07690, 0.07242), we were able to determine the far and close to earth GPS receivers.

The close to earth GPS receiver was determined to have a location at (-41.7727095708001, -16.7891941065067, 6370.05955922335) in km, and a measured time difference between the satellite and receiver as -0.00320156582959401. This answer was found with an initial guess of (0,0,6700,0).

After playing around with different guesses, we concluded that the far from earth GPS receiver had a location at (-39.7478181318263, -134.275259321179, -9413.77434469353) km, or roughly ~2700 km away from the surface of the earth. The measured time difference between the satellite and the far from earth receiver was 0.185174934816319. These calcuations were found with an initial guess of (0,0,50000,0). Sample function calls can be seen below:

Problem 2.)

Solving Problem 1 with the Quadratic Formula

For problem two, we created a script that ultimately solved for the same near earth reciever using a quadratic formula approach instead. The equations we used to generate the x,y,z coordinates of the receiver were as follows:

Console output of the satellites location and time difference was as follows:
>> p2
>> arr = [x, y, z, d]
arr = -41.7727095708375 -16.7891941065255 6370.05955922335 -0.00320156582959413

As evident, the quadratic method also generated the same location and time results for the near earth GPS receiver. As a check, using the second solution to the quadratic equation, we can verify that our far from earth solution was also matched:
>> arr = [x2, y2, z2, posd]
arr = -39.7478373481665 -134.274144360666 -9413.62455373576 0.185173047095946

Problem 4.)

Code to generate new Satellites

Code to generate variant EMF and Forward Error's based on modifcations in the direction of the differences in time

Script that stored resulting EMF's and distance displacements to find estimated condition number

For this problem, we created a function that output the location and tranmission times of a random satellite based on parameters (RHO,PHI,THETA). Of course, the RHO was fixed at 26570 km, while PHI and THETA were in the following ranges: 0 = PHI = PI/2 and 0 = THETA = 2PI. After constructing our function, we generated four, unclustered satellites which can be seen below. The locations and transmission times are as follows:

As evident by the coordinate locations of x,y, and z, it is clear that these satellites are random and located in different locations. Using these same satellites, we played around with different combinations of changes to their transmission times just to see how drastically the generated location of the receivers change. Since there are four satellites, there are approximately 2^4 different combinations that could be done with which direction each satellite's transmission time was done (either + 10e-8 or - 10e-8). Based on this, we did an analysis of 8 random changes to find an estimated condition number of 4.0252 and a max change in position of the receiver as 120.7 meters.

The following data below includes the initial phi's, theta's and rho's we used to generate four different satellites. Furthermore, the data includes different variations in which direction the delta t (10e-8) was added to the satellite's transmission times, as well as the resulting EMF and displacement. Finally, the table below also includes our estimates for our condition number and maximum position error, by essentially finding the maximum value of the absolute value of all of the variant EMF's and Forward Errors:

Problem 5.)

For problem 5, we repeated the same process, except with bunched / clustered satellites, all of which had PHI and THETA being within 5% of one another. The locations of the newly generated satellites were determined to be as follows:

Based on the coordinates of these satellites, it is very clear they are bunched close together. Once again, we played around with different variants in changes to the direction of transmission time (either + or - 10e-8), to estimate a condition number of 2508704.80298543. This could be due to the fact that our Newton method did not iterate more than 4 times, and we realized this too late. But none the less, based on the results it is clear that the bunched up satellites yield a larger condition number, and also maximum displacement in the receiver's position (75209.0779283407 km). These results can alos be explained from the fact that all location on the receiver is transmitted from four satellites that are extremely close together, so there will be an obvious increase in error.

The following data below includes the initial phi's, theta's and rho's we used to generate four different satellites. The main difference between problem 4 and 5 being that in this problem, the generated satellites were bunched closer together. In fact, all satellites generated were generated with phi's and theta's all within 5% of each other. Furthermore,the data includes different variations in which direction the delta t (10e-8) was added to the satelite's transmission times, as well as the resulting EMF and displacement. Finally, the table below also includes our estimates for our condition number and maximum position error, by essentially finding the maximum value of the absolute value of all of the variant EMF's and Forward Errors:

Problem 6.)

Gauss-Newton method

Modified code to generate receiver errors

Finally for part 6, we remodified the newton method so that it could solve the location of the receiver when we have more than 4 satellites, using the Guass-Newton approach. For this problem, our group decided to add 3 more satellites to the initial 4 unclustered satellites we generated in problem 4. Based on analysis of different variants in deltaT to each of the seven satellites, we estimate a condition number of 1.5206 and a maximum position error of 45.585 meters.

The following data below includes the initial phi's, theta's and rho's we used to generate seven different satellites. Furthermore,the data includes different variations in which direction the delta t (10e-8) was added to the satellite's transmission times, as well as the resulting EMF and displacement. Finally, the table below also includes our estimates for our condition number and maximum position error, by essentially finding the maximum value of the absolute value of all of the variant EMF's and Forward Errors:


Conclusion

There were many general conclusions for this project. First, good initial vectors were typically close the value we wanted to converge to, so it is clear that newton's multivariate method works well only if the initial guesses are close to the actual root. Furthermore, the maximum GPS position errors and largest condition errors were determined from the usage of satellites that were clustered close together. Although our failure to only implement the iterative method for four iterations may be a cause, it still seems likely that the reason for the large errors mentioned in problem 5 derive from the fact that all 4 satellites are positioned very closely. Finally, we also came to the conclusion that the best results in position error and condition number were derived from the usage of more than 4 unclustered satellites with the Guass-Newton approach. Using this approach, we minimized our condition number to 1.5206 which was far smaller than any other condition number we found in parts 4 and 5. In the future, it would also be suggested to estimate the condition number based on all possible combinations of alterations in deltaT to the satellites. Furthermore, as mentioned, if we did not realize so late, we would have modified our solutions to have more iterations. Finally, we can conclude that the best configuration of satellites to determine the true location and transmission time of the GPS receiver is by using more than 4 randomly unclustered satellites.