(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 11190, 299] NotebookOptionsPosition[ 10439, 280] NotebookOutlinePosition[ 10862, 297] CellTagsIndexPosition[ 10819, 294] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{"ClearAll", "[", "\"\\"", "]"}]], "Input", CellLabel->"In[1]:=",ExpressionUUID->"ce652c00-1bc9-47e0-8fe0-0730b767abf5"], Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{ SubscriptBox["u", "1"], "[", "s_", "]"}], ":=", "0"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"NN", "=", "50"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"dt", "=", "0.1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Beta]", "=", "5"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"\[Nu]", "=", ".5"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ SubscriptBox["\[Phi]", "0"], "=", RowBox[{"\[Pi]", "/", "4"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", RowBox[{"i", "\[LessEqual]", "NN"}], ",", RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ SubscriptBox["Sol", "i"], "=", RowBox[{ RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{"Sin", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"y", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{"Cos", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"y", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"\[Phi]", "[", "0", "]"}], "\[Equal]", SubscriptBox["\[Phi]", "0"]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"x", "[", "s", "]"}], ",", RowBox[{"y", "[", "s", "]"}], ",", RowBox[{"\[Phi]", "[", "s", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ SubscriptBox["u", RowBox[{"i", "+", "1"}]], "=", RowBox[{"FunctionInterpolation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}], "-", RowBox[{"dt", "*", RowBox[{"(", RowBox[{ RowBox[{"\[Beta]", "*", RowBox[{"Sin", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], "+", RowBox[{"\[Nu]", " ", RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}]}]}], ")"}]}]}], "/.", SubscriptBox["Sol", "i"]}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}]}], "]"}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "Input", CellChangeTimes->{{3.736252814879816*^9, 3.736252951154855*^9}, { 3.736252982924046*^9, 3.736253090033083*^9}, {3.736253271938836*^9, 3.736253282713636*^9}, {3.7362533305192537`*^9, 3.736253331723877*^9}, { 3.736253394912327*^9, 3.73625344270321*^9}, {3.73625348631996*^9, 3.7362534929775543`*^9}, {3.736253717780077*^9, 3.736253737464397*^9}, { 3.73685761414143*^9, 3.736857760056992*^9}, {3.736857793998076*^9, 3.736857840388*^9}, {3.7368581691634703`*^9, 3.7368582027458344`*^9}, 3.736862447293046*^9, {3.789370883071252*^9, 3.7893709578590527`*^9}, { 3.789370994019388*^9, 3.7893710452972727`*^9}}, CellLabel->"In[2]:=",ExpressionUUID->"5a9611e2-a180-41b8-8345-008761a85b73"], Cell["Plotting", "Text", CellChangeTimes->{{3.7362536511981564`*^9, 3.736253652187052*^9}, { 3.736253721471498*^9, 3.736253721649144*^9}, {3.736253766106793*^9, 3.7362537674574223`*^9}},ExpressionUUID->"9b27fc41-3333-4cf8-8aae-\ d5d0bc3ae8c8"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"ParametricPlot", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"x", "[", "s", "]"}], ",", RowBox[{"y", "[", "s", "]"}]}], "}"}], "/.", SubscriptBox["Sol", "i"]}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], "}"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"NN", "-", "1"}], ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.736253130951168*^9, 3.736253131231526*^9}, { 3.736253342846322*^9, 3.7362533503605633`*^9}, {3.736253385766016*^9, 3.7362533859097033`*^9}, {3.736253424712537*^9, 3.736253432755269*^9}, { 3.736253465112898*^9, 3.736253467596678*^9}, {3.736857688900659*^9, 3.73685768916431*^9}}, CellLabel->"In[9]:=",ExpressionUUID->"47b3c577-2996-448b-b13d-14e11263a666"], Cell[BoxData[ RowBox[{"Manipulate", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ SubscriptBox["u", "1"], "[", "s_", "]"}], ":=", "0"}], ";", "\[IndentingNewLine]", RowBox[{"NN", "=", "50"}], ";", "\[IndentingNewLine]", RowBox[{"dt", "=", "0.1"}], ";", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"\[Beta]", "=", "5"}], ";", "\[IndentingNewLine]", RowBox[{"\[Nu]", "=", ".5"}], ";"}], "*)"}], "\[IndentingNewLine]", RowBox[{ SubscriptBox["\[Phi]", "0"], "=", RowBox[{"\[Pi]", "/", "4"}]}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", RowBox[{"i", "\[LessEqual]", "NN"}], ",", RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ SubscriptBox["Sol", "i"], "=", RowBox[{ RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"x", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{"Sin", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"y", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{"Cos", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"\[Phi]", "'"}], "[", "s", "]"}], "\[Equal]", RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"y", "[", "0", "]"}], "\[Equal]", "0"}], ",", RowBox[{ RowBox[{"\[Phi]", "[", "0", "]"}], "\[Equal]", SubscriptBox["\[Phi]", "0"]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{"x", "[", "s", "]"}], ",", RowBox[{"y", "[", "s", "]"}], ",", RowBox[{"\[Phi]", "[", "s", "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}]}], "]"}], "[", RowBox[{"[", "1", "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ SubscriptBox["u", RowBox[{"i", "+", "1"}]], "=", RowBox[{"FunctionInterpolation", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}], "-", RowBox[{"dt", "*", RowBox[{"(", RowBox[{ RowBox[{"\[Beta]", "*", RowBox[{"Sin", "[", RowBox[{"\[Phi]", "[", "s", "]"}], "]"}]}], "+", RowBox[{"\[Nu]", " ", RowBox[{ SubscriptBox["u", "i"], "[", "s", "]"}]}]}], ")"}]}]}], "/.", SubscriptBox["Sol", "i"]}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}]}], "]"}]}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"ParametricPlot", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"x", "[", "s", "]"}], ",", RowBox[{"y", "[", "s", "]"}]}], "}"}], "/.", SubscriptBox["Sol", "k"]}], ",", RowBox[{"{", RowBox[{"s", ",", "0", ",", "2"}], "}"}], ",", RowBox[{"PlotRange", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "2"}], "}"}]}], "}"}]}]}], "]"}]}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Beta]", ",", "5"}], "}"}], ",", "1", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"\[Nu]", ",", ".5"}], "}"}], ",", "0", ",", "2"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{"NN", "-", "1"}], ",", "1"}], "}"}]}], "]"}]], "Input", CellChangeTimes->{{3.828672497228325*^9, 3.828672551972447*^9}, { 3.828672582933967*^9, 3.828672585522868*^9}, {3.828672654813384*^9, 3.828672661078679*^9}}, CellLabel->"In[12]:=",ExpressionUUID->"8c912ba8-b847-4a81-8d31-e8b23c6c1a64"] }, WindowSize->{808, 911}, WindowMargins->{{28, Automatic}, {Automatic, 0}}, Magnification:>1.25 Inherited, FrontEndVersion->"12.1 for Mac OS X x86 (64-bit) (June 19, 2020)", StyleDefinitions->"Default.nb", ExpressionUUID->"38c61aca-87f2-4bc3-9d24-ca996d6b9b90" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[558, 20, 154, 2, 37, "Input",ExpressionUUID->"ce652c00-1bc9-47e0-8fe0-0730b767abf5"], Cell[715, 24, 3826, 97, 428, "Input",ExpressionUUID->"5a9611e2-a180-41b8-8345-008761a85b73"], Cell[4544, 123, 249, 4, 44, "Text",ExpressionUUID->"9b27fc41-3333-4cf8-8aae-d5d0bc3ae8c8"], Cell[4796, 129, 1128, 29, 64, "Input",ExpressionUUID->"47b3c577-2996-448b-b13d-14e11263a666"], Cell[5927, 160, 4508, 118, 506, "Input",ExpressionUUID->"8c912ba8-b847-4a81-8d31-e8b23c6c1a64"] } ] *)