Least Squares Trilateralization – 2D

Trilateralization is basically a distance-distance intersection using two or more points and corresponding measurements from them to an unknown point.

Working with just two points can yield 0, 1 or 2 solutions.

Case 1: No Solutions

  • Given
    • Two points with fixed X,Y ( Points A and B)
    • Two measurements from fixed Points (A &B ) to the Unknown Point (P)
  • Results
    • If the sum of the measurements from A to P and B to P is less than the distance A to B then there cannot be an intersection

Case 2: One Solution

  • Given
    • Two points with fixed X,Y ( Points A and B)
    • Two measurements from fixed Points (A &B ) to the Unknown Point (P)
  • Results
    • The sum of the measurements from point A to P and B to P, equals the distance (A to B), thus point P must lie on the line AB

Case 3: Two Solutions

  • Given
    • Two points with fixed X,Y ( Points A and B)
    • Two measurements from fixed Points (A &B ) to the Unknown Point (P)
  • Results
    • If the sum of the measurements from A to P and B to P, are greater than the distance (A to B) then there exists two possible solutions. Circle-Circle Intersection

The least squares part of this occurs when you have 3 or more fixed points, and a measurement from each to the unknown point ( P ). Like shown here:

Assume Points A, B, C and D are fixed. Point P is unknown.


Chain Rule _ Dist Equation – Derivative

A different approach this time. Instead of showing each iteration in expanded form, I am going to introduce the matrices in the form of MathCAD functions. We can them solve them in a MathCAD Program Block.


Above is the MathCAD Program Block. Where we define the program, like a function, where it takes the matrix ‘pt’, the column vector ‘P’, and the double ‘tol’ and an integer ‘n’. However, MathCAD does not have strict variable declaration but the way I access the variables will error out if they aren’t passed in the method described.

SolveIt yields us the solution for point P and the variance from the measurements.

*EDIT – I found and corrected error in the J Matrix above. If you are revisiting the site be sure to refresh the page. Sorry.*

Dave

Share
Posted in Least Squares, Math | Tagged , , , , | Leave a comment

A Great Calculus Site

While writing the next least squares post I needed to review some calculus and in doing so I found a great site to refresh my memory

Visual Calculus

Share
Posted in Uncategorized | Tagged , | Leave a comment

Conformal Geometric Least Squares

I expect this to be the first in a series of articles detailing geometric least squares. By geometric least squares I mean fitting measurements to equations, or coordinates to equations or a combination there of. Getting started we will assume that the user has a background in Calculus and Linear Algebra. A recent site that I have found is http://www.khanacademy.org/ , it has some excellent resources. In college, many years ago we studied this text http://www.amazon.com/Adjustment-Computations-Statistics-Surveying-Boundary/dp/0471168335/ref=sr_1_4?ie=UTF8&qid=1295317634&sr=8-4

Working the problems, the generic problems can be worked with MathCAD, Smath http://www.smathstudio.com/ , or another computer algebra system. If things go far enough along I will show how to use open source libraries to do the matrix math.

First step is to clearly define what you know about the condition, what you need to know and how they are related. Then you create a matrix, J. J is the constraint matrix as defined below. Basically each row represents a condition. Each Column represents an independent variable. Each cell in J represents the first derivative of the observation equation, in regard to the row and column of said cell… see the sketch.

After defining the observation conditions, make initial estimates of the variable values and solve the equations. Subtract the Calculated Values from the Measured Values and call it Column Vector, k. Make sure the rows of J, correspond to the correct row of k.

IMPORTANT : The number of observations, rows, MUST be greater than the number of variables, columns.

You MUST have more independent measurements that dependent variables.

Solve by ->>>>>>>


Where X will result in a column vector containing as many rows as Matrix J. The elements of X are correction values to the assumed values. Apply these corrections like : a= a + X[0], b = b + X[1], … etc. The process is iterative, recalculate Matrix J and k, solve for X again. With any luck the correction values in X should converge towards zero, if they don’t you either have something wrong or you have bad data. If you don’t have enough observations to give an extra degree of freedom then you will have a singular matrix.

I learn better by example where I can see the actual math, so here is points fitted to a parabola. Enjoy. Comments welcome and requested.



Share
Posted in Least Squares | Tagged , , , , , | Leave a comment

Weighted / Non-weighted Quadratic Curve Fit to Point Set

While reading Walking Randomly yesterday, I came about this post on polynomial fitting with MATLAB, which went along with something I was working on in MathCAD and the next thing I new I worked the problems long hand, figured I might as well post them for someone else to find.
It took longer to decide how to post this than it did to flesh out the math. I couldn’t find a good way to post the MathCAD worksheet and settled for printing to the Snag-IT printer. If anyone knows a saner way, please let me know.








Share
Posted in Least Squares, Math | Tagged , , | Leave a comment

Merging of Sites

Greetings, if you were heading towards Model-This.com I apologize for the surprise redirect. As that I own and operate both sites with parallel topics I have decided to integrate both sites here. I apologize for any inconvenience; all the material is here, just some of the URL’s has changed, sorry.

Share
Posted in Site News | Tagged | Leave a comment