(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 15149, 401] NotebookOptionsPosition[ 13966, 371] NotebookOutlinePosition[ 14399, 388] CellTagsIndexPosition[ 14356, 385] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{ "This", " ", "programme", " ", "is", " ", "written", " ", "to", " ", "solve", " ", "the", " ", "1"}], "-", RowBox[{"D", " ", RowBox[{"(", "FORWARD", ")"}], " ", "gravity", " ", "problem"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Input", " ", "Part"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"m", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"9", ",", "3", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"16", ",", "4", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"25", ",", "5", ",", "1"}], "}"}]}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "coefficients"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"xx", "=", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c"}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "variables"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"g", "=", RowBox[{"{", RowBox[{"1.39", ",", "2.21", ",", "3.21", ",", "4.39", ",", "5.81"}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "gravity", " ", "readings"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Calculations", " ", "Part"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"sol", "=", RowBox[{ RowBox[{"Inverse", "[", RowBox[{ RowBox[{"Transpose", "[", "m", "]"}], ".", "m"}], "]"}], ".", RowBox[{"Transpose", "[", "m", "]"}], ".", "g"}]}], ";"}], RowBox[{"(*", RowBox[{ "Solving", " ", "the", " ", "equations", " ", "for", " ", "the", " ", "Predetermined", " ", "case"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"grav", "[", "x_", "]"}], "=", RowBox[{ RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "*", RowBox[{"(", RowBox[{"x", "^", "2"}], ")"}]}], "+", RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], "*", "x"}], "+", RowBox[{"sol", "[", RowBox[{"[", "3", "]"}], "]"}]}]}], ";"}], RowBox[{"(*", RowBox[{ "The", " ", "equation", " ", "of", " ", "gravity", " ", "anomaly", " ", "with", " ", "the", " ", "constants"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Output", " ", "Part"}], "*)"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], ",", "\"\<, \>\"", ",", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], ",", "\"\<, \>\"", ",", "\"\\"", ",", RowBox[{"sol", "[", RowBox[{"[", "3", "]"}], "]"}], ",", "\"\< respectively.\>\""}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"grav", "[", "2.5", "]"}], ",", "\"\< m/(s^2)\>\""}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"grav", "[", "4.5", "]"}], ",", "\"\< m/(s^2)\>\""}], "]"}]}]}]], "Input", CellChangeTimes->{{3.961404357415028*^9, 3.961404435847828*^9}, { 3.961404483324684*^9, 3.9614047101643877`*^9}, {3.9614047454555006`*^9, 3.961405048971077*^9}, {3.961405090932439*^9, 3.9614052505652213`*^9}, { 3.96140624451283*^9, 3.961406350727299*^9}, {3.9629643756247544`*^9, 3.9629644771228933`*^9}, {3.9629645208402777`*^9, 3.9629646349364815`*^9}, { 3.962964686540901*^9, 3.962964778392769*^9}, {3.962965004340699*^9, 3.9629650082590857`*^9}, {3.9629656648568993`*^9, 3.9629657173542933`*^9}, { 3.962967705633955*^9, 3.9629677103684754`*^9}},ExpressionUUID->"4c122a44-e682-4765-8b74-\ 16defeee3e1d"], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The values of the variables a, b, and c are \"\>", "\[InvisibleSpace]", "0.09857142857142853`", "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", "0.5105714285714287`", "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", "\<\"and \"\>", "\[InvisibleSpace]", "0.7859999999999996`", "\[InvisibleSpace]", "\<\" respectively.\"\>"}], SequenceForm[ "The values of the variables a, b, and c are ", 0.09857142857142853, ", ", 0.5105714285714287, ", ", "and ", 0.7859999999999996, " respectively."], Editable->False]], "Print", CellChangeTimes->{ 3.961404903701743*^9, {3.9614050233319087`*^9, 3.961405049620652*^9}, { 3.961405225865702*^9, 3.961405252909659*^9}, 3.962964638033066*^9, { 3.962964715043264*^9, 3.9629647819315796`*^9}, 3.962965048708764*^9, 3.9629657855018244`*^9}, CellLabel-> "During evaluation of \ In[1]:=",ExpressionUUID->"31756c0a-06af-41fb-8d58-2be7202a769f"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The gravity at x=2.5 m is \"\>", "\[InvisibleSpace]", "2.6784999999999997`", "\[InvisibleSpace]", "\<\" m/(s^2)\"\>"}], SequenceForm["The gravity at x=2.5 m is ", 2.6784999999999997`, " m/(s^2)"], Editable->False]], "Print", CellChangeTimes->{ 3.961404903701743*^9, {3.9614050233319087`*^9, 3.961405049620652*^9}, { 3.961405225865702*^9, 3.961405252909659*^9}, 3.962964638033066*^9, { 3.962964715043264*^9, 3.9629647819315796`*^9}, 3.962965048708764*^9, 3.96296578550603*^9}, CellLabel-> "During evaluation of \ In[1]:=",ExpressionUUID->"d9f5f7e1-c63c-4d06-91d7-ad6a9534da64"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The gravity at x=4.5 m is \"\>", "\[InvisibleSpace]", "5.079642857142856`", "\[InvisibleSpace]", "\<\" m/(s^2)\"\>"}], SequenceForm["The gravity at x=4.5 m is ", 5.079642857142856, " m/(s^2)"], Editable->False]], "Print", CellChangeTimes->{ 3.961404903701743*^9, {3.9614050233319087`*^9, 3.961405049620652*^9}, { 3.961405225865702*^9, 3.961405252909659*^9}, 3.962964638033066*^9, { 3.962964715043264*^9, 3.9629647819315796`*^9}, 3.962965048708764*^9, 3.962965785509491*^9}, CellLabel-> "During evaluation of \ In[1]:=",ExpressionUUID->"7ac9a20c-afd9-4925-b7a0-aecb9af546c4"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", RowBox[{ "m", ",", "xx", ",", "a", ",", "b", ",", "c", ",", "d", ",", "g", ",", "sol", ",", "grav"}], "]"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{ "This", " ", "programme", " ", "is", " ", "written", " ", "to", " ", "solve", " ", "the", " ", "2"}], "-", RowBox[{"D", " ", RowBox[{"(", "Forward", ")"}], " ", "gravity", " ", "problem"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Input", " ", "Part"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"m", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "0", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "0", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "0", ",", "0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "4", ",", "2", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", "1", ",", "1", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", "4", ",", "2", ",", "1"}], "}"}]}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "coefficients"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"xx", "=", RowBox[{"{", RowBox[{"a", ",", "b", ",", "c", ",", "d"}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "constants"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"g", "=", RowBox[{"{", RowBox[{ "0.95", ",", "1.19", ",", "1.09", ",", "1.21", ",", "1.39", ",", "1.81", ",", "1.40", ",", "1.72"}], "}"}]}], ";"}], RowBox[{"(*", RowBox[{ "This", " ", "is", " ", "the", " ", "matrix", " ", "of", " ", "gravity", " ", "readings"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Calculations", " ", "Part"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"sol", "=", RowBox[{ RowBox[{"Inverse", "[", RowBox[{ RowBox[{"Transpose", "[", "m", "]"}], ".", "m"}], "]"}], ".", RowBox[{"Transpose", "[", "m", "]"}], ".", "g"}]}], ";"}], RowBox[{"(*", RowBox[{ "Solving", " ", "the", " ", "equations", " ", "for", " ", "the", " ", "Predetermined", " ", "case"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"grav", "[", RowBox[{"x_", ",", "y_"}], "]"}], "=", RowBox[{ RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], "*", RowBox[{"(", RowBox[{"x", "^", "2"}], ")"}]}], "+", RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], "*", RowBox[{"(", RowBox[{"y", "^", "2"}], ")"}]}], "+", RowBox[{ RowBox[{"sol", "[", RowBox[{"[", "3", "]"}], "]"}], "*", "y"}], "+", RowBox[{"sol", "[", RowBox[{"[", "4", "]"}], "]"}]}]}], ";"}], RowBox[{"(*", RowBox[{ "The", " ", "equation", " ", "of", " ", "gravity", " ", "anomaly", " ", "with", " ", "the", " ", "constants"}], "*)"}], "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Output", " ", "Part"}], "*)"}]}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"sol", "[", RowBox[{"[", "1", "]"}], "]"}], ",", "\"\<, \>\"", ",", RowBox[{"sol", "[", RowBox[{"[", "2", "]"}], "]"}], ",", "\"\<, \>\"", ",", RowBox[{"sol", "[", RowBox[{"[", "3", "]"}], "]"}], ",", "\"\<,\>\"", ",", "\"\< and \>\"", ",", RowBox[{"sol", "[", RowBox[{"[", "4", "]"}], "]"}], ",", "\"\< respectively.\>\""}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"grav", "[", RowBox[{"1.5", ",", "1.25"}], "]"}], ",", "\"\< m/(s^2)\>\""}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"grav", "[", RowBox[{"0.25", ",", "1.75"}], "]"}], ",", "\"\< m/(s^2)\>\""}], "]"}]}], "Input", CellChangeTimes->{{3.9629649056964912`*^9, 3.9629650604147615`*^9}, { 3.962965112705587*^9, 3.9629651209708433`*^9}, {3.962965728519576*^9, 3.962965764254966*^9}, {3.9629677341039734`*^9, 3.9629677380718184`*^9}},ExpressionUUID->"f0d6816f-1810-4d1b-b005-\ 2ba37324291d"], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The values of the variables a, b, c, and d are \"\>", "\[InvisibleSpace]", "0.0765420560747663`", "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", "0.23214953271028044`", "\[InvisibleSpace]", "\<\", \"\>", "\[InvisibleSpace]", RowBox[{"-", "0.10881619937694692`"}], "\[InvisibleSpace]", "\<\",\"\>", "\[InvisibleSpace]", "\<\" and \"\>", "\[InvisibleSpace]", "1.0157632398753893`", "\[InvisibleSpace]", "\<\" respectively.\"\>"}], SequenceForm[ "The values of the variables a, b, c, and d are ", 0.0765420560747663, ", ", 0.23214953271028044`, ", ", -0.10881619937694692`, ",", " and ", 1.0157632398753893`, " respectively."], Editable->False]], "Print", CellChangeTimes->{{3.9629650442123713`*^9, 3.9629650634374905`*^9}, 3.962965139776736*^9, 3.9629657893606563`*^9}, CellLabel-> "During evaluation of \ In[6]:=",ExpressionUUID->"42c408b7-0c6f-4de1-b173-32036b68b39b"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The gravity at x=1.5 m, y=1.25 m is \"\>", "\[InvisibleSpace]", "1.4146962616822432`", "\[InvisibleSpace]", "\<\" m/(s^2)\"\>"}], SequenceForm[ "The gravity at x=1.5 m, y=1.25 m is ", 1.4146962616822432`, " m/(s^2)"], Editable->False]], "Print", CellChangeTimes->{{3.9629650442123713`*^9, 3.9629650634374905`*^9}, 3.962965139776736*^9, 3.9629657893653107`*^9}, CellLabel-> "During evaluation of \ In[6]:=",ExpressionUUID->"3fa4b032-b4f6-4e6b-ba36-6e1034b9596d"], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"The gravity at x=0.25 m, y=1.75 m is \"\>", "\[InvisibleSpace]", "1.541076713395639`", "\[InvisibleSpace]", "\<\" m/(s^2)\"\>"}], SequenceForm[ "The gravity at x=0.25 m, y=1.75 m is ", 1.541076713395639, " m/(s^2)"], Editable->False]], "Print", CellChangeTimes->{{3.9629650442123713`*^9, 3.9629650634374905`*^9}, 3.962965139776736*^9, 3.962965789370916*^9}, CellLabel-> "During evaluation of \ In[6]:=",ExpressionUUID->"22b44979-c1ee-40c6-b792-382733f8d018"] }, Open ]] }, Open ]] }, WindowSize->{951., 477.75}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Magnification:>1.5 Inherited, FrontEndVersion->"13.2 for Microsoft Windows (64-bit) (January 30, 2023)", StyleDefinitions->"Default.nb", ExpressionUUID->"6b728da8-fad3-4812-9404-74486312ab0f" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 4233, 108, 500, "Input",ExpressionUUID->"4c122a44-e682-4765-8b74-16defeee3e1d"], Cell[CellGroupData[{ Cell[4838, 134, 979, 19, 60, "Print",ExpressionUUID->"31756c0a-06af-41fb-8d58-2be7202a769f"], Cell[5820, 155, 649, 13, 33, "Print",ExpressionUUID->"d9f5f7e1-c63c-4d06-91d7-ad6a9534da64"], Cell[6472, 170, 647, 13, 33, "Print",ExpressionUUID->"7ac9a20c-afd9-4925-b7a0-aecb9af546c4"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7168, 189, 4706, 128, 585, "Input",ExpressionUUID->"f0d6816f-1810-4d1b-b005-2ba37324291d"], Cell[CellGroupData[{ Cell[11899, 321, 976, 19, 60, "Print",ExpressionUUID->"42c408b7-0c6f-4de1-b173-32036b68b39b"], Cell[12878, 342, 528, 11, 33, "Print",ExpressionUUID->"3fa4b032-b4f6-4e6b-ba36-6e1034b9596d"], Cell[13409, 355, 529, 12, 33, "Print",ExpressionUUID->"22b44979-c1ee-40c6-b792-382733f8d018"] }, Open ]] }, Open ]] } ] *)