(* 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[ 71217, 1647] NotebookOptionsPosition[ 70942, 1632] NotebookOutlinePosition[ 71314, 1649] CellTagsIndexPosition[ 71271, 1646] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[{ RowBox[{ RowBox[{"ClearAll", "[", "\"\\"", "]"}], ";"}], "\n", RowBox[{ RowBox[{ RowBox[{"Remove", "[", "\"\\"", "]"}], ";"}], "\[IndentingNewLine]"}], "\n", RowBox[{ RowBox[{"Monitor", "[", RowBox[{ RowBox[{"Monitor", "[", RowBox[{ RowBox[{"Monitor", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Incrementing", " ", "through", " ", "perturbations"}], ",", " ", RowBox[{"probability", " ", "of", " ", "connections"}], ",", " ", "iterations"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"kick", "=", "0.5"}], ",", RowBox[{"kick", "\[LessEqual]", "2.5"}], ",", RowBox[{"kick", "=", RowBox[{"kick", "+", "0.5"}]}], ",", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"prob", "=", "0"}], ",", RowBox[{"prob", "\[LessEqual]", "1"}], ",", RowBox[{"prob", "=", RowBox[{"prob", "+", "0.1"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"JJ", "=", "1"}], ",", RowBox[{"JJ", "\[LessEqual]", "100"}], ",", RowBox[{"JJ", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"n", "=", "25"}], ";", "\[IndentingNewLine]", RowBox[{"m", "=", "25"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Day", "-", RowBox[{"18", " ", "data"}]}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"var", " ", "=", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"1", ",", RowBox[{"0.161463468", "^", "2"}]}], "]"}], ",", RowBox[{"n", " ", "m"}]}], "]"}], ",", "n"}], "]"}]}], ";"}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Day", "-", RowBox[{"15", " ", "data"}]}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"var", " ", "=", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"NormalDistribution", "[", RowBox[{"1.04566289", ",", RowBox[{"0.0873686", "^", "2"}]}], "]"}], ",", RowBox[{"n", " ", "m"}]}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Parameter", " ", "values"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"A", "=", "3"}], ";", "\[IndentingNewLine]", RowBox[{"\[Alpha]", "=", "3"}], ";", RowBox[{"(*", RowBox[{ "Changes", " ", "height", " ", "of", " ", "cubic", " ", "nullcline", " ", "peak"}], "*)"}], "\[IndentingNewLine]", RowBox[{"\[Gamma]", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"var", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "*", "0.05"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{"1", "/", "\[Gamma]"}], " ", "is", " ", "the", " ", "gradient", " ", "of", " ", "the", " ", "straight"}], "-", RowBox[{"line", " ", "nullcline"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"v0", "=", RowBox[{"Table", "[", RowBox[{"0.4", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", RowBox[{"(*", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "\[Gamma]"}], " ", "v0", " ", "is", " ", "the", " ", "y", " ", "intercept", " ", "of", " ", "the", " ", "straight"}], "-", RowBox[{"line", " ", "nullcline"}]}], "*)"}], "\[IndentingNewLine]", RowBox[{"w0", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"var", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "*", "0.4"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"T", "=", "25"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Intersection", " ", "of", " ", "nullclines"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"initial", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"wi", "\[Equal]", RowBox[{ RowBox[{"A", "*", "vi", "*", RowBox[{"(", RowBox[{"vi", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vi"}], ")"}]}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}]}], "&&", RowBox[{"wi", "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{"vi", "-", RowBox[{"v0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Gamma]", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}]}]}], ",", RowBox[{"{", RowBox[{"vi", ",", "wi"}], "}"}], ",", "Reals"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"initialline", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"wj", "\[Equal]", RowBox[{ RowBox[{"A", "*", "vj", "*", RowBox[{"(", RowBox[{"vj", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vj"}], ")"}]}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}]}], "&&", RowBox[{"wj", "\[Equal]", "wi"}]}], "/.", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "1", ",", "2"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"vj", ",", "wj"}], "}"}], ",", "Reals"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"localmax", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"FindMaxValue", "[", RowBox[{ RowBox[{ RowBox[{"A", "*", "vi", "*", RowBox[{"(", RowBox[{"vi", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vi"}], ")"}]}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"vi", ",", RowBox[{"vj", "/.", RowBox[{"initialline", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "3"}], "]"}], "]"}]}]}], "}"}], ",", RowBox[{"AccuracyGoal", "\[Rule]", "4"}], ",", RowBox[{"PrecisionGoal", "\[Rule]", "4"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Defining", " ", "perturbed", " ", "cell"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"kickleftN", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "-", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kickrightN", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "+", "3"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kickcellN", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "+", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kickleftM", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "-", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kickrightM", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "+", "3"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"kickcellM", "=", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "+", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"minscale", "=", RowBox[{"-", "0.25"}]}], ";", "\[IndentingNewLine]", RowBox[{"maxscale", "=", "1.2"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Initialising", " ", "connection", " ", "structure"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"RC", "=", RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "\[Rule]", RowBox[{"{", RowBox[{"0", ",", "1"}], "}"}]}], ",", RowBox[{"{", RowBox[{ RowBox[{"2", " ", "n"}], ",", "n"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Day", " ", "18"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{ RowBox[{"Cap", " ", "=", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"LogNormalDistribution", "[", RowBox[{ RowBox[{"\[Minus]", "0.035506"}], ",", RowBox[{"0.266481", "^", "2"}]}], "]"}], ",", RowBox[{"n", " ", "m"}]}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"\[Epsilon]", " ", "=", " ", RowBox[{"Cap", "/", RowBox[{"(", RowBox[{"Exp", "[", RowBox[{ RowBox[{"\[Minus]", "0.035506"}], "-", RowBox[{"0.266481", "^", "2"}]}], "]"}], ")"}]}]}], ";"}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Day", "-", "15"}], "*)"}], "\[IndentingNewLine]", "\n", "\t\t", RowBox[{"Cap", " ", "=", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"LogNormalDistribution", "[", RowBox[{ RowBox[{"\[Minus]", "0.21139"}], ",", RowBox[{"0.307329", "^", "2"}]}], "]"}], ",", RowBox[{"n", " ", "m"}]}], "]"}], ",", "n"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"\[Epsilon]", " ", "=", " ", RowBox[{"Cap", "/", RowBox[{"(", RowBox[{"Exp", "[", RowBox[{ RowBox[{"\[Minus]", "0.21139"}], "-", RowBox[{"0.307329", "^", "2"}]}], "]"}], ")"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Resistance", " ", "defined", " ", "by", " ", "capacitance", " ", "and", " ", "a", " ", "sf"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"sf", " ", "=", " ", "1"}], ";", "\[IndentingNewLine]", RowBox[{"R", " ", "=", RowBox[{"sf", "/", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Solving", " ", "FHN", " ", "equations"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"fitz", "=", RowBox[{"NDSolve", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"Join", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"1", ",", RowBox[{"i", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", RowBox[{"i", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"2", ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", RowBox[{"i", "+", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"m", "-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"1", ",", "m"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"1", ",", "m"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"1", ",", RowBox[{"m", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", RowBox[{"m", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{"2", ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"1", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "2"}], ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "-", "1"}], ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "1"}], ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{"2", " ", "i"}], ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "m"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"i", ",", "m"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "2"}], ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "-", "1"}], ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "1"}], ",", RowBox[{"m", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", RowBox[{"m", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{"2", " ", "i"}], ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "1"}], ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "2"}], ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"n", ",", "i"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"n", ",", "i"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "1"}], ",", RowBox[{"i", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", RowBox[{"i", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "+", "\[IndentingNewLine]", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "2"}], ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "1"}], ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "i"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", RowBox[{"i", "+", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"m", "-", "1"}]}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "1"}], ",", RowBox[{"m", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", RowBox[{"m", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "n"}], "-", "2"}], ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], "}"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"A", "*", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], "-", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{"w0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}], "/", RowBox[{"\[Epsilon]", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "2"}], ",", "j"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "-", "1"}], ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "1"}], ",", RowBox[{"j", "-", "1"}]}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", RowBox[{"j", "-", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{"2", " ", "i"}], ",", "j"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RC", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"2", " ", "i"}], "-", "1"}], ",", "j"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{"(", RowBox[{"1", "/", RowBox[{"(", RowBox[{"R", "*", RowBox[{"Cap", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], ")"}]}], ")"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", RowBox[{"j", "+", "1"}]}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], ")"}]}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "2", ",", RowBox[{"n", "-", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "2", ",", RowBox[{"m", "-", "1"}]}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "\[Equal]", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"\[Gamma]", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}], "*", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], "-", RowBox[{"v0", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "kickleftN"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "kickrightN", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{ "kickcellN", ",", "j", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "kickleftM"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{ "kickcellN", ",", "j", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "kickrightM", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"kick", "+", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{ "kickcellN", ",", "kickcellM", ",", "1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}]}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "\[Equal]", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"i", ",", "j", ",", "1", ",", "2", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{"Table", "[", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"{", RowBox[{"t", ",", "0", ",", "T"}], "}"}], ",", RowBox[{"MaxSteps", "\[Rule]", "100000"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Calculating", " ", "number", " ", "of", " ", "excited", " ", "cells"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"CC", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Max", "[", RowBox[{"Last", "/@", RowBox[{"Level", "[", RowBox[{ RowBox[{"Cases", "[", RowBox[{ RowBox[{"ParametricPlot", "[", RowBox[{ RowBox[{"Evaluate", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], ",", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], "}"}], "/.", RowBox[{"fitz", "[", RowBox[{"[", "1", "]"}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"t", ",", "0", ",", "T"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"PlotStyle", "->", RowBox[{"{", RowBox[{"{", RowBox[{"Purple", ",", RowBox[{"Thickness", "[", "Large", "]"}]}], "}"}], "}"}]}], ",", RowBox[{"Background", "->", "White"}], ",", RowBox[{"PlotRange", "->", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"-", "1"}], ",", "3.5"}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"-", "3"}], ",", "10"}], "}"}]}], "}"}]}]}], "]"}], "\[IndentingNewLine]", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"clustersize", "[", "JJ", "]"}], "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", RowBox[{"CC", "-", "localmax"}], "]"}], "]"}], ",", "True"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Cluster", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"clustersize", "[", "JJ", "]"}], ",", RowBox[{"{", RowBox[{"JJ", ",", "1", ",", "100", ",", "1"}], "}"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Export", "[", RowBox[{ RowBox[{"\"\\"", "<>", RowBox[{"ToString", "[", "sf", "]"}], "<>", "\"\<_Pert_\>\"", "<>", RowBox[{"ToString", "[", "kick", "]"}], "<>", "\"\<_Prob_\>\"", "<>", RowBox[{"ToString", "[", "prob", "]"}], "<>", "\"\<.xls\>\""}], ",", "Cluster"}], "]"}]}]}], "\[IndentingNewLine]", "]"}]}], "]"}], ",", "JJ"}], "]"}], ",", "prob"}], "]"}], ",", "kick"}], "]"}], "\[IndentingNewLine]", "\n", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", CellChangeTimes->CompressedData[" 1:eJxTTMoPSmViYGBQAGIQbdH5sTys8JVjyOOVNSBauz0qPQZIf9P4A6Ybp+Zz JANpzRhxThD9iLX3mkf5K0eVrkpWTyA9gc1eAkQvZbkkDaJdbgYrgegQqSgw feT06ehcIC1nJBgDok+YrqhaBKS7ipKrQXRV44d+EK17J2EBiH4xvXAHiJY6 f/EQiP53df5xEN02aRuY5ko5cgVEp1XOuw6ilQ4H/ADRqgt7foLoC6p7GqQr XjlOUrzcBqKld+1bJAOkZVZJLgHRT5gOmjgDacFQD1MQ3f+o54Q/kO4zuA2m PconvpgLpJkPvQLTTTePLyiueuW449vLpSA6+4pJfx+Q3qBweyKILrl4sXIi kL7tyFcPohPkbkydBKT9OFingegJ1wwugGiHHHcwvSwh+wGIPnysCUw/nvl/ 9WQgXdU/exOIrrM0Owei730PvwKimwRCLFcA6acF3FYgeoKQ/+pdQHqX0cq1 IFqJ3Wf+ISD95fbGhSD62WLXRB/+144couI5IFpGOKIARGtFnqoC0averJwD omtkQ+aCaAAxIQdI "]] }, WindowSize->{1280, 693}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, Visible->True, FrontEndVersion->"10.0 for Mac OS X x86 (32-bit, 64-bit Kernel) (September 9, \ 2014)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[557, 20, 70381, 1610, 2528, "Input"] } ] *) (* End of internal cache information *)