(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 7.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 6239, 182] NotebookOptionsPosition[ 5647, 160] NotebookOutlinePosition[ 5990, 175] CellTagsIndexPosition[ 5947, 172] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[TextData[{ StyleBox["Guessing the Fourier Expansion of a Function\n\n", FontFamily->"Times New Roman", FontSize->28, FontWeight->"Bold"], StyleBox["Look at the function f(t) plotted below. It is a linear \ combination of sin(nx) for different values of n, i.e.\n\n\ f(t)=b1sin(t)+b2sin(2t)+b3sin(3t)+...\n\nYour job is to guess the values of \ the coefficients. To make your job a little easier, I have put in only 3 \ nonzero terms, all of the coefficients are positive or negative integers, and \ I have not included any terms for n>5.\n\nThe function is defined below, but \ I've disguised it so you won't be able to tell what the coefficients are by \ inspection!", FontFamily->"Times New Roman", FontSize->22] }], "Text", CellChangeTimes->{{3.520787015233611*^9, 3.520787243604226*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"Clear", "[", RowBox[{"f", ",", "t"}], "]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.5209626140746517`*^9, 3.520962617621459*^9}}], Cell[BoxData[ StyleBox[ RowBox[{ RowBox[{"f", "[", "t__", "]"}], "=", RowBox[{ RowBox[{ RowBox[{"Sin", "[", "t", "]"}], "*", "4", "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{"Cos", "[", "t", "]"}]}], ")"}]}], "-", RowBox[{"4", "*", RowBox[{ RowBox[{"Sin", "[", "t", "]"}], "^", "3"}]}]}]}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.520787274869251*^9, 3.5207873214777308`*^9}, { 3.520787394226334*^9, 3.520787394382581*^9}, {3.5209620667101617`*^9, 3.5209621014594946`*^9}, {3.520962384766555*^9, 3.520962400078761*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"4", "Pi"}]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", "Black", "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", "\"\\"", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.5207873412742257`*^9, 3.5207874155228004`*^9}, { 3.520787606050392*^9, 3.5207876134565*^9}, {3.520787652877618*^9, 3.5207876578150234`*^9}, {3.5207879996678343`*^9, 3.520788008136422*^9}, { 3.52078805822921*^9, 3.5207880597760553`*^9}, {3.5209624129535136`*^9, 3.520962413765998*^9}}], Cell[TextData[StyleBox["You might want to start by plotting sin(nx) for \ various values of n if you don't remember what this function looks like:", FontFamily->"Times New Roman", FontSize->22]], "Text", CellChangeTimes->{{3.520787686048856*^9, 3.520787745266469*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"Sin", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", "Black", "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", "\"\\"", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.520787747610174*^9, 3.520787809546485*^9}, { 3.520788018448724*^9, 3.520788052135577*^9}}], Cell[TextData[StyleBox["Guess the most important term. Plot your guess and \ the function f(t) on the same graph. \nKeep guessing more and more terms \ until the graph for your guess and the graph for f(t) overlap. For example:", FontFamily->"Times New Roman", FontSize->22]], "Text", CellChangeTimes->{{3.520787826093042*^9, 3.520787891263666*^9}, { 3.520962238925605*^9, 3.5209622442848773`*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"myguess", "=", RowBox[{ RowBox[{"1", "*", RowBox[{"Sin", "[", "t", "]"}]}], "-", RowBox[{"2", "*", RowBox[{"Sin", "[", RowBox[{"2", "*", "t"}], "]"}]}]}]}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.520787893466748*^9, 3.520787913731984*^9}, { 3.5207883140211735`*^9, 3.520788331677085*^9}, {3.5207883824886093`*^9, 3.5207883918321795`*^9}}], Cell[TextData[StyleBox["The unknown function is BLACK and your guess is RED, \ and the difference between the two is BLUE (which you want to drive to zero).", FontFamily->"Times New Roman", FontSize->22]], "Text", CellChangeTimes->{{3.52078808193188*^9, 3.5207881227748456`*^9}}], Cell[BoxData[ StyleBox[ RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"f", "[", "t", "]"}], ",", "myguess", ",", RowBox[{ RowBox[{"f", "[", "t", "]"}], "-", "myguess"}]}], "}"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", RowBox[{"2", "Pi"}]}], "}"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Black", ",", "Red", ",", "Blue"}], "}"}]}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", "\"\\"", "}"}]}]}], "]"}], FontFamily->"Courier New", FontSize->18]], "Input", CellChangeTimes->{{3.520788130774692*^9, 3.520788133118397*^9}, { 3.520788178320654*^9, 3.520788229647794*^9}, {3.520962424468918*^9, 3.520962429015705*^9}}] }, WindowSize->{616, 750}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"7.0 for Microsoft Windows (32-bit) (February 18, 2009)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[545, 20, 811, 16, 480, "Text"], Cell[1359, 38, 208, 6, 36, "Input"], Cell[1570, 46, 619, 17, 36, "Input"], Cell[2192, 65, 732, 18, 64, "Input"], Cell[2927, 85, 271, 4, 95, "Text"], Cell[3201, 91, 537, 15, 64, "Input"], Cell[3741, 108, 405, 6, 123, "Text"], Cell[4149, 116, 450, 13, 36, "Input"], Cell[4602, 131, 282, 4, 95, "Text"], Cell[4887, 137, 756, 21, 91, "Input"] } ] *) (* End of internal cache information *)