(************** Content-type: application/mathematica ************** Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing 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[ 49479, 961]*) (*NotebookOutlinePosition[ 50249, 987]*) (* CellTagsIndexPosition[ 50205, 983]*) (*WindowFrame->Normal*) Notebook[{ Cell["Project 1", "Title", Background->RGBColor[0, 0, 1]], Cell["Math 342\tSpring 2003", "Subtitle"], Cell[CellGroupData[{ Cell["\<\ Initialization Cells \ \>", "Subsubsection"], Cell[BoxData[{ RowBox[{\( (*\(:\)\(Title : \ Bisection\ Algorithm\)\ *) \), "\n", \( (*\(:\)\(Author : \ Mark\ Parker\)\ *) \), "\n", \( (*\(:\)\(Mathematica\ \(Version : \ 4.0\)\)\ *) \), "\n", \( (*\(:\)\(Version : \ 2.0\)\ *) \), "\n", \( (*\(\(:\)\(History : \n\tV1 .0\ by\ M . \ Parker\)\), \ August\ 2000. \ \[IndentingNewLine]\ \ V2 .0\ by\ M . \ Parker, \ February\ 2003\[IndentingNewLine]\ \ \ \ \ \ \ cleaned\ up\ code, \ added\ intervl\ list\ output*) \), "\n", "\n", \( (*\ Last\ \(Revision : \ \ February\ 2003\)\ *) \), "\n", "\n", \(Off[General::"\"];\)}], "\n", RowBox[{\(Off[General::"\"];\), "\n"}], "\n", \(Clear[Bisection, f0, end1, end2, tol, its, \ digits, \ stopping, \ intervl];\), "\[IndentingNewLine]", RowBox[{\(Bisection::usage = "\\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), its->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), digits->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\)] numerically solves for a zero \ of a function, \!\(\* StyleBox[\"f0\",\nFontSlant->\"Italic\"]\), occuring in the interval between \ \!\(\* StyleBox[\"end1\",\nFontSlant->\"Italic\"]\) and \!\(\* StyleBox[\"end2\",\nFontSlant->\"Italic\"]\). All other parameters are \ optional. The root is found within a horizontal tolerance of \!\(\* StyleBox[\"tol\",\nFontSlant->\"Italic\"]\) (default 0.00001), using a \ maximum number of iterations of \!\(\* StyleBox[\"its\",\nFontSlant->\"Italic\"]\) (default 100) and the result is \ printed using a precision of \!\(\* StyleBox[\"digits\",\nFontSlant->\"Italic\"]\)\!\(\* StyleBox[\" \",\nFontSlant->\"Plain\"]\)(default 10). A list containing the \ sequence of endpoints is returned in the variable \!\(\* StyleBox[\"intervl\",\nFontSlant->\"Italic\"]\).\>";\), "\n"}], "\[IndentingNewLine]", \(Bisection::ends\ = \ "\";\), "\[IndentingNewLine]", \(Bisection::ende\ \ = \ "\";\), "\[IndentingNewLine]", \ \(Bisection::tol\ = \ "\";\), "\ \[IndentingNewLine]", RowBox[{\(Bisection::its\ = \ "\";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{\(Options[Bisection] = {tol\ \[Rule] \ 0.00001, \ its\ \[Rule] \ 100, \ digits\ \[Rule] \ 10};\), "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{\(Bisection[f0_, end1_, end2_, intervl_, opts___Rule]\), ":=", RowBox[{"Module", "[", RowBox[{\({x1, x2, x3, \ FLAG, fx1, fx2, fx3, f, ztol, cnt, \ maxits, \ digs, \ toln}\), ",", "\[IndentingNewLine]", RowBox[{\(toln\ = \ \(tol\ /. \ {opts}\)\ /. \ Options[Bisection]\), ";", "\[IndentingNewLine]", \(maxits\ = \ \(its\ /. \ {opts}\)\ \ /. \ Options[Bisection]\), ";", "\[IndentingNewLine]", \(digs\ = \ \(digits\ /. \ {opts}\)\ \ /. \ Options[Bisection]\), ";", "\[IndentingNewLine]", \({f0, \ end1, \ end2, \ intervl, tol, \ its, \ digits}\), ";", "\[IndentingNewLine]", \(Set @@ {f[x_], f0}\), ";", "\[IndentingNewLine]", \(x1\ = \ N[end1, \ digs]\), ";", "\[IndentingNewLine]", \(x2\ = \ N[end2, \ digs]\), ";", "\[IndentingNewLine]", \(fx1\ = \ f[x1]\), ";", "\[IndentingNewLine]", \(fx2\ = \ f[x2]\), ";", "\[IndentingNewLine]", \(ztol\ = \ 1\/10\^20\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", \(If[ x1\ \[Equal] \ x2, \ \(Return[Message[Bisection::ende]];\)]\), ";", "\[IndentingNewLine]", \(If[ fx1\ fx2\ > \ 0, \ \(Return[Message[Bisection::ends]];\)]\), ";", "\[IndentingNewLine]", \(If[ toln\ \[LessEqual] \ 0, \ \(Return[Message[Bisection::tol]];\)]\), ";", "\[IndentingNewLine]", \(If[ maxits\ \[LessEqual] \ 0, \ \(Return[Message[Bisection::its]];\)]\), ";", "\[IndentingNewLine]", \(intervl = {{x1, x2}}\), ";", "\[IndentingNewLine]", \(cnt\ = \ 1\), ";", "\[IndentingNewLine]", \(dx\ = \ Abs[x1 - x2]/2\), ";", "\[IndentingNewLine]", \(FLAG\ = \ 1\), ";", "\[IndentingNewLine]", \(Print["\< end1 = \>", \ N[end1, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< end2 = \>", \ N[end2, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< tol = \>", \ toln, \ "\<, its = \>", \ maxits, \ "\<, digits = \>", \ digs]\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{\(cnt\ \[LessEqual] \ maxits\ && \ FLAG\ \[Equal] \ 1\), ",", "\[IndentingNewLine]", "\t", RowBox[{\(x3\ = \ \(x1 + x2\)\/2\), ";", "\[IndentingNewLine]", "\t", \(fx3\ = \ f[x3]\), ";", "\[IndentingNewLine]", "\t", \(Print["\"\_cnt, \ "\< = \>", \ N[x3, digs], \ "\<, f(x\>"\_cnt, \ "\<) = \>", \ N[fx3, digs], \ "\<, |\[CapitalDelta]x| = \>", \ N[dx, digs]\ , \ "\< Interval is [\>", x1, \ "\< , \>", x2, \ "\<] \>"]\), ";", "\[IndentingNewLine]", "\t", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{\(Abs[fx3]\ < \ ztol\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nVertical \ convergence! - function value is smaller than zero tolerance of \>", ztol]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\tPrint["\"]; \[IndentingNewLine]\t\tPrint["\< x = \ \>", \ N[x3, digs]]; \[IndentingNewLine]\t\tPrint["\", \ N[fx3, digs]]; \[IndentingNewLine]\t\tPrint["\<|\ \[CapitalDelta]x| = \>", \ N[dx, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"]; \[IndentingNewLine]\t\t\ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", " ", RowBox[{ RowBox[{"If", "[", RowBox[{\(dx\ < \ 2*toln\), ",", "\[IndentingNewLine]", " ", \(Print["\<\n\ Horizontal convergence! - interval width is smaller than twice tolerance of \ \>", toln]; \[IndentingNewLine]\t\t\ \ Print["\", \ f[x]]; \[IndentingNewLine]\t\t\ \ \ Print["\"]; \[IndentingNewLine]\t\t\ \ \ Print["\< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\t\ \ \ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\t\t\ \ \ Print["\<|\[CapitalDelta]x| = \>", \ N[dx, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"]; \[IndentingNewLine]\t\t\ \ \ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", "\t\t", \(cnt\ = \ cnt\ + \ 1; \[IndentingNewLine]\t\tIf[ fx3\ fx1\ < \ 0, \[IndentingNewLine]\t\t\tx2\ = \ x3; \[IndentingNewLine]\t\t\tfx2\ = \ fx3, \[IndentingNewLine]\t\t\t (*\ ELSE\ *) \[IndentingNewLine]\t\t\tx1\ = \ \ x3; \[IndentingNewLine]\t\t\tfx1\ = \ fx3]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ AppendTo[intervl, {x1, x2}]; \[IndentingNewLine]\t\tdx\ = \ Abs[x1 - x2]/2;\)}], "]"}], ";"}]}], "]"}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", " ", "\[IndentingNewLine]", "\[IndentingNewLine]", StyleBox[\(If[ FLAG\ == 1, \n\t\tPrint["\<\nWe haven't yet converged, but we've \ exceeded the iteration limit of \>", \ maxits]; \n\t\tPrint["\", f[x]]; \n\t\tPrint["\", \ maxits]; \[IndentingNewLine]\t Print["\", N[x3, digs]]; \[IndentingNewLine]\t Print["\", N[fx3, digs]]; \[IndentingNewLine]\t Print["\<|\[CapitalDelta]x| = \>", N[dx, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"];]\), "Input"], StyleBox[";", "Input"]}]}], StyleBox["\n", "Input"], StyleBox["\[IndentingNewLine]", "Input"], StyleBox[" ", "Input"], StyleBox["]", "Input"]}]}], StyleBox[";", "Input"]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(On[ General::"\"];\)}], "Input", InitializationCell->True], Cell[BoxData[{ RowBox[{\( (*\(:\)\(Title : \ Secant\ Algorithm\)\ *) \), "\n", \( (*\(:\)\(Author : \ Mark\ Parker\)\ *) \), "\n", \( (*\(:\)\(Mathematica\ \(Version : \ 4.0\)\)\ *) \), "\n", \( (*\(:\)\(Version : \ 2.0\)\ *) \), "\n", \( (*\(\(:\)\(History : \n\tV1 .0\ by\ M . \ Parker\)\), \ September\ 2000. \[IndentingNewLine]\ \ V2 .0\ by\ M . \ Parker, \ February\ 2003\[IndentingNewLine]\ \ \ \ \ \ \ cleaned\ up\ code*) \), "\n", "\n", \( (*\ Last\ \(Revision : \ \ February\ 2003\)\ *) \), "\n", "\n", \(Off[General::"\"];\)}], "\n", RowBox[{\(Off[General::"\"];\), "\n"}], "\n", \(Clear[Secant, f0, end1, end2, tol, its, \ digits];\), "\[IndentingNewLine]", RowBox[{\(Secant::usage = "\\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), its->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), digits->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\)] numerically solves for a zero \ of a function, \!\(\* StyleBox[\"f0\",\nFontSlant->\"Italic\"]\), with starting points \!\(\* StyleBox[\"end1\",\nFontSlant->\"Italic\"]\) and \!\(\* StyleBox[\"end2\",\nFontSlant->\"Italic\"]\). All other parameters are \ optional. The root is found within a tolerance of \!\(\* StyleBox[\"tol\",\nFontSlant->\"Italic\"]\) (default 0.00001), using a \ maximum number of iterations of \!\(\* StyleBox[\"its\",\nFontSlant->\"Italic\"]\) (default 100) and the result is \ printed using a precision of \!\(\* StyleBox[\"digits\",\nFontSlant->\"Italic\"]\)\!\(\* StyleBox[\" \",\nFontSlant->\"Plain\"]\)(default 16).\>";\), "\n"}], "\[IndentingNewLine]", \(Secant::ende\ = \ "\";\), "\[IndentingNewLine]", \(Secant::tol\ = \ \ "\";\), "\[IndentingNewLine]", RowBox[{\(Secant::its\ = \ "\";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{\(Options[Secant] = {tol\ \[Rule] \ 0.00001, \ its\ \[Rule] \ 100, \ digits\ \[Rule] \ 16};\), "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{\(Secant[f0_, end1_, end2_, opts___Rule]\), ":=", RowBox[{"Module", "[", RowBox[{\({x1, x2, x3, \ FLAG, fx1, fx2, fx3, f, ztol, cnt, \ maxits, \ digs, \ toln, denom}\), ",", "\[IndentingNewLine]", RowBox[{\(toln\ = \ \(tol\ /. \ {opts}\)\ /. \ Options[Secant]\), ";", "\[IndentingNewLine]", \(maxits\ = \ \(its\ /. \ {opts}\)\ \ /. \ Options[Secant]\), ";", "\[IndentingNewLine]", \(digs\ = \ \(digits\ /. \ {opts}\)\ \ /. \ Options[Secant]\), ";", "\[IndentingNewLine]", \({f0, \ end1, \ end2, \ tol, \ its, \ digits}\), ";", "\[IndentingNewLine]", \(Set @@ {f[x_], f0}\), ";", "\[IndentingNewLine]", \(x1\ = \ N[end1, \ digs]\), ";", "\[IndentingNewLine]", \(x2\ = \ N[end2, \ digs]\), ";", "\[IndentingNewLine]", \(fx1\ = \ f[x1]\), ";", "\[IndentingNewLine]", \(fx2\ = \ f[x2]\), ";", "\[IndentingNewLine]", \(ztol\ = \ 1\/10\^20\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", \(If[ x1\ \[Equal] \ x2, \ \(Return[Message[Secant::ende]];\)]\), ";", "\[IndentingNewLine]", \(If[ toln\ \[LessEqual] \ 0, \ \(Return[Message[Secant::tol]];\)]\), ";", "\[IndentingNewLine]", \(If[ maxits\ \[LessEqual] \ 0, \ \(Return[Message[Secant::its]];\)]\), ";", "\[IndentingNewLine]", \(cnt\ = \ 1\), ";", "\[IndentingNewLine]", \(If[ Abs[fx1] < Abs[fx2], \[IndentingNewLine]\t temp = fx1; \[IndentingNewLine]\t fx1 = fx2; \[IndentingNewLine]\t fx2 = temp; \[IndentingNewLine]\t temp = x1; \[IndentingNewLine]\t x1 = x2; \[IndentingNewLine]\tx2 = temp;]\), ";", "\[IndentingNewLine]", \(FLAG\ = \ 1\), ";", "\[IndentingNewLine]", \(Print["\< end1 = \>", \ N[end1, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< end2 = \>", \ N[end2, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< tol = \>", \ toln, \ "\<, its = \>", \ maxits, \ "\<, digits = \>", \ digs]\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{\(cnt\ \[LessEqual] \ maxits\ && \ FLAG\ \[Equal] \ 1\), ",", "\[IndentingNewLine]", " ", RowBox[{\(denom = fx1 - fx2\), ";", "\[IndentingNewLine]", " ", RowBox[{"If", "[", RowBox[{\(Abs[denom] < ztol\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nThe function is \ too flat! fx1 - fx2 is less than zero tolerance of \>", N[ztol]]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\t\tPrint["\ \< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< and \>", x2]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", "\t", \(x3\ = \ x2 - fx2*\(x1 - x2\)\/denom; \[IndentingNewLine]\t fx3 = f[x3]; \[IndentingNewLine]\t Print["\"\_cnt, \ "\< = \>", \ N[x3, digs], \ "\<, f(x\>"\_cnt, \ "\<) = \>", \ N[fx3, digs], \ "\< Secant points are: \>", x1, \ "\< and \>", x2];\)}], "]"}], ";", "\[IndentingNewLine]", "\t", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{\(Abs[fx3]\ < \ ztol\ \ && \ FLAG\ \[Equal] 1\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nVertical \ convergence! - function value is smaller than tolerance of \>", \ N[ztol]\ ]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\tPrint["\"]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\t\ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< and \>", x2]; \[IndentingNewLine]\t\tPrint["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", " ", \(If[ Abs[x3 - x2] < toln\ && \ FLAG\ \[Equal] 1, \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\<\nHorizontal convergence! x\>"\_cnt, \ "\< - x\>"\_\ \(cnt - 1\), \ "\< is smaller than tolerance of \>", toln]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< and \>", x2]; \[IndentingNewLine]\t\tPrint["\", \ cnt]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ FLAG\ = \ 0, \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ (*\ Else\ *) \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \(If[ FLAG\ \[Equal] \ 1, \[IndentingNewLine]\t\tcnt\ = \ cnt\ + \ 1; \[IndentingNewLine]\t\tx1 = x2; \[IndentingNewLine]\t\tfx1 = fx2; \[IndentingNewLine]\t\tx2\ = \ x3; \[IndentingNewLine]\t\tfx2 = fx3;];\)];\)}], "]"}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", StyleBox[\(If[ FLAG\ == 1, \n\t\tPrint["\<\nWe haven't yet converged, but we've \ exceeded the iteration limit of \>", \ maxits]; \n\t\tPrint["\", f[x]]; \n\t\tPrint["\", \ maxits]; \[IndentingNewLine]\t Print["\", N[x3, digs]]; \[IndentingNewLine]\t Print["\", N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< and \>", x2];]\), "Input"], StyleBox[";", "Input"]}]}], StyleBox["\[IndentingNewLine]", "Input"], StyleBox["\n", "Input"], StyleBox[" ", "Input"], StyleBox["]", "Input"]}]}], StyleBox[";", "Input"]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(On[ General::"\"];\)}], "Input", InitializationCell->True], Cell[BoxData[{ RowBox[{\( (*\(:\)\(Title : \ False\ Position\ Algorithm\)\ *) \), "\n", \( (*\(:\)\(Author : \ Mark\ Parker\)\ *) \), "\n", \( (*\(:\)\(Mathematica\ \(Version : \ 4.0\)\)\ *) \), "\n", \( (*\(:\)\(Version : \ 2.0\)\ *) \), "\n", \( (*\(\(:\)\(History : \n\tV1 .0\ by\ M . \ Parker\)\), \ September\ 2000. \[IndentingNewLine]\ \ V2 .0\ by\ M . \ Parker, \ February\ 2003\[IndentingNewLine]\ \ \ \ \ \ \ cleaned\ up\ code*) \), "\n", "\n", \( (*\ Last\ \(Revision : \ \ February\ 2003\)\ *) \), "\n", "\n", \(Off[General::"\"];\)}], "\n", RowBox[{\(Off[General::"\"];\), "\n"}], "\n", \(Clear[FalsePosition, f0, end1, end2, tol, its, \ digits];\), "\[IndentingNewLine]", RowBox[{\(FalsePosition::usage = "\\!\ \(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), its->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), digits->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\)] numerically solves for a zero \ of a function, \!\(\* StyleBox[\"f0\",\nFontSlant->\"Italic\"]\), occuring in the interval between \ \!\(\* StyleBox[\"end1\",\nFontSlant->\"Italic\"]\) and \!\(\* StyleBox[\"end2\",\nFontSlant->\"Italic\"]\). All other parameters are \ optional. The root is found within a tolerance of \!\(\* StyleBox[\"tol\",\nFontSlant->\"Italic\"]\) (default 0.00001), using a \ maximum number of iterations of \!\(\* StyleBox[\"its\",\nFontSlant->\"Italic\"]\) (default 100) and the result is \ printed using a precision of \!\(\* StyleBox[\"digits\",\nFontSlant->\"Italic\"]\)\!\(\* StyleBox[\" \",\nFontSlant->\"Plain\"]\)(default 16).\>";\), "\n"}], "\[IndentingNewLine]", \(FalsePosition::ends\ = \ "\";\), "\[IndentingNewLine]", \ \(FalsePosition::ende\ = \ "\";\), "\ \[IndentingNewLine]", \(FalsePosition::tol\ = \ "\";\), "\[IndentingNewLine]", RowBox[{\(FalsePosition::its\ = \ "\";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{\(Options[FalsePosition] = {tol\ \[Rule] \ 0.00001, \ its\ \[Rule] \ 100, \ digits\ \[Rule] \ 16};\), "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{\(FalsePosition[f0_, end1_, end2_, opts___Rule]\), ":=", RowBox[{"Module", "[", RowBox[{\({x1, x2, x3, \ FLAG, fx1, fx2, fx3, f, ztol, cnt, \ maxits, \ digs, \ toln, denom, \ xold}\), ",", "\[IndentingNewLine]", RowBox[{\(toln\ = \ \(tol\ /. \ {opts}\)\ /. \ Options[FalsePosition]\), ";", "\[IndentingNewLine]", \(maxits\ = \ \(its\ /. \ {opts}\)\ \ /. \ Options[FalsePosition]\), ";", "\[IndentingNewLine]", \(digs\ = \ \(digits\ /. \ {opts}\)\ \ /. \ Options[FalsePosition]\), ";", "\[IndentingNewLine]", \({f0, \ end1, \ end2, \ tol, \ its, \ digits}\), ";", "\[IndentingNewLine]", \(Set @@ {f[x_], f0}\), ";", "\[IndentingNewLine]", \(x1\ = \ N[end1, \ digs]\), ";", "\[IndentingNewLine]", \(x2\ = \ N[end2, \ digs]\), ";", "\[IndentingNewLine]", \(fx1\ = \ f[x1]\), ";", "\[IndentingNewLine]", \(fx2\ = \ f[x2]\), ";", "\[IndentingNewLine]", \(ztol\ = \ 1\/10\^20\), ";", "\[IndentingNewLine]", \(xold = x1\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", \(If[ x1\ \[Equal] \ x2, \ \(Return[Message[FalsePosition::ende]];\)]\), ";", "\[IndentingNewLine]", \(If[ fx1\ fx2\ > \ 0, \ \(Return[Message[FalsePosition::ends]];\)]\), ";", "\[IndentingNewLine]", \(If[ toln\ \[LessEqual] \ 0, \ \(Return[Message[FalsePosition::tol]];\)]\), ";", "\[IndentingNewLine]", \(If[ maxits\ \[LessEqual] \ 0, \ \(Return[Message[FalsePosition::its]];\)]\), ";", "\[IndentingNewLine]", \(cnt\ = \ 1\), ";", "\[IndentingNewLine]", \(dx\ = \ Abs[x1 - x2]\), ";", "\[IndentingNewLine]", \(FLAG\ = \ 1\), ";", "\[IndentingNewLine]", \(Print["\< end1 = \>", \ N[end1, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< end2 = \>", \ N[end2, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< tol = \>", \ toln, \ "\<, its = \>", \ maxits, \ "\<, digits = \>", \ digs]\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{\(cnt\ \[LessEqual] \ maxits\ && \ FLAG\ \[Equal] \ 1\), ",", "\[IndentingNewLine]", " ", RowBox[{\(denom = fx1 - fx2\), ";", "\[IndentingNewLine]", " ", RowBox[{"If", "[", RowBox[{\(Abs[denom] < ztol\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nThe function is \ too flat! fx1 - fx2 is less than zero tolerance of \>", N[ztol]]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\t\tPrint["\ \< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx3, digs]]; \ \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", "\t", \(x3\ = \ x2 - fx2*\(x1 - x2\)\/denom; \[IndentingNewLine]\t fx3 = f[x3]; \[IndentingNewLine]\t Print["\"\_cnt, \ "\< = \>", \ N[x3, digs], \ "\<, f(x\>"\_cnt, \ "\<) = \>", \ N[fx3, digs], \ "\< Interval is [\>", x1, \ "\< , \>", x2, \ "\<] \>"];\)}], "]"}], ";", "\[IndentingNewLine]", "\t", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{\(Abs[fx3]\ < \ ztol\ \ && \ FLAG\ \[Equal] 1\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nVertical \ convergence! - function value is smaller than tolerance of \>", \ N[ztol]\ ]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\tPrint["\"]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\t\ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", \ x2, \ "\<] \>"]; \[IndentingNewLine]\t\t\ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", " ", RowBox[{ RowBox[{"If", "[", RowBox[{\(Abs[x3 - xold] < toln\), ",", "\[IndentingNewLine]", " ", \(Print["\<\n\ Horizontal convergence! x\>"\_cnt, \ "\< - x\>"\_\(cnt - 1\), \ "\< is \ smaller than tolerance of \>", toln]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\< x = \>", \ N[x3, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"]; \[IndentingNewLine]\t\t\ Print["\", \ cnt]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ FLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", "\t\t", \(cnt\ = \ cnt\ + \ 1; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ xold = x3; \[IndentingNewLine]\t\tIf[ fx3\ fx1\ < \ 0, \[IndentingNewLine]\t\t\tx2\ = \ x3; \[IndentingNewLine]\t\t\tfx2\ = \ fx3, \[IndentingNewLine]\t\t\t (*\ ELSE\ *) \[IndentingNewLine]\t\t\tx1\ = \ \ x3; \[IndentingNewLine]\t\t\tfx1\ = \ fx3];\)}], "]"}], ";"}]}], "]"}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", StyleBox[\(If[ FLAG\ == 1, \n\t\tPrint["\<\nWe haven't yet converged, but we've \ exceeded the iteration limit of \>", \ maxits]; \n\t\tPrint["\", f[x]]; \n\t\tPrint["\", \ maxits]; \[IndentingNewLine]\t Print["\", N[x3, digs]]; \[IndentingNewLine]\t Print["\", N[fx3, digs]]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ Print["\", x1, \ "\< , \>", x2, \ "\<] \>"];]\), "Input"], StyleBox[";", "Input"]}]}], StyleBox["\[IndentingNewLine]", "Input"], StyleBox["\[IndentingNewLine]", "Input"], StyleBox[" ", "Input"], StyleBox["]", "Input"]}]}], StyleBox[";", "Input"]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(On[ General::"\"];\)}], "Input", InitializationCell->True], Cell[BoxData[{ RowBox[{\( (*\(:\)\(Title : \ Newton' s\ Method\)\ *) \), "\n", \( (*\(:\)\(Author : \ Mark\ Parker\)\ *) \), "\n", \( (*\(:\)\(Mathematica\ \(Version : \ 4.0\)\)\ *) \), "\n", \( (*\(:\)\(Version : \ 2.0\)\ *) \), "\n", \( (*\(\(:\)\(History : \n\tV1 .0\ by\ M . \ Parker\)\), \ September\ 2000. \n\ \ \ \ V2 .0\ by\ M . \ Parker, \ February\ 2003\[IndentingNewLine]\ \ \ \ \ \ \ cleaned\ up\ code*) \), "\n", "\n", \( (*\ Last\ \(Revision : \ \ February\ 2003\)\ *) \), "\n", "\n", \(Off[General::"\"];\)}], "\n", RowBox[{\(Off[General::"\"];\), "\n"}], "\n", \(Clear[OurNewton, f0, start, tol, its, \ digits];\), "\[IndentingNewLine]", RowBox[{\(OurNewton::usage = "\\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), its->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\), digits->\!\(\* StyleBox[\"value\",\nFontSlant->\"Italic\"]\)] numerically solves for a zero \ of a function, \!\(\* StyleBox[\"f0\",\nFontSlant->\"Italic\"]\), with starting point \!\(\* StyleBox[\"start\",\nFontSlant->\"Italic\"]\). All other parameters are \ optional. The root is found within a tolerance of \!\(\* StyleBox[\"tol\",\nFontSlant->\"Italic\"]\) (default 0.00001), using a \ maximum number of iterations of \!\(\* StyleBox[\"its\",\nFontSlant->\"Italic\"]\) (default 100) and the result is \ printed using a precision of \!\(\* StyleBox[\"digits\",\nFontSlant->\"Italic\"]\)\!\(\* StyleBox[\" \",\nFontSlant->\"Plain\"]\)(default 16).\>";\), "\[IndentingNewLine]"}], "\n", \(OurNewton::end0\ = \ "\";\), "\[IndentingNewLine]", \(OurNewton::tol\ = \ \ "\";\), "\[IndentingNewLine]", RowBox[{\(OurNewton::its\ = \ "\";\), "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{\(Options[OurNewton] = {tol\ \[Rule] \ 0.00001, \ its\ \[Rule] \ 100, \ digits\ \[Rule] \ 16};\), "\n"}], "\n", RowBox[{ RowBox[{ RowBox[{\(OurNewton[f0_, start_, opts___Rule]\), ":=", RowBox[{"Module", "[", RowBox[{\({x1, x2, \ FLAG, fx1, fx2, f, fprime, \ cnt, \ maxits, \ digs, \ toln, \ ztol}\), ",", "\[IndentingNewLine]", RowBox[{\(toln\ = \ \(tol\ /. \ {opts}\)\ /. \ Options[OurNewton]\), ";", "\[IndentingNewLine]", \(maxits\ = \ \(its\ /. \ {opts}\)\ \ /. \ Options[OurNewton]\), ";", "\[IndentingNewLine]", \(digs\ = \ \(digits\ /. \ {opts}\)\ \ /. \ Options[OurNewton]\), ";", "\[IndentingNewLine]", \({f0, start, \ tol, \ its, \ digits}\), ";", "\[IndentingNewLine]", \(Set @@ {f[x_], f0}\), ";", "\[IndentingNewLine]", \(x1\ = \ N[start, \ digs]\), ";", "\[IndentingNewLine]", \(fx1\ = \ f[x1]\), ";", "\[IndentingNewLine]", \(fprime = \(f'\)[x1]\), ";", "\[IndentingNewLine]", \(ztol\ = \ 1\/10\^20\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", \(If[ fprime \[Equal] 0, \ \(Return[Message[OurNewton::end0]];\)]\), ";", "\[IndentingNewLine]", \(If[ toln\ \[LessEqual] \ 0, \ \(Return[Message[OurNewton::tol]];\)]\), ";", "\[IndentingNewLine]", \(If[ maxits\ \[LessEqual] \ 0, \ \(Return[Message[OurNewton::its]];\)]\), ";", "\[IndentingNewLine]", \(cnt\ = \ 1\), ";", "\[IndentingNewLine]", \(FLAG\ = \ 1\), ";", "\[IndentingNewLine]", \(Print["\< start = \>", \ N[start, \ digs]]\), ";", "\[IndentingNewLine]", \(Print["\< tol = \>", \ toln, \ "\<, its = \>", \ maxits, \ "\<, digits = \>", \ digs]\), ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{\(cnt\ \[LessEqual] \ maxits\ && \ FLAG\ \[Equal] \ 1\), ",", "\[IndentingNewLine]", " ", RowBox[{ RowBox[{"If", "[", RowBox[{\(Abs[fprime] < ztol\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nThe function is \ too flat! derivative of f[x] is less than zero tolerance of \>", N[ztol]]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\t\tPrint["\ \< x = \>", \ N[x2, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx2, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", "\t", \(x2 = \ x1 - fx1\/fprime; \[IndentingNewLine]\t fx2 = f[x2]; \[IndentingNewLine]\t Print["\"\_cnt, \ "\< = \>", \ N[x2, digs], \ "\<, f(x\>"\_cnt, \ "\<) = \>", \ N[fx2, digs]];\)}], "]"}], ";", "\[IndentingNewLine]", "\t", "\[IndentingNewLine]", "\t", RowBox[{"If", "[", RowBox[{\(Abs[fx2]\ < \ ztol\ && \ FLAG\ \[Equal] 1\), ",", "\[IndentingNewLine]", " ", \(Print["\<\nVertical \ convergence! - function value is smaller than tolerance of \>", N[ztol]]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\tPrint["\"]; \[IndentingNewLine]\t\tPrint["\< x = \ \>", \ N[x2, digs]]; \[IndentingNewLine]\t\tPrint["\", \ N[fx2, digs]]; \[IndentingNewLine]\t\tPrint["\", \ cnt]; \[IndentingNewLine]\t\tFLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", " ", RowBox[{ RowBox[{"If", "[", RowBox[{\(Abs[x2 - x1] < toln\ && \ FLAG\ \[Equal] 1\), ",", "\[IndentingNewLine]", " ", \(Print["\<\n\ Horizontal convergence! x\>"\_cnt, \ "\< - x\>"\_\(cnt - 1\), \ "\< is \ smaller than tolerance of \>", toln]; \[IndentingNewLine]\t\tPrint["\", \ f[x]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\"]; \[IndentingNewLine]\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ Print["\< x = \>", \ N[x2, digs]]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ Print["\", \ N[fx2, digs]]; \[IndentingNewLine]\t\t\ Print["\", \ cnt]; \[IndentingNewLine]\t\ \ \ \ \ \ \ \ \ \ FLAG\ = \ 0\), ",", "\[IndentingNewLine]", StyleBox["\t\t", "Input"], StyleBox[\( (*\ ELSE\ *) \), "Input"], "\[IndentingNewLine]", " ", \(If[ FLAG \[Equal] 1, \[IndentingNewLine]\t\tcnt\ = \ cnt\ + \ 1; \[IndentingNewLine]\t\tx1 = x2; \[IndentingNewLine]\t\tfx1 = fx2; \[IndentingNewLine]\t\tfprime = \ \(f'\)[x1];];\)}], "]"}], ";"}]}], "]"}], ";"}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", StyleBox[\(If[ FLAG\ == 1, \n\t\tPrint["\<\nWe haven't yet converged, but we've \ exceeded the iteration limit of \>", \ maxits]; \n\t\tPrint["\", f[x]]; \n\t\tPrint["\", \ maxits]; \[IndentingNewLine]\t Print["\", N[x2, digs]]; \[IndentingNewLine]\t Print["\", N[fx2, digs]];]\), "Input"], StyleBox[";", "Input"]}]}], StyleBox["\[IndentingNewLine]", "Input"], StyleBox["\n", "Input"], StyleBox[" ", "Input"], StyleBox["]", "Input"]}]}], StyleBox[";", "Input"]}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", \(On[ General::"\"];\)}], "Input", InitializationCell->True] }, Closed]], Cell[TextData[{ "The initialization cells in this notebook define the commands Bisection, \ Secant, FalsePosition, and Newton. These commands allow us use the \ respective algorithms to find roots of a continuous function. The commands \ generate the sequence of test points iterated to the root. \n", StyleBox["NOTE:", FontWeight->"Bold"], " they have been modified to check for both vertical and horizontal \ convergence. Vertical convergence is attained when abs[f(x)] < ztol, where \ ztol is the zero tolerance (default definition of ", Cell[BoxData[ \(TraditionalForm\`10\^\(-20\)\)]], "). Horizontal convergence is attained when the absolute value of the \ difference between successive iterates (estimates) is less than ", StyleBox["tol", FontWeight->"Bold"], " (the tolerance specified by the user)." }], "Text"], Cell[CellGroupData[{ Cell["The Project ", "Section"], Cell["\<\ In this section, we'll look at what happens with the different algorithms \ when we test them on different kinds of functions...\ \>", "Text"], Cell[CellGroupData[{ Cell["Problem 1", "Subsubsection"], Cell[BoxData[{ \(\(Clear[f, g, h, x];\)\), "\[IndentingNewLine]", \(\(f[x_] = x\^3 - 4 x\^2 + x + 6;\)\), "\[IndentingNewLine]", \(\(Plot[f[x], {x, \(-5\), 4}, PlotStyle \[Rule] RGBColor[1, 0, 0], PlotLabel \[Rule] f[x]];\)\)}], "Input"], Cell[BoxData[{ \(Clear[intervl]\), "\[IndentingNewLine]", \(Bisection[f[x], \(-5\), 0, intervl, tol \[Rule] 10^\(-5\)]\)}], "Input"], Cell[BoxData[ \(FalsePosition[f[x], \(-5\), 0, tol \[Rule] 10^\(-5\)]\)], "Input"], Cell["Secant[f[x],-5,4,tol\[Rule]10^-5]", "Input", AspectRatioFixed->True], Cell[BoxData[ \(OurNewton[f[x], \(-5\), tol \[Rule] 10^\(-5\)]\)], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 2", "Subsubsection"], Cell[BoxData[{ \(\(Clear[f, g, h, x];\)\), "\[IndentingNewLine]", \(\(f[x_] = 0.0027\ x\^3 + 1.08\ x\^4 + 108\ x\^5;\)\), "\[IndentingNewLine]", \(\(Plot[f[x], {x, \(-1\), 2}, PlotLabel \[Rule] f[x]];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 3", "Subsubsection"], Cell[BoxData[{ \(Clear[f, x, g]\), "\[IndentingNewLine]", \(\(g[x_] = Tan[2 x];\)\), "\[IndentingNewLine]", \(\(Plot[g[x], {x, \(-1\), 6}, PlotStyle \[Rule] RGBColor[1, 0, 0], PlotLabel \[Rule] g[x]];\)\)}], "Input"] }, Closed]], Cell[CellGroupData[{ Cell["Problem 4", "Subsubsection"], Cell[BoxData[{ \(\(Clear[f, x];\)\), "\[IndentingNewLine]", \(\(f[x_] = 1/\((x - 4)\);\)\), "\[IndentingNewLine]", \(\(Plot[f[x], {x, 0, 10}, PlotStyle \[Rule] RGBColor[1, 0, 0], PlotLabel \[Rule] f[x]];\)\)}], "Input"] }, Closed]] }, Open ]] }, FrontEndVersion->"4.1 for Microsoft Windows", ScreenRectangle->{{0, 1024}, {0, 677}}, AutoGeneratedPackage->None, WindowToolbars->{"RulerBar", "EditBar"}, CellGrouping->Manual, WindowSize->{1016, 600}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, StyleDefinitions -> "DemoText.nb" ] (******************************************************************* 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[1705, 50, 59, 1, 70, "Title"], Cell[1767, 53, 41, 0, 41, "Subtitle"], Cell[CellGroupData[{ Cell[1833, 57, 54, 3, 71, "Subsubsection"], Cell[1890, 62, 11094, 198, 2312, "Input", InitializationCell->True], Cell[12987, 262, 11348, 201, 2374, "Input", InitializationCell->True], Cell[24338, 465, 12025, 216, 2354, "Input", InitializationCell->True], Cell[36366, 683, 10345, 189, 2096, "Input", InitializationCell->True] }, Closed]], Cell[46726, 875, 854, 17, 116, "Text"], Cell[CellGroupData[{ Cell[47605, 896, 31, 0, 54, "Section"], Cell[47639, 898, 152, 3, 29, "Text"], Cell[CellGroupData[{ Cell[47816, 905, 34, 0, 44, "Subsubsection"], Cell[47853, 907, 261, 4, 80, "Input"], Cell[48117, 913, 141, 2, 60, "Input"], Cell[48261, 917, 86, 1, 40, "Input"], Cell[48350, 920, 76, 1, 40, "Input"], Cell[48429, 923, 79, 1, 40, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[48545, 929, 34, 0, 28, "Subsubsection"], Cell[48582, 931, 239, 4, 80, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[48858, 940, 34, 0, 28, "Subsubsection"], Cell[48895, 942, 240, 4, 80, "Input"] }, Closed]], Cell[CellGroupData[{ Cell[49172, 951, 34, 0, 28, "Subsubsection"], Cell[49209, 953, 242, 4, 80, "Input"] }, Closed]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)