(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 8111, 224] NotebookOptionsPosition[ 7406, 203] NotebookOutlinePosition[ 7804, 219] CellTagsIndexPosition[ 7761, 216] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"cities", "=", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"alt", "=", RowBox[{"{", RowBox[{ "17", ",", "0", ",", "2", ",", "1", ",", "1", ",", "81", ",", "51", ",", "500", ",", "1868", ",", "680", ",", "95", ",", "5", ",", "25", ",", "5"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"avgtemp", "=", RowBox[{"{", RowBox[{ "27", ",", "27", ",", "27", ",", "27", ",", "27", ",", "29", ",", "30", ",", "25", ",", "16", ",", "24", ",", "27", ",", "27", ",", "27", ",", "27"}], "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", RowBox[{"Length", "[", "cities", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"tT", "[", "h_", "]"}], ":=", RowBox[{ RowBox[{ RowBox[{"-", "7"}], "*", RowBox[{"h", "/", "1000"}]}], "+", "27"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"calt", "=", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"tT", "[", RowBox[{"alt", "[", RowBox[{"[", "i", "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}], "//", "N"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"pcent", "=", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"Abs", "[", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"calt", "[", RowBox[{"[", "i", "]"}], "]"}], "-", RowBox[{"avgtemp", "[", RowBox[{"[", "i", "]"}], "]"}]}], ")"}], "/", RowBox[{"avgtemp", "[", RowBox[{"[", "i", "]"}], "]"}]}], ")"}], "*", "100"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}], "//", "N"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tab", "=", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"cities", ",", "alt", ",", "avgtemp", ",", RowBox[{"Round", "[", "calt", "]"}], ",", RowBox[{"Round", "[", "pcent", "]"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"TableOfValues1", "=", RowBox[{"Prepend", "[", RowBox[{"tab", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Grid", "[", RowBox[{"TableOfValues1", ",", RowBox[{"Frame", "->", "All"}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.8805943827214375`*^9, 3.8805945359170017`*^9}, { 3.8805945740461564`*^9, 3.8805945796851835`*^9}}, CellLabel->"In[2]:=",ExpressionUUID->"3cf05d00-3b86-454a-a7a6-22ac685f1374"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"City\"\>", "\<\"Altitude(m)\"\>", "\<\"ActTemp(\[Degree]C)\"\>", \ "\<\"CalTemp(\[Degree]C)\"\>", "\<\"Error(%)\"\>"}, {"\<\"Panadura\"\>", "17", "27", "27", "0"}, {"\<\"Galle\"\>", "0", "27", "27", "0"}, {"\<\"Matara\"\>", "2", "27", "27", "0"}, {"\<\"Hambantota\"\>", "1", "27", "27", "0"}, {"\<\"Colombo\"\>", "1", "27", "27", "0"}, {"\<\"Anuradhapura\"\>", "81", "29", "26", "9"}, {"\<\"Polonnaruwa\"\>", "51", "30", "27", "11"}, {"\<\"Kandy\"\>", "500", "25", "24", "6"}, {"\<\"NuwaraEliya\"\>", "1868", "16", "14", "13"}, {"\<\"Badulla\"\>", "680", "24", "22", "7"}, {"\<\"Nugegoda\"\>", "95", "27", "26", "2"}, {"\<\"Ratmalana\"\>", "5", "27", "27", "0"}, {"\<\"Maharagama\"\>", "25", "27", "27", "1"}, {"\<\"Jaffna\"\>", "5", "27", "27", "0"} }, AutoDelete->False, GridBoxFrame->{"Columns" -> {{True}}, "Rows" -> {{True}}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}], "Grid"]], "Output", CellChangeTimes->{{3.880594492201485*^9, 3.880594536512972*^9}, 3.8805945803647285`*^9, 3.8805947727266746`*^9}, CellLabel->"Out[11]=",ExpressionUUID->"76a3033c-a45e-44a2-b5c5-572542169a9b"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Grid", "[", RowBox[{"TableOfValues1", ",", RowBox[{"ItemStyle", "->", RowBox[{"{", RowBox[{"Automatic", ",", RowBox[{"{", RowBox[{"1", "->", RowBox[{"{", RowBox[{"Bold", ",", "14"}], "}"}]}], "}"}]}], "}"}]}], ",", RowBox[{"Frame", "->", RowBox[{"{", RowBox[{"All", ",", RowBox[{"1", "->", "True"}]}], "}"}]}], ",", RowBox[{"Background", "->", RowBox[{"{", RowBox[{"None", ",", RowBox[{"{", RowBox[{"{", RowBox[{"LightOrange", ",", "LightGray"}], "}"}], "}"}]}], "}"}]}]}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{3.88059474864533*^9}, CellLabel->"In[12]:=",ExpressionUUID->"afaacca6-d48b-4649-8c22-3d5e90a604ce"], Cell[BoxData[ TagBox[GridBox[{ {"\<\"City\"\>", "\<\"Altitude(m)\"\>", "\<\"ActTemp(\[Degree]C)\"\>", \ "\<\"CalTemp(\[Degree]C)\"\>", "\<\"Error(%)\"\>"}, {"\<\"Panadura\"\>", "17", "27", "27", "0"}, {"\<\"Galle\"\>", "0", "27", "27", "0"}, {"\<\"Matara\"\>", "2", "27", "27", "0"}, {"\<\"Hambantota\"\>", "1", "27", "27", "0"}, {"\<\"Colombo\"\>", "1", "27", "27", "0"}, {"\<\"Anuradhapura\"\>", "81", "29", "26", "9"}, {"\<\"Polonnaruwa\"\>", "51", "30", "27", "11"}, {"\<\"Kandy\"\>", "500", "25", "24", "6"}, {"\<\"NuwaraEliya\"\>", "1868", "16", "14", "13"}, {"\<\"Badulla\"\>", "680", "24", "22", "7"}, {"\<\"Nugegoda\"\>", "95", "27", "26", "2"}, {"\<\"Ratmalana\"\>", "5", "27", "27", "0"}, {"\<\"Maharagama\"\>", "25", "27", "27", "1"}, {"\<\"Jaffna\"\>", "5", "27", "27", "0"} }, AutoDelete->False, GridBoxBackground->{"Columns" -> {{None}}, "Rows" -> {{ RGBColor[1, 0.9, 0.8], GrayLevel[0.85]}}}, GridBoxFrame->{"Columns" -> {{True}}, "RowsIndexed" -> {1 -> True}}, GridBoxItemSize->{"Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, GridBoxItemStyle->{ "Columns" -> {{Automatic}}, "RowsIndexed" -> {1 -> {Bold, 14}}}], "Grid"]], "Output", CellChangeTimes->{{3.8805947505745273`*^9, 3.8805947768533626`*^9}}, CellLabel->"Out[12]=",ExpressionUUID->"ed11e65a-8deb-4ad8-99ed-09bfe4a2a0f7"] }, Open ]] }, WindowSize->{949., 472.5}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"12.3 for Microsoft Windows (64-bit) (May 11, 2021)", StyleDefinitions->"Default.nb", ExpressionUUID->"94cfe7ec-94e8-48c4-a8f6-683fb28e7cf6" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 3323, 92, 257, "Input",ExpressionUUID->"3cf05d00-3b86-454a-a7a6-22ac685f1374"], Cell[3906, 116, 1233, 25, 293, "Output",ExpressionUUID->"76a3033c-a45e-44a2-b5c5-572542169a9b"] }, Open ]], Cell[CellGroupData[{ Cell[5176, 146, 805, 23, 67, "Input",ExpressionUUID->"afaacca6-d48b-4649-8c22-3d5e90a604ce"], Cell[5984, 171, 1406, 29, 281, "Output",ExpressionUUID->"ed11e65a-8deb-4ad8-99ed-09bfe4a2a0f7"] }, Open ]] } ] *)