(************** 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[ 3687, 126]*) (*NotebookOutlinePosition[ 4642, 157]*) (* CellTagsIndexPosition[ 4598, 153]*) (*WindowFrame->Normal*) Notebook[{ Cell[TextData["Plotting Partial Sums of Fourier Series"], "Title", Evaluatable->False, AspectRatioFixed->True], Cell["Needs[\"Graphics`Colors`\"]", "Input", InitializationCell->True, AspectRatioFixed->True], Cell[TextData[{ "We will construct partial sums of the Fourier series for ", " ", Cell[BoxData[ \(TraditionalForm\`x\^2\)]], " on [-2,2]." }], "Text"], Cell[BoxData[{ \(\(L = 2;\)\), "\[IndentingNewLine]", \(\(f[x_] = x\^2;\)\)}], "Input"], Cell["The Fourier coefficients are", "Text"], Cell[BoxData[ \(a[0] = \(1\/\(2 L\)\) \(\[Integral]\_\(-L\)\%L f[ x] \[DifferentialD]x\)\)], "Input"], Cell[BoxData[ \(a[n_] = Assuming[n \[Element] Integers, \(1\/L\) \(\[Integral]\_\(-L\)\%L f[ x]\ Cos[\(n\ \[Pi]\ x\)\/L] \[DifferentialD]x\)]\)], "Input"], Cell[BoxData[ \(b[n_] = Assuming[n \[Element] Integers, \(1\/L\) \(\[Integral]\_\(-L\)\%L f[ x]\ Sin[\(n\ \[Pi]\ x\)\/L] \[DifferentialD]x\)]\)], "Input"], Cell[TextData[{ "Here is the ", Cell[BoxData[ \(TraditionalForm\`k\^th\)]], " partial sum of the Fourier series for f[x]." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell[BoxData[ \(fourierSum[x_, k_]\ := \ a[0] + \[Sum]\+\(n = 1\)\%k\((a[n]\ Cos[\(n\ \[Pi]\ x\)\/L] + b[n]\ Sin[\(n\ \[Pi]\ x\)\/L])\)\)], "Input"], Cell[TextData[{ "These are plots of the ", Cell[BoxData[ \(TraditionalForm\`0\^th\)]], " through the ", Cell[BoxData[ \(TraditionalForm\`5\^th\)]], " partial sums. Click on any one of the graphs to view an animation." }], "Text", Evaluatable->False, AspectRatioFixed->True], Cell["\<\ Table[ Plot[{f[x],fourierSum[x,k]}, {x,-2L,2L}, PlotStyle->{{Black},{Red}}, PlotRange->{-1,6}], {k,0,5} ];\ \>", "Input", AspectRatioFixed->True, AnimationDisplayTime->0.597328] }, FrontEndVersion->"5.0 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 695}}, AutoGeneratedPackage->None, WindowToolbars->{"RulerBar", "EditBar"}, CellGrouping->Manual, WindowSize->{906, 674}, WindowMargins->{{4, Automatic}, {Automatic, 0}}, PrivateNotebookOptions->{"ColorPalette"->{RGBColor, 128}}, ShowCellLabel->True, ShowCellTags->False, RenderingOptions->{"ObjectDithering"->True, "RasterDithering"->False}, CharacterEncoding->"MacintoshAutomaticEncoding" ] (******************************************************************* 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[1754, 51, 114, 2, 95, "Title", Evaluatable->False], Cell[1871, 55, 98, 2, 30, "Input", InitializationCell->True], Cell[1972, 59, 164, 6, 33, "Text"], Cell[2139, 67, 96, 2, 50, "Input"], Cell[2238, 71, 44, 0, 33, "Text"], Cell[2285, 73, 120, 2, 43, "Input"], Cell[2408, 77, 192, 4, 42, "Input"], Cell[2603, 83, 192, 4, 42, "Input"], Cell[2798, 89, 194, 7, 33, "Text", Evaluatable->False], Cell[2995, 98, 175, 3, 51, "Input"], Cell[3173, 103, 300, 10, 33, "Text", Evaluatable->False], Cell[3476, 115, 207, 9, 120, "Input"] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)