(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 14762, 532] NotebookOptionsPosition[ 10709, 393] NotebookOutlinePosition[ 11859, 430] CellTagsIndexPosition[ 11781, 425] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["\<\ \[OpenCurlyDoubleQuote]Damped Oscillator\[CloseCurlyDoubleQuote] class: \ Solve, Functions, Derivatives\ \>", "Section", CellChangeTimes->{{3.525246954439383*^9, 3.525246984245429*^9}, { 3.5252471339022512`*^9, 3.5252471458257647`*^9}, {3.525258626072893*^9, 3.525258626175849*^9}, {3.5538764985084753`*^9, 3.553876506384613*^9}, 3.55387654838059*^9}], Cell[BoxData[ RowBox[{"Remove", "[", "\"\\"", "]"}]], "Input"], Cell[TextData[{ "Today is to start using ", StyleBox["Mathematica", FontSlant->"Italic"], " for some simple applications. We will also learn a little more about \ plotting." }], "Subsection", CellChangeTimes->{{3.525247035409617*^9, 3.5252470894562483`*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Solving algebraic equations", "Section", CellChangeTimes->{{3.5252471900114202`*^9, 3.525247202034914*^9}}], Cell[CellGroupData[{ Cell["\<\ Note the use of \[OpenCurlyDoubleQuote]==\[CloseCurlyDoubleQuote] in the \ expression\ \>", "Subsection", CellChangeTimes->{{3.525247689298498*^9, 3.525247703982955*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"a", "*", "x"}], "+", "b"}], "\[Equal]", "0"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.52524721635783*^9, 3.525247235125743*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"a", "*", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"2", "*", "b", "*", "x"}], "+", "c"}], "\[Equal]", "0"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.525247637409875*^9, 3.525247653704173*^9}}] }, Open ]], Cell["\<\ Note the output is a (list of) \[OpenCurlyDoubleQuote]replacements\ \[CloseCurlyDoubleQuote]\ \>", "Subsection", CellChangeTimes->{{3.5252477221036263`*^9, 3.525247733807852*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Replacements", "Section", CellChangeTimes->{{3.525247813950321*^9, 3.5252478166496563`*^9}}], Cell[CellGroupData[{ Cell["\<\ Make the arrow with the two keys \[OpenCurlyDoubleQuote]-\ \[OpenCurlyDoubleQuote] and \[OpenCurlyDoubleQuote]>\[CloseCurlyDoubleQuote]\ \>", "Subsection", CellChangeTimes->{{3.525247939999707*^9, 3.525247976733605*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"x", "+", "a"}], "/.", RowBox[{"a", "\[Rule]", "3"}]}]], "Input", CellChangeTimes->{{3.525247859680832*^9, 3.525247868652348*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ The value of a is substituted into the expression\ \>", "Subsection", CellChangeTimes->{{3.5252479063320093`*^9, 3.525247916348218*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"sol", "=", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"a", "*", "x"}], "+", "b"}], "\[Equal]", "0"}], ",", "x"}], "]"}]}], ";"}]], "Input", CellChangeTimes->{{3.525248001918192*^9, 3.525248015339498*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"a", "*", "x"}], "+", "b"}], "/.", "sol"}]], "Input", CellChangeTimes->{{3.525248018463066*^9, 3.525248047937628*^9}}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Solve systems of equations", "Section", CellChangeTimes->{{3.525248093722897*^9, 3.525248103792609*^9}}], Cell[BoxData[ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"a", "*", "x"}], "+", RowBox[{"b", "*", "y"}]}], "\[Equal]", "c"}], " ", "&&", " ", RowBox[{ RowBox[{ RowBox[{"d", "*", "x"}], "+", RowBox[{"e", "*", "y"}]}], "\[Equal]", "f"}]}], ",", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.525248136760721*^9, 3.525248186422091*^9}}], Cell["\<\ Of course, this just scratches the surface, but it is enough for now.\ \>", "Subsection", CellChangeTimes->{{3.525248214358221*^9, 3.525248227299652*^9}}] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Functions", "Section", CellChangeTimes->{{3.5252483332808037`*^9, 3.525248335750002*^9}}], Cell[CellGroupData[{ Cell["\<\ You can define your own functions like f[x] but note the syntax\ \>", "Subsection", CellChangeTimes->{{3.5252483838091393`*^9, 3.525248410056307*^9}, { 3.5252484480893593`*^9, 3.525248452369049*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", RowBox[{ RowBox[{"a", "*", RowBox[{"x", "^", "2"}]}], "+", RowBox[{"b", "*", "x"}], "+", "c"}]}]], "Input", CellChangeTimes->{{3.525248426192896*^9, 3.525248475932684*^9}}], Cell[BoxData[ RowBox[{"f", "[", "x", "]"}]], "Input", CellChangeTimes->{{3.525248490167407*^9, 3.52524849145127*^9}}], Cell[BoxData[ RowBox[{"f", "[", "t", "]"}]], "Input", CellChangeTimes->{{3.5252484941734943`*^9, 3.525248495403829*^9}}], Cell[BoxData[ RowBox[{"parab", "=", RowBox[{ RowBox[{"f", "[", "x", "]"}], "/.", RowBox[{"{", RowBox[{ RowBox[{"a", "\[Rule]", "1"}], ",", RowBox[{"b", "\[Rule]", "2"}], ",", RowBox[{"c", "\[Rule]", "3"}]}], "}"}]}]}]], "Input", CellChangeTimes->{{3.525248556694406*^9, 3.5252485891751823`*^9}}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Derivatives", "Section", CellChangeTimes->{{3.525248640592062*^9, 3.525248642861768*^9}}], Cell[CellGroupData[{ Cell["\<\ You can take the derivative of a function\ \>", "Subsection", CellChangeTimes->{{3.525248656686576*^9, 3.525248664236463*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "'"}], "[", "u", "]"}]], "Input", CellChangeTimes->{{3.525248667495056*^9, 3.525248675304284*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ You can also take the derivative of an expression\ \>", "Subsection", CellChangeTimes->{{3.525248692560807*^9, 3.5252487018872833`*^9}}], Cell[BoxData[ RowBox[{"D", "[", RowBox[{ RowBox[{"x", "^", "n"}], ",", "x"}], "]"}]], "Input", CellChangeTimes->{{3.52524870462398*^9, 3.5252487171612473`*^9}}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["A Simple Application", "Section", CellChangeTimes->{{3.52524876263511*^9, 3.525248767800807*^9}}], Cell[CellGroupData[{ Cell["\<\ Find all the parabolas that pass through the origin and have a minimum at x=1\ \ \>", "Subsection", CellChangeTimes->{{3.5252487982737093`*^9, 3.525248832923637*^9}}], Cell[BoxData[ RowBox[{"orig", "=", RowBox[{"f", "[", "0", "]"}]}]], "Input", CellChangeTimes->{{3.525248863452581*^9, 3.525248868205042*^9}, { 3.525248925215033*^9, 3.525248928702601*^9}}], Cell[BoxData[ RowBox[{"derv", "=", RowBox[{ RowBox[{"f", "'"}], "[", "1", "]"}]}]], "Input", CellChangeTimes->{{3.525248873740016*^9, 3.525248897079919*^9}}], Cell[BoxData[ RowBox[{"sols", "=", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"orig", "\[Equal]", "0"}], "&&", " ", RowBox[{"derv", "\[Equal]", "0"}]}], ",", RowBox[{"{", RowBox[{"b", ",", "c"}], "}"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.5252489052754107`*^9, 3.52524897123239*^9}, { 3.52524900467161*^9, 3.525249028713653*^9}}], Cell[BoxData[ RowBox[{"parab", "=", RowBox[{ RowBox[{"f", "[", "x", "]"}], "/.", "sols"}]}]], "Input", CellChangeTimes->{{3.5252490160935707`*^9, 3.5252490406417437`*^9}}] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell["", "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell["Plot and Manipulate", "Section", CellChangeTimes->{{3.525249099748555*^9, 3.525249104472617*^9}}], Cell[CellGroupData[{ Cell["\<\ You can specify \[OpenCurlyDoubleQuote]PlotRange\[Rule]Full\ \[CloseCurlyDoubleQuote] or use a range\ \>", "Subsection", CellChangeTimes->{{3.525249226566782*^9, 3.525249236916586*^9}, { 3.525258378061275*^9, 3.525258385513335*^9}}], Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"parab", "/.", RowBox[{"a", "\[Rule]", "2"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", "Full"}]}], "]"}]], "Input", CellChangeTimes->{{3.5252491099006157`*^9, 3.525249140571649*^9}, 3.525249214129179*^9, {3.525249372804185*^9, 3.5252493873783293`*^9}, { 3.525258389366044*^9, 3.525258458213932*^9}}] }, Open ]], Cell[CellGroupData[{ Cell["\<\ Note the syntax; turn \[OpenCurlyDoubleQuote]a\[CloseCurlyDoubleQuote] into a \ \[OpenCurlyDoubleQuote]value\[CloseCurlyDoubleQuote] than can be manipulated\ \>", "Subsection", CellChangeTimes->{{3.525273385955886*^9, 3.5252734111460533`*^9}}], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"parab", "/.", RowBox[{"a", "\[Rule]", "t"}]}], ",", RowBox[{"{", RowBox[{"x", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "5"}], ",", "5"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "20"}], ",", "20"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", RowBox[{"-", "3"}], ",", "3"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.525249247914295*^9, 3.525249283512164*^9}, { 3.5252584517606277`*^9, 3.52525845479911*^9}, {3.525258494568384*^9, 3.525258514567799*^9}, {3.5252585571207857`*^9, 3.525258583714136*^9}, { 3.5252728360035*^9, 3.525272851367888*^9}, {3.5252728837383223`*^9, 3.5252728946268682`*^9}, {3.52527335147682*^9, 3.5252733650201397`*^9}}] }, Open ]] }, Open ]] }, Open ]] }, ScreenStyleEnvironment->"Working", WindowSize->{884, 667}, WindowMargins->{{74, Automatic}, {Automatic, 17}}, FrontEndVersion->"8.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (November 6, \ 2010)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{ "SlideShowHeader"->{ Cell[579, 22, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[1434, 52, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[2640, 99, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[3957, 151, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[4832, 184, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[6148, 233, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[7052, 272, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[8436, 323, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"]} } *) (*CellTagsIndex CellTagsIndex->{ {"SlideShowHeader", 11057, 405} } *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[668, 27, 373, 7, 67, "Section"], Cell[1044, 36, 74, 1, 27, "Input"], Cell[1121, 39, 264, 7, 34, "Subsection"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[1434, 52, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[1523, 57, 114, 1, 67, "Section"], Cell[CellGroupData[{ Cell[1662, 62, 181, 4, 34, "Subsection"], Cell[1846, 68, 231, 7, 27, "Input"], Cell[2080, 77, 306, 9, 27, "Input"] }, Open ]], Cell[2401, 89, 190, 4, 34, "Subsection"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[2640, 99, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[2729, 104, 99, 1, 67, "Section"], Cell[CellGroupData[{ Cell[2853, 109, 231, 4, 35, "Subsection"], Cell[3087, 115, 168, 4, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3292, 124, 147, 3, 34, "Subsection"], Cell[3442, 129, 286, 9, 27, "Input"], Cell[3731, 140, 165, 4, 27, "Input"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[3957, 151, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[4046, 156, 111, 1, 67, "Section"], Cell[4160, 159, 455, 14, 27, "Input"], Cell[4618, 175, 165, 3, 34, "Subsection"] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[4832, 184, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[4921, 189, 96, 1, 67, "Section"], Cell[CellGroupData[{ Cell[5042, 194, 212, 4, 34, "Subsection"], Cell[5257, 200, 251, 7, 27, "Input"], Cell[5511, 209, 119, 2, 27, "Input"], Cell[5633, 213, 122, 2, 27, "Input"], Cell[5758, 217, 329, 9, 27, "Input"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[6148, 233, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[6237, 238, 96, 1, 67, "Section"], Cell[CellGroupData[{ Cell[6358, 243, 137, 3, 34, "Subsection"], Cell[6498, 248, 138, 3, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[6673, 256, 147, 3, 34, "Subsection"], Cell[6823, 261, 168, 4, 27, "Input"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[7052, 272, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[7141, 277, 104, 1, 67, "Section"], Cell[CellGroupData[{ Cell[7270, 282, 177, 4, 34, "Subsection"], Cell[7450, 288, 195, 4, 27, "Input"], Cell[7648, 294, 165, 4, 27, "Input"], Cell[7816, 300, 377, 10, 27, "Input"], Cell[8196, 312, 179, 4, 27, "Input"] }, Open ]] }, Open ]] }, Open ]], Cell[CellGroupData[{ Cell[8436, 323, 64, 1, 63, "SlideShowNavigationBar", CellTags->"SlideShowHeader"], Cell[CellGroupData[{ Cell[8525, 328, 104, 1, 67, "Section"], Cell[CellGroupData[{ Cell[8654, 333, 245, 5, 35, "Subsection"], Cell[8902, 340, 463, 11, 27, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[9402, 356, 254, 4, 35, "Subsection"], Cell[9659, 362, 1010, 26, 27, "Input"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)