(* 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[ 11177, 319] NotebookOptionsPosition[ 10780, 300] NotebookOutlinePosition[ 11121, 315] CellTagsIndexPosition[ 11078, 312] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{"Fixed", " ", "Point", " ", "Analysis"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", RowBox[{ "v", ",", "w", ",", "k", ",", "n", ",", "f", ",", "t2", ",", "x1", ",", "x2"}], "]"}], "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{"c", "=", "2.7"}], ";"}], FontColor->RGBColor[1, 0, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{ RowBox[{"g", "[", "x_", "]"}], ":=", " ", RowBox[{"c", "*", "x", RowBox[{"(", RowBox[{"1", "-", "x"}], ")"}]}]}], FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[1, 0, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{ RowBox[{"a", "=", "0"}], ";"}], FontColor->RGBColor[1, 0, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{ RowBox[{"b", "=", "1"}], ";"}], FontColor->RGBColor[1, 0, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[1, 0, 0]], StyleBox[ RowBox[{ RowBox[{"x0", "=", ".2"}], ";"}], FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{"tol", "=", RowBox[{"5", "*", SuperscriptBox["10", RowBox[{"-", "8"}]]}]}], ";"}], FontColor->RGBColor[1, 0, 0]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[1, 0, 0]], "\[IndentingNewLine]", "\[IndentingNewLine]", StyleBox[ RowBox[{ RowBox[{"x0", ">>", "v"}], ";"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"x1", "=", RowBox[{"g", "[", "x0", "]"}]}], ";"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"x1", ">>>", "v"}], ";"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{ RowBox[{"n", "=", "1"}], ";"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"x1", "-", "x0"}], "]"}], "\[GreaterEqual]", " ", "tol"}], "\[And]", RowBox[{"n", "\[LessEqual]", " ", "50"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", "x1"}], ";", "\[IndentingNewLine]", RowBox[{"x1", "=", RowBox[{"g", "[", "x0", "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"x1", ">>>", "v"}], ";", "\[IndentingNewLine]", RowBox[{"n", "=", RowBox[{"n", "+", "1"}]}], ";"}]}], "]"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "n"}], "]"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "x1"}], "]"}], FontColor->RGBColor[0, 0, 1]], StyleBox["\[IndentingNewLine]", FontColor->RGBColor[0, 0, 1]], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"w", "=", RowBox[{"ReadList", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"L0", "=", RowBox[{"Show", "[", RowBox[{"Graphics", "[", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], ",", RowBox[{"g", "[", RowBox[{"w", "[", RowBox[{"[", "1", "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}], ",", RowBox[{"w", "[", RowBox[{"[", "2", "]"}], "]"}]}], "}"}]}], "}"}], "]"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p1", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"g", "[", "x", "]"}], ",", "x"}], "}"}], ",", RowBox[{"{", RowBox[{"x", ",", "a", ",", "b"}], "}"}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"t2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "0"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Animate", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"p4", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"t2", "[", RowBox[{"[", "k", "]"}], "]"}], ",", RowBox[{"PlotRange", "\[Rule]", " ", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "1.2"}], ",", "2.2"}], "}"}]}], "}"}]}], ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"Hue", "[", "1", "]"}], ",", RowBox[{"PointSize", "[", "0.02", "]"}]}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"p3", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Show", "[", RowBox[{"Graphics", "[", RowBox[{"Line", "[", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", RowBox[{"j", "-", "1"}], "]"}], "]"}], ",", RowBox[{"w", "[", RowBox[{"[", RowBox[{"j", "-", "1"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", RowBox[{"j", "-", "1"}], "]"}], "]"}], ",", RowBox[{"g", "[", RowBox[{"w", "[", RowBox[{"[", RowBox[{"j", "-", "1"}], "]"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{"w", "[", RowBox[{"[", "j", "]"}], "]"}]}], "}"}]}], "}"}], "]"}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"j", ",", "3", ",", "k", ",", "1"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"p1", ",", "p3", ",", "p4", ",", "L0"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"k", ",", "3", ",", "n", ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.442752493834536*^9, 3.442752564199211*^9}, 3.442752608280129*^9, {3.442752665601396*^9, 3.4427527968647957`*^9}, 3.442752930552734*^9, {3.442753020089971*^9, 3.4427530387299557`*^9}, { 3.442753130431561*^9, 3.44275315981361*^9}, {3.442753203430862*^9, 3.4427532036210403`*^9}, {3.442753243742597*^9, 3.442753305256959*^9}, { 3.442755052773652*^9, 3.4427550703181267`*^9}, 3.442755104542609*^9, { 3.442755150904399*^9, 3.4427552643145227`*^9}, {3.4433522180161657`*^9, 3.4433523234553013`*^9}, {3.443352448406138*^9, 3.44335258730967*^9}, { 3.4433526197282543`*^9, 3.443352623990611*^9}, {3.4433526629045773`*^9, 3.44335271529388*^9}, {3.443352784658503*^9, 3.443352841694107*^9}, 3.443352928790292*^9, {3.4433529809009037`*^9, 3.443352987074216*^9}, { 3.443353037104721*^9, 3.4433530373107986`*^9}, 3.443353085941366*^9, { 3.443353134299061*^9, 3.443353176301547*^9}, {3.44335322193039*^9, 3.443353223843508*^9}, {3.443353264254973*^9, 3.443353285735928*^9}, { 3.443353324424127*^9, 3.4433533529116983`*^9}, {3.443353401040677*^9, 3.443353442583837*^9}, {3.443353483503604*^9, 3.4433534892770653`*^9}, { 3.4433581870399637`*^9, 3.443358206789584*^9}, 3.443359013884678*^9, { 3.505655690107974*^9, 3.505655787708686*^9}, {3.5056558874635153`*^9, 3.505655943454534*^9}, {3.505656137141509*^9, 3.505656144497984*^9}, { 3.505656185483706*^9, 3.505656236441625*^9}, {3.5056563198459682`*^9, 3.505656350425899*^9}, {3.505656408893716*^9, 3.5056564091183987`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ FormBox[ InterpretationBox[ RowBox[{"\<\"Iterations=\"\>", "\[InvisibleSpace]", "43"}], SequenceForm["Iterations=", 43], Editable->False], TraditionalForm]], "Print", CellChangeTimes->{ 3.5056561864097548`*^9, {3.505656218361174*^9, 3.505656236854589*^9}, { 3.505656321360107*^9, 3.50565635069948*^9}, 3.505656433716851*^9}], Cell[BoxData[ FormBox[ InterpretationBox[ RowBox[{"\<\"Approximate fixed point = \"\>", "\[InvisibleSpace]", "0.6296296143184611`"}], SequenceForm["Approximate fixed point = ", 0.6296296143184611], Editable->False], TraditionalForm]], "Print", CellChangeTimes->{ 3.5056561864097548`*^9, {3.505656218361174*^9, 3.505656236854589*^9}, { 3.505656321360107*^9, 3.50565635069948*^9}, 3.505656433725608*^9}] }, Open ]] }, Open ]] }, WindowSize->{640, 750}, WindowMargins->{{Automatic, 467}, {Automatic, 91}}, FrontEndVersion->"7.0 for Mac OS X x86 (32-bit) (November 10, 2008)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[567, 22, 9377, 251, 1097, "Input"], Cell[CellGroupData[{ Cell[9969, 277, 356, 8, 24, "Print"], Cell[10328, 287, 424, 9, 24, "Print"] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)