(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of 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[ 48178, 1368]*) (*NotebookOutlinePosition[ 48812, 1391]*) (* CellTagsIndexPosition[ 48768, 1387]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["General Routines", "Section"], Cell[BoxData[ \(discretize::usage = \n\t "\"; \n\n discretize[a_, b_, nCells_] := Module[{\[CapitalDelta]x}, \n\t\t \[CapitalDelta]x = \((b - a)\)\/nCells; \n\t\t Return[Table[N[a + \[CapitalDelta]x\ i], {i, 0, nCells}]]; \n\t\t]; \)], "Input"], Cell[BoxData[ \(initialCondition::usage = "\"; \n\n initialCondition[a_, b_, nCells_, iCFunction_] := Module[{xIC, yIC}, \n\t\txIC = discretize[a, b, nCells]; \n\t\t yIC = Map[iCFunction, xIC]; \n\t\tReturn[Thread[{xIC, yIC}]]; \n \t\t]; \)], "Input"], Cell["\<\ To obtain the initial conditions we start the scheme with the \ solution vector at t_0 and t_{-1} the same i.e. both icy.\ \>", "Text"], Cell[BoxData[ \(\(advectionOneDimension[xL_, \ xR_, \ iCFunction_, \ nCells_, \ scheme_, \ \[Sigma]_, nTimeSteps_]\ := Module[{ic, \ icx, \ icy}, \n\t\t ic\ = \ initialCondition[xL, \ xR, \ nCells, \ iCFunction]; \n\t\t icx\ = \ Map[First, \ ic]; \n\t\ticy\ = \ Map[Last, \ ic]; \n \t\t\t\t\t yAtnTimeSteps = FixedPoint[scheme[#, \[Sigma]]&, {icy, icy}, nTimeSteps]; \n\t\t\ Return[Thread[{icx, \ yAtnTimeSteps[\([1]\)]}]]; \n\t\t]; \)\)], "Input"] }, Open ]], Cell[CellGroupData[{ Cell["Page 339", "Section"], Cell[CellGroupData[{ Cell["Problem 8.6-8.8", "Subsection"], Cell["Exact solution:", "Text"], Cell[BoxData[ \(\(uExact[a_, \ k_, \ t_]\ := \n\ \ \ \ Plot[\n\t\t If[0 < x - a\ t < 1, \n\t\tSin[k\ \[Pi]\ \((x\ - \ a\ t)\)], \n\t\t\t 0], \ {x, \ \(-0.5\), \ 2.5}, \n\ \ \ \ \ \ PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\ \ \ \ \ \ DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell[BoxData[{ \(plotTimes = Table[1\/10\ i, \ {i, \ 0, \ 10}]; \ \ (*{0, \ 0.1, \ 1, \ 2}; *) \ \n\), \(temp\ = Table[uExact[1, \ 1, \ plotTimes[\([i]\)]], \ {i, \ 1, Length[plotTimes]}]; \n Show[temp, \ DisplayFunction\ -> \ $DisplayFunction]; \)}], "Input"], Cell["\<\ Here we investigate how to get an second condition needed for the \ leapfrog method. I tried to invert the difference scheme. This seamed to \ work but I think that many terms are needed to have this transformation work.\ \ \>", "Text"], Cell[BoxData[ \(ic = initialCondition[0, 1, 50, Sin[\[Pi]\ #]&]; \nicy = Map[Last, ic]; \n\nf1[v_List, \[Sigma]_] := 1\/\((1 + \[Sigma])\) - \(\[Sigma]\/\((1 + \[Sigma])\)\^2\) RotateRight[v] + \(\[Sigma]\^2\/\((1 + \[Sigma])\)\^3\) RotateRight[v, 2]; \n f2[v_List, \[Sigma]_] := 1 - \[Sigma] + \[Sigma]\^2 + \((\(-\[Sigma]\) + 2\ \[Sigma]\^2)\) RotateRight[v] + \(\[Sigma]\^2\) RotateRight[v, 2]; \n\nlp0 = ListPlot[icy]; \n lp1 = ListPlot[f1[icy, 0.5]]; \nlp2 = ListPlot[f2[icy, 0.5]]; \n Show[{lp0, lp2}]; \)], "Input"], Cell["\<\ Another option would be just to use the same vector for the other \ condition needed for the leap frog method.\ \>", "Text"], Cell["Numerical schemes:", "Text"], Cell[BoxData[ \(\(upwind[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[\n \t\t\t{\((1 - \[Sigma])\)\ v1 + \[Sigma]\ RotateRight[v1], v1}\n \t\t\t\t]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxFriedrichs[{v1_List, v0_List}, \ \[Sigma]_]\ := Module[{}, \n\t\t \(Return[\n \t\t\t{\(1\/2\) \((\((1\ + \ \[Sigma])\)\ RotateRight[v1]\ + \ \((1\ - \ \[Sigma])\)\ RotateLeft[v1])\), v1}\n\t\t\t]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxWendroff[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[\n \t\t\t{\(\[Sigma]\/2\) \((1 + \[Sigma])\) RotateRight[v1] + \((1 - \[Sigma]\^2)\) v1 + \(\[Sigma]\/2\) \((\(-1\) + \[Sigma])\) RotateLeft[v1], v1}\n \t\t]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[\n \t\t\t{v0 - \[Sigma]\ RotateLeft[v1] + \[Sigma]\ RotateRight[v1], v1}\n\t\t]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, k_, scheme_, \ nCells_, \ \[Sigma]_, \ nTimeSteps_] := \ Module[{a\ = \ 1, \ \[CapitalDelta]x\ = \ \((xR\ - \ xL)\)\/nCells, \ ue, \ au, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, \ k, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, If[0 < x < 1, Sin[k\ \[Pi]\ x], 0]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, \ lpa}, \ \n\ \ \ \ \ \ \ \ \ \ DisplayFunction\ -> \ $DisplayFunction\n\t\t\t]; \n\t\t]; \)\)], "Input"], Cell[BoxData[{ \(Exercise[\(-.5\), 2.5, 1, laxFriedrichs, 150, 0.25, 10]\), \(Exercise[\(-.5\), 2.5, 10, laxFriedrichs, 150, 0.25, 10]\)}], "Input"], Cell[BoxData[{ \(Exercise[\(-.5\), 2.5, 1, upwind, 150, 0.25, 10]\), \(Exercise[\(-.5\), 2.5, 10, upwind, 150, 0.25, 10]\)}], "Input"], Cell[BoxData[{ \(Exercise[\(-.5\), 2.5, 1, leapFrog, 150, 0.25, 10]\), \(Exercise[\(-.5\), 2.5, 10, leapFrog, 150, 0.25, 10]\)}], "Input"], Cell[BoxData[{ \(Exercise[\(-.5\), 2.5, 1, laxWendroff, 150, 0.25, 10]\), \(Exercise[\(-.5\), 2.5, 10, laxWendroff, 150, 0.25, 10]\)}], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Page 340", "Section"], Cell[CellGroupData[{ Cell["Problem 8.12", "Subsection"], Cell[BoxData[ \(ul = 2; \nur = 0; \nsl = 1; \nu0[x_] := If[x < sl, ul, ur]; \)], "Input"], Cell[BoxData[ \(\(uExact[a_, t_]\ := \n\ \ \ \ Plot[u0[x - a\ t], \ {x, \ 2.0, \ 4.0}, \n\t\t PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\t\t DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell["Numerical schemes:", "Text"], Cell["\<\ To implement the boundary conditions we add an extra element to the \ ends of the array, compute with this element and then remove the two end \ elements.\ \>", "Text"], Cell[BoxData[ \(\(upwind[{v1_List, v0_List}, \[Sigma]_] := Module[{vPadded, vNextPadded, vNext}, \n\t\t vPadded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \((1 - \[Sigma])\)\ vPadded + \[Sigma]\ RotateRight[vPadded]; \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxFriedrichs[{v1_List, v0_List}, \ \[Sigma]_]\ := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(1\/2\) \((\((1\ + \ \[Sigma])\)\ RotateRight[v1Padded]\ + \ \((1\ - \ \[Sigma])\)\ RotateLeft[v1Padded])\); \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxWendroff[{v1_List, v0_List}, \[Sigma]_] := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(\[Sigma]\/2\) \((1 + \[Sigma])\) RotateRight[v1Padded] + \((1 - \[Sigma]\^2)\) v1Padded + \(\[Sigma]\/2\) \((\(-1\) + \[Sigma])\) RotateLeft[v1Padded]; \n \t\tvNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{v0Padded, v1Padded, vNextPadded, v1Next, v0Next}, \n\t\t v0Padded = Join[{ul}, v0, {ur}]; \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = v0Padded - \[Sigma]\ RotateLeft[v1Padded] + \[Sigma]\ RotateRight[v1Padded]; \n\t\t v1Next = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t v0Next = Take[v1Padded, {2, Length[v1Padded] - 1}]; \n\t\t Return[{v1Next, v0Next}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, scheme_, \ nCells_, \ \[Sigma]_, \ nTimeSteps_] := \ Module[{a\ = \ 1, \ \[CapitalDelta]x\ = \ \((xR\ - \ xL)\)\/nCells, \ ue, \ au, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, u0[x]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, lpa}, \ \n\ \ \t\t\tPlotRange -> {{2.0, 4.0}, All}, \n \ \ \ \ \ \ \ \ \ \ DisplayFunction\ -> \ $DisplayFunction\n \t\t\t]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(Exercise[0, 4, upwind, 80, .8, 50]\)], "Input"], Cell[BoxData[ \(Exercise[0, 4, laxFriedrichs, 80, .8, 50]\)], "Input"], Cell[BoxData[ \(Exercise[0, 4, laxWendroff\ , 80, .8, 50]\)], "Input"], Cell[BoxData[ \(Exercise[0, 4, leapFrog\ , 80, .8, 50]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 8.13", "Subsection"], Cell[BoxData[ \(pL = 1.5; \npR = 3.5; \)], "Input"], Cell[BoxData[ \(\(u0[x_] := If[0 < x < 1, Sin[2\ \[Pi]\ n\ x], 0]; \)\)], "Input"], Cell[BoxData[ \(n = 2; \nPlot[u0[x], {x, \(-2\), 2}]; \nn = 4; \n Plot[u0[x], {x, \(-2\), 2}]; \)], "Input"], Cell[BoxData[ \(\(uExact[a_, t_]\ := \n\ \ \ \ Plot[u0[x - a\ t], \ {x, \ pL, \ pR}, \n\t\t PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\t\t DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell[BoxData[ \(\(uExact[1, 2.1] // Show[#, DisplayFunction -> $DisplayFunction]&; \)\)], "Input"], Cell["Numerical schemes:", "Text"], Cell[BoxData[ \(\(upwind[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[{\((1 - \[Sigma])\)\ v1 + \[Sigma]\ RotateRight[v1], v1}]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxFriedrichs[{v1_List, v0_List}, \ \[Sigma]_]\ := Module[{}, \n\t\t \(Return[{ \(1\/2\) \((\((1\ + \ \[Sigma])\)\ RotateRight[v1]\ + \ \((1\ - \ \[Sigma])\)\ RotateLeft[v1])\), v1}]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxWendroff[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[{ \(\[Sigma]\/2\) \((1 + \[Sigma])\) RotateRight[v1] + \((1 - \[Sigma]\^2)\) v1 + \(\[Sigma]\/2\) \((\(-1\) + \[Sigma])\) RotateLeft[v1], v1}]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{}, \n\t\t \(Return[{v0 - \[Sigma]\ RotateLeft[v1] + \[Sigma]\ RotateRight[v1], v1}]; \)\n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, scheme_, \ nCells_, \ \[Sigma]_, \ nTimeSteps_] := \ Module[{a\ = \ 1, \ \[CapitalDelta]x\ = \ \((xR\ - \ xL)\)\/nCells, \ ue, \ au, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, u0[x]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, lpa}, \ \n\ \ \t\t\tPlotRange -> {{pL, pR}, All}, \n \ \ \ \ \ \ \ \ \ \ DisplayFunction\ -> \ $DisplayFunction\n \t\t\t]; \n\t\t]; \)\)], "Input"], Cell[BoxData[{ \(n = 2; \nExercise[0, 3.5, upwind, 70, .8, 50]\), \(Exercise[0, 3.5, laxFriedrichs, 70, .8, 50]\), \(Exercise[0, 3.5, laxWendroff\ , 70, .8, 50]\), \(Exercise[0, 3.5, leapFrog\ , 80, .8, 50]\)}], "Input"], Cell[BoxData[{ \(n = 4; \nExercise[0, 3.5, upwind, 70, .8, 50]\), \(Exercise[0, 3.5, laxFriedrichs, 70, .8, 50]\), \(Exercise[0, 3.5, laxWendroff\ , 70, .8, 50]\), \(Exercise[0, 3.5, leapFrog\ , 80, .8, 50]\)}], "Input"], Cell[BoxData[{ \(n = 2; \nCFL = 0.2; \nExercise[0, 3.5, upwind, 70, CFL, 50]\), \(Exercise[0, 3.5, laxFriedrichs, 70, CFL, 50]\), \(Exercise[0, 3.5, laxWendroff\ , 70, CFL, 50]\), \(Exercise[0, 3.5, leapFrog\ , 80, CFL, 50]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 8.16", "Subsection"], Cell[BoxData[ \(ul = 1; \nur = \(-1\); \nsLoc = 1; \ (*\(+0.025\); \ (*\ Offset\ added\ to\ have\ shock\ location\ NOT\ at\ a\ grid\ \(point.\)*) \n \(u0[x_] := If[x < sLoc, ul, ur]; \)\)], "Input"], Cell[BoxData[ \(\(uExact[a_, t_]\ := \n\ \ \ \ Plot[u0[x], \ {x, 0\ .0, \ 2.0}, \n\t\t PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\t\t DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell[BoxData[ \(\(uExact[1, 1] // Show[#, DisplayFunction -> $DisplayFunction]&; \)\)], "Input"], Cell["Numerical schemes:", "Text"], Cell["\<\ To implement the boundary conditions we add an extra element to the \ ends of the array, compute with this element and then remove the two end \ elements.\ \>", "Text"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{v0Padded, v1Padded, vNextPadded, v1Next, v0Next}, \n\t\t v0Padded = Join[{ul}, v0, {ur}]; \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = v0Padded - \[Sigma]\ v1Padded\ RotateLeft[v1Padded] + \[Sigma]\ v1Padded\ RotateRight[v1Padded]; \n\t\t v1Next = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t v0Next = Take[v1Padded, {2, Length[v1Padded] - 1}]; \n\t\t Return[{v1Next, v0Next}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, scheme_, \ nCells_, \ \[Sigma]_, \ nTimeSteps_] := \ Module[{a\ = \ 1, \ \[CapitalDelta]x\ = \ \((xR\ - \ xL)\)\/nCells, \ ue, \ au, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, u0[x]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, lpa}, \ \n\ \ \t\t\tPlotRange -> {{0.0, 2.0}, All}, \n \ \ \ \ \ \ \ \ \ \ DisplayFunction\ -> \ $DisplayFunction\n \t\t\t]; \n\t\t]; \)\)], "Input"], Cell[BoxData[{ \(CFL = 0.8; \nExercise[0, 2, leapFrog\ , 40, CFL, 0]\), \(Exercise[0, 2, leapFrog\ , 40, CFL, 1]\), \(Exercise[0, 2, leapFrog\ , 40, CFL, 2]\)}], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Page 341", "Section"], Cell[CellGroupData[{ Cell["Problem 8.21", "Subsection"], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \((\(-Sin[\[Phi]]\) - \(3\/2\) I\ \[Sigma]\ Cos[\[Phi]])\) \((2 + Cos[\[Phi]] + \(3\/2\) I\ \[Sigma]\ Sin[\[Phi]])\) - \((2 + Cos[\[Phi]] - \(3\/2\) I\ \[Sigma]\ Sin[\[Phi]])\) \((\(-Sin[\[Phi]]\) + \(3\/2\) I\ \[Sigma]\ Cos[\[Phi]])\)]\)], "Input"], Cell[BoxData[ \(\(-3\)\ I\ \[Sigma]\ \((1 + 2\ Cos[\[Phi]])\)\)], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Problem 8.22", "Subsection"], Cell[BoxData[ \(<< Graphics`\)], "Input"], Cell[BoxData[ \(upwind[\[Sigma]_] := PolarPlot[ \((\((1 - \[Sigma])\)\ Cos[\[Phi]] + \[Sigma]) \)\/\(\((1 + \[Sigma] \((Cos[\[Phi]] - 1)\))\)\^2 + \(\[Sigma]\^2\) Sin[\[Phi]]\^2\), {\[Phi], 0, 2 \[Pi]}]\)], "Input"], Cell[BoxData[ \(upwind[0.2]; \nupwind[0.4]; \nupwind[0.6]; \nupwind[0.8]; \n upwind[1.0]; \)], "Input"], Cell[BoxData[ \(laxFriedrichs[\[Sigma]_] := PolarPlot[ 1\/\(Cos[\[Phi]]\^2 + \(\[Sigma]\^2\) Sin[\[Phi]]\^2\), {\[Phi], 0, 2 \[Pi]}]\)], "Input"], Cell[BoxData[ \(laxFriedrichs[0.2]; \nlaxFriedrichs[0.4]; \nlaxFriedrichs[0.6]; \n laxFriedrichs[0.8]; \nlaxFriedrichs[1.0]; \nlaxFriedrichs[1.5]; \)], "Input"], Cell[BoxData[ \(laxWendroff[\[Sigma]_] := PolarPlot[ \(\((1 - 2\ \(\[Sigma]\^2\) Sin[\[Phi]\/2]\^2)\) Cos[\[Phi]] + \(\[Sigma]\^2\) Sin[\[Phi]]\^2\)\/\(\((1 - 2 \( \[Sigma]\^2\) Sin[\[Phi]\/2]\^2) \)\^2 + \(\[Sigma]\^2\) Sin[\[Phi]]\^2\), {\[Phi], 0, 2 \[Pi]}]\)], "Input"], Cell[BoxData[ \(CFL = {0.2, 0.4, 0.6, 0.8, 1.0, 1.2}; \n Table[laxWendroff[CFL[\([i]\)]], {i, 1, Length[CFL]}]; \)], "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell["Page 353", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(Series[ ArcTan[\ \[Sigma]\ Tan[\[Phi]]]\/\(\[Sigma]\ \[Phi]\), {\[Phi], 0, 3}] // Simplify\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"1", "+", \(\((1\/3 - \[Sigma]\^2\/3)\)\ \[Phi]\^2\), "+", InterpretationBox[\(O[\[Phi]]\^4\), SeriesData[ \[Phi], 0, {}, 0, 4, 1]]}], SeriesData[ \[Phi], 0, {1, 0, Plus[ Rational[ 1, 3], Times[ Rational[ -1, 3], Power[ \[Sigma], 2]]]}, 0, 4, 1]]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Page 355", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[1 - 2\ Sin[\[Phi]\/2]\^2 + 8\ Sin[\[Phi]\/2]\^4]\)], "Input"], Cell[BoxData[ \(3 - 3\ Cos[\[Phi]] + Cos[2\ \[Phi]]\)], "Output"] }, Open ]], Cell[BoxData[ \(\(p[n_] := Plot[{Cos[n\ \[Phi]], 1 + Sum[\(\((\(-1\))\)\^l\) \(2\^\(2\ l - 1\)\) Sin[\[Phi]\/2]\^\(2\ l\), {l, n}]}, {\[Phi], 0, 2\ \[Pi]}, \n \t\tPlotRange -> All]; \)\)], "Input"], Cell[BoxData[ \(\(p[3]; \)\)], "Input"], Cell["\<\ I can't seem to get these two expressions to match? Could this \ expression be incorrect? Gradshteyn and Ryzhik has a different version?\ \>", "Text"] }, Closed]], Cell[CellGroupData[{ Cell["Page 358", "Section"], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[{b\_\(-2\) + b\_\(-1\) + b\_0 == 1, \n\t\t \(-2\)\ b\_\(-2\) - b\_\(-1\) == \(-\[Sigma]\), \n\t\t 4 b\_\(-2\) + b\_\(-1\) == \[Sigma]\^2}, \n \t{b\_\(-2\), b\_\(-1\), b\_0}] // Simplify\)], "Input"], Cell[BoxData[ \({{b\_\(-2\) \[Rule] 1\/2\ \((\(-1\) + \[Sigma])\)\ \[Sigma], b\_\(-1\) \[Rule] \(-\((\(-2\) + \[Sigma])\)\)\ \[Sigma], b\_0 \[Rule] 1\/2\ \((2 - 3\ \[Sigma] + \[Sigma]\^2)\)}}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \(\(-8\)\/2\) \[Sigma] \((\[Sigma] - 1)\) - \[Sigma] \((2 - \[Sigma])\) + \[Sigma]\^3]\)], "Input"], Cell[BoxData[ \(\[Sigma]\ \((2 - 3\ \[Sigma] + \[Sigma]\^2)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[Out[9]]\)], "Input"], Cell[BoxData[ \(\((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\ \[Sigma]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \(16\/2\) \[Sigma] \((\[Sigma] - 1)\) + \[Sigma] \((2 - \[Sigma])\) - \[Sigma]\^4]\)], "Input"], Cell[BoxData[ \(\(-\[Sigma]\)\ \((6 - 7\ \[Sigma] + \[Sigma]\^3)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[Out[11]]\)], "Input"], Cell[BoxData[ \(\(-\((\(-2\) + \[Sigma])\)\)\ \((\(-1\) + \[Sigma])\)\ \[Sigma]\ \(( 3 + \[Sigma])\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(TrigExpand[ 1 - \[Sigma] \((1 - Cos[\[Phi]] + I\ Sin[\[Phi]])\) + \(1\/2\) \[Sigma] \((\[Sigma] - 1)\) \((1 - 2 \((Cos[\[Phi]] - I\ Sin[\[Phi]])\) + \((Cos[2\ \[Phi]] - I\ Sin[2\ \[Phi]])\))\)]\)], "Input"], Cell[BoxData[ \(1 - \(3\ \[Sigma]\)\/2 + \[Sigma]\^2\/2 + 2\ \[Sigma]\ Cos[\[Phi]] - \[Sigma]\^2\ Cos[\[Phi]] - 1\/2\ \[Sigma]\ Cos[\[Phi]]\^2 + 1\/2\ \[Sigma]\^2\ Cos[\[Phi]]\^2 - 2\ I\ \[Sigma]\ Sin[\[Phi]] + I\ \[Sigma]\^2\ Sin[\[Phi]] + I\ \[Sigma]\ Cos[\[Phi]]\ Sin[\[Phi]] - I\ \[Sigma]\^2\ Cos[\[Phi]]\ Sin[\[Phi]] + 1\/2\ \[Sigma]\ Sin[\[Phi]]\^2 - 1\/2\ \[Sigma]\^2\ Sin[\[Phi]]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \(-\(\(3\ \[Sigma]\)\/2\)\) + \[Sigma]\^2\/2 + 2\ \[Sigma]\ Cos[\[Phi]] - \[Sigma]\^2\ Cos[\[Phi]] - 1\/2\ \[Sigma]\ Cos[\[Phi]]\^2 + 1\/2\ \[Sigma]\^2\ Cos[\[Phi]]\^2 + 1\/2\ \[Sigma]\ Sin[\[Phi]]\^2 - 1\/2\ \[Sigma]\^2\ Sin[\[Phi]]\^2] \)], "Input"], Cell[BoxData[ \(\(-2\)\ \[Sigma]\ \((1 + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]])\)\ Sin[\[Phi]\/2]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \(-2\)\ I\ \[Sigma]\ Sin[\[Phi]] + I\ \[Sigma]\^2\ Sin[\[Phi]] + I\ \[Sigma]\ Cos[\[Phi]]\ Sin[\[Phi]] - I\ \[Sigma]\^2\ Cos[\[Phi]]\ Sin[\[Phi]]]\)], "Input"], Cell[BoxData[ \(\(-I\)\ \[Sigma]\ \(( 2 - \[Sigma] + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]])\)\ Sin[\[Phi]]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Simplify[ \((1 - 2\ \[Sigma]\ \((1 + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]])\)\ Sin[\[Phi]\/2]\^2)\)\^2 + \((\ \[Sigma]\ \((2 - \[Sigma] + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]]) \)\ Sin[\[Phi]])\)\^2]\)], "Input"], Cell[BoxData[ \(\((1 - 2\ \[Sigma]\ \((1 + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]])\)\ Sin[\[Phi]\/2]\^2)\)\^2 + \[Sigma]\^2\ \((2 - \[Sigma] + \((\(-1\) + \[Sigma])\)\ Cos[\[Phi]])\)\^2\ Sin[\[Phi]]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(TrigExpand[Out[31]]\)], "Input"], Cell[BoxData[ \(1 - 3\ \[Sigma] + \(15\ \[Sigma]\^2\)\/2 - 6\ \[Sigma]\^3 + \(3\ \[Sigma]\^4\)\/2 + 4\ \[Sigma]\ Cos[\[Phi]\/2]\^2 - 10\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^2 + 8\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^2 - 2\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^2 - \[Sigma]\ Cos[\[Phi]\/2]\^4 + 5\/2\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^4 - 2\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^4 + 1\/2\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^4 - 4\ \[Sigma]\ Sin[\[Phi]\/2]\^2 + 10\ \[Sigma]\^2\ Sin[\[Phi]\/2]\^2 - 8\ \[Sigma]\^3\ Sin[\[Phi]\/2]\^2 + 2\ \[Sigma]\^4\ Sin[\[Phi]\/2]\^2 + 6\ \[Sigma]\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 - 15\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 + 12\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 - 3\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 - \[Sigma]\ Sin[\[Phi]\/2]\^4 + 5\/2\ \[Sigma]\^2\ Sin[\[Phi]\/2]\^4 - 2\ \[Sigma]\^3\ Sin[\[Phi]\/2]\^4 + 1\/2\ \[Sigma]\^4\ Sin[\[Phi]\/2]\^4\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ \(-3\)\ \[Sigma] + \(15\ \[Sigma]\^2\)\/2 - 6\ \[Sigma]\^3 + \(3\ \[Sigma]\^4\)\/2]\)], "Input"], Cell[BoxData[ \(3\/2\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ \(+4\)\ \[Sigma]\ Cos[\[Phi]\/2]\^2 - 10\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^2 + 8\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^2 - 2\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^2] \)], "Input"], Cell[BoxData[ \(\(-2\)\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\ Cos[\[Phi]\/2]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ \(-\[Sigma]\)\ Cos[\[Phi]\/2]\^4 + 5\/2\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^4 - 2\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^4 + 1\/2\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^4]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\ Cos[\[Phi]\/2]\^4\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ \(-4\)\ \[Sigma]\ Sin[\[Phi]\/2]\^2 + 10\ \[Sigma]\^2\ Sin[\[Phi]\/2]\^2 - 8\ \[Sigma]\^3\ Sin[\[Phi]\/2]\^2 + 2\ \[Sigma]\^4\ Sin[\[Phi]\/2]\^2] \)], "Input"], Cell[BoxData[ \(2\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\ Sin[\[Phi]\/2]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ 6\ \[Sigma]\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 - 15\ \[Sigma]\^2\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 + 12\ \[Sigma]\^3\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2 - 3\ \[Sigma]\^4\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2]\)], "Input"], Cell[BoxData[ \(\(-3\)\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\ Cos[\[Phi]\/2]\^2\ Sin[\[Phi]\/2]\^2\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Factor[ \(-\[Sigma]\)\ Sin[\[Phi]\/2]\^4 + 5\/2\ \[Sigma]\^2\ Sin[\[Phi]\/2]\^4 - 2\ \[Sigma]\^3\ Sin[\[Phi]\/2]\^4 + 1\/2\ \[Sigma]\^4\ Sin[\[Phi]\/2]\^4]\)], "Input"], Cell[BoxData[ \(1\/2\ \((\(-2\) + \[Sigma])\)\ \((\(-1\) + \[Sigma])\)\^2\ \[Sigma]\ Sin[\[Phi]\/2]\^4\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Expand[ 3\/2 - 2 \((1 - x\^2)\) + \(1\/2\) \((1 - x\^2)\)\^2 + 2\ x\^2 - 3\ \(x\^2\) \((1 - x\^2)\) + \(1\/2\) x\^4]\)], "Input"], Cell[BoxData[ \(4\ x\^4\)], "Output"] }, Open ]], Cell[BoxData[ \(\(Plot[{x \(\((1 - x)\)\^2\) \((2 - x)\), 1\/2}, {x, 0, 4}]; \)\)], "Input"], Cell[BoxData[ \(\(Plot[1\/Sin[x]\^4, {x, 1, \[Pi]\/2}]; \)\)], "Input"], Cell[BoxData[ \(\(Plot[\(1\/6\) \((1 - x)\) \((2 - x)\), {x, 0, 2}]; \)\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Page 367", "Section"], Cell["Problem 9.1", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Series[\ ArcSin[\ \[Sigma]\ Sin[\[Phi]]]\/\(\[Sigma]\ \[Phi]\), {\[Phi], 0, 6}] // Simplify\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{ "1", "+", \(1\/6\ \((\(-1\) + \[Sigma]\^2)\)\ \[Phi]\^2\), "+", \(1\/120\ \((1 - 10\ \[Sigma]\^2 + 9\ \[Sigma]\^4)\)\ \[Phi]\^4\), "+", \(\(\(( \(-1\) + 91\ \[Sigma]\^2 - 315\ \[Sigma]\^4 + 225\ \[Sigma]\^6)\)\ \[Phi]\^6\)\/5040\), "+", InterpretationBox[\(O[\[Phi]]\^7\), SeriesData[ \[Phi], 0, {}, 0, 7, 1]]}], SeriesData[ \[Phi], 0, {1, 0, Times[ Rational[ 1, 6], Plus[ -1, Power[ \[Sigma], 2]]], 0, Times[ Rational[ 1, 120], Plus[ 1, Times[ -10, Power[ \[Sigma], 2]], Times[ 9, Power[ \[Sigma], 4]]]], 0, Times[ Rational[ 1, 5040], Plus[ -1, Times[ 91, Power[ \[Sigma], 2]], Times[ -315, Power[ \[Sigma], 4]], Times[ 225, Power[ \[Sigma], 6]]]]}, 0, 7, 1]]], "Output"] }, Open ]], Cell["Problem 9.2", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Series[ ArcTan[\((\[Sigma]\ Sin[\[Phi]])\)\/\(1 - \[Sigma] - \[Sigma]\ Cos[\[Phi]]\)]\/\(\[Sigma]\ \[Phi]\), {\[Phi], 0, 4}] // Simplify\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{ \(1\/\(1 - 2\ \[Sigma]\)\), "-", \(\(\((\(-1\) + \[Sigma])\)\ \[Phi]\^2\)\/\(6\ \((\(-1\) + 2\ \[Sigma])\)\^3\)\), "-", \(\(\((1 + 7\ \[Sigma] - 16\ \[Sigma]\^2 + 8\ \[Sigma]\^3)\)\ \[Phi]\^4\)\/\(120\ \((\(-1\) + 2\ \[Sigma])\)\^5\)\), "+", InterpretationBox[\(O[\[Phi]]\^5\), SeriesData[ \[Phi], 0, {}, 0, 5, 1]]}], SeriesData[ \[Phi], 0, { Power[ Plus[ 1, Times[ -2, \[Sigma]]], -1], 0, Times[ Rational[ -1, 6], Plus[ -1, \[Sigma]], Power[ Plus[ -1, Times[ 2, \[Sigma]]], -3]], 0, Times[ Rational[ -1, 120], Power[ Plus[ -1, Times[ 2, \[Sigma]]], -5], Plus[ 1, Times[ 7, \[Sigma]], Times[ -16, Power[ \[Sigma], 2]], Times[ 8, Power[ \[Sigma], 3]]]]}, 0, 5, 1]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Series[\@\(Cos[\[Phi]]\^2 + \[Sigma]\ Sin[\[Phi]]\^2\), {\[Phi], 0, 3}] \)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"1", "+", \(1\/2\ \((\(-1\) + \[Sigma])\)\ \[Phi]\^2\), "+", InterpretationBox[\(O[\[Phi]]\^4\), SeriesData[ \[Phi], 0, {}, 0, 4, 1]]}], SeriesData[ \[Phi], 0, {1, 0, Times[ Rational[ 1, 2], Plus[ -1, \[Sigma]]]}, 0, 4, 1]]], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Series[ ArcTan[\[Sigma]\ Tan[\[Phi]]]\/\(\[Sigma]\ \[Phi]\), {\[Phi], 0, 3}] // Simplify\)], "Input"], Cell[BoxData[ InterpretationBox[ RowBox[{"1", "+", \(\((1\/3 - \[Sigma]\^2\/3)\)\ \[Phi]\^2\), "+", InterpretationBox[\(O[\[Phi]]\^4\), SeriesData[ \[Phi], 0, {}, 0, 4, 1]]}], SeriesData[ \[Phi], 0, {1, 0, Plus[ Rational[ 1, 3], Times[ Rational[ -1, 3], Power[ \[Sigma], 2]]]}, 0, 4, 1]]], "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell["Page 368", "Section"], Cell[CellGroupData[{ Cell["Problem 9.7", "Subsection"], Cell[BoxData[ \(\(Needs["\"]; \)\)], "Input"], Cell[BoxData[ \(\(GSquared[\[Phi]_, \[Sigma]_] := \((1 - 2 \[Sigma] \((1 - \((1 - \[Sigma])\) Cos[\[Phi]])\)\ Sin[\[Phi]\/2]\^2)\)\^2 + \(\[Sigma]\^2\) \(Sin[\[Phi]]\^2\) \((1 + 2 \((1 - \[Sigma])\) Sin[\[Phi]\/2]\^2)\)\^2; \)\)], "Input"], Cell[BoxData[ \(\(pp[\[Sigma]_] := PolarPlot[{1, GSquared[\[Phi], \[Sigma]]}, {\[Phi], 0, 2 \[Pi]}]; \)\)], "Input"], Cell[BoxData[ \(samples = {0.25, 0.5, 0.75, 0.99, 1.1}; \n For[i = 1, i <= Length[samples], \(i++\), \n\t\(pp[samples[\([i]\)]]; \)\n \t]; \)], "Input"], Cell["Which of these two formulations is correct?", "Text"], Cell[BoxData[ \(\(\[CapitalPhi][\[Sigma]_, \[Phi]_] := ArcTan[\[Sigma]\ Sin[\[Phi]] \((1 + 2 \((1 - \[Sigma])\) Sin[\[Phi]\/2]\^2)\), 1 - 2 \[Sigma] \((1 - \((1 - \[Sigma])\) Cos[\[Sigma]])\) Sin[\[Phi]\/2]\^2]; \)\)], "Input"], Cell[BoxData[ \(\(\[CapitalPhi][\[Sigma]_, \[Phi]_] := ArcTan[\(\[Sigma]\ Sin[\[Phi]] \((1 + 2 \((1 - \[Sigma])\) Sin[\[Phi]\/2]\^2)\)\)\/\(1 - 2 \[Sigma] \((1 - \((1 - \[Sigma])\) Cos[\[Sigma]])\) Sin[\[Phi]\/2]\^2\)]; \)\)], "Input"], Cell[BoxData[ \(\(\[Epsilon]\_\[Phi][\[Sigma]_, \[Phi]_] := \[CapitalPhi][\[Sigma], \[Phi]]\/\(\[Sigma]\ \[Phi]\); \)\)], "Input"], Cell[BoxData[ \(\(pp[\[Sigma]_] := PolarPlot[{1, \[Epsilon]\_\[Phi][\[Sigma], \[Phi]]}, {\[Phi], 0, 2\ \[Pi]}]; \)\)], "Input"], Cell[BoxData[ \(samples = {0.25, 0.5, 0.75, 0.99, 1.1}; \n For[i = 1, i <= Length[samples], \(i++\), \n\t\(pp[samples[\([i]\)]]; \)\n \t]; \)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 9.8", "Subsection"], Cell["\<\ Exact solution. The definitions of ul and ur are needed for the \ boundary condition routines.\ \>", "Text"], Cell[BoxData[ \(ul = 0; \nur = 0; \n u0[x_, k_] := If[0 < x < 1, Sin[2\ \[Pi]\ k\ x], 0]; \)], "Input"], Cell[BoxData[ \(\(uExact[a_, k_, t_]\ := \n\ \ \ \ Plot[u0[x - a\ t, k], \ {x, \ \(-1.0\), \ 6.0}, \n\t\t PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\t\t DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell[BoxData[ \(\(Show[uExact[1, 4, 1], DisplayFunction -> $DisplayFunction]; \)\)], "Input"], Cell["Numerical schemes:", "Text"], Cell["\<\ To implement the periodic boundary conditions for this problem we \ add an extra element to the ends of the array, compute with this element and \ then remove the two end elements. The vector of unknowns values at time \ \"n\" are stored in v1 with the previous values at time \"n-1\" stored in v0.\ \ \>", "Text"], Cell[BoxData[ \(\(upwind[{v1_List, v0_List}, \[Sigma]_] := Module[{vPadded, vNextPadded, vNext}, \n\t\t vPadded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \((1 - \[Sigma])\)\ vPadded + \[Sigma]\ RotateRight[vPadded]; \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxFriedrichs[{v1_List, v0_List}, \ \[Sigma]_]\ := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(1\/2\) \((\((1\ + \ \[Sigma])\)\ RotateRight[v1Padded]\ + \ \((1\ - \ \[Sigma])\)\ RotateLeft[v1Padded])\); \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxWendroff[{v1_List, v0_List}, \[Sigma]_] := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(\[Sigma]\/2\) \((1 + \[Sigma])\) RotateRight[v1Padded] + \((1 - \[Sigma]\^2)\) v1Padded + \(\[Sigma]\/2\) \((\(-1\) + \[Sigma])\) RotateLeft[v1Padded]; \n \t\tvNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{v0Padded, v1Padded, vNextPadded, v1Next, v0Next}, \n\t\t v0Padded = Join[{ul}, v0, {ur}]; \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = v0Padded - \[Sigma]\ RotateLeft[v1Padded] + \[Sigma]\ RotateRight[v1Padded]; \n\t\t v1Next = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t v0Next = Take[v1Padded, {2, Length[v1Padded] - 1}]; \n\t\t Return[{v1Next, v0Next}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, scheme_, \[CapitalDelta]x_, \ \[Sigma]_, \ nTimeSteps_, k_] := \ Module[{a\ = \ 1, \ nCells\ = \ \((xR\ - \ xL)\)\/\[CapitalDelta]x, \ ue, \ ua, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, k, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, u0[x, k]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, lpa}, \ \n\ \ \t\t\tPlotRange -> Automatic, \n \ \ \ \ \ \ \ \ \ \ DisplayFunction\ -> \ $DisplayFunction\n \t\t\t]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(xL = \(-1\); xR = 3; \n\[CapitalDelta]x = 1\/60; \nk = 4; \)], "Input"], Cell[BoxData[{ \(scheme = upwind; \n\n\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\)}], "Input"], Cell[BoxData[{ \(scheme = laxFriedrichs; \n\n\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\)}], "Input"], Cell[BoxData[{ \(scheme = laxWendroff; \n\n\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\)}], "Input"], Cell[BoxData[{ \(scheme = leapFrog; \n\n\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\n\), \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100, k]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200, k]\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 9.9", "Subsection"], Cell["\<\ Exact solution. The definitions of ul and ur are needed for the \ boundary condition routines.\ \>", "Text"], Cell[BoxData[ \(ul = 1; \nur = 0; \nu0[x_] := If[x < 0, 1, 0]; \)], "Input"], Cell[BoxData[ \(\(uExact[a_, t_, xL_, xR_]\ := Plot[u0[x - a\ t], \ {x, \ xL, xR}, \n\t\t PlotStyle\ -> \ RGBColor[0, \ 1, \ 0], \n\t\t DisplayFunction\ -> \ Identity]; \)\)], "Input"], Cell[BoxData[ \(\(Show[uExact[1, 1, \(-1\), 6], DisplayFunction -> $DisplayFunction]; \)\)], "Input"], Cell["Numerical schemes:", "Text"], Cell["\<\ To implement the periodic boundary conditions for this problem we \ add an extra element to the ends of the array, compute with this element and \ then remove the two end elements. The vector of unknowns values at time \ \"n\" are stored in v1 with the previous values at time \"n-1\" stored in v0.\ \ \>", "Text"], Cell[BoxData[ \(\(upwind[{v1_List, v0_List}, \[Sigma]_] := Module[{vPadded, vNextPadded, vNext}, \n\t\t vPadded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \((1 - \[Sigma])\)\ vPadded + \[Sigma]\ RotateRight[vPadded]; \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxFriedrichs[{v1_List, v0_List}, \ \[Sigma]_]\ := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(1\/2\) \((\((1\ + \ \[Sigma])\)\ RotateRight[v1Padded]\ + \ \((1\ - \ \[Sigma])\)\ RotateLeft[v1Padded])\); \n\t\t vNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(laxWendroff[{v1_List, v0_List}, \[Sigma]_] := Module[{v1Padded, vNextPadded, vNext}, \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = \(\[Sigma]\/2\) \((1 + \[Sigma])\) RotateRight[v1Padded] + \((1 - \[Sigma]\^2)\) v1Padded + \(\[Sigma]\/2\) \((\(-1\) + \[Sigma])\) RotateLeft[v1Padded]; \n \t\tvNext = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t Return[{vNext, v1}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(leapFrog[{v1_List, v0_List}, \[Sigma]_] := Module[{v0Padded, v1Padded, vNextPadded, v1Next, v0Next}, \n\t\t v0Padded = Join[{ul}, v0, {ur}]; \n\t\t v1Padded = Join[{ul}, v1, {ur}]; \n\t\t vNextPadded = v0Padded - \[Sigma]\ RotateLeft[v1Padded] + \[Sigma]\ RotateRight[v1Padded]; \n\t\t v1Next = Take[vNextPadded, {2, Length[vNextPadded] - 1}]; \n\t\t v0Next = Take[v1Padded, {2, Length[v1Padded] - 1}]; \n\t\t Return[{v1Next, v0Next}]; \n\t\t]; \)\)], "Input"], Cell["\<\ Note: the second order upwind scheme is also known as the method of \ Beam and Warming\ \>", "Text"], Cell[BoxData[ \(\(secondOrderUpwind[{v1_List, v0_List}, \[Sigma]_] := Module[{v0Padded, v1Padded, vNextPadded, v1Next, v0Next}, \n\t\t v1Padded = Join[{ul}, {ul}, v1, {ur}, {ur}]; \n\t\t vNextPadded = \((1 - \(3\/2\) \[Sigma] + \[Sigma]\^2\/2)\) v1Padded + \[Sigma] \((2 - \[Sigma])\)\ RotateRight[v1Padded] + \(\[Sigma]\/2\) \((\[Sigma] - 1)\)\ RotateRight[v1Padded, 2]; \n \t\tv1Next = Take[vNextPadded, {3, Length[vNextPadded] - 2}]; \n\t\t v0Next = Take[v1Padded, {3, Length[v1Padded] - 2}]; \n\t\t Return[{v1Next, v0Next}]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(\(Exercise[xL_, xR_, scheme_, \[CapitalDelta]x_, \ \[Sigma]_, \ nTimeSteps_] := \ Module[{a\ = \ 1, \ nCells\ = \ \((xR\ - \ xL)\)\/\[CapitalDelta]x, \ ue, \ ua, \ lpa}, \ \[IndentingNewLine]ue\ = \ uExact[a, \[Sigma] \( \[CapitalDelta]x\/a\) nTimeSteps, xL, xR]; \ \[IndentingNewLine]ua\ = \ advectionOneDimension[xL, \ xR, Function[x, u0[x]], \ nCells, \ scheme, \ \[Sigma], \ nTimeSteps]; \ \[IndentingNewLine]lpa\ = \ ListPlot[ua, DisplayFunction\ -> \ Identity]; \n\t\t\n\t\t Show[{ue, lpa}, \t\t\tPlotRange -> All, DisplayFunction\ -> \ $DisplayFunction]; \n\t\t]; \)\)], "Input"], Cell[BoxData[ \(xL = \(-1\); xR = 4; \n\[CapitalDelta]x = 1\/60; \)], "Input"], Cell[BoxData[ \(\(scheme = upwind; \)\)], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[ \(\(scheme = laxFriedrichs; \)\)], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\n\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[ \(\(scheme = laxWendroff; \)\)], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"], Cell[BoxData[ \(\(scheme = secondOrderUpwind; \)\)], "Input"], Cell[BoxData[{ \(\[Sigma] = 0.1; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\n\), \(\[Sigma] = 0.5; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\n\), \(\[Sigma] = 0.9; \n Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 50]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 100]\), \(Exercise[xL, xR, scheme, \[CapitalDelta]x, \[Sigma], 200]\)}], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"X 3.0", ScreenRectangle->{{0, 2048}, {0, 768}}, WindowSize->{868, 648}, WindowMargins->{{37, Automatic}, {7, Automatic}} ] (*********************************************************************** 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[CellGroupData[{ Cell[1731, 51, 35, 0, 52, "Section"], Cell[1769, 53, 399, 8, 150, "Input"], Cell[2171, 63, 410, 7, 139, "Input"], Cell[2584, 72, 145, 3, 32, "Text"], Cell[2732, 77, 527, 10, 123, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[3296, 92, 27, 0, 52, "Section"], Cell[CellGroupData[{ Cell[3348, 96, 37, 0, 45, "Subsection"], Cell[3388, 98, 31, 0, 32, "Text"], Cell[3422, 100, 333, 6, 123, "Input"], Cell[3758, 108, 297, 6, 94, "Input"], Cell[4058, 116, 248, 5, 50, "Text"], Cell[4309, 123, 593, 11, 201, "Input"], Cell[4905, 136, 134, 3, 32, "Text"], Cell[5042, 141, 34, 0, 32, "Text"], Cell[5079, 143, 230, 5, 91, "Input"], Cell[5312, 150, 320, 7, 122, "Input"], Cell[5635, 159, 345, 7, 118, "Input"], Cell[5983, 168, 237, 5, 91, "Input"], Cell[6223, 175, 776, 14, 195, "Input"], Cell[7002, 191, 157, 2, 43, "Input"], Cell[7162, 195, 143, 2, 43, "Input"], Cell[7308, 199, 147, 2, 43, "Input"], Cell[7458, 203, 153, 2, 43, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[7660, 211, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[7712, 215, 34, 0, 45, "Subsection"], Cell[7749, 217, 93, 1, 75, "Input"], Cell[7845, 220, 218, 4, 75, "Input"], Cell[8066, 226, 34, 0, 32, "Text"], Cell[8103, 228, 178, 4, 50, "Text"], Cell[8284, 234, 389, 7, 107, "Input"], Cell[8676, 243, 483, 9, 133, "Input"], Cell[9162, 254, 514, 9, 129, "Input"], Cell[9679, 265, 561, 10, 139, "Input"], Cell[10243, 277, 773, 13, 211, "Input"], Cell[11019, 292, 67, 1, 27, "Input"], Cell[11089, 295, 74, 1, 27, "Input"], Cell[11166, 298, 74, 1, 27, "Input"], Cell[11243, 301, 71, 1, 27, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[11351, 307, 34, 0, 29, "Subsection"], Cell[11388, 309, 55, 1, 43, "Input"], Cell[11446, 312, 86, 1, 27, "Input"], Cell[11535, 315, 116, 2, 75, "Input"], Cell[11654, 319, 216, 4, 75, "Input"], Cell[11873, 325, 107, 2, 27, "Input"], Cell[11983, 329, 34, 0, 32, "Text"], Cell[12020, 331, 199, 4, 59, "Input"], Cell[12222, 337, 302, 7, 84, "Input"], Cell[12527, 346, 331, 7, 80, "Input"], Cell[12861, 355, 212, 4, 59, "Input"], Cell[13076, 361, 771, 13, 211, "Input"], Cell[13850, 376, 239, 4, 91, "Input"], Cell[14092, 382, 239, 4, 91, "Input"], Cell[14334, 388, 256, 4, 107, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[14627, 397, 34, 0, 29, "Subsection"], Cell[14664, 399, 233, 5, 75, "Input"], Cell[14900, 406, 211, 4, 75, "Input"], Cell[15114, 412, 103, 2, 27, "Input"], Cell[15220, 416, 34, 0, 32, "Text"], Cell[15257, 418, 178, 4, 50, "Text"], Cell[15438, 424, 581, 10, 139, "Input"], Cell[16022, 436, 773, 13, 211, "Input"], Cell[16798, 451, 184, 3, 75, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[17031, 460, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[17083, 464, 34, 0, 45, "Subsection"], Cell[CellGroupData[{ Cell[17142, 468, 319, 6, 64, "Input"], Cell[17464, 476, 79, 1, 27, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[17592, 483, 34, 0, 29, "Subsection"], Cell[17629, 485, 45, 1, 27, "Input"], Cell[17677, 488, 263, 6, 46, "Input"], Cell[17943, 496, 111, 2, 91, "Input"], Cell[18057, 500, 176, 4, 46, "Input"], Cell[18236, 506, 171, 3, 107, "Input"], Cell[18410, 511, 348, 7, 61, "Input"], Cell[18761, 520, 133, 2, 43, "Input"] }, Closed]] }, Closed]], Cell[CellGroupData[{ Cell[18943, 528, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[18995, 532, 140, 3, 44, "Input"], Cell[19138, 537, 391, 10, 45, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[19578, 553, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[19630, 557, 90, 1, 43, "Input"], Cell[19723, 560, 69, 1, 27, "Output"] }, Open ]], Cell[19807, 564, 244, 5, 64, "Input"], Cell[20054, 571, 43, 1, 27, "Input"], Cell[20100, 574, 165, 4, 50, "Text"] }, Closed]], Cell[CellGroupData[{ Cell[20302, 583, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[20354, 587, 253, 4, 85, "Input"], Cell[20610, 593, 227, 3, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[20874, 601, 144, 3, 43, "Input"], Cell[21021, 606, 79, 1, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21137, 612, 47, 1, 27, "Input"], Cell[21187, 615, 92, 1, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21316, 621, 140, 3, 43, "Input"], Cell[21459, 626, 84, 1, 31, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21580, 632, 48, 1, 27, "Input"], Cell[21631, 635, 124, 2, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[21792, 642, 267, 5, 64, "Input"], Cell[22062, 649, 446, 7, 81, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[22545, 661, 320, 6, 81, "Input"], Cell[22868, 669, 124, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23029, 676, 213, 4, 31, "Input"], Cell[23245, 682, 132, 3, 27, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[23414, 690, 276, 5, 65, "Input"], Cell[23693, 697, 270, 6, 45, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24000, 708, 52, 1, 27, "Input"], Cell[24055, 711, 1011, 16, 225, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25103, 732, 139, 3, 45, "Input"], Cell[25245, 737, 104, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25386, 744, 217, 5, 43, "Input"], Cell[25606, 751, 129, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[25772, 758, 221, 5, 43, "Input"], Cell[25996, 765, 127, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26160, 772, 217, 5, 43, "Input"], Cell[26380, 779, 124, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[26541, 786, 291, 5, 79, "Input"], Cell[26835, 793, 148, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27020, 800, 221, 5, 43, "Input"], Cell[27244, 807, 127, 2, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[27408, 814, 164, 3, 43, "Input"], Cell[27575, 819, 41, 1, 29, "Output"] }, Open ]], Cell[27631, 823, 99, 2, 43, "Input"], Cell[27733, 827, 75, 1, 46, "Input"], Cell[27811, 830, 88, 1, 43, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[27936, 836, 27, 0, 32, "Section"], Cell[27966, 838, 27, 0, 32, "Text"], Cell[CellGroupData[{ Cell[28018, 842, 142, 3, 45, "Input"], Cell[28163, 847, 1054, 30, 45, "Output"] }, Open ]], Cell[29232, 880, 27, 0, 32, "Text"], Cell[CellGroupData[{ Cell[29284, 884, 205, 4, 54, "Input"], Cell[29492, 890, 1047, 30, 47, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[30576, 925, 111, 2, 36, "Input"], Cell[30690, 929, 342, 8, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[31069, 942, 138, 3, 44, "Input"], Cell[31210, 947, 391, 10, 45, "Output"] }, Open ]] }, Closed]], Cell[CellGroupData[{ Cell[31650, 963, 27, 0, 32, "Section"], Cell[CellGroupData[{ Cell[31702, 967, 33, 0, 45, "Subsection"], Cell[31738, 969, 70, 1, 27, "Input"], Cell[31811, 972, 288, 5, 45, "Input"], Cell[32102, 979, 133, 3, 27, "Input"], Cell[32238, 984, 166, 3, 75, "Input"], Cell[32407, 989, 59, 0, 32, "Text"], Cell[32469, 991, 272, 5, 44, "Input"], Cell[32744, 998, 288, 5, 60, "Input"], Cell[33035, 1005, 141, 2, 44, "Input"], Cell[33179, 1009, 149, 3, 27, "Input"], Cell[33331, 1014, 166, 3, 75, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[33534, 1022, 33, 0, 29, "Subsection"], Cell[33570, 1024, 119, 3, 32, "Text"], Cell[33692, 1029, 111, 2, 59, "Input"], Cell[33806, 1033, 230, 4, 75, "Input"], Cell[34039, 1039, 100, 2, 27, "Input"], Cell[34142, 1043, 34, 0, 32, "Text"], Cell[34179, 1045, 325, 6, 50, "Text"], Cell[34507, 1053, 389, 7, 107, "Input"], Cell[34899, 1062, 483, 9, 133, "Input"], Cell[35385, 1073, 514, 9, 129, "Input"], Cell[35902, 1084, 561, 10, 139, "Input"], Cell[36466, 1096, 790, 14, 211, "Input"], Cell[37259, 1112, 91, 1, 79, "Input"], Cell[37353, 1115, 757, 13, 267, "Input"], Cell[38113, 1130, 764, 13, 267, "Input"], Cell[38880, 1145, 762, 13, 267, "Input"], Cell[39645, 1160, 759, 13, 267, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[40441, 1178, 33, 0, 29, "Subsection"], Cell[40477, 1180, 119, 3, 32, "Text"], Cell[40599, 1185, 80, 1, 59, "Input"], Cell[40682, 1188, 214, 4, 59, "Input"], Cell[40899, 1194, 110, 2, 27, "Input"], Cell[41012, 1198, 34, 0, 32, "Text"], Cell[41049, 1200, 325, 6, 50, "Text"], Cell[41377, 1208, 389, 7, 107, "Input"], Cell[41769, 1217, 483, 9, 133, "Input"], Cell[42255, 1228, 514, 9, 129, "Input"], Cell[42772, 1239, 561, 10, 139, "Input"], Cell[43336, 1251, 110, 3, 32, "Text"], Cell[43449, 1256, 641, 10, 151, "Input"], Cell[44093, 1268, 733, 13, 163, "Input"], Cell[44829, 1283, 82, 1, 61, "Input"], Cell[44914, 1286, 54, 1, 27, "Input"], Cell[44971, 1289, 250, 4, 75, "Input"], Cell[45224, 1295, 250, 4, 75, "Input"], Cell[45477, 1301, 250, 4, 75, "Input"], Cell[45730, 1307, 61, 1, 27, "Input"], Cell[45794, 1310, 250, 4, 75, "Input"], Cell[46047, 1316, 250, 4, 75, "Input"], Cell[46300, 1322, 252, 4, 91, "Input"], Cell[46555, 1328, 59, 1, 27, "Input"], Cell[46617, 1331, 250, 4, 75, "Input"], Cell[46870, 1337, 250, 4, 75, "Input"], Cell[47123, 1343, 250, 4, 75, "Input"], Cell[47376, 1349, 65, 1, 27, "Input"], Cell[47444, 1352, 706, 12, 235, "Input"] }, Closed]] }, Open ]] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)