(* Content-type: application/mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 6.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 145, 7] NotebookDataLength[ 13542, 356] NotebookOptionsPosition[ 12778, 324] NotebookOutlinePosition[ 13112, 339] CellTagsIndexPosition[ 13069, 336] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"f", "=", RowBox[{"Piecewise", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{"1", ",", RowBox[{"x", "<", "1"}]}], "}"}], "}"}], ",", RowBox[{"2", "-", "x"}]}], "]"}]}]], "Input", CellChangeTimes->{{3.3963765994429693`*^9, 3.3963766630226803`*^9}}], Cell[BoxData[ RowBox[{"\[Piecewise]", GridBox[{ {"1", RowBox[{"x", "<", "1"}]}, { RowBox[{"2", "-", "x"}], TagBox["True", "PiecewiseDefault", AutoDelete->False, DeletionWarning->True]} }, GridBoxAlignment->{ "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, "RowsIndexed" -> {}}, GridBoxItemSize->{ "Columns" -> {{Automatic}}, "ColumnsIndexed" -> {}, "Rows" -> {{1.}}, "RowsIndexed" -> {}}, GridBoxSpacings->{"Columns" -> { Offset[0.27999999999999997`], { Offset[0.84]}, Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { Offset[0.2], { Offset[0.4]}, Offset[0.2]}, "RowsIndexed" -> {}}]}]], "Output", CellChangeTimes->{{3.3963766525743856`*^9, 3.3963766643338747`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Plot", "[", RowBox[{"f", ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "2"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.396376671862775*^9, 3.3963766770386267`*^9}}], Cell[BoxData[ GraphicsBox[{{{}, {}, {Hue[0.67, 0.6, 0.6], LineBox[{{4.081632653061224*^-8, 1.}, {0.019628681609693666`, 1.}, { 0.0392573224030608, 1.}, {0.08181671417091729, 1.}, { 0.12155576714030418`, 1.}, {0.1605152976377521, 1.}, { 0.20277693831632224`, 1.}, {0.24221824019642277`, 1.}, { 0.2849616522576456, 1.}, {0.32692554184692935`, 1.}, { 0.3660690926377435, 1.}, {0.4085147536096799, 1.}, { 0.44814007578314674`, 1.}, {0.48698587548467454`, 1.}, { 0.5291337853673247, 1.}, {0.5684613564515052, 1.}, {0.611091037716808, 1.}, {0.6529411965101717, 1.}, {0.6919710165050659, 1.}, { 0.7343029466810822, 1.}, {0.773814538058629, 1.}, {0.816628239617298, 1.}, {0.858662418704028, 1.}, {0.8978762589922885, 1.}, { 0.9403922094616711, 1.}, {0.9800878211325842, 1.}, {0.9898168434323278, 1.}, {0.9993622448979592, 1.}}], LineBox[{{1.000637755102041, 0.9993622448979591}, {1.0007619935195393`, 0.9992380064804607}, {1.0013700574132733`, 0.9986299425867267}, { 1.0019781213070071`, 0.9980218786929929}, {1.002586185200741, 0.9974138147992591}, {1.003194249094475, 0.996805750905525}, { 1.004410376881943, 0.995589623118057}, {1.0092748880318148`, 0.9907251119681852}, {1.0190039103315582`, 0.9809960896684418}, { 1.0196635696968723`, 0.9803364303031277}, {1.0203232290621862`, 0.9796767709378138}, {1.0216425477928142`, 0.9783574522071858}, { 1.0242811852540703`, 0.9757188147459297}, {1.0295584601765824`, 0.9704415398234176}, {1.0401130100216065`, 0.9598869899783935}, { 1.0612221097116545`, 0.9387778902883455}, {1.1006199702932813`, 0.8993800297067187}, {1.1433199410560302`, 0.8566800589439698}, { 1.1852403893468402`, 0.8147596106531598}, {1.2243404988391806`, 0.7756595011608194}, {1.2667427185126432`, 0.7332572814873568}, { 1.3063245993876362`, 0.6936754006123638}, {1.3451269577906901`, 0.6548730422093099}, {1.3872314263748664`, 0.6127685736251336}, { 1.426515556160573, 0.5734844438394271}, {1.4691017961274018`, 0.5308982038725982}, {1.508867697295761, 0.4911323027042389}, { 1.5478540759921813`, 0.4521459240078187}, {1.5901425648697238`, 0.40985743513027617`}, {1.6296107149487966`, 0.3703892850512034}, { 1.6723809752089918`, 0.32761902479100824`}, {1.714371712997248, 0.285628287002752}, {1.7535421119870345`, 0.24645788801296553`}, { 1.7960146211579433`, 0.2039853788420567}, {1.8356667915303824`, 0.16433320846961763`}, {1.8745394394308825`, 0.12546056056911747`}, { 1.9167141975125048`, 0.08328580248749518}, {1.9560686167956576`, 0.04393138320434242}, {1.9987251462599327`, 0.0012748537400673055`}, { 1.9987450652118661`, 0.0012549347881338768`}, {1.9987649841637998`, 0.0012350158362002261`}, {1.9988048220676666`, 0.0011951779323333689`}, {1.9988844978754003`, 0.0011155021245996544`}, {1.9990438494908678`, 0.0009561505091322253}, { 1.999362552721803, 0.0006374472781969232}, {1.9993824716737365`, 0.0006175283262634945}, {1.99940239062567, 0.0005976093743300659}, { 1.9994422285295368`, 0.0005577714704632086}, {1.9995219043372707`, 0.00047809566272927206`}, {1.9996812559527384`, 0.000318744047261621}, { 1.9997011749046718`, 0.00029882509532819235`}, {1.9997210938566052`, 0.0002789061433947637}, {1.999760931760472, 0.00023906823952790646`}, { 1.9998406075682058`, 0.00015939243179419194`}, {1.9998605265201392`, 0.0001394734798607633}, {1.9998804454720727`, 0.00011955452792733468`}, {1.9999202833759395`, 0.00007971662406047741}, {1.999940202327873, 0.000059797672127048784`}, {1.9999601212798064`, 0.000039878720193620154`}, {1.99998004023174, 0.00001995976825996948}, { 1.9999999591836735`, 4.081632654084899*^-8}}]}, {}}, {{}, {}, {}}}, AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948], Axes->True, AxesOrigin->{0, 0}, PlotRange->{{0, 2}, {0., 1.}}, PlotRangeClipping->True, PlotRangePadding->{ Scaled[0.02], Scaled[0.02]}]], "Output", CellChangeTimes->{3.3963766781640663`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ SubsuperscriptBox["\[Integral]", "0", "2"], RowBox[{ RowBox[{"(", RowBox[{"f", " ", RowBox[{"Sin", "[", RowBox[{"n", " ", "\[Pi]", " ", RowBox[{"x", "/", "2"}]}], "]"}]}], ")"}], RowBox[{"\[DifferentialD]", "x"}]}]}]], "Input", CellChangeTimes->{{3.396376694211857*^9, 3.396376711096355*^9}}], Cell[BoxData[ FractionBox[ RowBox[{"2", " ", RowBox[{"(", RowBox[{ RowBox[{"n", " ", "\[Pi]", " ", RowBox[{"Cos", "[", FractionBox[ RowBox[{"n", " ", "\[Pi]"}], "2"], "]"}]}], "+", RowBox[{"2", " ", "n", " ", "\[Pi]", " ", SuperscriptBox[ RowBox[{"Sin", "[", FractionBox[ RowBox[{"n", " ", "\[Pi]"}], "4"], "]"}], "2"]}], "+", RowBox[{"2", " ", RowBox[{"Sin", "[", FractionBox[ RowBox[{"n", " ", "\[Pi]"}], "2"], "]"}]}], "-", RowBox[{"2", " ", RowBox[{"Sin", "[", RowBox[{"n", " ", "\[Pi]"}], "]"}]}]}], ")"}]}], RowBox[{ SuperscriptBox["n", "2"], " ", SuperscriptBox["\[Pi]", "2"]}]]], "Output", CellChangeTimes->{3.39637671475344*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Simplify", "[", "%", "]"}]], "Input", CellChangeTimes->{{3.396376830313492*^9, 3.396376832453128*^9}}], Cell[BoxData[ FractionBox[ RowBox[{"2", " ", RowBox[{"(", RowBox[{ RowBox[{"n", " ", "\[Pi]"}], "+", RowBox[{"2", " ", RowBox[{"Sin", "[", FractionBox[ RowBox[{"n", " ", "\[Pi]"}], "2"], "]"}]}], "-", RowBox[{"2", " ", RowBox[{"Sin", "[", RowBox[{"n", " ", "\[Pi]"}], "]"}]}]}], ")"}]}], RowBox[{ SuperscriptBox["n", "2"], " ", SuperscriptBox["\[Pi]", "2"]}]]], "Output", CellChangeTimes->{3.3963768329007683`*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"u", "=", RowBox[{ FractionBox["2", "\[Pi]"], RowBox[{ UnderoverscriptBox["\[Sum]", RowBox[{"n", "=", "1"}], "100"], RowBox[{"(", RowBox[{ FractionBox[ RowBox[{ RowBox[{"Sin", "[", RowBox[{"n", " ", "\[Pi]", " ", "x"}], "]"}], " ", RowBox[{"Cos", "[", FractionBox[ RowBox[{"n", " ", "\[Pi]", " ", "t"}], "5"], "]"}]}], RowBox[{"2", "n"}]], "+", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{"1", "-", FractionBox[ RowBox[{"2", " ", SuperscriptBox[ RowBox[{"(", RowBox[{"-", "1"}], ")"}], "n"]}], RowBox[{"n", " ", "\[Pi]"}]]}], ")"}], " ", RowBox[{"Sin", "[", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"2", "n"}], "-", "1"}], ")"}], " ", "\[Pi]", " ", "x"}], "2"], "]"}], " ", RowBox[{"Cos", "[", FractionBox[ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"2", "n"}], "-", "1"}], ")"}], " ", "\[Pi]", " ", "t"}], "10"], "]"}]}], RowBox[{ RowBox[{"2", "n"}], "-", "1"}]]}], ")"}]}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"u", "/.", RowBox[{"t", "\[Rule]", "currt"}]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "2"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", "1.5"}], ",", "1.5"}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"currt", ",", "0", ",", "20"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->{{3.396376873775694*^9, 3.3963769870365143`*^9}, 3.396377044404842*^9, {3.396377117176289*^9, 3.3963771172774363`*^9}, { 3.396377170987314*^9, 3.396377297882245*^9}, {3.396377339035462*^9, 3.396377348279776*^9}, 3.396377636701096*^9, {3.396377675056188*^9, 3.39637767570118*^9}, {3.3963779777055902`*^9, 3.396378019926991*^9}, { 3.3963780848010283`*^9, 3.396378175299159*^9}, {3.39637820707965*^9, 3.396378207180044*^9}, {3.396378461784853*^9, 3.396378462445636*^9}}], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`currt$$ = 5.536874771118164, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`currt$$], 0, 20}}, Typeset`size$$ = { 360., {110., 114.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`currt$775344$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`currt$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`currt$$, $CellContext`currt$775344$$, 0]}, "OtherVariables" :> { Typeset`show$$, Typeset`bookmarkList$$, Typeset`bookmarkMode$$, Typeset`animator$$, Typeset`animvar$$, Typeset`name$$, Typeset`specs$$, Typeset`size$$, Typeset`update$$, Typeset`initDone$$, Typeset`skipInitDone$$}, "Body" :> Plot[ ReplaceAll[$CellContext`u, $CellContext`t -> $CellContext`currt$$], \ {$CellContext`x, 0, 2}, PlotRange -> {-1.5, 1.5}], "Specifications" :> {{$CellContext`currt$$, 0, 20, AppearanceElements -> { "ProgressSlider", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}}}, "Options" :> { ControlType -> Animator, AppearanceElements -> None, SynchronousUpdating -> True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}], ImageSizeCache->{402., {146.375, 151.625}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{ 3.396376995021597*^9, {3.396377033261422*^9, 3.396377047645913*^9}, 3.396377135468733*^9, {3.3963771762924767`*^9, 3.39637730022397*^9}, 3.396377349487774*^9, 3.396377386088875*^9, {3.3963774926558533`*^9, 3.396377506962393*^9}, {3.396377645551895*^9, 3.396377692989915*^9}, { 3.396378183207209*^9, 3.396378236948907*^9}, 3.396378466785592*^9, 3.396378562430456*^9, 3.396380864509334*^9, 3.3963809491198997`*^9, 3.3963810751590633`*^9, 3.3963814921991997`*^9}] }, Open ]] }, WindowSize->{640, 718}, WindowMargins->{{4, Automatic}, {Automatic, 0}}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (June 19, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 310, 9, 27, "Input"], Cell[903, 34, 829, 24, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[1769, 63, 207, 5, 27, "Input"], Cell[1979, 70, 4209, 67, 243, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[6225, 142, 355, 10, 48, "Input"], Cell[6583, 154, 776, 24, 56, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[7396, 183, 127, 2, 27, "Input"], Cell[7526, 187, 492, 16, 54, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8055, 208, 2331, 65, 103, "Input"], Cell[10389, 275, 2373, 46, 316, "Output"] }, Open ]] } ] *) (* End of internal cache information *)