(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 8.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 12667, 321] NotebookOptionsPosition[ 11914, 300] NotebookOutlinePosition[ 12260, 315] CellTagsIndexPosition[ 12217, 312] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ \:0420\:0435\:0448\:0435\:0442\:0435 \:043c\:043e\:0434\:0435\:043b\:043d\ \:0430\:0442\:0430 \:0437\:0430\:0434\:0430\:0447\:0430 u\[CloseCurlyQuote](x)=10u(1-u), 0", "Chapter", CellChangeTimes->{{3.747918045893719*^9, 3.7479180792016163`*^9}, { 3.748019567260964*^9, 3.7480195984310884`*^9}, {3.7491799306613116`*^9, 3.749179945330095*^9}, {3.7491820390416107`*^9, 3.749182140816432*^9}, { 3.7491822953940344`*^9, 3.7491823155841894`*^9}, {3.749182378833807*^9, 3.749182424987447*^9}, {3.749182543546228*^9, 3.74918254777547*^9}, { 3.7491855618392*^9, 3.749185791014152*^9}, 3.7494816355928173`*^9, { 3.7494826582226067`*^9, 3.749482678435937*^9}, {3.749483068682683*^9, 3.7494830721446886`*^9}, {3.7494884082644987`*^9, 3.7494884424507885`*^9}, {3.749488494590744*^9, 3.7494885492422333`*^9}, { 3.749488662765763*^9, 3.7494886848150673`*^9}, {3.7494887168485804`*^9, 3.749488740273077*^9}, 3.749490389264352*^9, {3.749789440131727*^9, 3.749789499828309*^9}, {3.74979010532883*^9, 3.7497901250714474`*^9}, 3.7499847604043837`*^9, {3.7499852544136286`*^9, 3.749985272769679*^9}}, FontFamily-> "Times New Roman",ExpressionUUID->"71d6cb14-925a-4d9f-afb2-1ba5c31e5c93"], Cell[BoxData[ RowBox[{ RowBox[{"RungeKuttaLogistic", "[", RowBox[{"f_", ",", "n_", ",", "t0_", ",", "T_"}], "]"}], ":=", " ", RowBox[{"(", "\[IndentingNewLine]", RowBox[{ RowBox[{"h", "=", RowBox[{ RowBox[{"(", RowBox[{"T", "-", "t0"}], ")"}], "/", "n"}]}], ";", "\[IndentingNewLine]", RowBox[{"x", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"t0", "+", RowBox[{"i", "*", "h"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "0", ",", "n"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"y", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"n", "+", "1"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"y", "[", RowBox[{"[", "1", "]"}], "]"}], " ", "=", " ", "0.1"}], ";", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "1"}], ",", " ", RowBox[{"i", "<", RowBox[{"n", "+", "1"}]}], ",", " ", RowBox[{"i", "++"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"k1", " ", "=", " ", RowBox[{"h", "*", RowBox[{"f", "[", RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], ",", RowBox[{"y", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"k2", " ", "=", " ", RowBox[{"h", "*", RowBox[{"f", "[", RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"h", "/", "2"}]}], ",", RowBox[{ RowBox[{"y", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"k1", "/", "2"}]}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"k3", " ", "=", " ", RowBox[{"h", "*", RowBox[{"f", "[", RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"h", "/", "2"}]}], ",", RowBox[{ RowBox[{"y", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{"k2", "/", "2"}]}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"k4", " ", "=", RowBox[{"h", "*", " ", RowBox[{"f", "[", RowBox[{ RowBox[{ RowBox[{"x", "[", RowBox[{"[", "i", "]"}], "]"}], "+", "h"}], ",", RowBox[{ RowBox[{"y", "[", RowBox[{"[", "i", "]"}], "]"}], "+", "k3"}]}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"y", "[", RowBox[{"[", RowBox[{"i", "+", "1"}], "]"}], "]"}], " ", "=", " ", RowBox[{ RowBox[{"y", "[", RowBox[{"[", "i", "]"}], "]"}], "+", RowBox[{ RowBox[{"1", "/", "6"}], "k1"}], "+", RowBox[{ RowBox[{"1", "/", "3"}], "k2"}], "+", RowBox[{ RowBox[{"1", "/", "3"}], "k3"}], "+", RowBox[{ RowBox[{"1", "/", "6"}], "k4"}]}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Transpose", "[", RowBox[{"{", RowBox[{"x", ",", "y"}], "}"}], "]"}]}], "\[IndentingNewLine]", ")"}]}]], "Input", CellChangeTimes->{{3.749790138229862*^9, 3.7497901566012683`*^9}, 3.7499849756016817`*^9, {3.750398226091392*^9, 3.750398389332283*^9}, { 3.7503984331110306`*^9, 3.750398439266488*^9}, {3.750398574497512*^9, 3.7503985813046026`*^9}, {3.7503986122967186`*^9, 3.75039861385282*^9}, { 3.7503987198976784`*^9, 3.750398731724861*^9}, 3.7827038487119055`*^9, { 3.7833286603219395`*^9, 3.7833286663654423`*^9}},ExpressionUUID->"1e21fb3c-05bb-4168-ab90-\ 774284e003ac"], Cell[CellGroupData[{ Cell[BoxData[{ RowBox[{ RowBox[{ RowBox[{"exact", "[", "x_", "]"}], "=", RowBox[{ RowBox[{"DSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"u", "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{"10", RowBox[{"u", "[", "t", "]"}], RowBox[{"(", RowBox[{"1", "-", RowBox[{"u", "[", "t", "]"}]}], ")"}]}]}], ",", RowBox[{ RowBox[{"u", "[", "0", "]"}], "\[Equal]", "0.1"}]}], "}"}], ",", RowBox[{"u", "[", "t", "]"}], ",", "t"}], "]"}], "[", RowBox[{"[", RowBox[{"1", ",", " ", "1", ",", " ", "2"}], "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"plotExact", " ", "=", " ", RowBox[{"Plot", "[", RowBox[{ RowBox[{"exact", "[", "x", "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", " ", "6"}], "}"}], ",", " ", RowBox[{"PlotStyle", "\[Rule]", "Red"}], ",", " ", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}], ";"}], "\[IndentingNewLine]"}], "\[IndentingNewLine]", RowBox[{"Manipulate", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{ RowBox[{"f", "[", RowBox[{"x_", ",", "u_"}], "]"}], ":=", RowBox[{"10", "u", RowBox[{"(", RowBox[{"1", "-", "u"}], ")"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"appr", " ", "=", RowBox[{"RungeKuttaLogistic", "[", RowBox[{"f", ",", "n", ",", "0", ",", "6"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"plotAppr", " ", "=", " ", RowBox[{"ListLinePlot", "[", RowBox[{"appr", ",", " ", RowBox[{"PlotMarkers", "\[Rule]", "\[FilledCircle]"}], ",", RowBox[{"PlotRange", "\[Rule]", "All"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Show", "[", RowBox[{"plotExact", ",", " ", "plotAppr"}], "]"}]}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"n", ",", "100", ",", "500", ",", "5"}], "}"}]}], "]"}]}], "Input", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmViYGAQAWIQrX99OovGh9eOym+eg+kJkvEiIFrtcbQEiG5Z6CwD or1CLsuD6NPtc5RB9JaZ3JogOmfbHBsQXc7W6wqipUpLQkD0kchT0SDa1/5T CohO/Z9bDDaHYz+zJkh+Rh4HiL6jMec0iH6WdhdMz7giewFEi/3NvQii52Z9 LNAC0lGmJ4tAdL60jE87kL764C6YjvjPGAqicxJnxIDolnqxLBD9JUERTJ9z MMsH0YnevmD60abvxSDa5+AfMO13q9W4A0hX7QwxB9HzSsotAj++dpT7yWsF olkm/rcF0U6HXrqC6H8WdyJBNI+RcwyIBgBfS6wd "],ExpressionUUID->"366eccc3-1592-4049-9fbf-bed71d471569"], Cell[BoxData[ TemplateBox[{ "Solve","ifun", "\"Inverse functions are being used by \ \\!\\(\\*RowBox[{\\\"Solve\\\"}]\\), so some solutions may not be found; use \ Reduce for complete solution information.\"",2,264,331,17881517475459895019, "Local"}, "MessageTemplate"]], "Message", "MSG", CellChangeTimes->{{3.749984966557164*^9, 3.7499849973849277`*^9}, 3.74998510635116*^9, 3.7499851471314926`*^9, 3.749985184387624*^9, { 3.7499867406933002`*^9, 3.749986747893712*^9}, 3.750398514950844*^9, 3.7503986268433294`*^9, {3.750398673032699*^9, 3.7503986960014577`*^9}, 3.782703726106019*^9, 3.782703852209978*^9, 3.783328672142101*^9},ExpressionUUID->"0b7c5296-dc64-4ea6-be88-\ fdb079bada25"], Cell[BoxData[ TagBox[ StyleBox[ DynamicModuleBox[{$CellContext`n$$ = 100, Typeset`show$$ = True, Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = "\"untitled\"", Typeset`specs$$ = {{ Hold[$CellContext`n$$], 100, 500, 5}}, Typeset`size$$ = { 360., {108., 113.}}, Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = True, $CellContext`n$34616$$ = 0}, DynamicBox[Manipulate`ManipulateBoxes[ 1, StandardForm, "Variables" :> {$CellContext`n$$ = 100}, "ControllerVariables" :> { Hold[$CellContext`n$$, $CellContext`n$34616$$, 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`f[ Pattern[$CellContext`x, Blank[]], Pattern[$CellContext`u, Blank[]]] := 10 $CellContext`u ( 1 - $CellContext`u); $CellContext`appr = \ $CellContext`RungeKuttaLogistic[$CellContext`f, $CellContext`n$$, 0, 6]; $CellContext`plotAppr = ListLinePlot[$CellContext`appr, PlotMarkers -> $CellContext`\[FilledCircle], PlotRange -> All]; Show[$CellContext`plotExact, $CellContext`plotAppr]), "Specifications" :> {{$CellContext`n$$, 100, 500, 5}}, "Options" :> {}, "DefaultOptions" :> {}], ImageSizeCache->{411., {155., 161.}}, SingleEvaluation->True], Deinitialization:>None, DynamicModuleValues:>{}, SynchronousInitialization->True, UndoTrackedVariables:>{Typeset`show$$, Typeset`bookmarkMode$$}, UnsavedVariables:>{Typeset`initDone$$}, UntrackedVariables:>{Typeset`size$$}], "Manipulate", Deployed->True, StripOnInput->False], Manipulate`InterpretManipulate[1]]], "Output", CellChangeTimes->{{3.7497904170501113`*^9, 3.749790432535183*^9}, { 3.7497905050423784`*^9, 3.7497906202479553`*^9}, {3.7497917791337843`*^9, 3.749791812556514*^9}, {3.7497933765718575`*^9, 3.749793420403587*^9}, { 3.749794697393198*^9, 3.749794711089302*^9}, 3.749984739125167*^9, { 3.7499849665821657`*^9, 3.749984997565938*^9}, 3.749985106509169*^9, 3.749985147165495*^9, 3.7499851844216256`*^9, {3.7499867407433033`*^9, 3.7499867479407153`*^9}, 3.750398515402583*^9, 3.750398626889305*^9, { 3.75039867306668*^9, 3.7503986960324383`*^9}, 3.7827037264664507`*^9, 3.782703852271942*^9, 3.783328672219056*^9},ExpressionUUID->"5ebaf8be-4d98-4421-91d4-\ 25cadf32d9a4"] }, Open ]] }, Open ]] }, WindowSize->{1349, 709}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, FrontEndVersion->"11.2 for Microsoft Windows (64-bit) (September 10, 2017)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[579, 22, 1436, 23, 193, "Chapter",ExpressionUUID->"71d6cb14-925a-4d9f-afb2-1ba5c31e5c93"], Cell[2018, 47, 3923, 109, 295, "Input",ExpressionUUID->"1e21fb3c-05bb-4168-ab90-774284e003ac"], Cell[CellGroupData[{ Cell[5966, 160, 2492, 65, 181, "Input",ExpressionUUID->"366eccc3-1592-4049-9fbf-bed71d471569"], Cell[8461, 227, 720, 14, 21, "Message",ExpressionUUID->"0b7c5296-dc64-4ea6-be88-fdb079bada25"], Cell[9184, 243, 2702, 53, 335, "Output",ExpressionUUID->"5ebaf8be-4d98-4421-91d4-25cadf32d9a4"] }, Open ]] }, Open ]] } ] *)