(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 11.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       158,          7]
NotebookDataLength[     42941,       1111]
NotebookOptionsPosition[     39937,        998]
NotebookOutlinePosition[     40337,       1015]
CellTagsIndexPosition[     40294,       1012]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Mathematica tools to study delay differential equations", "Title",
 CellChangeTimes->{{3.6803436809633603`*^9, 3.680343714873103*^9}, 
   3.6803437502124243`*^9}],

Cell[CellGroupData[{

Cell["Summary", "Section",
 CellChangeTimes->{{3.6803437923637676`*^9, 3.6803438203140335`*^9}}],

Cell["\<\
Mathematica has built-in commands to solve delay differential equation with \
constant delays both symbolically and numerically. In this workshop we will \
work on projects in which we first consider elementary  ordinary differential \
equations and then we introduce delays and compare the properties of them. We \
implement the methods in Mathematica studied in the morning introductory \
courses. The most important concepts are summarized in the poster attached.\
\>", "Text",
 CellChangeTimes->{{3.6803438221000133`*^9, 3.680344133263152*^9}, {
  3.6803441726486826`*^9, 3.6803442442951527`*^9}, {3.680344278254654*^9, 
  3.6803443209694386`*^9}, {3.6803479384170065`*^9, 3.6803479447061677`*^9}, {
  3.682399310297676*^9, 3.6823993106779757`*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Project 1: Introduction to the tools to study ODE\[CloseCurlyQuote]s", \
"Chapter",
 CellChangeTimes->{{3.6803438221000133`*^9, 3.680344133263152*^9}, {
  3.6803441726486826`*^9, 3.680344186598686*^9}, {3.680357826768152*^9, 
  3.6803578304716682`*^9}, {3.6823992715853786`*^9, 3.682399289802273*^9}}],

Cell[CellGroupData[{

Cell["Goals", "Section",
 CellChangeTimes->{{3.6803579202020936`*^9, 3.6803579436600676`*^9}, 
   3.680357995670724*^9}],

Cell["\<\
Introduction to Mathematica and learning the basic tools for differential \
equations and visualization\
\>", "Text",
 CellChangeTimes->{{3.680357948078904*^9, 3.680357992435274*^9}, {
  3.680358023497876*^9, 3.680358043527462*^9}, {3.680358079836583*^9, 
  3.6803580989843874`*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell["Task", "Section",
 CellChangeTimes->{{3.680358008909094*^9, 3.6803580173942356`*^9}}],

Cell[TextData[{
 "Investigate the differential equation of Malthusian population model: ",
 Cell[BoxData[
  FormBox[
   RowBox[{" ", 
    RowBox[{
     RowBox[{
      RowBox[{"p", "'"}], 
      RowBox[{"(", "t", ")"}]}], "=", 
     RowBox[{"k", " ", 
      RowBox[{"p", "(", "t", ")"}]}]}]}], TraditionalForm]]],
 ", i.e., growht if ",
 Cell[BoxData[
  FormBox[
   RowBox[{"k", ">", "0"}], TraditionalForm]]],
 " and decay if ",
 Cell[BoxData[
  FormBox[
   RowBox[{"k", "<", "0"}], TraditionalForm]]],
 "."
}], "Text",
 CellChangeTimes->{{3.6803442710960474`*^9, 3.6803442742831683`*^9}, {
  3.6803443489543886`*^9, 3.6803444547939205`*^9}, {3.6803500450177865`*^9, 
  3.6803500559383497`*^9}, {3.6810576438324766`*^9, 3.6810577504511642`*^9}}],

Cell["In Mathematica, it is written as", "Text",
 CellChangeTimes->{{3.6803442710960474`*^9, 3.6803442742831683`*^9}, {
  3.6803443489543886`*^9, 3.6803444547939205`*^9}, {3.6803500450177865`*^9, 
  3.6803500579078913`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ode", "=", 
  RowBox[{
   RowBox[{
    RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", 
   RowBox[{"k", " ", 
    RowBox[{"p", "[", "t", "]"}]}]}]}]], "Input",
 CellChangeTimes->{{3.6803443850182686`*^9, 3.6803443950877733`*^9}, {
   3.6803444583121624`*^9, 3.680344462467309*^9}, 3.6810577559412007`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   SuperscriptBox["p", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}], "\[Equal]", 
  RowBox[{"k", " ", 
   RowBox[{"p", "[", "t", "]"}]}]}]], "Output",
 CellChangeTimes->{3.680349898135892*^9, 3.6810577595586615`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Direction field and the stream", "Section",
 CellChangeTimes->{{3.680350104282704*^9, 3.6803501206846504`*^9}}],

Cell["\<\
The direction field (showing the tangent vectors of solutions in the space \
{t,p}) is a function of two variables:\
\>", "Text",
 CellChangeTimes->{{3.6803496940334125`*^9, 3.680349749890052*^9}, 
   3.6803500679291105`*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"fld", "=", 
  RowBox[{"{", 
   RowBox[{"1", ",", 
    RowBox[{"k", " ", "p"}]}], "}"}]}]], "Input",
 CellChangeTimes->{{3.6803497536245017`*^9, 3.6803497679391737`*^9}, 
   3.681057771469119*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"1", ",", 
   RowBox[{"k", " ", "p"}]}], "}"}]], "Output",
 CellChangeTimes->{{3.6803499002689114`*^9, 3.680349915094723*^9}, 
   3.6810577745883646`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Equilibrium", "Section",
 CellChangeTimes->{{3.6803501264183836`*^9, 3.680350137457404*^9}}],

Cell["\<\
 The equilibria of a differential equation x\[CloseCurlyQuote]=f(t,x) are the \
solutions of f(t,x)=0. 
Equations can be solved in Mathematica basically with Solve (symbolic, gives \
all solutions) or FindRoot (approximate from an initial value):\
\>", "Text",
 CellChangeTimes->{{3.6803501384799824`*^9, 3.680350211256872*^9}, {
  3.680354211945733*^9, 3.6803543111930723`*^9}, {3.6803543700256233`*^9, 
  3.6803544032199736`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"equilib", "=", 
  RowBox[{"Solve", "[", 
   RowBox[{
    RowBox[{
     RowBox[{"fld", "[", 
      RowBox[{"[", "2", "]"}], "]"}], "\[Equal]", "0"}], ",", "p"}], 
   "]"}]}]], "Input",
 CellChangeTimes->{{3.6803543172107897`*^9, 3.6803543470836515`*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"{", 
   RowBox[{"p", "\[Rule]", "0"}], "}"}], "}"}]], "Output",
 CellChangeTimes->{{3.6803543415805063`*^9, 3.6803543485480733`*^9}, 
   3.6810577919839554`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 "Manipulate the direction field by dynamically changing ",
 StyleBox["k",
  FontSlant->"Italic"],
 ":"
}], "Section",
 CellChangeTimes->{{3.68034979184599*^9, 3.680349824419441*^9}, {
  3.6803498614262238`*^9, 3.6803498713501005`*^9}, {3.6807978712999287`*^9, 
  3.6807978973211403`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Manipulate", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"VectorPlot", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"1", ",", " ", 
        RowBox[{"k", " ", "p"}]}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"t", ",", "0", ",", "5"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"p", ",", "0", ",", "2"}], "}"}], ",", 
      RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{"k", ",", 
      RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}], 
  "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.6803498266907034`*^9, 3.6803498548687887`*^9}, {
  3.6803499102771144`*^9, 3.6803499347867103`*^9}, {3.680797952191117*^9, 
  3.680798050129134*^9}, {3.681057796007687*^9, 3.6810578023654504`*^9}}],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`k$$ = -2., Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{
      Hold[$CellContext`k$$], -2, 2}}, Typeset`size$$ = {648., {145., 156.}}, 
    Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
    True, $CellContext`k$3383$$ = 0}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`k$$ = -2}, 
      "ControllerVariables" :> {
        Hold[$CellContext`k$$, $CellContext`k$3383$$, 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" :> 
      VectorPlot[{
        1, $CellContext`k$$ $CellContext`p}, {$CellContext`t, 0, 
         5}, {$CellContext`p, 0, 2}, AspectRatio -> Automatic], 
      "Specifications" :> {{$CellContext`k$$, -2, 2}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{730., {219., 230.}},
     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.6803499041040893`*^9, 3.6803499357416496`*^9}, {
   3.6807980108286476`*^9, 3.6807980513080845`*^9}, 3.6810578041286945`*^9}]
}, Open  ]],

Cell[BoxData[","], "Input",
 CellChangeTimes->{3.6807980344169044`*^9}],

Cell["... or the stream is much nicer", "Text",
 CellChangeTimes->{{3.680349954312729*^9, 3.6803499732550945`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"Manipulate", "[", "\[IndentingNewLine]", 
   RowBox[{
    RowBox[{"StreamPlot", "[", 
     RowBox[{
      RowBox[{"{", 
       RowBox[{"1", ",", " ", 
        RowBox[{"k", " ", "p"}]}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"t", ",", "0", ",", "5"}], "}"}], ",", 
      RowBox[{"{", 
       RowBox[{"p", ",", "0", ",", "2"}], "}"}], ",", 
      RowBox[{"AspectRatio", "\[Rule]", "Automatic"}]}], "]"}], ",", 
    "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{"k", ",", 
      RowBox[{"-", "2"}], ",", "2"}], "}"}]}], "]"}], 
  "\[IndentingNewLine]"}]], "Input",
 CellChangeTimes->{{3.6803498266907034`*^9, 3.6803498548687887`*^9}, {
  3.6803499102771144`*^9, 3.6803499347867103`*^9}, {3.680797952191117*^9, 
  3.6807980779277134`*^9}, {3.6810578151379986`*^9, 3.6810578191620493`*^9}}],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`k$$ = -2, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{
      Hold[$CellContext`k$$], -2, 2}}, Typeset`size$$ = {648., {138., 148.}}, 
    Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
    True, $CellContext`k$5289$$ = 0}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`k$$ = -2}, 
      "ControllerVariables" :> {
        Hold[$CellContext`k$$, $CellContext`k$5289$$, 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" :> 
      StreamPlot[{
        1, $CellContext`k$$ $CellContext`p}, {$CellContext`t, 0, 
         5}, {$CellContext`p, 0, 2}, AspectRatio -> Automatic], 
      "Specifications" :> {{$CellContext`k$$, -2, 2}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{730., {212., 223.}},
     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.680798079497562*^9, 3.681057821327879*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Symbolic solution (DSolve, DSolveValue)", "Section",
 CellChangeTimes->{{3.680354483285797*^9, 3.680354493894696*^9}, {
  3.6803545633893867`*^9, 3.68035456972301*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"Clear", "[", "k", "]"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{"ode", "=", 
  RowBox[{
   RowBox[{
    RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", 
   RowBox[{"k", " ", 
    RowBox[{"p", "[", "t", "]"}]}]}]}]}], "Input",
 CellChangeTimes->{{3.6803443850182686`*^9, 3.6803443950877733`*^9}, {
   3.6803444583121624`*^9, 3.680344462467309*^9}, {3.680354599297612*^9, 
   3.6803545996447678`*^9}, 3.6810578268531046`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{
   SuperscriptBox["p", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}], "\[Equal]", 
  RowBox[{"k", " ", 
   RowBox[{"p", "[", "t", "]"}]}]}]], "Output",
 CellChangeTimes->{3.6803544789295864`*^9, 3.68035463009929*^9, 
  3.6810578279755955`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{
  RowBox[{"sol", "[", 
   RowBox[{"t_", ",", "k_", ",", "p0_"}], "]"}], "=", 
  RowBox[{"DSolveValue", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", 
       RowBox[{"k", " ", 
        RowBox[{"p", "[", "t", "]"}]}]}], ",", " ", 
      RowBox[{
       RowBox[{"p", "[", "0", "]"}], "\[Equal]", "p0"}]}], "}"}], ",", 
    RowBox[{"p", "[", "t", "]"}], ",", "t"}], "]"}]}]], "Input",
 CellChangeTimes->{{3.6803545577148275`*^9, 3.680354661636848*^9}, 
   3.680356961889368*^9, 3.6803571508287992`*^9, 3.6810578336124954`*^9}],

Cell[BoxData[
 RowBox[{
  SuperscriptBox["\[ExponentialE]", 
   RowBox[{"k", " ", "t"}]], " ", "p0"}]], "Output",
 CellChangeTimes->{{3.6803546222757125`*^9, 3.6803546629379745`*^9}, 
   3.680357153831312*^9, 3.6810578356312957`*^9}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Numerical solution (NDSolve, NDSolveValue)", "Section",
 CellChangeTimes->{{3.680354483285797*^9, 3.680354493894696*^9}, {
  3.6803545633893867`*^9, 3.68035456972301*^9}, {3.680354678274607*^9, 
  3.6803546875332556`*^9}}],

Cell["No symbolic parameter allowed!!!", "Text",
 CellChangeTimes->{{3.680354711639075*^9, 3.6803547290265875`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nsol", "[", 
   RowBox[{"t_", ",", "k_", ",", "p0_"}], "]"}], ":=", 
  RowBox[{"NDSolveValue", "[", 
   RowBox[{
    RowBox[{"{", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", 
       RowBox[{"k", " ", 
        RowBox[{"p", "[", "t", "]"}]}]}], ",", " ", 
      RowBox[{
       RowBox[{"p", "[", "0", "]"}], "\[Equal]", "p0"}]}], "}"}], ",", 
    RowBox[{"p", "[", "t", "]"}], ",", 
    RowBox[{"{", 
     RowBox[{"t", ",", "0", ",", "5"}], "}"}]}], "]"}]}]], "Input",
 CellChangeTimes->{{3.6803545577148275`*^9, 3.680354661636848*^9}, 
   3.6803547037941923`*^9, 3.6803568631346054`*^9, 3.680356931482085*^9, 
   3.6803569661542444`*^9, {3.6803570668992014`*^9, 3.680357071963025*^9}, 
   3.680357159533372*^9, 3.6810578429315743`*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"nsol", "[", 
  RowBox[{"t", ",", "1", ",", "1"}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  TagBox[
   TemplateBox[{RowBox[{
       StyleBox[
        TagBox["InterpolatingFunction", "SummaryHead"], 
        "NonInterpretableSummary"], 
       StyleBox["[", "NonInterpretableSummary"], 
       DynamicModuleBox[{Typeset`open$$ = False}, 
        PanelBox[
         PaneSelectorBox[{False -> GridBox[{{
               PaneBox[
                ButtonBox[
                 DynamicBox[
                  FEPrivate`FrontEndResource[
                  "FEBitmaps", "SquarePlusIconMedium"]], 
                 ButtonFunction :> (Typeset`open$$ = True), Appearance -> 
                 None, Evaluator -> Automatic, Method -> "Preemptive"], 
                Alignment -> {Center, Center}, ImageSize -> 
                Dynamic[{
                  Automatic, 
                   3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                    Magnification])}]], 
               GraphicsBox[{{{{}, {}, {
                    Directive[
                    Opacity[1.], 
                    RGBColor[0.368417, 0.506779, 0.709798], 
                    AbsoluteThickness[1]], 
                    LineBox[CompressedData["
1:eJwB0QMu/CFib1JlAgAAADwAAAACAAAAStFeOa+/dj4PooDS///vPzd0wYnD
3bQ/sjO2msR+7T/SUFjDa77FP9KIcvIsAOs/IqE47Akn0D+Y40JvwNzoP9Wb
k3tZVNU/Z36DJi3u5j+7wbiC/fHaP9QeimgKAeU/gEqXStgX4D9w7bf0QVrj
P7tJtw/c7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xZky4E/CC6jzRNWE0D6
+KgzRUqAP2z7RgaIqhNATr5M3UIAfj8yFFD6//8TQFnKLENAmXs/jOvHsg==

                    "]]}}}, {}, {}}, {
                DisplayFunction -> Identity, Ticks -> {Automatic, Automatic}, 
                 AxesOrigin -> {0, 0}, 
                 FrameTicks -> {{None, None}, {None, None}}, 
                 GridLines -> {None, None}, DisplayFunction -> Identity, 
                 PlotRangePadding -> {{
                    Scaled[0.1], 
                    Scaled[0.1]}, {
                    Scaled[0.1], 
                    Scaled[0.1]}}, PlotRangeClipping -> True, ImagePadding -> 
                 All, DisplayFunction -> Identity, AspectRatio -> 1, 
                 Axes -> {False, False}, AxesLabel -> {None, None}, 
                 AxesOrigin -> {0, 0}, DisplayFunction :> Identity, 
                 Frame -> {{True, True}, {True, True}}, 
                 FrameLabel -> {{None, None}, {None, None}}, FrameStyle -> 
                 Directive[
                   Opacity[0.5], 
                   Thickness[Tiny], 
                   RGBColor[0.368417, 0.506779, 0.709798]], 
                 FrameTicks -> {{None, None}, {None, None}}, 
                 GridLines -> {None, None}, GridLinesStyle -> Directive[
                   GrayLevel[0.5, 0.4]], ImageSize -> 
                 Dynamic[{
                   Automatic, 
                    3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                    Magnification])}], 
                 Method -> {
                  "DefaultBoundaryStyle" -> Automatic, "DefaultMeshStyle" -> 
                   AbsolutePointSize[6], "ScalingFunctions" -> None, 
                   "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 1, 
                    2][#]& )[
                    Part[#, 1]], 
                    (Part[{{Identity, Identity}, {Identity, Identity}}, 2, 
                    2][#]& )[
                    Part[#, 2]]}& ), "CopiedValueFunction" -> ({
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 1, 
                    2][#]& )[
                    Part[#, 1]], 
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 2, 
                    2][#]& )[
                    Part[#, 2]]}& )}}, 
                 PlotRange -> {{0., 5.}, {0., 0.9999999152542517}}, 
                 PlotRangeClipping -> True, PlotRangePadding -> {{
                    Scaled[0.1], 
                    Scaled[0.1]}, {
                    Scaled[0.1], 
                    Scaled[0.1]}}, Ticks -> {Automatic, Automatic}}], 
               GridBox[{{
                  RowBox[{
                    TagBox["\"Domain: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox[
                    RowBox[{"{", 
                    RowBox[{"{", 
                    RowBox[{"0.`", ",", "5.`"}], "}"}], "}"}], 
                    "SummaryItem"]}]}, {
                  RowBox[{
                    TagBox["\"Output: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox["\"scalar\"", "SummaryItem"]}]}}, 
                GridBoxAlignment -> {
                 "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
                False, GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{2}}, "Rows" -> {{Automatic}}}, 
                BaseStyle -> {
                 ShowStringCharacters -> False, NumberMarks -> False, 
                  PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
             GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False, 
             GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             BaselinePosition -> {1, 1}], True -> GridBox[{{
               PaneBox[
                ButtonBox[
                 DynamicBox[
                  FEPrivate`FrontEndResource[
                  "FEBitmaps", "SquareMinusIconMedium"]], 
                 ButtonFunction :> (Typeset`open$$ = False), Appearance -> 
                 None, Evaluator -> Automatic, Method -> "Preemptive"], 
                Alignment -> {Center, Center}, ImageSize -> 
                Dynamic[{
                  Automatic, 
                   3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                    Magnification])}]], 
               GraphicsBox[{{{{}, {}, {
                    Directive[
                    Opacity[1.], 
                    RGBColor[0.368417, 0.506779, 0.709798], 
                    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ATPyU/J/klD/iQSI0QtYPQLT6unoyJJM/8mdUAc0+EEAI1i9QtqORP6ZR
FDB+mRBAfFLklvokkD96IyEXh/IQQOrpbQaVmY0/JADj7pBFEUDG0UlkXUuL
P4F/IQ6gnxFAHjodVxb/iD+0CRUesPMRQJcFzVu+Boc/mjaFdcVOEkBCoJFd
ExGFP59LQoUyqBJANZpO5Q5Ogz96a7SFoPsSQIZaWxZky4E/CC6jzRNWE0D6
+KgzRUqAP2z7RgaIqhNATr5M3UIAfj8yFFD6//8TQFnKLENAmXs/jOvHsg==

                    "]]}}}, {}, {}}, {
                DisplayFunction -> Identity, Ticks -> {Automatic, Automatic}, 
                 AxesOrigin -> {0, 0}, 
                 FrameTicks -> {{None, None}, {None, None}}, 
                 GridLines -> {None, None}, DisplayFunction -> Identity, 
                 PlotRangePadding -> {{
                    Scaled[0.1], 
                    Scaled[0.1]}, {
                    Scaled[0.1], 
                    Scaled[0.1]}}, PlotRangeClipping -> True, ImagePadding -> 
                 All, DisplayFunction -> Identity, AspectRatio -> 1, 
                 Axes -> {False, False}, AxesLabel -> {None, None}, 
                 AxesOrigin -> {0, 0}, DisplayFunction :> Identity, 
                 Frame -> {{True, True}, {True, True}}, 
                 FrameLabel -> {{None, None}, {None, None}}, FrameStyle -> 
                 Directive[
                   Opacity[0.5], 
                   Thickness[Tiny], 
                   RGBColor[0.368417, 0.506779, 0.709798]], 
                 FrameTicks -> {{None, None}, {None, None}}, 
                 GridLines -> {None, None}, GridLinesStyle -> Directive[
                   GrayLevel[0.5, 0.4]], ImageSize -> 
                 Dynamic[{
                   Automatic, 
                    3.5 (CurrentValue["FontCapHeight"]/AbsoluteCurrentValue[
                    Magnification])}], 
                 Method -> {
                  "DefaultBoundaryStyle" -> Automatic, "DefaultMeshStyle" -> 
                   AbsolutePointSize[6], "ScalingFunctions" -> None, 
                   "CoordinatesToolOptions" -> {"DisplayFunction" -> ({
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 1, 
                    2][#]& )[
                    Part[#, 1]], 
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 2, 
                    2][#]& )[
                    Part[#, 2]]}& ), "CopiedValueFunction" -> ({
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 1, 
                    2][#]& )[
                    Part[#, 1]], 
                    (
                    Part[{{Identity, Identity}, {Identity, Identity}}, 2, 
                    2][#]& )[
                    Part[#, 2]]}& )}}, 
                 PlotRange -> {{0., 5.}, {0., 0.9999999152542517}}, 
                 PlotRangeClipping -> True, PlotRangePadding -> {{
                    Scaled[0.1], 
                    Scaled[0.1]}, {
                    Scaled[0.1], 
                    Scaled[0.1]}}, Ticks -> {Automatic, Automatic}}], 
               GridBox[{{
                  RowBox[{
                    TagBox["\"Domain: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox[
                    RowBox[{"{", 
                    RowBox[{"{", 
                    RowBox[{"0.`", ",", "5.`"}], "}"}], "}"}], 
                    "SummaryItem"]}]}, {
                  RowBox[{
                    TagBox["\"Output: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox["\"scalar\"", "SummaryItem"]}]}, {
                  RowBox[{
                    TagBox["\"Order: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox["3", "SummaryItem"]}]}, {
                  RowBox[{
                    TagBox["\"Method: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox["\"Hermite\"", "SummaryItem"]}]}, {
                  RowBox[{
                    TagBox["\"Periodic: \"", "SummaryItemAnnotation"], 
                    "\[InvisibleSpace]", 
                    TagBox["False", "SummaryItem"]}]}}, 
                GridBoxAlignment -> {
                 "Columns" -> {{Left}}, "Rows" -> {{Automatic}}}, AutoDelete -> 
                False, GridBoxItemSize -> {
                 "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
                GridBoxSpacings -> {
                 "Columns" -> {{2}}, "Rows" -> {{Automatic}}}, 
                BaseStyle -> {
                 ShowStringCharacters -> False, NumberMarks -> False, 
                  PrintPrecision -> 3, ShowSyntaxStyles -> False}]}}, 
             GridBoxAlignment -> {"Rows" -> {{Top}}}, AutoDelete -> False, 
             GridBoxItemSize -> {
              "Columns" -> {{Automatic}}, "Rows" -> {{Automatic}}}, 
             BaselinePosition -> {1, 1}]}, 
          Dynamic[Typeset`open$$], ImageSize -> Automatic], BaselinePosition -> 
         Baseline], DynamicModuleValues :> {}], 
       StyleBox["]", "NonInterpretableSummary"]}]},
    "CopyTag",
    DisplayFunction->(#& ),
    InterpretationFunction->("InterpolatingFunction[{{0., 5.}}, <>]"& )],
   False,
   Editable->False,
   SelectWithContents->True,
   Selectable->False], "[", "t", "]"}]], "Output",
 CellChangeTimes->{
  3.680357104183727*^9, {3.6803571642819614`*^9, 3.68035717552032*^9}}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Visualization", "Section",
 CellChangeTimes->{{3.68035690544081*^9, 3.680356927980993*^9}}],

Cell[CellGroupData[{

Cell["Visualize the solution at fixed data :", "Subsubsection",
 CellChangeTimes->{{3.6803568688831034`*^9, 3.6803568896094837`*^9}, 
   3.680356943752979*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Plot", "[", 
  RowBox[{
   RowBox[{"Evaluate", "[", 
    RowBox[{"nsol", "[", 
     RowBox[{"t", ",", "1", ",", "1"}], "]"}], "]"}], ",", 
   RowBox[{"{", 
    RowBox[{"t", ",", "0", ",", "5"}], "}"}]}], "]"}]], "Input",
 CellChangeTimes->{{3.680356945591123*^9, 3.6803570003371153`*^9}}],

Cell[BoxData[
 GraphicsBox[{{{}, {}, 
    {RGBColor[0.368417, 0.506779, 0.709798], AbsoluteThickness[1.6], Opacity[
     1.], LineBox[CompressedData["
1:eJwVkHk41HkAhyfjCJPrV/OQcdTjSQ1ZE3I8y/cjK02u1hJia34/RhemsGlL
WlQiR6JUiqS1mzK7W3YRWZtO11ZqO7aWDuTafkwjJrHtH+/z/vs+7wJGFiRV
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ze43GWFkyzNrJ7MIsH+/brkj
pGAhDLbXXbAeslO5VFY+BV5ScZhHmQTts6zeri6gUKaYDs+tlEC48Uorr5BC
mi9b0F0twWtRf9rhYxS+qHhTldsoQdgtsMWnKbxt3/mDwVMJVowp2isvUFh7
qEjt8jwa/FXrDly/RaGoaaA8MZ9GYjVLH7hDwZgWudsW07hrlOm+qo3CIotu
9zelNA49v/yurZOCJDD+my1yGpzEOVFdDymkC6X9xR00Bk83k5evKOibq1kf
5zHw4YaanuulENf7oD1zLoNzm0bGpf0UXAModpeAwQaH+fKBQQql0gc1W20Z
PLidKBgdpdAasp1O9mMgstOZuKSgwN6vEmQEM8grPNOVpKSQXBNEH4lkIF7f
kT0x8alP821OQyyDypaomCsqClrWr3c8TGKgvkTlmTJF4eYcMTuWwoDOO2zm
MU2h3qhURe1n0KRYNDkz8+lXXlSxSy6D/wA3TyRM
      "]]}}, {}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->{True, True},
  AxesLabel->{None, None},
  AxesOrigin->{0, 0},
  DisplayFunction->Identity,
  Frame->{{False, False}, {False, False}},
  FrameLabel->{{None, None}, {None, None}},
  FrameTicks->{{Automatic, Automatic}, {Automatic, Automatic}},
  GridLines->{None, None},
  GridLinesStyle->Directive[
    GrayLevel[0.5, 0.4]],
  ImagePadding->All,
  Method->{
   "DefaultBoundaryStyle" -> Automatic, "DefaultMeshStyle" -> 
    AbsolutePointSize[6], "ScalingFunctions" -> None},
  PlotRange->{{0, 5}, {0., 148.41315812534788`}},
  PlotRangeClipping->True,
  PlotRangePadding->{{
     Scaled[0.02], 
     Scaled[0.02]}, {
     Scaled[0.05], 
     Scaled[0.05]}},
  Ticks->{Automatic, Automatic}]], "Output",
 CellChangeTimes->{{3.6803569878566537`*^9, 3.680357002339585*^9}, 
   3.6803571853657856`*^9, 3.681057851715111*^9}]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Dynamic visualization of solutions", "Section",
 CellChangeTimes->{{3.6803571912536645`*^9, 3.680357206770722*^9}, {
  3.6807982484200945`*^9, 3.6807982511534557`*^9}}],

Cell[CellGroupData[{

Cell["A simple example", "Subsubsection",
 CellChangeTimes->{{3.6803575996760373`*^9, 3.6803576127682114`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Manipulate", "[", "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"Plot", "[", 
    RowBox[{
     RowBox[{"E", "^", 
      RowBox[{"(", 
       RowBox[{"k", " ", "t"}], ")"}]}], ",", 
     RowBox[{"{", 
      RowBox[{"t", ",", "0", ",", "5"}], "}"}], ",", 
     RowBox[{"PlotRange", "\[Rule]", "All"}], ",", 
     RowBox[{"AxesOrigin", "\[Rule]", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}], ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{"k", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}]}], "\[IndentingNewLine]", 
  "]"}]], "Input",
 CellChangeTimes->{{3.680357614572609*^9, 3.680357679297385*^9}, {
  3.681057859836135*^9, 3.6810579170338445`*^9}}],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`k$$ = -0.494, Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{
      Hold[$CellContext`k$$], -1, 1}}, Typeset`size$$ = {648., {194., 203.}}, 
    Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
    True, $CellContext`k$13952$$ = 0}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, "Variables" :> {$CellContext`k$$ = -1}, 
      "ControllerVariables" :> {
        Hold[$CellContext`k$$, $CellContext`k$13952$$, 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" :> 
      Plot[E^($CellContext`k$$ $CellContext`t), {$CellContext`t, 0, 5}, 
        PlotRange -> All, AxesOrigin -> {0, 0}], 
      "Specifications" :> {{$CellContext`k$$, -1, 1}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{730., {267., 278.}},
     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.680357660911154*^9, 3.6803576805366263`*^9}, 
   3.6810578607362013`*^9, {3.681057895119451*^9, 3.6810579177492447`*^9}}]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Visualize the solutions", "Subsubsection",
 CellChangeTimes->{{3.680357704217842*^9, 3.6803577123224545`*^9}, 
   3.6803577641355114`*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Manipulate", "[", "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"DynamicModule", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{"p", ",", "nsol"}], "}"}], ",", 
     RowBox[{
      RowBox[{
       RowBox[{"nsol", "[", 
        RowBox[{"t_", ",", "k_", ",", "p0_"}], "]"}], ":=", 
       RowBox[{"NDSolveValue", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{
           RowBox[{
            RowBox[{
             RowBox[{"p", "'"}], "[", "t", "]"}], "\[Equal]", 
            RowBox[{
             RowBox[{"-", "k"}], " ", 
             RowBox[{"p", "[", "t", "]"}]}]}], ",", " ", 
           RowBox[{
            RowBox[{"p", "[", "0", "]"}], "\[Equal]", "p0"}]}], "}"}], ",", 
         RowBox[{"p", "[", "t", "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"t", ",", "0", ",", "T"}], "}"}]}], "]"}]}], ";", 
      "\[IndentingNewLine]", 
      RowBox[{"Plot", "[", 
       RowBox[{
        RowBox[{"Evaluate", "[", 
         RowBox[{"nsol", "[", 
          RowBox[{"t", ",", "k", ",", "p0"}], "]"}], "]"}], ",", 
        RowBox[{"{", 
         RowBox[{"t", ",", "0", ",", "T"}], "}"}], ",", 
        RowBox[{"PlotRange", "\[Rule]", "All"}], ",", 
        RowBox[{"AxesOrigin", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{"0", ",", "0"}], "}"}]}]}], "]"}]}]}], 
    "\[IndentingNewLine]", "]"}], ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{"k", ",", 
     RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", "\[IndentingNewLine]", 
   RowBox[{"{", 
    RowBox[{"p0", ",", "1", ",", "0"}], "}"}], ",", 
   RowBox[{"{", 
    RowBox[{"T", ",", "1", ",", "10"}], "}"}]}], "\[IndentingNewLine]", 
  "]"}]], "Input",
 CellChangeTimes->{{3.680357254315432*^9, 3.680357422411628*^9}, {
  3.680357498154586*^9, 3.680357546547616*^9}, {3.681057941232812*^9, 
  3.6810579643805823`*^9}}],

Cell[BoxData[
 TagBox[
  StyleBox[
   DynamicModuleBox[{$CellContext`k$$ = -1., $CellContext`p0$$ = 
    1, $CellContext`T$$ = 1., Typeset`show$$ = True, 
    Typeset`bookmarkList$$ = {}, Typeset`bookmarkMode$$ = "Menu", 
    Typeset`animator$$, Typeset`animvar$$ = 1, Typeset`name$$ = 
    "\"untitled\"", Typeset`specs$$ = {{
      Hold[$CellContext`k$$], -1, 1}, {
      Hold[$CellContext`p0$$], 1, 0}, {
      Hold[$CellContext`T$$], 1, 10}}, Typeset`size$$ = {648., {194., 203.}}, 
    Typeset`update$$ = 0, Typeset`initDone$$, Typeset`skipInitDone$$ = 
    True, $CellContext`k$20755$$ = 0, $CellContext`p0$20756$$ = 
    0, $CellContext`T$20757$$ = 0}, 
    DynamicBox[Manipulate`ManipulateBoxes[
     1, StandardForm, 
      "Variables" :> {$CellContext`k$$ = -1, $CellContext`p0$$ = 
        1, $CellContext`T$$ = 1}, "ControllerVariables" :> {
        Hold[$CellContext`k$$, $CellContext`k$20755$$, 0], 
        Hold[$CellContext`p0$$, $CellContext`p0$20756$$, 0], 
        Hold[$CellContext`T$$, $CellContext`T$20757$$, 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" :> 
      DynamicModule[{$CellContext`p, $CellContext`nsol}, $CellContext`nsol[
           Pattern[$CellContext`t$, 
            Blank[]], 
           Pattern[$CellContext`k$, 
            Blank[]], 
           Pattern[$CellContext`p0$, 
            Blank[]]] := 
         NDSolveValue[{
           Derivative[
             1][$CellContext`p][$CellContext`t$] == (-$CellContext`k$) \
$CellContext`p[$CellContext`t$], $CellContext`p[0] == $CellContext`p0$}, 
           $CellContext`p[$CellContext`t$], {$CellContext`t$, 
            0, $CellContext`T$$}]; Plot[
          Evaluate[
           $CellContext`nsol[$CellContext`t, $CellContext`k$$, \
$CellContext`p0$$]], {$CellContext`t, 0, $CellContext`T$$}, PlotRange -> All, 
          AxesOrigin -> {0, 0}]], 
      "Specifications" :> {{$CellContext`k$$, -1, 1}, {$CellContext`p0$$, 1, 
         0}, {$CellContext`T$$, 1, 10}}, "Options" :> {}, 
      "DefaultOptions" :> {}],
     ImageSizeCache->{730., {305., 316.}},
     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.6803574241450586`*^9, {3.680357521427559*^9, 3.6803575496734333`*^9}, 
   3.6810579658186083`*^9}]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
},
WindowToolbars->"EditBar",
WindowSize->{1218, 677},
WindowMargins->{{-8, Automatic}, {Automatic, -8}},
Magnification:>1.8 Inherited,
FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (July 28, 2016)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 168, 2, 300, "Title"],
Cell[CellGroupData[{
Cell[773, 28, 96, 1, 124, "Section"],
Cell[872, 31, 763, 11, 220, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[1672, 47, 307, 4, 223, "Chapter"],
Cell[CellGroupData[{
Cell[2004, 55, 120, 2, 124, "Section"],
Cell[2127, 59, 293, 6, 87, "Text"]
}, Open  ]],
Cell[CellGroupData[{
Cell[2457, 70, 91, 1, 124, "Section"],
Cell[2551, 73, 745, 23, 87, "Text"],
Cell[3299, 98, 224, 3, 53, "Text"],
Cell[CellGroupData[{
Cell[3548, 105, 330, 8, 54, "Input"],
Cell[3881, 115, 264, 7, 54, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[4194, 128, 117, 1, 124, "Section"],
Cell[4314, 131, 235, 5, 87, "Text"],
Cell[CellGroupData[{
Cell[4574, 140, 219, 6, 54, "Input"],
Cell[4796, 148, 193, 5, 54, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[5038, 159, 98, 1, 124, "Section"],
Cell[5139, 162, 442, 8, 120, "Text"],
Cell[CellGroupData[{
Cell[5606, 174, 277, 8, 54, "Input"],
Cell[5886, 184, 201, 5, 54, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[6136, 195, 305, 8, 197, "Section"],
Cell[CellGroupData[{
Cell[6466, 207, 835, 21, 157, "Input"],
Cell[7304, 230, 1784, 36, 478, "Output"]
}, Open  ]],
Cell[9103, 269, 71, 1, 54, "Input"],
Cell[9177, 272, 115, 1, 53, "Text"],
Cell[CellGroupData[{
Cell[9317, 277, 839, 21, 157, "Input"],
Cell[10159, 300, 1699, 35, 464, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[11907, 341, 174, 2, 124, "Section"],
Cell[CellGroupData[{
Cell[12106, 347, 461, 11, 89, "Input"],
Cell[12570, 360, 290, 8, 54, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[12897, 373, 638, 17, 54, "Input"],
Cell[13538, 392, 233, 5, 56, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[13820, 403, 228, 3, 124, "Section"],
Cell[14051, 408, 116, 1, 53, "Text"],
Cell[14170, 411, 828, 21, 54, "Input"],
Cell[CellGroupData[{
Cell[15023, 436, 90, 2, 54, "Input"],
Cell[15116, 440, 13602, 271, 121, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[28767, 717, 97, 1, 124, "Section"],
Cell[CellGroupData[{
Cell[28889, 722, 159, 2, 68, "Subsubsection"],
Cell[CellGroupData[{
Cell[29073, 728, 312, 8, 54, "Input"],
Cell[29388, 738, 2749, 57, 421, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[32198, 802, 174, 2, 124, "Section"],
Cell[CellGroupData[{
Cell[32397, 808, 111, 1, 68, "Subsubsection"],
Cell[CellGroupData[{
Cell[32533, 813, 714, 19, 157, "Input"],
Cell[33250, 834, 1758, 35, 574, "Output"]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[35057, 875, 144, 2, 68, "Subsubsection"],
Cell[CellGroupData[{
Cell[35226, 881, 1843, 49, 327, "Input"],
Cell[37072, 932, 2801, 59, 650, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}, Open  ]]
}
]
*)

