diff --git a/Lectures_my/NumMet/2016/Lecture10/bessel.nb b/Lectures_my/NumMet/2016/Lecture10/bessel.nb index d8a3818..68354fe 100644 --- a/Lectures_my/NumMet/2016/Lecture10/bessel.nb +++ b/Lectures_my/NumMet/2016/Lecture10/bessel.nb @@ -10,10 +10,10 @@ NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] -NotebookDataLength[ 34265, 816] -NotebookOptionsPosition[ 33004, 768] -NotebookOutlinePosition[ 33341, 783] -CellTagsIndexPosition[ 33298, 780] +NotebookDataLength[ 39725, 969] +NotebookOptionsPosition[ 38125, 909] +NotebookOutlinePosition[ 38460, 924] +CellTagsIndexPosition[ 38417, 921] WindowFrame->Normal*) (* Beginning of Notebook Content *) @@ -29,7 +29,8 @@ RowBox[{"BesselJ", "[", RowBox[{"1", ",", "x"}], "]"}]], "Output", CellChangeTimes->{ - 3.6879511299603863`*^9, {3.687952885427848*^9, 3.687952897510394*^9}}] + 3.6879511299603863`*^9, {3.687952885427848*^9, 3.687952897510394*^9}, + 3.6880962693042727`*^9}] }, Open ]], Cell[CellGroupData[{ @@ -52,7 +53,8 @@ RowBox[{"BesselJ", "[", RowBox[{"2", ",", "x"}], "]"}]}], ")"}]}]], "Output", CellChangeTimes->{ - 3.6879513307406588`*^9, {3.687952882162366*^9, 3.68795289760646*^9}}] + 3.6879513307406588`*^9, {3.687952882162366*^9, 3.68795289760646*^9}, + 3.6880962694577637`*^9}] }, Open ]], Cell[CellGroupData[{ @@ -85,7 +87,7 @@ Cell[BoxData["0.`"], "Output", CellChangeTimes->{{3.6879512129131317`*^9, 3.6879512398981333`*^9}, { - 3.687952879441258*^9, 3.687952897673266*^9}}] + 3.687952879441258*^9, 3.687952897673266*^9}, 3.688096269524742*^9}] }, Open ]], Cell[CellGroupData[{ @@ -145,7 +147,7 @@ Function[BoxForm`e$, TableForm[BoxForm`e$]]]], "Output", CellChangeTimes->{{3.687951293721142*^9, 3.687951349903165*^9}, - 3.687952897700285*^9}] + 3.687952897700285*^9, 3.6880962695947113`*^9}] }, Open ]], Cell[CellGroupData[{ @@ -308,7 +310,8 @@ Scaled[0.05], Scaled[0.05]}}, Ticks->{Automatic, Automatic}]], "Output", - CellChangeTimes->{3.687951519211877*^9, 3.6879528977846212`*^9}] + CellChangeTimes->{3.687951519211877*^9, 3.6879528977846212`*^9, + 3.6880962698158503`*^9}] }, Open ]], Cell[CellGroupData[{ @@ -378,7 +381,8 @@ RowBox[{ SuperscriptBox["h", "2"], " ", SuperscriptBox["x", "2"]}]}]]}]}]}], "}"}], "}"}]], "Output", - CellChangeTimes->{3.68795262166017*^9, 3.68795289781152*^9}] + CellChangeTimes->{3.68795262166017*^9, 3.68795289781152*^9, + 3.688096269923039*^9}] }, Open ]], Cell[BoxData[ @@ -439,17 +443,17 @@ Cell[BoxData[{ RowBox[{ - RowBox[{"x", " ", "=", " ", + RowBox[{"xv", " ", "=", " ", RowBox[{"{", "1", "}"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ - RowBox[{"z", " ", "=", " ", + RowBox[{"zv", " ", "=", " ", RowBox[{"{", RowBox[{"{", RowBox[{"0.44005058574493355`", ",", "0.32514710081303305`"}], "}"}], "}"}]}], ";"}]}], "Input", CellChangeTimes->{{3.687952819885274*^9, 3.687952867466277*^9}, { 3.687952936314144*^9, 3.687952943521549*^9}, {3.687953115720479*^9, - 3.6879531173360987`*^9}}], + 3.6879531173360987`*^9}, {3.688096393658708*^9, 3.688096395027461*^9}}], Cell[BoxData[ RowBox[{ @@ -461,27 +465,28 @@ RowBox[{ RowBox[{ RowBox[{"AppendTo", "[", - RowBox[{"z", ",", " ", + RowBox[{"zv", ",", " ", RowBox[{"Evaluate", "[", RowBox[{"next", "[", RowBox[{ - RowBox[{"z", "[", + RowBox[{"zv", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], ",", " ", - RowBox[{"x", "[", + RowBox[{"xv", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], ",", " ", "h"}], "]"}], "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"AppendTo", "[", - RowBox[{"x", ",", " ", + RowBox[{"xv", ",", " ", RowBox[{ - RowBox[{"x", "[", + RowBox[{"xv", "[", RowBox[{"[", RowBox[{"-", "1"}], "]"}], "]"}], " ", "+", " ", "h"}]}], "]"}]}], ",", "\[IndentingNewLine]", "20"}], "\[IndentingNewLine]", "]"}]], "Input",\ CellChangeTimes->{{3.687952951550411*^9, 3.687952998700535*^9}, { - 3.687953031128552*^9, 3.6879530947921257`*^9}}], + 3.687953031128552*^9, 3.6879530947921257`*^9}, {3.688096398887005*^9, + 3.688096405793003*^9}}], Cell[CellGroupData[{ @@ -508,9 +513,9 @@ RowBox[{ RowBox[{"{", RowBox[{ - RowBox[{"x", "[", + RowBox[{"xv", "[", RowBox[{"[", "i", "]"}], "]"}], ",", " ", - RowBox[{"z", "[", + RowBox[{"zv", "[", RowBox[{"[", RowBox[{"i", ",", " ", "1"}], "]"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", @@ -524,9 +529,9 @@ RowBox[{ RowBox[{"{", RowBox[{ - RowBox[{"x", "[", + RowBox[{"xv", "[", RowBox[{"[", "i", "]"}], "]"}], ",", " ", - RowBox[{"z", "[", + RowBox[{"zv", "[", RowBox[{"[", RowBox[{"i", ",", " ", "2"}], "]"}], "]"}]}], "}"}], ",", " ", RowBox[{"{", @@ -535,7 +540,8 @@ RowBox[{"PlotStyle", " ", "\[Rule]", " ", "Red"}]}], "\[IndentingNewLine]", "]"}]}], "\[IndentingNewLine]", "]"}]], "Input", CellChangeTimes->{{3.687953151463984*^9, 3.687953187447447*^9}, { - 3.687953219177075*^9, 3.6879532547988777`*^9}}], + 3.687953219177075*^9, 3.6879532547988777`*^9}, {3.6880964183986797`*^9, + 3.6880964264261427`*^9}}], Cell[BoxData[ GraphicsBox[{{{}, {}, @@ -700,7 +706,8 @@ Ticks->{Automatic, Automatic}]], "Output", CellChangeTimes->{ 3.687953146432378*^9, 3.687953187966303*^9, 3.687953219983635*^9, { - 3.687953251654253*^9, 3.687953255151575*^9}}] + 3.687953251654253*^9, 3.687953255151575*^9}, 3.688096270324798*^9, + 3.688096430646126*^9}] }, Open ]], Cell[CellGroupData[{ @@ -711,19 +718,20 @@ RowBox[{ RowBox[{"{", RowBox[{ - RowBox[{"x", "[", + RowBox[{"xv", "[", RowBox[{"[", "i", "]"}], "]"}], ",", " ", - RowBox[{"z", "[", + RowBox[{"zv", "[", RowBox[{"[", RowBox[{"i", ",", " ", "1"}], "]"}], "]"}], ",", " ", - RowBox[{"z", "[", + RowBox[{"zv", "[", RowBox[{"[", RowBox[{"i", ",", " ", "2"}], "]"}], "]"}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"i", ",", " ", "1", ",", " ", "20"}], "}"}]}], "\[IndentingNewLine]", "]"}], " ", "//", " ", "TableForm"}]], "Input", - CellChangeTimes->{{3.687953282490951*^9, 3.6879533023903112`*^9}}], + CellChangeTimes->{{3.687953282490951*^9, 3.6879533023903112`*^9}, { + 3.688096436313034*^9, 3.68809643970492*^9}}], Cell[BoxData[ TagBox[GridBox[{ @@ -763,11 +771,144 @@ Offset[0.2]}, "RowsIndexed" -> {}}], Function[BoxForm`e$, TableForm[BoxForm`e$]]]], "Output", - CellChangeTimes->{{3.687953298055676*^9, 3.68795330274361*^9}}] + CellChangeTimes->{{3.687953298055676*^9, 3.68795330274361*^9}, + 3.6880962705620747`*^9, 3.688096440033141*^9}] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"0.44051", " ", "/", " ", + RowBox[{"-", "0.781213"}]}], ")"}], " ", + RowBox[{"BesselY", "[", + RowBox[{"1", ",", " ", "1"}], "]"}]}], " ", "//", " ", "N"}]], "Input", + CellChangeTimes->{{3.688096283121851*^9, 3.6880963427830563`*^9}}], + +Cell[BoxData["0.4405098992348951`"], "Output", + CellChangeTimes->{{3.688096296808793*^9, 3.6880962999412107`*^9}, + 3.688096343042938*^9}] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"dBesselY1", " ", "=", " ", + RowBox[{"D", "[", + RowBox[{ + RowBox[{"BesselY", "[", + RowBox[{"1", ",", " ", "x"}], "]"}], ",", " ", "x"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"0.44051", " ", "/", " ", + RowBox[{"-", "0.781213"}]}], ")"}], " ", "%"}], " ", "//.", " ", + RowBox[{"x", " ", "\[Rule]", " ", "1"}]}], " ", "//", " ", "N"}]}], "Input",\ + + CellChangeTimes->{{3.6880963488655243`*^9, 3.688096376037588*^9}, { + 3.688096458710487*^9, 3.688096472498193*^9}, {3.6880965816590633`*^9, + 3.688096584528266*^9}}], + +Cell[BoxData[ + RowBox[{"-", "0.4902761925590563`"}]], "Output", + CellChangeTimes->{{3.688096358302816*^9, 3.688096376305706*^9}, { + 3.688096451237818*^9, 3.6880964735801697`*^9}, 3.688096586179656*^9}] +}, Open ]], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"Table", "[", "\[IndentingNewLine]", + RowBox[{ + RowBox[{"{", + RowBox[{"x", ",", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"0.44051", " ", "/", " ", + RowBox[{"-", "0.781213"}]}], ")"}], + RowBox[{"BesselY", "[", + RowBox[{"1", ",", " ", "x"}], "]"}]}], ",", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"0.44051", " ", "/", " ", + RowBox[{"-", "0.781213"}]}], ")"}], "dBesselY1"}]}], "}"}], ",", + "\[IndentingNewLine]", + RowBox[{"{", + RowBox[{"x", ",", " ", "1", ",", " ", "2", ",", " ", "0.05"}], "}"}]}], + "\[IndentingNewLine]", "]"}], " ", "//", " ", "TableForm"}]], "Input", + CellChangeTimes->{{3.687951256849247*^9, 3.687951349621264*^9}, { + 3.688096576891368*^9, 3.688096601391418*^9}}], + +Cell[BoxData[ + TagBox[GridBox[{ + {"1.`", "0.4405098992348951`", + RowBox[{"-", "0.4902761925590563`"}]}, + {"1.05`", "0.4165722418543332`", + RowBox[{"-", "0.46792416184695335`"}]}, + {"1.1`", "0.3936553121945078`", + RowBox[{"-", "0.44930897228105887`"}]}, + {"1.15`", "0.37159146668466003`", + RowBox[{"-", "0.4336914390067379`"}]}, + {"1.2`", "0.35024607455734225`", + RowBox[{"-", "0.4204833417722396`"}]}, + {"1.25`", "0.3295109039010836`", + RowBox[{"-", "0.4092119136667375`"}]}, + {"1.3`", "0.309299034007155`", + RowBox[{"-", "0.3994937493107006`"}]}, + {"1.35`", "0.28954089612251704`", + RowBox[{"-", "0.39101538614739567`"}]}, + {"1.4`", "0.2701811588123735`", + RowBox[{"-", "0.38351868058717653`"}]}, + {"1.45`", "0.25117625273849076`", + RowBox[{"-", "0.3767896744962259`"}]}, + {"1.5`", "0.23249238462273106`", + RowBox[{"-", "0.37065003304818167`"}]}, + {"1.55`", "0.21410392912845047`", + RowBox[{"-", "0.3649503980003679`"}]}, + {"1.6`", "0.1959921153653018`", + RowBox[{"-", "0.35956518248307073`"}]}, + {"1.65`", "0.1781439450429483`", + RowBox[{"-", "0.354388461014997`"}]}, + {"1.7000000000000002`", "0.1605512942221554`", + RowBox[{"-", "0.34933069903748687`"}]}, + {"1.75`", "0.14321016168340858`", + RowBox[{"-", "0.34431613128255356`"}]}, + {"1.8`", "0.12612003522612755`", + RowBox[{"-", "0.33928064546528164`"}]}, + {"1.85`", "0.10928335347877638`", + RowBox[{"-", "0.3341700623609435`"}]}, + {"1.9`", "0.09270504557629103`", + RowBox[{"-", "0.32893872889794035`"}]}, + {"1.9500000000000002`", "0.07639213472975706`", + RowBox[{"-", "0.32354835997934156`"}]}, + {"2.`", "0.06035339455193191`", + RowBox[{"-", "0.31796707910389155`"}]} + }, + GridBoxAlignment->{ + "Columns" -> {{Left}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, + "RowsIndexed" -> {}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[2.0999999999999996`]}, + Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { + Offset[0.2], { + Offset[0.4]}, + Offset[0.2]}, "RowsIndexed" -> {}}], + Function[BoxForm`e$, + TableForm[BoxForm`e$]]]], "Output", + CellChangeTimes->{{3.687951293721142*^9, 3.687951349903165*^9}, + 3.687952897700285*^9, 3.6880962695947113`*^9, {3.6880965905617533`*^9, + 3.688096601940598*^9}}] }, Open ]] }, -WindowSize->{1054, 1179}, -WindowMargins->{{0, Automatic}, {Automatic, 19}}, +WindowSize->{958, 1059}, +WindowMargins->{{0, Automatic}, {2, Automatic}}, FrontEndVersion->"10.3 for Linux x86 (64-bit) (October 9, 2015)", StyleDefinitions->"Default.nb" ] @@ -784,39 +925,51 @@ Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 156, 3, 32, "Input"], -Cell[739, 27, 177, 4, 32, "Output"] +Cell[739, 27, 205, 5, 32, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[953, 36, 257, 6, 32, "Input"], -Cell[1213, 44, 334, 10, 49, "Output"] +Cell[981, 37, 257, 6, 32, "Input"], +Cell[1241, 45, 362, 11, 49, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[1584, 59, 800, 24, 32, "Input"], -Cell[2387, 85, 149, 2, 32, "Output"] +Cell[1640, 61, 800, 24, 32, "Input"], +Cell[2443, 87, 172, 2, 32, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[2573, 92, 507, 12, 99, "Input"], -Cell[3083, 106, 2002, 41, 383, "Output"] +Cell[2652, 94, 507, 12, 99, "Input"], +Cell[3162, 108, 2026, 41, 383, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[5122, 152, 568, 15, 121, "Input"], -Cell[5693, 169, 7786, 141, 230, "Output"] +Cell[5225, 154, 568, 15, 121, "Input"], +Cell[5796, 171, 7813, 142, 230, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[13516, 315, 979, 25, 165, "Input"], -Cell[14498, 342, 1245, 38, 54, "Output"] +Cell[13646, 318, 979, 25, 165, "Input"], +Cell[14628, 345, 1270, 39, 54, "Output"] }, Open ]], -Cell[15758, 383, 1968, 54, 198, "Input"], -Cell[17729, 439, 465, 12, 55, "Input"], -Cell[18197, 453, 145, 3, 32, "Input"], -Cell[18345, 458, 894, 25, 121, "Input"], +Cell[15913, 387, 1968, 54, 198, "Input"], +Cell[17884, 443, 513, 12, 55, "Input"], +Cell[18400, 457, 145, 3, 32, "Input"], +Cell[18548, 462, 948, 26, 121, "Input"], Cell[CellGroupData[{ -Cell[19264, 487, 1941, 50, 341, "Input"], -Cell[21208, 539, 8977, 163, 230, "Output"] +Cell[19521, 492, 1998, 51, 341, "Input"], +Cell[21522, 545, 9025, 164, 230, "Output"] }, Open ]], Cell[CellGroupData[{ -Cell[30222, 707, 661, 18, 99, "Input"], -Cell[30886, 727, 2102, 38, 366, "Output"] +Cell[30584, 714, 712, 19, 99, "Input"], +Cell[31299, 735, 2152, 39, 366, "Output"] +}, Open ]], +Cell[CellGroupData[{ +Cell[33488, 779, 309, 8, 32, "Input"], +Cell[33800, 789, 140, 2, 32, "Output"] +}, Open ]], +Cell[CellGroupData[{ +Cell[33977, 796, 644, 18, 55, "Input"], +Cell[34624, 816, 203, 3, 32, "Output"] +}, Open ]], +Cell[CellGroupData[{ +Cell[34864, 824, 812, 21, 99, "Input"], +Cell[35679, 847, 2430, 59, 383, "Output"] }, Open ]] } ] diff --git a/Lectures_my/NumMet/2016/Lecture10/lecture10.tex b/Lectures_my/NumMet/2016/Lecture10/lecture10.tex index 2d4ac99..b8aa404 100644 --- a/Lectures_my/NumMet/2016/Lecture10/lecture10.tex +++ b/Lectures_my/NumMet/2016/Lecture10/lecture10.tex @@ -236,6 +236,30 @@ }{\BesselJtable} \pgfplotstableread{ +1. 0.44051 -0.490276 +1.05 0.416572 -0.467924 +1.1 0.393655 -0.449309 +1.15 0.371591 -0.433691 +1.2 0.350246 -0.420483 +1.25 0.329511 -0.409212 +1.3 0.309299 -0.399494 +1.35 0.289541 -0.391015 +1.4 0.270181 -0.383519 +1.45 0.251176 -0.37679 +1.5 0.232492 -0.37065 +1.55 0.214104 -0.36495 +1.6 0.195992 -0.359565 +1.65 0.178144 -0.354388 +1.7 0.160551 -0.349331 +1.75 0.14321 -0.344316 +1.8 0.12612 -0.339281 +1.85 0.109283 -0.33417 +1.9 0.092705 -0.328939 +1.95 0.0763921 -0.323548 +2. 0.0603534 -0.317967 +}{\BesselYtable} + +\pgfplotstableread{ 1 0.440051 0.325147 1.05 0.455468 0.308347 1.1 0.47002 0.291039 @@ -266,21 +290,24 @@ \only<1>{ x^2 y'' + x y' + (x^2 - \nu^2) y = 0 } - \only<2>{ + \only<2->{ y'' = -\frac{1}{x} y' - \left(1 - \frac{\nu^2}{x^2}\right) y } \end{equation*} \end{overlayarea} + \begin{overlayarea}{\textwidth}{.8\textwidth} \begin{columns} \begin{column}{.7\textwidth} + \only<2->{ \resizebox{\textwidth}{!}{ \begin{tikzpicture} \begin{axis}[% axis x line=center, axis y line=left, - ymin=-0.25,ymax=+0.65, + ymin=-0.50,ymax=+0.65, xmin=+1.00,xmax=+2.00 ] + % Bessel J \addplot+[ ultra thick, mark=none, @@ -315,11 +342,34 @@ x index=0, y index=2 ] {\numBesselJtable}; + % BesselY1 * (0.44051 / -0.781213) + \only<3>{ + \addplot+[ + ultra thick, + dashed, + mark=none, + color=blue, + ] table [ + x index=0, + y index=1 + ] {\BesselYtable}; + \addplot+[ + ultra thick, + dashed, + mark=none, + color=red, + ] table [ + x index=0, + y index=2 + ] {\BesselYtable}; + } \end{axis} \end{tikzpicture} } + } \end{column} \begin{column}{.3\textwidth} + \only<2>{ \begin{block}{IVP} \begin{align*} y(1) & = 0.44051 \\ @@ -329,8 +379,21 @@ \bigskip Using implicit Euler method! \end{block} + } + \only<3>{ + \begin{block}{IVP (dashed)} + \begin{align*} + y(1) & = 0.44051 \\ + y'(1) & = -0.490276 + \end{align*} + step size: $h = 0.05$\\ + \bigskip + Using implicit Euler method! + \end{block} + } \end{column} \end{columns} + \end{overlayarea} \end{frame} \begin{frame}{Boundary Value Problem and the Shooting Method}