Math Quiz 11

The solver approach also gives p4 = (-.409, .555). I modified the distEQ from my previous post and it converged pretty much immediately.

Not sure what Wolfram Alpha uses but e-15 looks an awful lot like C++'s double epsilon value, meaning it it likely hitting limits of the precision an 8-byte floating point number can handle.

Point (-.409, .555) works out just fine in gawk (running under cygwin running under windows 7 32 bit); I suspect differences in round off.

GeeTwo@Teal ~
$ cat ./MQ11.gawk
#!/bin/gawk -f
BEGIN {x[1]=1; x[2]=1.5; x[3]=2.0;
        y[1]=1;y[2]=0.5; y[3]=0.75;
        r[1]=1.477601434758372;
        r[2]=1.909792135285932;
        r[3]=2.416879392936271;
        tx=-.409; ty=0.555;
        for (i=1; i<4; i++) {
                printf "point %d: %.15f %.15f
",
                        i, r*, sqrt((tx-x*)*(tx-x*)+(ty-y*)*(ty-y*));}
}

GeeTwo@Teal ~
$ ./MQ11.gawk
point 1: 1.477601434758372 1.477601434758372
point 2: 1.909792135285932 1.909792135285932
point 3: 2.416879392936271 2.416879392936271

Excel (2010, same O/S) rounds all these numbers down a digit earlier than depicted.*****

*Nice work Jared and Jon. Thanks for posting.

Or minimize the sum of the squares of the distance errors, using Maxima’s COBYLA.

Good question.

Technically, no, because it’s overdetermined as Jared (and you) said…

… but, I purposely picked distance values that make all 3 circles have a common intersection point (to several decimal digits), so in that sense it is solvable for a unique solution.

EDIT:

Hey Gus, welcome to the gawk club! It’s my go-to tool for data munging and quick math stuff.

*









Change the p4_p3 distance from 2.416879392936271 to 2.6

Now the 3 circles no longer have a common point of intersection, so it becomes an optimization problem.

Maxima can use Powell’s COBYLA algorithm to find a “best fit” value based on an objective function that the user can define.

The red boxes are the solution using equal weights for all three distance errors.

The green boxes are the solution for relative weights inversely proportional to the distance.

*







I’m not nearly as good at math as a lot of you so maybe this doesn’t work? I was trying to find an answer that minimized the error using the equal error method. I put the first three points into SolidWorks and then created three distance lines (I didn’t use circles) from each point. I then created point four and three more lines connecting each distance line to point four (the error lines). Because I was trying to minimize the error using equal error I set three error lines equal to each other.

Then I didn’t know what to do. SolidWorks doesn’t (that I know of) have a way to set the length of a line to it’s minimum acceptable value. So I just started plugging in numbers, a number larger than the minimum error would be accepted, a number smaller would make the sketch unsolvable. So I started hopping between two numbers, averaging them, getting a new domain, averaging them, etc. I did like 20 iterations of this, eventually working with numbers that were ten decimals long. Then I finally noticed something interesting, as the error became closer to the minimum value the lines became closer and closer to being co-linear.

So I scrapped dimensioning the error lines and just set each error line as co-linear with its respective distance line. This generated the final position of my point four. Which I got to be (-.50036693, .54231098) with an error length of .09102222. This was a different location than Ether’s so I tried plugging in his point for equal error. When I did this the minimum error I could get was .118118 (coincidence? I think not).

Ether is a lot smarter than I am, and he actually used math so I’m assuming I just couldn’t get SolidWorks to get a smaller error using his point. So what I want to know is what is the error for Ether’s calculation and is it actually smaller than mine (I assume so)?


Quiz11CloseUp.PNG



Quiz11CloseUp.PNG

Since the 3 circles have no common point of intersection, there is no unique “correct” solution.

The answer you get depends on what you’re trying to minimize and what constraints you impose.

As Jared posted earlier in this thread:

You added the constraint that the magnitude of the residuals had to be equal, so you got a different solution. Your solution is valid, given that extra constraint.

I minimized the sum of the squares of the errors (SSE), with no residual equality constraint, so my solution has a smaller SSE than yours.

*





Here’s the Maxima solution, with your added constraint (red box) that the residuals must be equal in magnitude.

The coordinates of the solution (green box) match yours, and the residuals (orange box) match yours.

*