Least squares adjustment of two positions with distance constraint

8 views (last 30 days)
Hi All,
I'm struggling with finding a solution to an adjustment I'm working on. Thought someone else may have some thoughts?
I have a kinematic time series of X,Y positions for two points (X1,Y1,X2,Y2). I know that the two points were a distance D (e.g., 100 m) apart from each other (the constraint).
I'm attempting to find a solution that finds a best fit to X1,Y1 and to X2,Y2 based on the constraint that the distance between them is D. The path formed by the points is not linear -- I'm starting with a quadratic model.
In coming up with observation equations, my initial thought was something like:
X1(t) = At^2+Bt+C
Y1(t) = Dt^2+Et+F
X2(t) = Gt^2+Ht+I
Y2(t) = Jt^2+Jt+L
Then:
sqrt((X1-X2)^2+(Y1-Y2)^2) = 100
So this leaves me with 12 parameters. I have ample observations to solve this.
Does it appear that I'm on the right track?
I'm not sure what the best method is to proceed from here using matlab. Any suggestions?
Thanks in advance for any help, Brad

Answers (2)

Matt J
Matt J on 17 Dec 2012
Edited: Matt J on 17 Dec 2012
This looks applicable
This gives a closed-form solution, which should be fine for problems as small as 12 unknowns.
For large version of the problem, if you have the Optimization Toolbox, you could use FMINCON, but you need to express the constraints in terms of differentiable functions
(X1-X2)^2+(Y1-Y2)^2 - 100^2 = 0

John Petersen
John Petersen on 17 Dec 2012
Once you add the constraint, the LS solution becomes much more difficult. However, there are also a number of approaches, such as linear programming, simplex algorithms, interior point algorithms, recursive LS, constrained LS. If don't want to program your own, the optimization toolbox is a good place to start.
  1 Comment
Matt J
Matt J on 17 Dec 2012
Actually, it's not that bad. The link I provided in my answer implements a closed-form solution.

Sign in to comment.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!