(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.0' 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[ 8967, 232]*) (*NotebookOutlinePosition[ 9909, 262]*) (* CellTagsIndexPosition[ 9865, 258]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Differentiation", "Title", TextAlignment->Center, FontFamily->"Times"], Cell["\<\ You will explore some of the attributes of the approximations of \ the derivative that we will need when we solve Newton's Laws and other \ differential equations. \ \>", "Text", FontSize->14], Cell[CellGroupData[{ Cell["1. Necessary Commands.", "Section", FontFamily->"Times"], Cell["\<\ Some of the commands that you might find useful in this \ computational laboratory are shown here with comments describing their \ purpose.\ \>", "Text"], Cell[BoxData[ \(\(\( (*\ Defining\ a\ \(\(function\)\(.\)\)\ *) \)\(\[IndentingNewLine]\)\(\(f[ x_]\ := \ Sin[x];\)\[IndentingNewLine]\[IndentingNewLine] (*\ Making\ a\ table\ of\ f \((x)\)\ from\ 0 \[Rule] 10\ in\ steps\ of\ 2. \ *) \[IndentingNewLine] table1\ = \ Table[{x, f[x]}, {x, 0, 10, 2}]\[IndentingNewLine]\[IndentingNewLine] (*\ Getting\ the\ size\ of\ the\ \(\(table\)\(.\)\)\ *) \[IndentingNewLine] TableSize\ = \ Length[table1]\[IndentingNewLine]\[IndentingNewLine] (*\ Make\ two\ curve\ and\ put\ them\ on\ one\ \(\(plot\)\(.\)\)\ \ *) \[IndentingNewLine]\[IndentingNewLine] plot1\ = \ Plot[f[x], {x, 0, 30}]\[IndentingNewLine] plot2\ = \ Plot[2*f[x], {x, 0, 25}]\[IndentingNewLine] Show[{plot1, plot2}]\)\)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["2. Round-Off Error.", "Section", FontFamily->"Times"], Cell[TextData[{ "There are limits to the accuracy of any computation done on a machine. \ This limit is important when you are differentiating because you may have to \ take the difference between two large numbers. One of the standard tests of \ computer accuracy is to calculate the sum ", StyleBox["S=x+1-x ", FontSlant->"Italic"], "where x is some large number. Calculate ", StyleBox["S", FontSlant->"Italic"], " for different values of ", StyleBox["x", FontSlant->"Italic"], " and find the limit of accuracy on your machine." }], "Text"] }, Closed]], Cell[CellGroupData[{ Cell["3. Calculating Velocity and Acceleration.", "Section", FontFamily->"Times"], Cell[TextData[{ "The position of an object is given by the following equation\n\n \ ", StyleBox["x(t) = b", FontSlant->"Italic"], Cell[BoxData[ \(TraditionalForm\`t\^3\ + \ ct\^2\ + \ dt\)], FontSlant->"Italic"], "\n\nwhere b = 3.0 m/", Cell[BoxData[ \(TraditionalForm\`\(\(s\^3\)\(,\)\)\)]], " c = 8.0 m/", Cell[BoxData[ \(TraditionalForm\`\(\(s\^2\)\(,\)\)\)]], " and d = 1.0 m/s.\n\na. Generate two tables of ordered pairs of {t,x(t)} \ for the first 4.0 seconds of the objects's motion. For one table use a \ stepsize h=0.2 s and use h=0.02 s for the second. Make a plot with both \ curves on it. How many ordered pairs are in each table?\n\nb. Using the \ 2-point, forward difference formula for the first derivative calculate the \ velocity of the object at each point along its path. How many ordered pairs \ are in these velocity tables versus the tables from Part 3.a? Put these \ curves on one plot. What is the analytical form of the velocity? Use ", StyleBox["Mathematica", FontSlant->"Italic"], "'s ", StyleBox["Plot", FontWeight->"Bold"], " command to add this third curve to your plot. What happens as the \ stepsize shrinks?\n\nc. Create two new tables or ordered pairs of time ", StyleBox["t", FontSlant->"Italic"], " and the difference between your calculated velocity from Part 3.b and the \ analytical form. Plot these two curves and compare them. Which method is \ better? Be quantitative in your answer.\n\nd. Using the two tables from Part \ 3.b calculate the acceleration using the 2-point, forward difference formula \ for the derivative of the velocity of the object at each point along its \ path. How many ordered pairs are in these accelration tables versus the \ position and velocity tables? Plot your results on one graph. What is the \ analytical form of the acceleration? Use ", StyleBox["Mathematica", FontSlant->"Italic"], "'s ", StyleBox["Plot", FontWeight->"Bold"], " command to add this third curve to your plot.\n\ne. Create two new tables \ of ordered pairs of time ", StyleBox["t", FontSlant->"Italic"], " and the difference between your calculated acceleration from Part 3.d and \ the analytical form. Plot these two curves. What method is better? How do \ these curves compare with the ones from Part 3.c?" }], "Text", TextAlignment->Left] }, Closed]], Cell[CellGroupData[{ Cell["4. Non-Simple Harmonic Oscillators", "Section", FontFamily->"Times"], Cell[TextData[{ "Oscillatory systems are found throughout physics (stars, atomic nuclei, \ bridges). If \nthe oscillating system has some sort of damping in it \ (typically friction), then the \nharmonic motion of the system will \ eventually fade away. For example, the time\ndependent behavior of a mass on \ a spring that is bouncing up and down in a liquid \ncan be described by\n\n \ ", Cell[BoxData[ \(TraditionalForm\`x(t)\)]], " = ", Cell[BoxData[ \(TraditionalForm\`A\)]], " ", Cell[BoxData[ \(TraditionalForm\`e\^\(-t\)\ cos\ \[Omega]\ t\)]], "\n\nwhere t is time, \[Omega] is the angular frequency, and x is the \ displacement from equilibrium.\n\na. Make a plot of the displacement using \ the ", StyleBox["Table", FontFamily->"Courier"], " command in ", StyleBox["Mathematica", FontSlant->"Italic"], " for the first six seconds of the motion when \[Omega]=5.0 rad/s and \ h=0.1 s.\n\nb. Calculate analytically the velocity of the mass and plot it \ for the same period. Use the centered derivative formula and a stepsize of \ 0.1 s to calculate the velocity again and plot both curves together. Are \ there any significant differences?\n\nc. Plot the difference between the \ analytical expression for the velocity and the velocity you calculated with \ the centered derivative formula. In other words, calculate\n\n \ ", Cell[BoxData[ \(TraditionalForm\`\[Delta]\_1\ \((t)\)\ = \ \(x\^\[Prime]\)(t)\ - \ g(t)\)]], "\n\nwhere g(t) is the approximation to ", Cell[BoxData[ \(TraditionalForm\`\(x\^\[Prime]\)(t)\)]], " given by the centered derivative formula.\nWhen is the centered \ derivative formula most accurate?\n\nd. Now plot the normalized difference \ between the analytical expression for the velocity and the velocity you \ calculated with the centered derivative formula. In other words, calculate\n\n\ ", Cell[BoxData[ \(TraditionalForm\`\[Delta]\_2\ \((t)\)\ = \ \(\(x\^\[Prime]\)(t)\ - \ \ g(t)\)\/\(\(\(x\^\[Prime]\)(t)\)\(\ \)\)\)]], "\n\nwhere the quantities are defined as they were in the previous part. \ When is the centered derivative formula most accurate when viewed with this \ method? Are \nyour results consistent? Explain." }], "Text"] }, Closed]] }, Open ]] }, FrontEndVersion->"5.0 for X", ScreenRectangle->{{0, 1280}, {0, 1024}}, WindowSize->{642, 939}, WindowMargins->{{60, Automatic}, {Automatic, 21}}, PrintingCopies->1, PrintingPageRange->{1, 32000}, PrintingOptions->{"PaperSize"->{612, 792}, "PaperOrientation"->"Portrait", "PostScriptOutputFile":>FrontEnd`FileName[{$RootDirectory, "mnt", "stick", \ "compphys", "f04", "notebooks"}, "lab3_diff.nb.ps", CharacterEncoding -> \ "iso8859-1"], "Magnification"->1} ] (******************************************************************* 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[CellGroupData[{ Cell[1776, 53, 80, 2, 96, "Title"], Cell[1859, 57, 207, 5, 52, "Text"], Cell[CellGroupData[{ Cell[2091, 66, 64, 1, 73, "Section"], Cell[2158, 69, 163, 4, 50, "Text"], Cell[2324, 75, 829, 15, 235, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[3190, 95, 61, 1, 43, "Section"], Cell[3254, 98, 568, 14, 86, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[3859, 117, 83, 1, 43, "Section"], Cell[3945, 120, 2434, 52, 536, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[6416, 177, 76, 1, 43, "Section"], Cell[6495, 180, 2444, 48, 613, "Text"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)