(* 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[ 25943, 716] NotebookOptionsPosition[ 25050, 680] NotebookOutlinePosition[ 25388, 695] CellTagsIndexPosition[ 25345, 692] WindowFrame->Normal ContainsDynamic->True *) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Clear", "[", RowBox[{"a", ",", "f", ",", "b", ",", "c", ",", "n"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", " ", RowBox[{"1", "-", "x", "+", RowBox[{"Sin", "[", "x", "]"}]}]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"a", "[", "0", "]"}], "=", " ", "0.0"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"b", "[", "0", "]"}], "=", " ", "Pi"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "0"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"c", "[", "0", "]"}], "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"a", "[", "0", "]"}], "+", RowBox[{"b", "[", "0", "]"}]}], ")"}], "/", "2"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{ RowBox[{"a", "[", "n", "]"}], "-", RowBox[{"b", "[", "n", "]"}]}], "]"}], "\[GreaterEqual]", RowBox[{"(", RowBox[{"5", "*", RowBox[{"10", "^", RowBox[{"(", RowBox[{"-", "8"}], ")"}]}]}], ")"}]}], "\[And]", RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"a", "[", "n", "]"}], "]"}], "*", RowBox[{"f", "[", RowBox[{"b", "[", "n", "]"}], "]"}]}], "<", "0"}], "\[And]", RowBox[{"n", "\[LessEqual]", "50"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"a", "[", "n", "]"}], "]"}], "*", RowBox[{"f", "[", RowBox[{"c", "[", "n", "]"}], "]"}]}], "<", "0"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"b", "[", RowBox[{"n", "+", "1"}], "]"}], "=", RowBox[{"c", "[", "n", "]"}]}], ",", " ", RowBox[{ RowBox[{"a", "[", RowBox[{"n", "+", "1"}], "]"}], "=", RowBox[{"a", "[", "n", "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"a", "[", RowBox[{"n", "+", "1"}], "]"}], "=", RowBox[{"c", "[", "n", "]"}]}], ",", RowBox[{ RowBox[{"b", "[", RowBox[{"n", "+", "1"}], "]"}], "=", RowBox[{"b", "[", "n", "]"}]}]}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"c", "[", RowBox[{"n", "+", "1"}], "]"}], "=", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"a", "[", RowBox[{"n", "+", "1"}], "]"}], "+", RowBox[{"b", "[", RowBox[{"n", "+", "1"}], "]"}]}], ")"}], "/", "2"}]}], ";", "\[IndentingNewLine]", RowBox[{"n", "=", RowBox[{"n", "+", "1"}]}]}]}], "]"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "n"}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"c", "[", "n", "]"}]}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p1", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"t1", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"c", "[", "k", "]"}], ",", "0"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"p2", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"t1", "[", 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", "[", RowBox[{"1", "-", RowBox[{"1", "/", RowBox[{"(", RowBox[{"3", "k"}], ")"}]}]}], "]"}], ",", RowBox[{"PointSize", "[", "0.02", "]"}]}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"p1", ",", "p2"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"k", ",", "1", ",", RowBox[{"n", "-", "1"}], ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.442322271630126*^9, 3.4423223187966633`*^9}, { 3.442322363729254*^9, 3.442322364507118*^9}}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Bisection iterations = \"\>", "\[InvisibleSpace]", "26"}], SequenceForm["Bisection iterations = ", 26], Editable->False]], "Print", CellChangeTimes->{3.4423223670366297`*^9, 3.442322606062994*^9}], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Approximate root = \"\>", "\[InvisibleSpace]", "1.9345632191232311`"}], SequenceForm["Approximate root = ", 1.9345632191232311`], Editable->False]], "Print", CellChangeTimes->{3.4423223670366297`*^9, 3.442322606064514*^9}] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`k$$ = 9, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`k$$], 1, 25, 1}}, Typeset`size$$ = { 360., {105., 109.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`k$93454$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`k$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`k$$, $CellContext`k$93454$$, 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`p2 = ListPlot[ Part[$CellContext`t1, $CellContext`k$$], PlotRange -> {{0, 1}, {-1.2, 2.2}}, PlotStyle -> { Hue[1 - 1/(3 $CellContext`k$$)], PointSize[0.02]}, DisplayFunction -> Identity]; Show[$CellContext`p1, $CellContext`p2]), "Specifications" :> {{$CellContext`k$$, 1, 25, 1, AppearanceElements -> { "ProgressSlider", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}}}, "Options" :> { ControlType -> Animator, AppearanceElements -> None, SynchronousUpdating -> True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}], ImageSizeCache->{406., {142., 149.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{3.442322367101405*^9, 3.442322606140724*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"(*", RowBox[{ RowBox[{"Newton", "'"}], "s", " ", "Method"}], "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Clear", "[", RowBox[{"v", ",", "w", ",", "k", ",", "n", ",", "f", ",", "t2"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", " ", RowBox[{"1", "-", "x", "+", RowBox[{"Sin", "[", "x", "]"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", "0."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"b", "=", "Pi"}], ";"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", RowBox[{ RowBox[{"(", RowBox[{"a", "+", "b"}], ")"}], "/", "2"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", ">>", "v"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x1", "=", RowBox[{"x0", "-", RowBox[{ RowBox[{"f", "[", "x0", "]"}], "/", RowBox[{ RowBox[{"f", "'"}], "[", "x0", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x1", ">>>", "v"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tol", "=", RowBox[{"5", "*", SuperscriptBox["10", RowBox[{"-", "8"}]]}]}], ";"}], "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"x1", "-", "x0"}], "]"}], "\[GreaterEqual]", " ", "tol"}], "\[And]", RowBox[{"n", "\[LessEqual]", " ", "100"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", "x1"}], ";", "\[IndentingNewLine]", RowBox[{"x1", "=", RowBox[{"x0", "-", RowBox[{ RowBox[{"f", "[", "x0", "]"}], "/", RowBox[{ RowBox[{"f", "'"}], "[", "x0", "]"}]}]}]}], ";", "\[IndentingNewLine]", RowBox[{"x1", ">>>", "v"}], ";", "\[IndentingNewLine]", RowBox[{"n", "=", RowBox[{"n", "+", "1"}]}], ";"}]}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "n"}], "]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "x1"}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"w", "=", RowBox[{"ReadList", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p1", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"t2", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "0"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"p2", "=", 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", "[", RowBox[{"1", "-", RowBox[{"1", "/", RowBox[{"(", RowBox[{"3", "k"}], ")"}]}]}], "]"}], ",", RowBox[{"PointSize", "[", "0.02", "]"}]}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"p1", ",", "p2"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n", ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}]}]], "Input", CellChangeTimes->{{3.442317101201092*^9, 3.442317525367282*^9}, { 3.442317558864347*^9, 3.442317632711286*^9}, {3.442317666890592*^9, 3.4423176733115473`*^9}, {3.442317775329691*^9, 3.442317796119836*^9}, { 3.4423178285699797`*^9, 3.442317865825734*^9}, 3.442317928233704*^9, { 3.442317974257519*^9, 3.44231804738169*^9}, {3.442318097477516*^9, 3.442318177993153*^9}, 3.442318217809681*^9, {3.442318469488698*^9, 3.4423184916746063`*^9}, {3.4423186595014973`*^9, 3.442318741596673*^9}, { 3.442318772368868*^9, 3.442318787960107*^9}, 3.442319055074854*^9, { 3.442319133547068*^9, 3.4423191360167847`*^9}, {3.442319211041895*^9, 3.4423192286467533`*^9}, {3.442320370907352*^9, 3.4423203896442013`*^9}, { 3.442320427118987*^9, 3.4423204777059307`*^9}, {3.442320533396418*^9, 3.442320541429496*^9}, {3.442320622573268*^9, 3.442320626420764*^9}, { 3.4423225424254827`*^9, 3.442322548042532*^9}, 3.44232259639718*^9, { 3.442322635774867*^9, 3.442322658340588*^9}}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Newton's Method iterations=\"\>", "\[InvisibleSpace]", "5"}], SequenceForm["Newton's Method iterations=", 5], Editable->False]], "Print", CellChangeTimes->{{3.4423225816400337`*^9, 3.442322599385366*^9}, 3.442322659290496*^9}], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"approximate root = \"\>", "\[InvisibleSpace]", "1.9345632107520243`"}], SequenceForm["approximate root = ", 1.9345632107520243`], Editable->False]], "Print", CellChangeTimes->{{3.4423225816400337`*^9, 3.442322599385366*^9}, 3.442322659292144*^9}] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`k$$ = 3, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`k$$], 1, 5, 1}}, Typeset`size$$ = { 360., {105., 109.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`k$94754$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`k$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`k$$, $CellContext`k$94754$$, 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`p2 = ListPlot[ Part[$CellContext`t2, $CellContext`k$$], PlotRange -> {{0, 1}, {-1.2, 2.2}}, PlotStyle -> { Hue[1 - 1/(3 $CellContext`k$$)], PointSize[0.02]}, DisplayFunction -> Identity]; Show[$CellContext`p1, $CellContext`p2]), "Specifications" :> {{$CellContext`k$$, 1, 5, 1, AppearanceElements -> { "ProgressSlider", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}}}, "Options" :> { ControlType -> Animator, AppearanceElements -> None, SynchronousUpdating -> True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}], ImageSizeCache->{406., {142., 149.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{{3.4423225817985077`*^9, 3.4423225997454977`*^9}, 3.442322659350869*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{"Clear", "[", RowBox[{ "v", ",", "w", ",", "k", ",", "n", ",", "f", ",", "x1", ",", "x2", ",", "x0", ",", "tol", ",", "t3"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"f", "[", "x_", "]"}], ":=", " ", RowBox[{"1", "-", "x", "+", RowBox[{"Sin", "[", "x", "]"}]}]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"a", "=", "0."}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"b", "=", "Pi"}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", "a"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x1", "=", "b"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", ">>", "v"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x2", "=", RowBox[{"x1", "-", RowBox[{ RowBox[{"f", "[", "x1", "]"}], RowBox[{ RowBox[{"(", RowBox[{"x1", "-", "x0"}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"f", "[", "x1", "]"}], "-", RowBox[{"f", "[", "x0", "]"}]}], ")"}]}]}]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"x1", ">>>", "v"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "1"}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"tol", "=", RowBox[{"5", "*", SuperscriptBox["10", RowBox[{"-", "8"}]]}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"Abs", "[", RowBox[{"x2", "-", "x1"}], "]"}], "\[GreaterEqual]", " ", "tol"}], "\[And]", RowBox[{"n", "\[LessEqual]", " ", "100"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"x0", "=", "x1"}], ";", "\[IndentingNewLine]", RowBox[{"x1", "=", "x2"}], ";", "\[IndentingNewLine]", RowBox[{"x2", "=", RowBox[{"x1", "-", RowBox[{ RowBox[{"f", "[", "x1", "]"}], RowBox[{ RowBox[{"(", RowBox[{"x1", "-", "x0"}], ")"}], "/", RowBox[{"(", RowBox[{ RowBox[{"f", "[", "x1", "]"}], "-", RowBox[{"f", "[", "x0", "]"}]}], ")"}]}]}]}]}], ";", "\[IndentingNewLine]", RowBox[{"x2", ">>>", "v"}], ";", "\[IndentingNewLine]", RowBox[{"n", "=", RowBox[{"n", "+", "1"}]}], ";"}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "n"}], "]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", RowBox[{"\"\\"", ",", "x2"}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"w", "=", RowBox[{"ReadList", "[", "\"\\"", "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"p1", "=", RowBox[{"Plot", "[", RowBox[{ RowBox[{"f", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "3"}], "}"}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"t3", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"{", RowBox[{ RowBox[{"w", "[", RowBox[{"[", "k", "]"}], "]"}], ",", "0"}], "}"}], "}"}], ",", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"Animate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"p2", "=", RowBox[{"ListPlot", "[", RowBox[{ RowBox[{"t3", "[", 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", "[", RowBox[{"1", "-", RowBox[{"1", "/", RowBox[{"(", RowBox[{"3", "k"}], ")"}]}]}], "]"}], ",", RowBox[{"PointSize", "[", "0.02", "]"}]}], "}"}]}], ",", RowBox[{"DisplayFunction", "\[Rule]", "Identity"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"p1", ",", "p2"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"k", ",", "1", ",", "n", ",", "1"}], "}"}]}], "]"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->{{3.442317101201092*^9, 3.442317525367282*^9}, { 3.442317558864347*^9, 3.442317632711286*^9}, {3.442317666890592*^9, 3.4423176733115473`*^9}, {3.442317775329691*^9, 3.442317796119836*^9}, { 3.4423178285699797`*^9, 3.442317865825734*^9}, 3.442317928233704*^9, { 3.442317974257519*^9, 3.44231804738169*^9}, {3.442318097477516*^9, 3.442318177993153*^9}, 3.442318217809681*^9, {3.442318469488698*^9, 3.4423184916746063`*^9}, {3.4423186595014973`*^9, 3.442318741596673*^9}, { 3.442318772368868*^9, 3.442318787960107*^9}, 3.442319055074854*^9, { 3.442319133547068*^9, 3.4423191360167847`*^9}, {3.442319211041895*^9, 3.4423192286467533`*^9}, {3.442319530786735*^9, 3.4423196176021214`*^9}, { 3.442319735588746*^9, 3.4423198193545094`*^9}, {3.442319898720502*^9, 3.4423199030323277`*^9}, {3.442319946499791*^9, 3.442319947282126*^9}, { 3.442320554451133*^9, 3.442320612508523*^9}, {3.442320755185871*^9, 3.442320760957608*^9}, {3.442322526758895*^9, 3.442322533372465*^9}, 3.4423225722073383`*^9, {3.4423226501093597`*^9, 3.442322652541664*^9}}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"Secant Method iterations=\"\>", "\[InvisibleSpace]", "9"}], SequenceForm["Secant Method iterations=", 9], Editable->False]], "Print", CellChangeTimes->{ 3.4423225190654697`*^9, {3.442322553723942*^9, 3.442322572937236*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{"\<\"approximate root = \"\>", "\[InvisibleSpace]", "1.9345632107520243`"}], SequenceForm["approximate root = ", 1.9345632107520243`], Editable->False]], "Print", CellChangeTimes->{ 3.4423225190654697`*^9, {3.442322553723942*^9, 3.4423225729767847`*^9}}] }, Open ]], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`k$$ = 7, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`k$$], 1, 9, 1}}, Typeset`size$$ = { 360., {105., 109.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`k$92007$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`k$$ = 1}, "ControllerVariables" :> { Hold[$CellContext`k$$, $CellContext`k$92007$$, 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`p2 = ListPlot[ Part[$CellContext`t3, $CellContext`k$$], PlotRange -> {{0, 1}, {-1.2, 2.2}}, PlotStyle -> { Hue[1 - 1/(3 $CellContext`k$$)], PointSize[0.02]}, DisplayFunction -> Identity]; Show[$CellContext`p1, $CellContext`p2]), "Specifications" :> {{$CellContext`k$$, 1, 9, 1, AppearanceElements -> { "ProgressSlider", "PlayPauseButton", "FasterSlowerButtons", "DirectionButton"}}}, "Options" :> { ControlType -> Animator, AppearanceElements -> None, SynchronousUpdating -> True, ShrinkingDelay -> 10.}, "DefaultOptions" :> {}], ImageSizeCache->{406., {142., 149.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{ 3.442322519037361*^9, {3.442322553691311*^9, 3.442322573028043*^9}}] }, Open ]] }, WindowSize->{640, 750}, WindowMargins->{{456, Automatic}, {Automatic, 34}}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (April 20, 2007)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 5162, 155, 532, "Input"], Cell[CellGroupData[{ Cell[5777, 182, 250, 5, 24, "Print"], Cell[6030, 189, 280, 6, 24, "Print"] }, Open ]], Cell[6325, 198, 2047, 42, 308, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[8409, 245, 5481, 144, 736, "Input"], Cell[CellGroupData[{ Cell[13915, 393, 284, 6, 24, "Print"], Cell[14202, 401, 308, 7, 24, "Print"] }, Open ]], Cell[14525, 411, 2077, 43, 308, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[16639, 459, 5692, 153, 716, "Input"], Cell[CellGroupData[{ Cell[22356, 616, 279, 6, 24, "Print"], Cell[22638, 624, 309, 7, 24, "Print"] }, Open ]], Cell[22962, 634, 2072, 43, 308, "Output"] }, Open ]] } ] *) (* End of internal cache information *)