(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 4.0, MathReader 4.0, or any compatible application. 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[ 12182, 416]*) (*NotebookOutlinePosition[ 13090, 447]*) (* CellTagsIndexPosition[ 13046, 443]*) (*WindowFrame->Normal*) Notebook[{ Cell["Distance from Speed", "Title", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True, Background->RGBColor[0, 1, 0]], Cell["\<\ This notebook is by Steven Amgott. Please send any questions or \ comments to samgott1@swarthmore.edu. Feel free to use and distribute this \ notebook, but keep this author information in any copy you use or distribute.\ \ \>", "SmallText"], Cell[TextData[{ "In any input cell containing ", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], " , you must replace it with your input before evaluating the cell. In \ general, anything in ", StyleBox["magenta", FontColor->RGBColor[1, 0, 1]], " is something you can, and possibly should, change." }], "Text"], Cell[CellGroupData[{ Cell["\<\ Finding distance traveled by a falling object (overestimate).\ \>", \ "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "We will look at an object falling under the influence of gravity. \ Assuming we neglect air resistance, the only force acting on the object is \ gravity. The acceleration of the object is then g, which in English units is \ about 32 ft/", Cell[BoxData[ \(TraditionalForm\`sec\^2\)]], ". If we assume that the object is dropped from rest at time 0, its \ velocity is then" }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[" v(t) = 32 t.", "Text", Evaluatable->False, TextAlignment->Center, AspectRatioFixed->True], Cell["\<\ We will compute the distance it has fallen numerically. \ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[TextData["First we enter the formula for speed."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(v[t_] := 32\ t\)], "Input", AspectRatioFixed->True], Cell[TextData[{ StyleBox["We next tell ", Evaluatable->False, AspectRatioFixed->True], StyleBox["Mathematica", Evaluatable->False, AspectRatioFixed->True, FontSlant->"Italic"], StyleBox[ " the starting (a) and ending (b) times for the distance we are trying to \ find.", Evaluatable->False, AspectRatioFixed->True] }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(a = 0; \nb = 3; \)], "Input", AspectRatioFixed->True], Cell[TextData[ "We split the interval from a to b into n pieces. (In this case, n=4.)"], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(\(n = 4; \)\)], "Input", AspectRatioFixed->True], Cell[TextData[ "The times where we will evaluate the speed are created by the following \ Table command."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(time1 = Table[a + \(\((b - a)\)\ k\)\/n, {k, 1, n}]\)], "Input", AspectRatioFixed->True], Cell[TextData["We get the speed at these times."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(speedOver = v[time1]\)], "Input", AspectRatioFixed->True], Cell[TextData[ "We need to get our approximations to the distance traveled each time \ interval by multiplying the speed at each time by the length of the time \ intervals."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(speedOver\ \((b - a)\)\/n\)], "Input", AspectRatioFixed->True], Cell[TextData[ "We add these up to get an approximation to the distance traveled."], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(distanceOver = Plus@@speedOver\ \((b - a)\)\/n\)], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["\<\ Finding distance traveled by a falling object \ (underestimate).\ \>", "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ We can do the same thing, but using the speed at the beginning of \ each time interval, rather than the speed at the end of the time interval. \ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(time2 = Table[a + \(\((b - a)\) k\)\/n, {k, 0, n - 1}]\)], "Input", AspectRatioFixed->True], Cell["We get the speed at these times.", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(speedUnder = v[time2]\)], "Input", AspectRatioFixed->True], Cell["\<\ We need to get our approximations to the distance traveled each \ time interval by multiplying the speed at each time by the length of the time \ intervals.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(speedUnder\ \((b - a)\)\/n\)], "Input", AspectRatioFixed->True], Cell["\<\ We add these up to get an approximation to the distance traveled.\ \ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(distanceUnder = Plus@@speedUnder\ \((b - a)\)\/n\)], "Input", AspectRatioFixed->True], Cell["Comparing the two:", "Text"], Cell[BoxData[ \(distanceOver - distanceUnder\)], "Input"], Cell["\<\ This should be the same as the difference of the velocities at b \ and a, times the length of the time interval.\ \>", "Text"], Cell[BoxData[ \(\((v[b] - v[a])\) \(\ b - a\)\/n\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Automating the process.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ The next cell combines all of the above steps. We can easily \ adjust any of the parameters, and re-calculate. The final output it produces \ is the average of our under and over estimates, which we can use in the next \ section.\ \>", "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[{\(v[t_] := 32\ t;\), "\n", \(a = 0;\), "\n", RowBox[{ RowBox[{"b", "=", StyleBox["3", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\n", RowBox[{ RowBox[{"n", "=", StyleBox["4", FontColor->RGBColor[1, 0, 1]]}], ";"}], "\n", \(time1 = Table[a + \(\((b - a)\)\ k\)\/n, {k, 1, n}];\), "\n", \(time2 = Table[a + \(\((b - a)\)\ k\)\/n, {k, 0, n - 1}];\), "\n", \(speedOver = v[time1];\), "\n", \(speedUnder = v[time2];\), "\n", \(distanceOver = N[Plus @@ speedOver\ \((b - a)\)\/n]\), "\n", \(distanceUnder = N[Plus @@ speedUnder\ \((b - a)\)\/n]\), "\n", \(distanceOver - distanceUnder\), "\n", \(\((v[b] - v[a])\) \(\(\ \)\(b - a\)\)\/n\), "\[IndentingNewLine]", \ \(\((distanceOver + distanceUnder)\)/2\)}], "Input", AspectRatioFixed->True] }, Closed]], Cell[CellGroupData[{ Cell["Plotting distance against time.", "Section", Evaluatable->False, AspectRatioFixed->True], Cell[TextData[{ "You can use the previous section to get estimates of how far the object \ has fallen during various time intervals. (The ending time for the interval \ is the first coordinate of a point in the list, and the distance is the \ second coordinate.) These distances should be entered in the next cell in \ place of the ", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "s. (If you do not want to do this for all the possible ending times, it \ has already been done for you in a cell grouped with the one below. Open the \ group and evaluate the already filled-in cell.)" }], "Text"], Cell[CellGroupData[{ Cell[TextData[{ "distTime={{0,0},{.5,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{1,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{1.5,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{2,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},\n {2.5,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{3,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{3.5,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "},{4,", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]], "}};" }], "Input", AspectRatioFixed->True], Cell[BoxData[ RowBox[{ RowBox[{"distTime", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", StyleBox["0", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{".5", ",", StyleBox["4", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"1", ",", StyleBox["16", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"1.5", ",", StyleBox["36", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"2", ",", StyleBox["64", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"2.5", ",", StyleBox["100", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"3", ",", StyleBox["144", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"3.5", ",", StyleBox["196", FontColor->RGBColor[1, 0, 1]]}], "}"}], ",", RowBox[{"{", RowBox[{"4", ",", StyleBox["256", FontColor->RGBColor[1, 0, 1]]}], "}"}]}], "}"}]}], ";"}]], "Input", AspectRatioFixed->True] }, Closed]], Cell["Here is a plot of these data points.", "Text"], Cell[BoxData[ \(\(dataPlot = ListPlot[distTime, PlotRange \[Rule] {0, 300}, AxesLabel \[Rule] {"\", "\"}, PlotStyle \[Rule] PointSize[ .03]];\)\)], "Input", AspectRatioFixed->True], Cell["\<\ You might be able to guess at a function which \"fits\" these data \ points. Replace the xxx in the next cell with your guess. \ \>", "Text"], Cell[BoxData[{ RowBox[{\(dist[t_]\), ":=", StyleBox["xxx", FontColor->RGBColor[1, 0, 1]]}], "\n", \(functionPlot = Plot[dist[t], {t, 0, 4}, PlotRange \[Rule] {0, 300}, AxesLabel \[Rule] {"\", "\"}];\)}], "Input", AspectRatioFixed->True], Cell["\<\ This next cell will compare your guess with the data points. If \ they do not roughly agree, you should change your guess and try again.\ \>", \ "Text"], Cell[BoxData[ \(\(Show[dataPlot, functionPlot];\)\)], "Input", AspectRatioFixed->True] }, Closed]] }, FrontEndVersion->"4.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 720}}, ScreenStyleEnvironment->"Working", WindowToolbars->"EditBar", CellGrouping->Manual, WindowSize->{526, 485}, WindowMargins->{{6, Automatic}, {Automatic, 0}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, -1}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False} ] (*********************************************************************** 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[1717, 49, 142, 4, 121, "Title", Evaluatable->False], Cell[1862, 55, 252, 5, 44, "SmallText"], Cell[2117, 62, 328, 9, 52, "Text"], Cell[CellGroupData[{ Cell[2470, 75, 138, 5, 53, "Section", Evaluatable->False], Cell[2611, 82, 463, 11, 78, "Text", Evaluatable->False], Cell[3077, 95, 102, 3, 30, "Text", Evaluatable->False], Cell[3182, 100, 159, 5, 30, "Text", Evaluatable->False], Cell[3344, 107, 111, 2, 30, "Text", Evaluatable->False], Cell[3458, 111, 73, 2, 27, "Input"], Cell[3534, 115, 410, 15, 48, "Text", Evaluatable->False], Cell[3947, 132, 75, 2, 43, "Input"], Cell[4025, 136, 148, 4, 30, "Text", Evaluatable->False], Cell[4176, 142, 70, 2, 27, "Input"], Cell[4249, 146, 163, 4, 30, "Text", Evaluatable->False], Cell[4415, 152, 110, 2, 42, "Input"], Cell[4528, 156, 106, 2, 30, "Text", Evaluatable->False], Cell[4637, 160, 79, 2, 27, "Input"], Cell[4719, 164, 231, 5, 46, "Text", Evaluatable->False], Cell[4953, 171, 84, 2, 42, "Input"], Cell[5040, 175, 140, 3, 30, "Text", Evaluatable->False], Cell[5183, 180, 105, 2, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[5325, 187, 139, 5, 33, "Section", Evaluatable->False], Cell[5467, 194, 246, 6, 46, "Text", Evaluatable->False], Cell[5716, 202, 113, 2, 42, "Input"], Cell[5832, 206, 96, 2, 30, "Text", Evaluatable->False], Cell[5931, 210, 80, 2, 27, "Input"], Cell[6014, 214, 228, 6, 46, "Text", Evaluatable->False], Cell[6245, 222, 85, 2, 42, "Input"], Cell[6333, 226, 139, 5, 30, "Text", Evaluatable->False], Cell[6475, 233, 107, 2, 42, "Input"], Cell[6585, 237, 34, 0, 30, "Text"], Cell[6622, 239, 61, 1, 27, "Input"], Cell[6686, 242, 136, 3, 46, "Text"], Cell[6825, 247, 65, 1, 42, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[6927, 253, 90, 2, 33, "Section", Evaluatable->False], Cell[7020, 257, 303, 7, 62, "Text", Evaluatable->False], Cell[7326, 266, 888, 19, 312, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[8251, 290, 98, 2, 33, "Section", Evaluatable->False], Cell[8352, 294, 610, 11, 128, "Text"], Cell[CellGroupData[{ Cell[8987, 309, 607, 27, 48, "Input"], Cell[9597, 338, 1549, 42, 50, "Input"] }, Closed]], Cell[11161, 383, 52, 0, 30, "Text"], Cell[11216, 385, 235, 5, 70, "Input"], Cell[11454, 392, 153, 3, 52, "Text"], Cell[11610, 397, 295, 6, 70, "Input"], Cell[11908, 405, 163, 4, 52, "Text"], Cell[12074, 411, 92, 2, 30, "Input"] }, Closed]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)