(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 11.3' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 7880, 224] NotebookOptionsPosition[ 6860, 191] NotebookOutlinePosition[ 7405, 214] CellTagsIndexPosition[ 7334, 209] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell["\<\ Migrating Populations : now we consider u_t = -cu_x, u (x, 0) = u0 (x) \ \>", "Section", Evaluatable->False, CellChangeTimes->{{3.760366941524991*^9, 3.760366945568947*^9}, { 3.760367111299034*^9, 3.7603671228974*^9}, {3.761037532746563*^9, 3.761037534511614*^9}, {3.7610433232013807`*^9, 3.761043326040297*^9}, { 3.7610433729954967`*^9, 3.761043375686651*^9}, 3.761043597401373*^9}, CellLabel->"In[77]:=",ExpressionUUID->"55693a20-c381-4b7f-a6a5-454b39e3d16b"], Cell[BoxData[""], "Input", CellChangeTimes->{{3.761045990842964*^9, 3.7610459937156*^9}, 3.76104680292583*^9}, CellLabel->"In[11]:=",ExpressionUUID->"95d36ad6-be1a-41b5-b01f-be49482aeb05"], Cell[BoxData[ RowBox[{"DynamicModule", "[", RowBox[{ RowBox[{"{", "U", "}"}], ",", RowBox[{ RowBox[{"UMigration", "=", RowBox[{ RowBox[{"U", "[", RowBox[{"x", ",", "t"}], "]"}], "/.", RowBox[{"First", "[", RowBox[{"DSolve", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"D", "[", RowBox[{ RowBox[{"U", "[", RowBox[{"x", ",", "t"}], "]"}], ",", "t"}], "]"}], "\[Equal]", RowBox[{ RowBox[{"-", "c"}], "*", RowBox[{"D", "[", RowBox[{ RowBox[{"U", "[", RowBox[{"x", ",", "t"}], "]"}], ",", "x"}], "]"}]}]}], ",", RowBox[{ RowBox[{"U", "[", RowBox[{"x", ",", "0"}], "]"}], "\[Equal]", RowBox[{"PDF", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ "Input", "[", "\"\\"", "]"}], "]"}], ",", RowBox[{"Evaluate", "[", RowBox[{ "Input", "[", "\"\\"", "]"}], "]"}]}], "]"}], ",", "x"}], "]"}]}]}], "}"}], ",", RowBox[{"U", "[", RowBox[{"x", ",", "t"}], "]"}], ",", RowBox[{"{", RowBox[{"x", ",", "t"}], "}"}]}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Manipulate", "[", RowBox[{ RowBox[{"Plot", "[", RowBox[{ RowBox[{"UMigration", "/.", RowBox[{"{", RowBox[{ RowBox[{"c", "\[Rule]", "speed"}], ",", RowBox[{"t", "\[Rule]", "time"}]}], "}"}]}], ",", RowBox[{"{", RowBox[{"x", ",", "0", ",", "100"}], "}"}], ",", RowBox[{"AxesLabel", "\[Rule]", RowBox[{"{", RowBox[{"x", ",", "u"}], "}"}]}], ",", RowBox[{"Ticks", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"25", ",", " ", "\"\< \>\""}], "}"}], ",", RowBox[{"{", RowBox[{"50", ",", " ", "\"\< \>\""}], "}"}], ",", RowBox[{"{", RowBox[{"75", ",", " ", "\"\< \>\""}], "}"}], ",", RowBox[{"{", RowBox[{"100", ",", "\"\< \>\""}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{".02", ",", "\"\< \>\""}], "}"}], ",", RowBox[{"{", RowBox[{".04", ",", " ", "\"\< \>\""}], "}"}], ",", RowBox[{"{", RowBox[{".06", ",", " ", "\"\< \>\""}], "}"}]}], "}"}]}], "}"}]}], ",", RowBox[{"PlotLabel", "\[Rule]", RowBox[{"Row", "[", RowBox[{"{", RowBox[{"\"\\"", ",", RowBox[{"HoldForm", "[", RowBox[{ RowBox[{"D", "[", RowBox[{"u", ",", "t"}], "]"}], "\[Equal]", RowBox[{ RowBox[{"-", "c"}], " ", RowBox[{"D", "[", RowBox[{"u", ",", "x"}], "]"}]}]}], "]"}]}], "}"}], "]"}]}]}], "]"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"speed", ",", "10", ",", "\"\\""}], "}"}], ",", RowBox[{"{", RowBox[{"10", ",", "50"}], "}"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"time", ",", "0", ",", "\"\