(* 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[ 11540, 355] NotebookOptionsPosition[ 10326, 311] NotebookOutlinePosition[ 10731, 327] CellTagsIndexPosition[ 10688, 324] WindowFrame->Normal ContainsDynamic->False*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Math 481A California State University, Northridge Picard Iteration\ \>", "Section", CellChangeTimes->{{3.404587942926263*^9, 3.404587944715847*^9}}], Cell[CellGroupData[{ Cell["\[Copyright]2007 BE Shapiro", "Subsection", CellChangeTimes->{{3.404587947250783*^9, 3.404587948779574*^9}}], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{ RowBox[{"Picard", "[", RowBox[{"f_", ",", "t_", ",", "t0_", ",", "y0_", ",", "n_"}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{"y", "=", "y0"}]}], "}"}], ",", " ", "\[IndentingNewLine]", " ", RowBox[{ RowBox[{"Print", "[", RowBox[{ RowBox[{"Subscript", "[", RowBox[{"\"\<\[CurlyPhi]\>\"", ",", "0"}], "]"}], ",", "\"\<=\>\"", ",", "y0"}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "0"}], ",", RowBox[{"i", "<", "n"}], ",", RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"ynext", "=", RowBox[{"y0", "+", RowBox[{ SubsuperscriptBox["\[Integral]", "t0", "t"], RowBox[{ RowBox[{"(", RowBox[{"f", "[", RowBox[{"s", ",", RowBox[{"y", "/.", RowBox[{"{", RowBox[{"t", "\[Rule]", " ", "s"}], "}"}]}]}], "]"}], ")"}], RowBox[{"\[DifferentialD]", "s"}]}]}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{ RowBox[{"Subscript", "[", RowBox[{"\"\<\[CurlyPhi]\>\"", ",", RowBox[{"i", "+", "1"}]}], "]"}], ",", "\"\<=\>\"", ",", "ynext"}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"SameQ", "[", RowBox[{"y", ",", " ", "ynext"}], "]"}], ",", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{"Print", "[", "\"\\"", "]"}], ";", " ", "\[IndentingNewLine]", RowBox[{"Return", "[", "y", "]"}]}]}], "\[IndentingNewLine]", "]"}], ";", " ", "\[IndentingNewLine]", RowBox[{"y", "=", "ynext"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\n", RowBox[{"Return", "[", "y", "]"}]}]}], "\n", "]"}]}], ";"}], "\n"}]], "Input", CellChangeTimes->{{3.404569683236595*^9, 3.404569769337825*^9}, 3.4045698987434998`*^9, {3.40457002011335*^9, 3.4045701248364077`*^9}}], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"t_", ",", "y_"}], "]"}], ":=", " ", "y"}]], "Input", CellChangeTimes->{{3.404569771348445*^9, 3.404569812966927*^9}, { 3.404569849890006*^9, 3.404569865933441*^9}, {3.4045699833322287`*^9, 3.4045699920561123`*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Picard", "[", RowBox[{"f", ",", " ", "t", ",", " ", "0", ",", " ", "1", ",", " ", "5"}], "]"}]], "Input", CellChangeTimes->{{3.404569785207412*^9, 3.404569790386941*^9}, { 3.4045698815940857`*^9, 3.404569887120977*^9}}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "0"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", "1"}], SequenceForm[ Subscript["\[CurlyPhi]", 0], "=", 1], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.404570090018292*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "1"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", "t"}]}], SequenceForm[ Subscript["\[CurlyPhi]", 1], "=", 1 + $CellContext`t], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.4045700900217323`*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "2"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", "t", "+", FractionBox[ SuperscriptBox["t", "2"], "2"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 2], "=", 1 + $CellContext`t + Rational[1, 2] $CellContext`t^2], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.404570090067202*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "3"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", "t", "+", FractionBox[ SuperscriptBox["t", "2"], "2"], "+", FractionBox[ SuperscriptBox["t", "3"], "6"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 3], "=", 1 + $CellContext`t + Rational[1, 2] $CellContext`t^2 + Rational[1, 6] $CellContext`t^3], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.404570090070528*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "4"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", "t", "+", FractionBox[ SuperscriptBox["t", "2"], "2"], "+", FractionBox[ SuperscriptBox["t", "3"], "6"], "+", FractionBox[ SuperscriptBox["t", "4"], "24"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 4], "=", 1 + $CellContext`t + Rational[1, 2] $CellContext`t^2 + Rational[1, 6] $CellContext`t^3 + Rational[1, 24] $CellContext`t^4], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.4045700901059303`*^9}}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "5"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", "t", "+", FractionBox[ SuperscriptBox["t", "2"], "2"], "+", FractionBox[ SuperscriptBox["t", "3"], "6"], "+", FractionBox[ SuperscriptBox["t", "4"], "24"], "+", FractionBox[ SuperscriptBox["t", "5"], "120"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 5], "=", 1 + $CellContext`t + Rational[1, 2] $CellContext`t^2 + Rational[1, 6] $CellContext`t^3 + Rational[1, 24] $CellContext`t^4 + Rational[1, 120] $CellContext`t^5], Editable->False]], "Print", CellChangeTimes->{{3.4045697909969797`*^9, 3.404569816365814*^9}, { 3.404569869064645*^9, 3.404569887746338*^9}, 3.404569994688085*^9, { 3.40457005817824*^9, 3.4045700901571207`*^9}}] }, Open ]], Cell[BoxData[ RowBox[{"1", "+", "t", "+", FractionBox[ SuperscriptBox["t", "2"], "2"], "+", FractionBox[ SuperscriptBox["t", "3"], "6"], "+", FractionBox[ SuperscriptBox["t", "4"], "24"], "+", FractionBox[ SuperscriptBox["t", "5"], "120"]}]], "Output", CellChangeTimes->{{3.404569797283326*^9, 3.404569816466655*^9}, { 3.4045698691501637`*^9, 3.404569887832151*^9}, 3.404569994876327*^9, { 3.4045700582120447`*^9, 3.404570090160265*^9}}] }, Open ]], Cell[BoxData[ RowBox[{ RowBox[{"f", "[", RowBox[{"t_", ",", "y_"}], "]"}], ":=", "t"}]], "Input", CellChangeTimes->{{3.4045699966713133`*^9, 3.404570001249915*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"Picard", "[", RowBox[{"f", ",", " ", "t", ",", " ", "0", ",", " ", "1", ",", " ", "5"}], "]"}]], "Input", CellChangeTimes->{{3.4045700027118263`*^9, 3.404570005585664*^9}}], Cell[CellGroupData[{ Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "0"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", "1"}], SequenceForm[ Subscript["\[CurlyPhi]", 0], "=", 1], Editable->False]], "Print", CellChangeTimes->{ 3.404570005997134*^9, {3.404570038299335*^9, 3.404570054421179*^9}, 3.404570094996086*^9}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "1"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", FractionBox[ SuperscriptBox["t", "2"], "2"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 1], "=", 1 + Rational[1, 2] $CellContext`t^2], Editable->False]], "Print", CellChangeTimes->{ 3.404570005997134*^9, {3.404570038299335*^9, 3.404570054421179*^9}, 3.4045700949981833`*^9}], Cell[BoxData[ InterpretationBox[ RowBox[{ SubscriptBox["\<\"\[CurlyPhi]\"\>", "2"], "\[InvisibleSpace]", "\<\"=\"\>", "\[InvisibleSpace]", RowBox[{"1", "+", FractionBox[ SuperscriptBox["t", "2"], "2"]}]}], SequenceForm[ Subscript["\[CurlyPhi]", 2], "=", 1 + Rational[1, 2] $CellContext`t^2], Editable->False]], "Print", CellChangeTimes->{ 3.404570005997134*^9, {3.404570038299335*^9, 3.404570054421179*^9}, 3.4045700950492764`*^9}], Cell[BoxData["\<\"Algorithm has converged.\"\>"], "Print", CellChangeTimes->{ 3.404570005997134*^9, {3.404570038299335*^9, 3.404570054421179*^9}, 3.4045700950994883`*^9}] }, Open ]], Cell[BoxData[ RowBox[{"1", "+", FractionBox[ SuperscriptBox["t", "2"], "2"]}]], "Output", CellChangeTimes->{ 3.40457000620833*^9, {3.4045700387951527`*^9, 3.404570054426622*^9}, 3.40457009514944*^9}] }, Open ]] }, Open ]] }, Open ]] }, WindowSize->{640, 750}, WindowMargins->{{4, Automatic}, {Automatic, 4}}, FrontEndVersion->"6.0 for Mac OS X x86 (32-bit) (June 19, 2007)", StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", CharacterEncoding -> "UTF-8"] ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[590, 23, 159, 5, 112, "Section"], Cell[CellGroupData[{ Cell[774, 32, 115, 1, 34, "Subsection"], Cell[892, 35, 2393, 61, 314, "Input"], Cell[3288, 98, 277, 6, 37, "Input"], Cell[CellGroupData[{ Cell[3590, 108, 252, 5, 37, "Input"], Cell[CellGroupData[{ Cell[3867, 117, 431, 10, 22, "Print"], Cell[4301, 129, 474, 11, 20, "Print"], Cell[4778, 142, 570, 14, 40, "Print"], Cell[5351, 158, 664, 16, 41, "Print"], Cell[6018, 176, 766, 19, 41, "Print"], Cell[6787, 197, 864, 21, 41, "Print"] }, Open ]], Cell[7666, 221, 469, 12, 58, "Output"] }, Open ]], Cell[8150, 236, 172, 4, 37, "Input"], Cell[CellGroupData[{ Cell[8347, 244, 203, 4, 37, "Input"], Cell[CellGroupData[{ Cell[8575, 252, 359, 10, 22, "Print"], Cell[8937, 264, 469, 13, 40, "Print"], Cell[9409, 279, 469, 13, 40, "Print"], Cell[9881, 294, 177, 3, 20, "Print"] }, Open ]], Cell[10073, 300, 213, 6, 57, "Output"] }, Open ]] }, Open ]] }, Open ]] } ] *) (* End of internal cache information *)