(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 31825, 864]*) (*NotebookOutlinePosition[ 32613, 890]*) (* CellTagsIndexPosition[ 32569, 886]*) (*WindowFrame->Normal*) Notebook[{ Cell[BoxData[ \( (*\ Refer\ to\ book\ Ch .3\ Exercise\ 2 \((b)\)\ *) \)], "Input"], Cell[BoxData[ RowBox[{ StyleBox[\(Remove["\"]\), FormatType->StandardForm, FontFamily->"Courier New"], StyleBox[" ", FormatType->StandardForm, FontFamily->"Courier New"], StyleBox[\( (*\ Clear\ all\ variables\ *) \), FormatType->StandardForm, FontFamily->"Courier New", FontSize->14]}]], "Input"], Cell[BoxData[ \(\(\(\(s1 = {3669.350, 1746.890}\) \)\(;\)\(\(s2 = {3812.070, 1631.320}\) \)\(;\)\(\(k0 = {3640.000, 1600.000}\) \)\(;\)\( (*\ these\ are\ coordinates\ of\ S1, \ S2, \ K\ *) \)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(a\)\(=\)\({eA, nA}\)\(\ \)\( (*\ coordinates\ of\ A, \ which\ are\ unknowns\ *) \)\)\)], "Input"], Cell[BoxData[ \({eA, nA}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(\(\(v1 = s2 - s1\) \)\(;\)\(\(v2 = a - s1\) \)\(;\)\(\ \)\( (*\ the\ two\ vectors\ forming\ the\ angle\ A - S1 - S2\ *) \)\)\)], "Input"], Cell[BoxData[ \( (*\ \(calculate\ angle\ A - S1 - S2\ as\ function\ of\ unknown\ coordinates\ using\ v1\ &\)\ v2*) \ \)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(angle1\)\(=\)\(ArcCos[\(Dot[v1, v2]/Sqrt[v1 . v1]\)/ Sqrt[v2 . v2]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(ArcCos[\(0.005445293527926181`\ \((142.72000000000025`\ \ \((\(-3669.35`\) + eA)\) - 115.57000000000016`\ \((\(-1746.89`\) + nA)\))\)\)\ \/\@\(\((\(-3669.35`\) + eA)\)\^2 + \((\(-1746.89`\) + nA)\)\^2\)]\)], \ "Output"] }, Open ]], Cell[BoxData[ \(\(\(\(v1 = a - s2\) \)\(;\)\(\(v2 = s1 - s2\) \)\(;\)\(\ \)\( (*\ the\ two\ vectors\ forming\ the\ angle\ A - S2 - S1\ *) \)\)\)], "Input"], Cell[BoxData[ \( (*\ \(calculate\ angle\ A - S2 - S1\ as\ function\ of\ unknown\ coordinates\ using\ v1\ &\)\ v2*) \ \)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(angle2\)\(=\)\(ArcCos[\(Dot[v1, v2]/Sqrt[v1 . v1]\)/ Sqrt[v2 . v2]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(ArcCos[\(0.005445293527926181`\ \((\(-142.72000000000025`\)\ \ \((\(-3812.07`\) + eA)\) + 115.57000000000016`\ \((\(-1631.32`\) + nA)\))\)\)\ \/\@\(\((\(-3812.07`\) + eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2\)]\)], \ "Output"] }, Open ]], Cell[BoxData[ \(\(\(\(v1 = a - k0\) \)\(;\)\(\(v2 = s2 - k0\) \)\(;\)\(\ \)\( (*\ the\ two\ vectors\ forming\ the\ angle\ A - K - S2\ *) \)\)\)], "Input"], Cell[BoxData[ \( (*\ \(calculate\ angle\ A - K - S2\ as\ function\ of\ unknown\ coordinates\ using\ v1\ &\)\ v2*) \ \)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(angle3\)\(=\)\(ArcCos[\(Dot[v1, v2]/Sqrt[v1 . v1]\)/ Sqrt[v2 . v2]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(ArcCos[\(0.005717644727389747`\ \((172.07000000000016`\ \((\(-3640.`\) \ + eA)\) + 31.319999999999936`\ \((\(-1600.`\) + \ nA)\))\)\)\/\@\(\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) + nA)\)\^2\)]\)], \ "Output"] }, Open ]], Cell[BoxData[ \(\(\(\(v1 = k0 - s2\) \)\(;\)\(\(v2 = a - s2\) \)\(;\)\(\ \)\( (*\ the\ two\ vectors\ forming\ the\ angle\ K - S2 - A\ *) \)\)\)], "Input"], Cell[BoxData[ \( (*\ \(calculate\ angle\ A - S2 - K\ as\ function\ of\ unknown\ coordinates\ using\ v1\ &\)\ v2\ *) \ \)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(angle4\)\(=\)\(ArcCos[\(Dot[v1, v2]/Sqrt[v1 . v1]\)/ Sqrt[v2 . v2]]\)\(\ \)\)\)], "Input"], Cell[BoxData[ \(ArcCos[\(0.005717644727389747`\ \((\(-172.07000000000016`\)\ \ \((\(-3812.07`\) + eA)\) - 31.319999999999936`\ \((\(-1631.32`\) + nA)\))\)\)\ \/\@\(\((\(-3812.07`\) + eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2\)]\)], \ "Output"] }, Open ]], Cell[BoxData[ \(\(\(observations = {angle1, angle2, angle3, angle4};\)\(\ \)\( (*\ observations\ vector\ "\"\ *) \)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(m\)\(=\)\(Length[observations]\)\(\ \)\( (*\ count\ how\ many\ components\ are\ in\ f\ *) \)\)\)], "Input"], Cell[BoxData[ \(4\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\(n\)\(=\)\(Length[a]\)\(\ \)\( (*\ count\ #\ of\ unknowns\ *) \)\)\)], "Input"], Cell[BoxData[ \(2\)], "Output"] }, Open ]], Cell[BoxData[ \(\(\( (*\ Observed\ values\ for\ the\ 3\ angles\ *) \)\(\t\)\(\[IndentingNewLine]\ \)\(\t\)\(observedDMS = {{27, 54, 35}, {17, 42, 21}, {41, 00, 55}, {31, 36, 3}};\)\)\)], "Input"], Cell[BoxData[ \(\(\( (*\ Define\ function\ \((a\ rule)\) to\ convert\ degree\ into\ radians\ *) \)\(\[IndentingNewLine]\)\(\t\ \)\(rad[{deg_, min_, sec_}] := \(\(\((deg + min/60 + sec/3600)\)/ 180\)\(*\)\(Pi\)\(\ \)\)\)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ Converting\ observed\ angles\ to\ radians, \ using\ Map\ to\ apply\ rule\ to\ each\ component\ *) \)\(\ \[IndentingNewLine]\)\(\t\)\(\(observedAngles\)\(=\)\(Map[rad, observedDMS]\)\(\ \)\)\)\)], "Input"], Cell[BoxData[ \({\(4019\ \[Pi]\)\/25920, \(21247\ \[Pi]\)\/216000, \(29531\ \ \[Pi]\)\/129600, \(37921\ \[Pi]\)\/216000}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(sd = 5\ (*\ SD\ for\ angles\ in\ seconds\ *) ; sd = sd/3600*\(\(Pi/180\)\(\ \)\( (*\ convert\ to\ radianns*) \)\)\)], "Input"], Cell[BoxData[ \(\[Pi]\/129600\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ Construct\ weight\ matrix\ *) \)\(\[IndentingNewLine]\)\(\t\)\(w = DiagonalMatrix[{1/sd^2, 1/sd^2, 1/sd^2, 1/sd^2}]\)\)\)], "Input"], Cell[BoxData[ \({{16796160000\/\[Pi]\^2, 0, 0, 0}, {0, 16796160000\/\[Pi]\^2, 0, 0}, {0, 0, 16796160000\/\[Pi]\^2, 0}, {0, 0, 0, 16796160000\/\[Pi]\^2}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(\( (*\ Differentiate\ angles\ w . r . t . \ unknowns\ to\ form\ A\ matrix\ *) \)\(\[IndentingNewLine]\)\(\t\ \)\(matrixA = Table[D[observations[\([i]\)], a[\([j]\)]], {i, 1, m}, {j, 1, n}];\)\)\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(\(\( (*\ Print\ each\ entry\ of\ matrix\ A\ *) \)\(\[IndentingNewLine]\)\(\t\ \)\(Do[Print[ SubscriptBox["\", RowBox[{i, "\<,\>", j}]] // DisplayForm, "\< = \>", matrixA[\([i, j]\)]], {i, m}, {j, n}]\)\)\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(1, 1\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(\(0.005445293527926181`\ \((\(-3669.35`\) + \ eA)\)\ \((142.72000000000025`\ \((\(-3669.35`\) + eA)\) - 115.57000000000016`\ \ \((\(-1746.89`\) + nA)\))\)\)\/\((\((\(-3669.35`\) + eA)\)\^2 + \ \((\(-1746.89`\) + nA)\)\^2)\)\^\(3/2\) - 0.777152292305626`\/\@\(\((\(-3669.35`\) + eA)\)\^2 + \ \((\(-1746.89`\) + nA)\)\^2\)\)\/\@\(1 - \(0.00002965122160527476`\ \ \((142.72000000000025`\ \((\(-3669.35`\) + eA)\) - 115.57000000000016`\ \ \((\(-1746.89`\) + nA)\))\)\^2\)\/\(\((\(-3669.35`\) + eA)\)\^2 + \ \((\(-1746.89`\) + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {1, ",", 1}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000029651221605274761, Power[ Plus[ Times[ 142.72000000000025, Plus[ -3669.3499999999999, eA]], Times[ -115.57000000000016, Plus[ -1746.8900000000001, nA]]], 2], Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .0054452935279261814, Plus[ -3669.3499999999999, eA], Plus[ Times[ 142.72000000000025, Plus[ -3669.3499999999999, eA]], Times[ -115.57000000000016, Plus[ -1746.8900000000001, nA]]], Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], Rational[ -3, 2]]], Times[ -.77715229230562599, Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], Rational[ -1, 2]]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(1, 2\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(0.6293125730224297`\/\@\(\((\(-3669.35`\) + \ eA)\)\^2 + \((\(-1746.89`\) + nA)\)\^2\) + \(0.005445293527926181`\ \ \((142.72000000000025`\ \((\(-3669.35`\) + eA)\) - 115.57000000000016`\ \ \((\(-1746.89`\) + nA)\))\)\ \((\(-1746.89`\) + nA)\)\)\/\((\((\(-3669.35`\) \ + eA)\)\^2 + \((\(-1746.89`\) + nA)\)\^2)\)\^\(3/2\)\)\/\@\(1 - \ \(0.00002965122160527476`\ \((142.72000000000025`\ \((\(-3669.35`\) + eA)\) - \ 115.57000000000016`\ \((\(-1746.89`\) + nA)\))\)\^2\)\/\(\((\(-3669.35`\) + \ eA)\)\^2 + \((\(-1746.89`\) + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {1, ",", 2}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000029651221605274761, Power[ Plus[ Times[ 142.72000000000025, Plus[ -3669.3499999999999, eA]], Times[ -115.57000000000016, Plus[ -1746.8900000000001, nA]]], 2], Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .62931257302242971, Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], Rational[ -1, 2]]], Times[ .0054452935279261814, Plus[ Times[ 142.72000000000025, Plus[ -3669.3499999999999, eA]], Times[ -115.57000000000016, Plus[ -1746.8900000000001, nA]]], Power[ Plus[ Power[ Plus[ -3669.3499999999999, eA], 2], Power[ Plus[ -1746.8900000000001, nA], 2]], Rational[ -3, 2]], Plus[ -1746.8900000000001, nA]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(2, 1\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(\(0.005445293527926181`\ \((\(-3812.07`\) + \ eA)\)\ \((\(-142.72000000000025`\)\ \((\(-3812.07`\) + eA)\) + \ 115.57000000000016`\ \((\(-1631.32`\) + nA)\))\)\)\/\((\((\(-3812.07`\) + eA)\ \)\^2 + \((\(-1631.32`\) + nA)\)\^2)\)\^\(3/2\) + 0.777152292305626`\/\@\(\((\(-3812.07`\) + eA)\)\^2 + \ \((\(-1631.32`\) + nA)\)\^2\)\)\/\@\(1 - \(0.00002965122160527476`\ \ \((\(-142.72000000000025`\)\ \((\(-3812.07`\) + eA)\) + 115.57000000000016`\ \ \((\(-1631.32`\) + nA)\))\)\^2\)\/\(\((\(-3812.07`\) + eA)\)\^2 + \ \((\(-1631.32`\) + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {2, ",", 1}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000029651221605274761, Power[ Plus[ Times[ -142.72000000000025, Plus[ -3812.0700000000002, eA]], Times[ 115.57000000000016, Plus[ -1631.3199999999999, nA]]], 2], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .0054452935279261814, Plus[ -3812.0700000000002, eA], Plus[ Times[ -142.72000000000025, Plus[ -3812.0700000000002, eA]], Times[ 115.57000000000016, Plus[ -1631.3199999999999, nA]]], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -3, 2]]], Times[ .77715229230562599, Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -1, 2]]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(2, 2\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(\(-\(0.6293125730224297`\/\@\(\((\(-3812.07`\ \) + eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2\)\)\) + \(0.005445293527926181`\ \ \((\(-142.72000000000025`\)\ \((\(-3812.07`\) + eA)\) + 115.57000000000016`\ \ \((\(-1631.32`\) + nA)\))\)\ \((\(-1631.32`\) + nA)\)\)\/\((\((\(-3812.07`\) \ + eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2)\)\^\(3/2\)\)\/\@\(1 - \ \(0.00002965122160527476`\ \((\(-142.72000000000025`\)\ \((\(-3812.07`\) + \ eA)\) + 115.57000000000016`\ \((\(-1631.32`\) + \ nA)\))\)\^2\)\/\(\((\(-3812.07`\) + eA)\)\^2 + \((\(-1631.32`\) + \ nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {2, ",", 2}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000029651221605274761, Power[ Plus[ Times[ -142.72000000000025, Plus[ -3812.0700000000002, eA]], Times[ 115.57000000000016, Plus[ -1631.3199999999999, nA]]], 2], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ -.62931257302242971, Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -1, 2]]], Times[ .0054452935279261814, Plus[ Times[ -142.72000000000025, Plus[ -3812.0700000000002, eA]], Times[ 115.57000000000016, Plus[ -1631.3199999999999, nA]]], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -3, 2]], Plus[ -1631.3199999999999, nA]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(3, 1\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(\(0.005717644727389747`\ \((\(-3640.`\) + \ eA)\)\ \((172.07000000000016`\ \((\(-3640.`\) + eA)\) + 31.319999999999936`\ \ \((\(-1600.`\) + nA)\))\)\)\/\((\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) + \ nA)\)\^2)\)\^\(3/2\) - 0.9838351282419547`\/\@\(\((\(-3640.`\) + eA)\)\^2 + \ \((\(-1600.`\) + nA)\)\^2\)\)\/\@\(1 - \(0.00003269146122864778`\ \ \((172.07000000000016`\ \((\(-3640.`\) + eA)\) + 31.319999999999936`\ \ \((\(-1600.`\) + nA)\))\)\^2\)\/\(\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) \ + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {3, ",", 1}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000032691461228647779, Power[ Plus[ Times[ 172.07000000000016, Plus[ -.364*^4, eA]], Times[ 31.319999999999936, Plus[ -.16*^4, nA]]], 2], Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .0057176447273897474, Plus[ -.364*^4, eA], Plus[ Times[ 172.07000000000016, Plus[ -.364*^4, eA]], Times[ 31.319999999999936, Plus[ -.16*^4, nA]]], Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], Rational[ -3, 2]]], Times[ -.98383512824195474, Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], Rational[ -1, 2]]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(3, 2\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \ \(\(\(-\(0.17907663286184652`\/\@\(\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) \ + nA)\)\^2\)\)\) + \(0.005717644727389747`\ \((172.07000000000016`\ \ \((\(-3640.`\) + eA)\) + 31.319999999999936`\ \((\(-1600.`\) + nA)\))\)\ \ \((\(-1600.`\) + nA)\)\)\/\((\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) + nA)\ \)\^2)\)\^\(3/2\)\)\/\@\(1 - \(0.00003269146122864778`\ \ \((172.07000000000016`\ \((\(-3640.`\) + eA)\) + 31.319999999999936`\ \ \((\(-1600.`\) + nA)\))\)\^2\)\/\(\((\(-3640.`\) + eA)\)\^2 + \((\(-1600.`\) \ + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {3, ",", 2}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000032691461228647779, Power[ Plus[ Times[ 172.07000000000016, Plus[ -.364*^4, eA]], Times[ 31.319999999999936, Plus[ -.16*^4, nA]]], 2], Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ -.17907663286184652, Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], Rational[ -1, 2]]], Times[ .0057176447273897474, Plus[ Times[ 172.07000000000016, Plus[ -.364*^4, eA]], Times[ 31.319999999999936, Plus[ -.16*^4, nA]]], Power[ Plus[ Power[ Plus[ -.364*^4, eA], 2], Power[ Plus[ -.16*^4, nA], 2]], Rational[ -3, 2]], Plus[ -.16*^4, nA]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(4, 1\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(\(0.005717644727389747`\ \((\(-3812.07`\) + \ eA)\)\ \((\(-172.07000000000016`\)\ \((\(-3812.07`\) + eA)\) - \ 31.319999999999936`\ \((\(-1631.32`\) + nA)\))\)\)\/\((\((\(-3812.07`\) + eA)\ \)\^2 + \((\(-1631.32`\) + nA)\)\^2)\)\^\(3/2\) + 0.9838351282419547`\/\@\(\((\(-3812.07`\) + eA)\)\^2 + \ \((\(-1631.32`\) + nA)\)\^2\)\)\/\@\(1 - \(0.00003269146122864778`\ \ \((\(-172.07000000000016`\)\ \((\(-3812.07`\) + eA)\) - 31.319999999999936`\ \ \((\(-1631.32`\) + nA)\))\)\^2\)\/\(\((\(-3812.07`\) + eA)\)\^2 + \ \((\(-1631.32`\) + nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {4, ",", 1}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000032691461228647779, Power[ Plus[ Times[ -172.07000000000016, Plus[ -3812.0700000000002, eA]], Times[ -31.319999999999936, Plus[ -1631.3199999999999, nA]]], 2], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .0057176447273897474, Plus[ -3812.0700000000002, eA], Plus[ Times[ -172.07000000000016, Plus[ -3812.0700000000002, eA]], Times[ -31.319999999999936, Plus[ -1631.3199999999999, nA]]], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -3, 2]]], Times[ .98383512824195474, Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -1, 2]]]]]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{ TagBox[\(A\_\(4, 2\)\), DisplayForm], "\[InvisibleSpace]", "\<\" = \"\>", "\[InvisibleSpace]", \(\(0.17907663286184652`\/\@\(\((\(-3812.07`\) + \ eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2\) + \(0.005717644727389747`\ \ \((\(-172.07000000000016`\)\ \((\(-3812.07`\) + eA)\) - 31.319999999999936`\ \ \((\(-1631.32`\) + nA)\))\)\ \((\(-1631.32`\) + nA)\)\)\/\((\((\(-3812.07`\) \ + eA)\)\^2 + \((\(-1631.32`\) + nA)\)\^2)\)\^\(3/2\)\)\/\@\(1 - \ \(0.00003269146122864778`\ \((\(-172.07000000000016`\)\ \((\(-3812.07`\) + \ eA)\) - 31.319999999999936`\ \((\(-1631.32`\) + \ nA)\))\)\^2\)\/\(\((\(-3812.07`\) + eA)\)\^2 + \((\(-1631.32`\) + \ nA)\)\^2\)\)\)}], SequenceForm[ DisplayForm[ SubscriptBox[ "A", RowBox[ {4, ",", 2}]]], " = ", Times[ Power[ Plus[ 1, Times[ -.000032691461228647779, Power[ Plus[ Times[ -172.07000000000016, Plus[ -3812.0700000000002, eA]], Times[ -31.319999999999936, Plus[ -1631.3199999999999, nA]]], 2], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], -1]]], Rational[ -1, 2]], Plus[ Times[ .17907663286184652, Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -1, 2]]], Times[ .0057176447273897474, Plus[ Times[ -172.07000000000016, Plus[ -3812.0700000000002, eA]], Times[ -31.319999999999936, Plus[ -1631.3199999999999, nA]]], Power[ Plus[ Power[ Plus[ -3812.0700000000002, eA], 2], Power[ Plus[ -1631.3199999999999, nA], 2]], Rational[ -3, 2]], Plus[ -1631.3199999999999, nA]]]]], Editable->False]], "Print"] }, Open ]], Cell[BoxData[ \( (*\ very\ crude\ estimates\ as\ provisional\ coordinates\ *) \)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(updatedCoordinates = {3700, 1675}\)], "Input"], Cell[BoxData[ \({3700, 1675}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ \( (*\ Initialize\ counter\ and\ change\ *) \[IndentingNewLine]\t counter = 1; \ change = 999;\), "\[IndentingNewLine]", \(\t\(Print["\"];\)\n (*\ Stop\ iteriation\ if\ no\ adjusted\ coordinate\ changes\ more\ than\ \ 0.1 mm\ *) \), "\[IndentingNewLine]", \(While[\ change > 1/1000, \[IndentingNewLine] (*\ Substitution\ rule\ for\ each\ coordinate\ to\ be\ replaced\ by\ its\ \ updated\ value\ *) \[IndentingNewLine]\t updateRule = Table[a[\([j]\)] \[Rule] updatedCoordinates[\([j]\)], {j, 1, n}]; \ \[IndentingNewLine] (*\ "\"\ = \ \(angular\ residuals\ \ vector\ = \ observed\ value\ - \ \((calculated\ version\ using\ updated\ \ coordinates)\)\)\ *) \[IndentingNewLine]\t k = Table[ observedAngles[\([i]\)] - \((observations[\([i]\)] /. updateRule)\), {i, 1, m}]; \[IndentingNewLine] (*\ Turn\ A\ matrix\ numerical\ by\ assigning\ all\ coordinates\ to\ \ their\ updated\ values\ *) \[IndentingNewLine]\ \ \ \ \ \ \ \ \ numericA = matrixA /. updateRule; \ \[IndentingNewLine] (*\ Solve\ the\ linearized\ problem\ and\ record\ change\ \ *) \[IndentingNewLine]\t\ \ dx = Inverse[Transpose[numericA] . w . numericA] . Transpose[numericA] . w . k; change = Sqrt[dx . dx]; (*\ Add\ obtained\ correction\ vector\ to\ coordinates\ \ *) \[IndentingNewLine]\t updatedCoordinates = updatedCoordinates + dx; \ \[IndentingNewLine] (*\ Adding\ back\ the\ 3\ known\ values\ to\ the\ lists, \ forming\ the\ list\ of\ allCooridnates\ for\ outputting\ *) \[IndentingNewLine]\t Print["\", counter, "\< \[CapitalDelta] = \>", NumberForm[ change*1000, {10, 3}], "\< mm.\>"]; \[IndentingNewLine] (*\ Reporting\ the\ adjusted\ coordinates\ to\ 3\ decimal\ places\ *) \[IndentingNewLine]\t Print["\", NumberForm[ updatedCoordinates, {10, 3}]]; \[IndentingNewLine]\(counter++\)]\)}], "Input"], Cell[BoxData[ \("Output of Mathematica program"\)], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Iteration \"\>", "\[InvisibleSpace]", "1", "\[InvisibleSpace]", "\<\" \[CapitalDelta] = \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox["\<\"15.386\"\>", 15.385890140143262, AutoDelete->True], (NumberForm[ #, {10, 3}]&)], "\[InvisibleSpace]", "\<\" mm.\"\>"}], SequenceForm[ "Iteration ", 1, " \[CapitalDelta] = ", NumberForm[ 15.385890140143262, {10, 3}], " mm."], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Adjusted coordinates are: \"\>", "\[InvisibleSpace]", TagBox[ RowBox[{"{", RowBox[{ InterpretationBox["\<\"3700.007\"\>", 3700.0069250895758, AutoDelete->True], ",", InterpretationBox["\<\"1674.986\"\>", 1674.986260685979, AutoDelete->True]}], "}"}], (NumberForm[ #, {10, 3}]&)]}], SequenceForm[ "Adjusted coordinates are: ", NumberForm[ {3700.0069250895758, 1674.986260685979}, {10, 3}]], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Iteration \"\>", "\[InvisibleSpace]", "2", "\[InvisibleSpace]", "\<\" \[CapitalDelta] = \"\>", "\[InvisibleSpace]", TagBox[ InterpretationBox["\<\"0.001\"\>", .0011982752786421102, AutoDelete->True], (NumberForm[ #, {10, 3}]&)], "\[InvisibleSpace]", "\<\" mm.\"\>"}], SequenceForm[ "Iteration ", 2, " \[CapitalDelta] = ", NumberForm[ .0011982752786421102, {10, 3}], " mm."], Editable->False]], "Print"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Adjusted coordinates are: \"\>", "\[InvisibleSpace]", TagBox[ RowBox[{"{", RowBox[{ InterpretationBox["\<\"3700.007\"\>", 3700.0069248792547, AutoDelete->True], ",", InterpretationBox["\<\"1674.986\"\>", 1674.9862618656521, AutoDelete->True]}], "}"}], (NumberForm[ #, {10, 3}]&)]}], SequenceForm[ "Adjusted coordinates are: ", NumberForm[ {3700.0069248792547, 1674.9862618656521}, {10, 3}]], Editable->False]], "Print"] }, Open ]] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 685}}, ScreenStyleEnvironment->"Presentation", PrintingStyleEnvironment->"Presentation", WindowSize->{1014, 651}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrintingCopies->1, PrintingPageRange->{Automatic, Automatic} ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1705, 50, 87, 1, 38, "Input"], Cell[1795, 53, 387, 11, 38, "Input"], Cell[2185, 66, 228, 3, 61, "Input"], Cell[CellGroupData[{ Cell[2438, 73, 130, 2, 38, "Input"], Cell[2571, 77, 42, 1, 38, "Output"] }, Open ]], Cell[2628, 81, 166, 2, 38, "Input"], Cell[2797, 85, 148, 3, 38, "Input"], Cell[CellGroupData[{ Cell[2970, 92, 124, 2, 38, "Input"], Cell[3097, 96, 239, 4, 61, "Output"] }, Open ]], Cell[3351, 103, 166, 2, 38, "Input"], Cell[3520, 107, 148, 3, 38, "Input"], Cell[CellGroupData[{ Cell[3693, 114, 124, 2, 38, "Input"], Cell[3820, 118, 244, 4, 61, "Output"] }, Open ]], Cell[4079, 125, 165, 2, 38, "Input"], Cell[4247, 129, 147, 3, 38, "Input"], Cell[CellGroupData[{ Cell[4419, 136, 124, 2, 38, "Input"], Cell[4546, 140, 231, 4, 61, "Output"] }, Open ]], Cell[4792, 147, 165, 2, 38, "Input"], Cell[4960, 151, 149, 3, 38, "Input"], Cell[CellGroupData[{ Cell[5134, 158, 124, 2, 38, "Input"], Cell[5261, 162, 244, 4, 61, "Output"] }, Open ]], Cell[5520, 169, 145, 2, 38, "Input"], Cell[CellGroupData[{ Cell[5690, 175, 140, 2, 38, "Input"], Cell[5833, 179, 35, 1, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[5905, 185, 111, 2, 38, "Input"], Cell[6019, 189, 35, 1, 38, "Output"] }, Open ]], Cell[6069, 193, 219, 4, 61, "Input"], Cell[6291, 199, 264, 5, 61, "Input"], Cell[CellGroupData[{ Cell[6580, 208, 249, 4, 61, "Input"], Cell[6832, 214, 138, 2, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7007, 221, 163, 3, 61, "Input"], Cell[7173, 226, 47, 1, 51, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7257, 232, 175, 3, 61, "Input"], Cell[7435, 237, 188, 3, 95, "Output"] }, Open ]], Cell[7638, 243, 268, 6, 61, "Input"], Cell[CellGroupData[{ Cell[7931, 253, 275, 6, 84, "Input"], Cell[8209, 261, 2374, 58, 98, "Print"], Cell[10586, 321, 2359, 57, 98, "Print"], Cell[12948, 380, 2383, 58, 98, "Print"], Cell[15334, 440, 2381, 58, 98, "Print"], Cell[17718, 500, 2225, 58, 98, "Print"], Cell[19946, 560, 2221, 58, 98, "Print"], Cell[22170, 620, 2386, 58, 98, "Print"], Cell[24559, 680, 2374, 58, 98, "Print"] }, Open ]], Cell[26948, 741, 102, 2, 38, "Input"], Cell[CellGroupData[{ Cell[27075, 747, 66, 1, 38, "Input"], Cell[27144, 750, 46, 1, 38, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27227, 756, 2138, 40, 521, "Input"], Cell[29368, 798, 64, 1, 28, "Print"], Cell[29435, 801, 551, 12, 28, "Print"], Cell[29989, 815, 629, 15, 28, "Print"], Cell[30621, 832, 554, 12, 28, "Print"], Cell[31178, 846, 631, 15, 28, "Print"] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)