(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 13882, 356] NotebookOptionsPosition[ 12711, 319] NotebookOutlinePosition[ 13148, 336] CellTagsIndexPosition[ 13105, 333] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["Exercise 3.8.3 bis", "Section", CellChangeTimes->{{3.560521238086179*^9, 3.560521261855824*^9}, { 3.560522080648183*^9, 3.560522080804096*^9}, {3.56052578958524*^9, 3.560525789791052*^9}, {3.6233068693875265`*^9, 3.623306884692402*^9}}], Cell[CellGroupData[{ Cell[TextData[{ "For few instants of time ", Cell[BoxData[ FormBox[ RowBox[{"t", "\[GreaterEqual]", "0"}], TraditionalForm]]], " make a graph of the solution", Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{"u", "(", RowBox[{"x", ",", "t"}], ")"}]}], TraditionalForm]]], " to the\nwave equation on the half line ", Cell[BoxData[ FormBox[ RowBox[{"x", "\[GreaterEqual]", "0"}], TraditionalForm]]], " ", "with the Dirichlet boundary condition" }], "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}, CellChangeTimes->{{3.560530623451397*^9, 3.5605306246861677`*^9}, { 3.560530687284501*^9, 3.56053073057257*^9}, {3.560530890244561*^9, 3.560530894683855*^9}, {3.5605309568476553`*^9, 3.560530985466798*^9}, { 3.5605317142193613`*^9, 3.560531718573595*^9}, 3.560531878410747*^9, { 3.560531970387444*^9, 3.560532004067419*^9}, {3.560532715833149*^9, 3.560532717821567*^9}, {3.6233067449684105`*^9, 3.623306817745573*^9}}], Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{ RowBox[{"u", "(", RowBox[{"0", ",", "t"}], ")"}], "=", "0"}]}], TraditionalForm]], "DisplayFormula", CellGroupingRules->{GroupTogetherGrouping, 10000.}, CellChangeTimes->{{3.560530734070614*^9, 3.560530863523694*^9}, { 3.560531032709358*^9, 3.560531083583021*^9}, 3.560531878411058*^9, { 3.5605320148750753`*^9, 3.5605320323243647`*^9}, {3.623306198571158*^9, 3.623306199004183*^9}}], Cell["and with the initial data", "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}, CellChangeTimes->{{3.560530623451397*^9, 3.5605306246861677`*^9}, { 3.560530687284501*^9, 3.56053073057257*^9}, {3.560530890244561*^9, 3.560530894683855*^9}, {3.5605309568476553`*^9, 3.560530985466798*^9}, { 3.5605317142193613`*^9, 3.560531718573595*^9}, 3.560531878410747*^9, { 3.560531970387444*^9, 3.560532004067419*^9}, {3.56053203668499*^9, 3.5605320372670097`*^9}, 3.6233068288362074`*^9}], Cell[BoxData[ FormBox[ RowBox[{" ", RowBox[{ RowBox[{ RowBox[{"u", "(", RowBox[{"x", ",", "0"}], ")"}], "=", RowBox[{"\[Phi]", "(", "x", ")"}]}], ",", " ", RowBox[{ RowBox[{ SubscriptBox["u", "t"], "(", RowBox[{"x", ",", "0"}], ")"}], "=", "0"}], ",", " ", RowBox[{"x", ">", "0"}]}]}], TraditionalForm]], "DisplayFormula", CellGroupingRules->{GroupTogetherGrouping, 10000.}, CellChangeTimes->{{3.560530734070614*^9, 3.560530863523694*^9}, { 3.560531032709358*^9, 3.560531083583021*^9}, 3.560531878411058*^9, { 3.560532044268095*^9, 3.560532066048213*^9}, {3.560532408795342*^9, 3.5605324365588627`*^9}}], Cell[TextData[{ "where the graph of the function ", Cell[BoxData[ FormBox[ RowBox[{"\[Phi]", "(", "x", ")"}], TraditionalForm]]], " is an isosceles triangle of height 1 and base ", Cell[BoxData[ FormBox[ RowBox[{"[", RowBox[{"l", ",", RowBox[{"3", "l"}]}], "]"}], TraditionalForm]]], "." }], "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}, CellChangeTimes->{{3.560530623451397*^9, 3.5605306246861677`*^9}, { 3.560530687284501*^9, 3.56053073057257*^9}, {3.560530890244561*^9, 3.560530894683855*^9}, {3.5605309568476553`*^9, 3.560530985466798*^9}, { 3.5605317142193613`*^9, 3.560531718573595*^9}, 3.560531878410747*^9, { 3.560531970387444*^9, 3.560532004067419*^9}, {3.56053203668499*^9, 3.5605320372670097`*^9}, {3.560532451077292*^9, 3.5605324990543537`*^9}, { 3.623306844982131*^9, 3.6233068597889776`*^9}}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{"Clear", "[", RowBox[{ "l", ",", "a", ",", "\[CapitalPhi]", ",", "\[Phi]", ",", "u", ",", "g", ",", "\[Epsilon]"}], "]"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"l", "=", "2"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", "3"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Epsilon]", "=", "0.1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[CapitalPhi]", "[", "x_", "]"}], ":=", RowBox[{"Piecewise", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ FractionBox["1", "l"], " ", RowBox[{"(", RowBox[{"x", "-", "l"}], ")"}]}], ",", RowBox[{"l", "\[LessEqual]", "x", "\[LessEqual]", RowBox[{"2", " ", "l"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", FractionBox["1", "l"]}], " ", RowBox[{"(", RowBox[{"x", "-", RowBox[{"3", " ", "l"}]}], ")"}]}], ",", RowBox[{ RowBox[{"2", " ", "l"}], "<", "x", "\[LessEqual]", RowBox[{"3", " ", "l"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{ RowBox[{"0", "\[LessEqual]", "x", "<", "l"}], "||", RowBox[{"x", ">", RowBox[{"3", " ", "l"}]}]}]}], "}"}]}], "}"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "[", "x_", "]"}], ":=", RowBox[{"If", "[", RowBox[{ RowBox[{"x", "\[GreaterEqual]", "0"}], ",", RowBox[{"\[CapitalPhi]", "[", "x", "]"}], ",", RowBox[{"-", RowBox[{"\[CapitalPhi]", "[", RowBox[{"-", "x"}], "]"}]}]}], "]"}]}], ";"}]}], "Input", CellGroupingRules->{GroupTogetherGrouping, 10001.}, CellChangeTimes->{{3.560521398924756*^9, 3.56052146488236*^9}, { 3.56052151209116*^9, 3.560521516092292*^9}, {3.560521935380967*^9, 3.560521963414092*^9}, {3.5605220905603313`*^9, 3.5605221511397867`*^9}, { 3.560522370340001*^9, 3.5605225977488422`*^9}, {3.5605251071529827`*^9, 3.5605251874133997`*^9}, {3.560525390820428*^9, 3.560525452091939*^9}, { 3.560525529113583*^9, 3.560525530212133*^9}, {3.560525571704544*^9, 3.560525573194811*^9}, {3.5605256250110817`*^9, 3.560525630631247*^9}, { 3.5605257973498297`*^9, 3.560525800667618*^9}, {3.5605260018674517`*^9, 3.56052600266733*^9}, {3.560526052966045*^9, 3.560526206089787*^9}, { 3.560526284107451*^9, 3.560526288490638*^9}, {3.560526409537643*^9, 3.560526530673566*^9}, {3.560526642491044*^9, 3.5605266655575457`*^9}, { 3.5605266991793013`*^9, 3.5605267473620157`*^9}, {3.560526789400531*^9, 3.560526899058642*^9}, 3.56053226029712*^9, {3.560532729437326*^9, 3.560532740592771*^9}, 3.5605327822105093`*^9, {3.560666127418591*^9, 3.56066612806653*^9}, {3.560680296399692*^9, 3.560680301350379*^9}, 3.560680649713838*^9, 3.623306103214704*^9, {3.6233063526399703`*^9, 3.6233063534590173`*^9}}], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"u", "[", RowBox[{"x_", ",", "t_"}], "]"}], ":=", FractionBox[ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"x", "-", RowBox[{"a", " ", "t"}]}], "]"}], " ", "+", " ", RowBox[{"\[Phi]", "[", RowBox[{"x", "+", RowBox[{"a", " ", "t"}]}], "]"}]}], "2"]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"G", "[", "t_", "]"}], ":=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"x", "-", RowBox[{"a", " ", "t"}]}], "]"}], "/", "2"}], ",", RowBox[{ RowBox[{"\[Phi]", "[", RowBox[{"x", "+", RowBox[{"a", " ", "t"}]}], "]"}], "/", "2"}], ",", RowBox[{"u", "[", RowBox[{"x", ",", "t"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "10"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"-", ".6"}], ",", " ", "1"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", "None"}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"Dashed", ",", "Dashed", ",", "Thick"}], "}"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Animate", "[", RowBox[{ RowBox[{"G", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "3"}], "}"}]}], "]"}]}], "Input", CellGroupingRules->{GroupTogetherGrouping, 10001.}, CellChangeTimes->{{3.560521478963798*^9, 3.560521664673451*^9}, { 3.5605218899453793`*^9, 3.560521921517679*^9}, {3.560521978395503*^9, 3.560522026034234*^9}, {3.5605251969282837`*^9, 3.560525207447413*^9}, { 3.560525305136126*^9, 3.560525338745996*^9}, {3.560525463230443*^9, 3.5605254840465107`*^9}, 3.560525566980328*^9, {3.56052564719571*^9, 3.560525695018005*^9}, {3.560526213837237*^9, 3.5605262712894173`*^9}, { 3.560526912357441*^9, 3.560526933947195*^9}, 3.560532260297348*^9, { 3.560604443657003*^9, 3.560604445393029*^9}, {3.560605073530183*^9, 3.560605076507432*^9}, 3.56066466640421*^9, {3.5606774987302837`*^9, 3.560677501619934*^9}, {3.560680307012944*^9, 3.56068032537167*^9}, 3.560680567592862*^9, {3.62330613723665*^9, 3.6233061791810493`*^9}, { 3.654341793922974*^9, 3.654341813594709*^9}, {3.654342268971904*^9, 3.65434229777*^9}, {3.654342391061586*^9, 3.65434240699082*^9}}] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`t$$ = 2.495209121704102, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`t$$], 0, 3}}, Typeset`size$$ = {360., {109., 114.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`t$626$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`t$$ = 0}, "ControllerVariables" :> { Hold[$CellContext`t$$, $CellContext`t$626$$, 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" :> $CellContext`G[$CellContext`t$$], "Specifications" :> {{$CellContext`t$$, 0, 3, AppearanceElements -> { "ProgressSlider", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}}}, "Options" :> { ControlType -> Animator, AppearanceElements -> None, DefaultBaseStyle -> "Animate", DefaultLabelStyle -> "AnimateLabel", SynchronousUpdating -> True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}], ImageSizeCache->{405., {143., 149.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Animate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{{3.623306123281852*^9, 3.6233061797750835`*^9}, 3.623306357302237*^9, 3.62330795167743*^9, 3.654236812004163*^9, 3.654341044170327*^9, 3.654341816572887*^9, 3.654342095654583*^9, { 3.654342274327668*^9, 3.654342298286006*^9}, 3.65434240836193*^9, 3.654342689755691*^9, 3.654433155316223*^9}], Cell[BoxData[ RowBox[{ RowBox[{"Export", "[", RowBox[{"\"\\"", ",", RowBox[{"Animate", "[", RowBox[{ RowBox[{"G", "[", "t", "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "3"}], "}"}]}], "]"}], ",", RowBox[{"\"\\"", "\[Rule]", " ", "20"}]}], "]"}], " ", RowBox[{"(*", RowBox[{"to", " ", "export", " ", "avi", " ", "file"}], "*)"}]}]], "Input", CellChangeTimes->{{3.654342047019685*^9, 3.654342068504506*^9}, 3.6543421125297327`*^9, 3.6543421627337513`*^9, {3.654342419287674*^9, 3.654342419430955*^9}, {3.6543426655619507`*^9, 3.654342672042322*^9}, { 3.65443316942997*^9, 3.654433204225075*^9}}] }, Open ]] }, WindowSize->{1276, 944}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, ShowSelection->True, FrontEndVersion->"8.0 for Linux x86 (64-bit) (November 7, 2010)", StyleDefinitions->"Default.nb", PrivateNotebookOptions -> {"VersionedStylesheet" -> {"Default.nb"[8.] -> True}} ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 248, 3, 70, "Section"], Cell[CellGroupData[{ Cell[852, 29, 974, 24, 47, "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}], Cell[1829, 55, 460, 11, 23, "DisplayFormula", CellGroupingRules->{GroupTogetherGrouping, 10000.}], Cell[2292, 68, 508, 7, 29, "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}], Cell[2803, 77, 679, 17, 25, "DisplayFormula", CellGroupingRules->{GroupTogetherGrouping, 10000.}], Cell[3485, 96, 868, 20, 29, "Text", CellGroupingRules->{GroupTogetherGrouping, 10000.}] }, Open ]], Cell[CellGroupData[{ Cell[4390, 121, 3016, 71, 147, "Input", CellGroupingRules->{GroupTogetherGrouping, 10001.}], Cell[7409, 194, 2451, 60, 93, "Input", CellGroupingRules->{GroupTogetherGrouping, 10001.}] }, Open ]], Cell[9875, 257, 2117, 41, 309, "Output"], Cell[11995, 300, 700, 16, 29, "Input"] }, Open ]] } ] *) (* End of internal cache information *)