Nonlinear Least Squares with Its Application to GPS Technology

48
Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism Nonlinear Least Squares with Its Application to GPS Technology Moody T. Chu North Carolina State University MA325 @ North Carolina State University

Transcript of Nonlinear Least Squares with Its Application to GPS Technology

Page 1: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Nonlinear Least Squares with ItsApplication to GPS Technology

Moody T. Chu

North Carolina State University

MA325 @ North Carolina State University

Page 2: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Take Home Message

I Many sophisticated modern applications are based on simplemathematical theory.

I Many complicated mathematical concepts are based onelementary geometry and calculus.

I The global position system (GPS) is one such an example.

Page 3: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Course Plan of This Module

1. Review of Calculus (2 hour)2. Linear Least Squares Problems (2 hours)

• Homework

3. Nonlinear Least Squares Problems (1 hours)4. 2-D Set up (2 hours)

• Homework

5. 3-D Set up (2 hours)• Project

Page 4: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

OutlineReview of Calculus

OptimizationConstrained Optimization

Linear Least SquaresData FittingMathematics BehindNumerical Techniques

Nonlinear Least SquaresMathematical SetupGauss-Newton Method

2-D GPS SetupObservation Along a Straight LineMeasurement by Distance

3-D GPS MechanismSatellite setupNavigation Equation

Page 5: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

OutlineReview of Calculus

OptimizationConstrained Optimization

Linear Least SquaresData FittingMathematics BehindNumerical Techniques

Nonlinear Least SquaresMathematical SetupGauss-Newton Method

2-D GPS SetupObservation Along a Straight LineMeasurement by Distance

3-D GPS MechanismSatellite setupNavigation Equation

Page 6: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

OutlineReview of Calculus

OptimizationConstrained Optimization

Linear Least SquaresData FittingMathematics BehindNumerical Techniques

Nonlinear Least SquaresMathematical SetupGauss-Newton Method

2-D GPS SetupObservation Along a Straight LineMeasurement by Distance

3-D GPS MechanismSatellite setupNavigation Equation

Page 7: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

OutlineReview of Calculus

OptimizationConstrained Optimization

Linear Least SquaresData FittingMathematics BehindNumerical Techniques

Nonlinear Least SquaresMathematical SetupGauss-Newton Method

2-D GPS SetupObservation Along a Straight LineMeasurement by Distance

3-D GPS MechanismSatellite setupNavigation Equation

Page 8: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

OutlineReview of Calculus

OptimizationConstrained Optimization

Linear Least SquaresData FittingMathematics BehindNumerical Techniques

Nonlinear Least SquaresMathematical SetupGauss-Newton Method

2-D GPS SetupObservation Along a Straight LineMeasurement by Distance

3-D GPS MechanismSatellite setupNavigation Equation

Page 9: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Gradient

I Given a scalar function

f : Rn −→ R,

define the gradient of η by

∇f :=

[∂f∂x1

, . . . ,∂f∂xn

].

I Significance:• Points in the direction where the function f (x) ascends most rapidly.• Attainable maximum rate of change is precisely ‖∇f (x)‖.

Page 10: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

First Order Optimality Condition

Suppose f : Rn −→ R is a smooth function over an open domain.Then

I The functional value f (x) reaches an extreme value, eithermaximum or minimum, at a point x ∈ Rn only if

∇f (x) = 0.

I The extreme is only a relative (local) extreme.

Page 11: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

f (x , y) = 3(1−x)2e−x2−(y+1)2−10( x5−x3−y5)e(−x2−y2)− 1

3 e−(x+1)2−y2

−3−2

−10

12

3

−3

−2

−1

0

1

2

3

−6

−4

−2

0

2

4

6

8

x

Peaks

y

Page 12: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Second Order Optimality Condition

I Need a way to tell the concavity.I In Calculus III, for the case n = 2, we have learned the basic

rules:• Compute the second derivative, the so called Hessian matrix,

Hf (x , y) =[

fxx fxy

fyx fyy

].

• If fxx fyy − fxy fyx < 0, then it is a saddle.• If fxx fyy − fxy fyx > 0 and fxx > 0, then it is a minimum (cup).• If fxx fyy − fxy fyx > 0 and fxx < 0, then it is a maximum (cap).• If any of these is zero, then go to graduate school.

I What is going on here?I How to generalize this concept to more than two variables?

Page 13: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Symmetric and Positive Definite Matrix

I A matrix A ∈ Rn×n is said to be positive definite if and only if

x>Ax > 0 for all x 6= 0.

• A is said to be positive semi-definite if “>" is replaced by “≥".I There are multiple equivalent conditions for determining whether

a matrix A is symmetric and positive definite.• All eigenvalues of A are positive.• All principal minors have positive determinant.

Page 14: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Negative Definite Matrix

I How to define a negative definite matrix?I What are some conditions for determining whether a matrix A is

symmetric and negative definite?I Where does the symmetry of a Hessian matrix come from?

Page 15: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

The Real Second Order Optimality Condition

I If x is a critical point and is a local minimum for a smooth functionf , then its Hessian Hf (x) is necessarily positive semi-definite.

I If x is a critical point and if its Hessian Hf (x) is positive definite,then x is a local minimum.

• What is the difference?I What can be said about a local maximum?

Page 16: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Constrained Optimization

I In real world, we cannot do whatever we want to do.I Even we are interested in maximizing the gain or minimizing the

loss, often we are subject to some constraints.I The challenge is how to handle this type of constrained

optimization?

Page 17: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Roserbrock Function

min 100(y − x2)2 + (1− x)2,subject to x2 + y2 ≤ 1.

Page 18: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Method of Lagrange Multiplier

Suppose that the optimization problem is

min f (x , y),subject to g(x , y) = c.

I Introduce a new variable λ, called a Lagrange multiplier.I Define the Lagrange function, called Lagrangian, defined by

Λ(x , y , λ) = f (x , y)− λ(g(x , y)− c) (1)

I The critical point must satisfy

∇Λ = 0.

I Why?

Page 19: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Geometric Meaning

feasible set g(x,y) = c

level curves of f(x,y) = d

level curves of f(x,y) = c

Page 20: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

An ExampleFind the dimensions of the box with largest volume if the total surfacearea is A.

I Setup:

max xyz,subject to 2xy + 2xz + 2yz = A.

I Lagrangian:

Λ(x , y , z) = xyz − λ(xy + xz + yz − A2

).

I Necessary condition:yz = λ(y + z),xz = λ(x + z),xy = λ(x + y),

xy + xz + yz = A2 .

I Need to solve the above system of equations for (x , y , z, λ).• Hint: Multiply the first equation by x and the second equation by y .

Make an argument from here.

Page 21: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Parameter Estimation

Parameter estimation is an important technique used for modeling inmany areas of disciplines.

I To mimic a complicated physical phenomenon, we sometimescan create a model via a relationship such as

y = f (z; x1, . . . , xn). (2)

• f is a prescribed model determined up to values of x1, . . . , xn.• x1, . . . , xn are the parameters.• z is the control variable or input.• y is the expected response or output to z.

I For more sophisticated models, both input z and output y can bevectors.

Page 22: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Using Observations

I Perform m experiments and collected m observed quantities(zi , yi ), i = 1, . . . ,m.

• Typically (m ≥ n).• Why?

I Due to measurement errors (called noise), (zi , yi ) may not satisfy(2) exactly.

I Seek to adjust the parameters x1, . . . , xn so that the expression

g(x1, . . . , xn) :=m∑

i=1

‖yi − f (zi ; x1, . . . , xn)‖2 (3)

is minimized.I When the norm used in (3) is either the 2−norm or the Frobenius

norm, we say we have a least squares problem .

Page 23: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Polynomial Fitting

I Suppose an (n − 1)-th degree polynomial

f (z; x1, . . . , xn) = x1zn−1 + . . .+ xn−1z + xn. (4)

is to fit m points in the plane.I Ideally, want to solve the system

zn−11 zn−2

1 . . . z1 1zn−1

2...

zn−1m zn−2

m . . . zm 1

x1x2...

xn

=

y1y2...

ym

(5)

for the coefficients (x1, . . . , xn).• The system (5) is overdetermined, so generally there is no solution.

Page 24: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

General Linear Least Squares Problem

I Want to solve the optimization problem

minx∈Rn‖Ax− b‖2

2 (6)

where A ∈ Rm×n, b ∈ Rm are known quantities.I “Linear" in the sense that the expected response y depends

linearly on the parameters x.

Page 25: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Normal Equation

I Can write the objective function as

g(x) =12

(Ax− b)>(Ax− b).

I The first order condition becomes

∇g(x) = A>Ax− A>b = 0.

• Prefer Ax = b; now A>Ax = A>b.

Page 26: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Geometry behind Linear Least Squares

I Let the columns of A ∈ Rm×n be denoted as A = [a1, . . . ,an]where each ai ∈ Rm.

I The product Ax can be written as

Ax =n∑

i=1

xiai ,

• Ax is a linear combination of columns of A and hence is an elementin the range space of A.

I Solving the equation Ax = b is equivalent to finding anappropriate combination of columns of A that makes up thevector b.

• A necessary condition for Ax = b to have a solution is thatb ∈ R(A).

• What to do when b /∈ R(A)?

Page 27: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

b

Ax

Range space of A

I The best we can hope for is to find a combination so that theresidual b− Ax is minimized.

I The residual b− Ax must be perpendicular to R(A).• How to quantify this geometry?

Page 28: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Mathematical SetupI From the assumed model y = f (z; x1, . . . , xn), define a residual

ri = ri (x1, . . . , xn) := yi − f (zi ; x1, . . . , xn)

for each observed data (zi , yi ), i = 1, . . . ,m.I Intend to minimize the overall residual

g(x1, . . . , xn) :=m∑

i=1

‖ri‖22.

I Rewrite the notion as an unconstrained optimization problem

minx∈Rn

F (x)

whereF (x) :=

12‖r(x)‖2

2 (7)

andr(x) := [r1(x), . . . , rm(x)]>.

Page 29: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

First Optimality Condition

I The necessary condition for x to be a critical point is that∇F (x) = 0.

I We calculate the gradient of F to be

∇F (x) = J(x)T r(x) (8)

where

J(x) :=∂r∂x

:=

∂r1∂x1

∂r1∂x2

. . . ∂r1∂xn

...∂rm∂x1

∂rm∂x2

. . . ∂rm∂xn

is the m × n Jacobian matrix of f .

Page 30: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Finding Critical Points

I Note that ∇F : Rn → Rn in nonlinear in general.I Need an algorithm to solve the equation ∇F (x) = 0.

• The Newton-Ralphson method is generally too expensive.• Special techniques are available for this type of problems.• See lsqnonlin in MATLAB.

Page 31: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

A MATLAB DemonstrationI Want to minimize the function

10∑k=1

(2 + 2k − ekx1 − ekx2

)︸ ︷︷ ︸rk (x)

2.

%%function example_lsqnonlin

x0 = [0.3 0.4] % Starting guess[x,resnorm] = lsqnonlin(@myfun,x0); % Invoke optimizer

function F = myfun(x)k = 1:10;F = 2 + 2*k-exp(k*x(1))-exp(k*x(2));

end

end

Page 32: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Basic Ideas of GPSI Consider the scenario:

• Three observers, located along a straight line, measure the angleof their line-of-sight to a certain object.

• Assume that the angles are measured counterclockwise from theeast (normal to the baseline of observers).

• Due to various reasons, such as atmosphere turbulence, theirobservations are obscured.

y1y1

y2y2

y3y3

θ1

θ2

θ3

η1

η2

η3

1

Page 33: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Information Retrieval

I The three measured angles θi , i = 1,2,3, are more or lesscorrect but carry some small uncertainties.

I It is desired to estimate the true position of the object.I How to correct the problem?

Page 34: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Necessary Conditions on the True Solution

y

x

y1

y2

y3

η1

η2

η3

1

y − yi

x= tan ηi , i = 1,2,3.

Page 35: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Build up Something Workable

I Get rid of y :

y = y1 + x tan η1 = y2 + x tan η2 = y3 + x tan η3.

I Get rid of x :

y2 − y1

tan η1 − tan η2=

y3 − y2

tan η2 − tan η3.

I The constraint:

(y2 − y1) (tan η2 − tan η3) = (y3 − y2) (tan η1 − tan η2) .

• Why is this significant?

Page 36: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Constrained Least Squares

min f (η1, η2, η3) :=∑3

i=1(θi − ηi )2,

subject to (y2 − y1) (tan η2 − tan η3) = (y3 − y2) (tan η1 − tan η2) .

I How to handle this type of optimization problem?I Homework: Using Lagrange multiplier theory, show that the

optimal angles are given by

η1 = θ1 + ω(y2 − y3) sec2 η1,

η2 = θ2 + ω(y3 − y1) sec2 η2,

η3 = θ3 + ω(y1 − y2) sec2 η3,

where ω is a constant that ensures the lines of sight define asingle point of intersection.

Page 37: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Improvement of Techonology

I Must the measurement be done by angles?• What are pros and cons in doing measurement by angles?

I Must the observers be lined up?• What will happen if more observers (m > 3) are providing

information?I The newer technology allows us to measure long distances.

• (L)ight (a)mplification by (s)timulated (e)mission of (r)adiation.• Electronic signals.• Satellite.• GPS.

Page 38: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Observation Around a PointI Consider the scenario:

• Four observers, located at known positions in the plane, measurethe distance of their line-of-sight to a certain object.

• For various reasons, the measurements do not add up.• Where is the correct position of (x , y)?

(x,y)

(x1, y1)

(x2, y2)

(x3, y3) (x4, y4)

R1

R2

R3

R4

1

Page 39: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Setup

I Define the residuals:

ri (x , y) =√

(x − xi )2 + (y − yi )2 − Ri , i = 1,2,3,4.

I Want to minimize the overall residual

F (x) :=12‖r(x)‖2

2.

I Need to solve the first order optimality condition:

[ x−x1S1

x−x2S2

x−x3S3

x−x4S4

y−y1S1

y−y2S2

y−y3S3

y−y4S4

]r1(x , y)r2(x , y)r3(x , y)r4(x , y)

= 0.

• Si :=√

(x − xi)2 + (y − yi)2.

Page 40: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

A Blessed Curse

I Suppose• The observers are the satellites.• A signal traveling at speed c is sent between the satellite and the

receiver.• The distance Ri is calculated by measuring the transmission time

ti . Ideally,Ri = cti .

I The clock in the typical low-cost receiver, i.e., the GPS, hasrelatively poor precision. It carries an unknown latency d . So, inreality,

Ri = c(ti − d)

• d is part of the calculation.I How precise the time measurement of the atomic clocks must be

to keep the precision of distance to within 3 meter? 10 nanoseconds

Page 41: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Reformulation

I Define the residuals:

ri (x , y ,d) =√

(x − xi )2 + (y − yi )2 − c(ti − d), i = 1,2,3,4.

I Need to solve the first order optimality condition:x−x1

S1

x−x2S2

x−x3S3

x−x4S4

y−y1S1

y−y2S2

y−y3S3

y−y4S4

c c c c

r1(x , y ,d)r2(x , y ,d)r3(x , y ,d)r4(x , y ,d)

= 0.

• How many solutions are there in the system?.• Why is this question important?

Page 42: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

How Many Satellites?

I Suppose that• The object is moving around a circle (the earth) center at the origin

with radius r .• The satellites are moving around the earth at a height of R from the

center.I Assume that

• Satellites are programmed to automatically avoid collision.• The object can occur at arbitrary point on the circle.

I To fully cover any point on the earth at any given time by foursatellites, how many satellites in total are needed in the orbit?

Page 43: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

r

R

Page 44: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

General GPS Description

I Currently, there are 24 satellites carrying atomic clocks.I Orbit at an altitude of 20,200 km.I Four satellites in each of six planes, slanted at 55o with respect

to the poles, make two revolutions per day.I At any time, from any point on earth, five to eight satellites are in

the direct line of sight.I Transmit synchronized signals from predetermined positions in

space.I The receivers (GPS) on earth will pick up the signals.I Do the mathematics to determine the accurate (x , y , z)

coordinates of the receiver.

Page 45: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

– from Wikipedia

Page 46: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Navigation Equation

I Define the residuals:

ri (x , y , z,d) =√

(x − xi )2 + (y − yi )2 + (z − zi )2 − c(ti − d).

I Four equations in four unknowns.• Subtracting the first equation from the last three leads to three

linear equations in (x , y , z).• By Gaussian elimination, a single solution (x , y , z) is found.• Obtain a quadratic equation in d upon substitution.• At most two real solutions can be found.

Page 47: Nonlinear Least Squares with Its Application to GPS Technology

Review of Calculus Linear Least Squares Nonlinear Least Squares 2-D GPS Setup 3-D GPS Mechanism

Other ConcernsI There are other technical issues when GPS is deployed.

• Conditioning of the navigation equation.• Transmission speed might be less than the speed of light

• Need to pass through 100 km ionosphere and 10 km tropospherewhile subjecting to electromagnetic fields.

• Might encounter obstacles or atmospheric degradation.

I Can overcome the issues by adding more satellites.• No longer a square problem.• Need fast nonlinear least squares techniques.

I Who is maintaining the GBS?• civilian GPS (CPS) versus military GPS (PPS)

• two frequencies + ionosphere correction.

• DoD, $1.3B, US taxpayers’ money.• Galileo, EU, e5.0B, 30 satellites by 2019.• GLONESS, Russian, 24 satellites.• BeiDou, China, 35 satellites by 2020.• QZSS, Japan, 7 satellites by 2023, high precision (6 cm)• NAVIC, India, 7 by 2018.

Page 48: Nonlinear Least Squares with Its Application to GPS Technology

MA 325 GPS Project Name:Due: February 2, 2018 SID #:

We discussed in this module a simple model mimicking how the GPS works by using least squares technique.For simple setup, the idea can easily be verified by calculus (as we did in class). But quickly the system becomestoo difficult to handle by hand. The project therefore asks you to solve the problem numerically by using someexisting optimization software package.

What to submit:

• Please typeset your report. A hard copy is needed for submission.• Your report should include the complete code used by you for answering question. The code should be

sufficiently commented to explain your steps.• The graphs for 1(b) and 2(b) must be computer generated, where the locations of the satellites and the

receiver must be correctly positioned.• You must clearly identify the numerical answers to each problem.• Problem 2(b) also requires elaborations what has gone wrong.

How to submit:

• Print out a hard copy and turn it in to SAS 4112 by 5:00 PM, Friday, February 2.• Use this page as the cover page with your name and student ID number.

1. Consider the scenario that four satellite positioned in the space with coordinates

Satellite 1 : (15600, 7540, 20140)

Satellite 2 : (18760, 2750, 18610)

Satellite 3 : (17610, 14630, 13480)

Satellite 4 : (19170, 610, 18390)

in km are observing a receive position (x, y, z) near earth. Suppose that the measured time intervals are0.07074, 0.07220, 0.07690, 0.07242 in seconds, respectively, with an unknown latency correction d.

(a) (20 pts) Solve the navigation equation (on the second to the last slide in lecture notes) for theposition (x, y, z) of the receiver and the time correction d. (Hint: As the numbers are not sofriendly, you had better use some existing library routines to help you to get the numerical solution.For example, the subroutine fsolve in either Maple or Matlab can help you.)

(b) (20 pts) Plot a sphere center at the origin with appropriate radius to represent the earth. Use thecommands scatter3 to plot the locations of the four satellites as well as the calculated location ofthe receiver.

2. The reason that a minimum of 4 satellites are needed is because in the navigation equation there are 4unknowns. In this case, the problem is a square problem and no least squares are involved. Assume nowthat two more satellites are observing the receiver with the following data available:

Satellite 5 : position = (17800, 6400, 18660), time interval =0.0732;

Satellite 6 : position = (17500, 7590, 18490), time interval =0.0735.

(a) (20 pts) Set up a nonlinear least squares minimization and use the Matlab optimization toollsqnonlin to find the receiver’s position and the time correction. (Hint: Be aware of that theobjective function FUN(x) should be set up in a specific way as we have explained in class. Read,again, my lecture notes and see the example there.)

(b) (20 pts) Plot the earth, the six satellites, and the receiver’s location. What is wrong? Reexaminethe data and offer an explanation.