(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 9.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 157, 7] NotebookDataLength[ 216980, 4665] NotebookOptionsPosition[ 216065, 4631] NotebookOutlinePosition[ 216521, 4649] CellTagsIndexPosition[ 216478, 4646] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{ "Contains", " ", "code", " ", "for", " ", "calculating", " ", "correlation", " ", "function"}], ",", " ", RowBox[{ "and", " ", "creating", " ", "a", " ", "network", " ", "diagram"}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.631816866402197*^9, 3.63181687905577*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{ RowBox[{"Monitor", "[", RowBox[{ RowBox[{"Monitor", "[", RowBox[{ RowBox[{"Monitor", "[", RowBox[{ RowBox[{ "Monitor", "[", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Cycling", " ", "through", " ", "connection", " ", "probabilities"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"For", "[", RowBox[{ RowBox[{"prob", "=", "1"}], ",", RowBox[{"prob", "\[GreaterEqual]", "0.6"}], ",", " ", RowBox[{"prob", "=", RowBox[{"prob", "-", "0.1"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"parameter", " ", "values"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"A", " ", "=", " ", "3"}], ";", " ", "\n", RowBox[{"\[Epsilon]", " ", "=", " ", "0.2"}], ";", "\n", RowBox[{"\[Alpha]", " ", "=", " ", "3"}], ";", " ", RowBox[{"(*", " ", RowBox[{ "Changes", " ", "height", " ", "of", " ", "cubic", " ", "nullcline", " ", "peak"}], " ", "*)"}], "\n", RowBox[{"\[Gamma]", " ", "=", " ", "0.05"}], ";", " ", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{"1", "/", "\[Gamma]"}], " ", "is", " ", "the", " ", "gradient", " ", "of", " ", "the", " ", "straight"}], "-", RowBox[{"line", " ", "nullcline"}]}], " ", "*)"}], "\n", RowBox[{"v0", " ", "=", " ", "0.4"}], ";", " ", RowBox[{"(*", " ", RowBox[{ RowBox[{ RowBox[{ RowBox[{"-", "1"}], "/", "\[Gamma]"}], " ", "v0", " ", "is", " ", "the", " ", "y", " ", "intercept", " ", "of", " ", "the", " ", "straight"}], "-", RowBox[{"line", " ", "nullcline"}]}], " ", "*)"}], "\n", RowBox[{"w0", " ", "=", " ", "0.4"}], ";", "\n", RowBox[{"T", " ", "=", " ", "25"}], ";", "\n", RowBox[{"n", " ", "=", " ", "25"}], ";", "\n", RowBox[{"m", " ", "=", " ", "25"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"initialising", " ", "parameters"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"kick", " ", "=", " ", "1"}], ";", "\[IndentingNewLine]", RowBox[{"Corr", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"K", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", "j"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"CorrelationFunc", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "100"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", "iterations", " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"ee", "=", "1"}], ",", RowBox[{"ee", "\[LessEqual]", "100"}], ",", RowBox[{"ee", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"initial", " ", "=", " ", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{"wi", " ", "==", " ", RowBox[{ RowBox[{"A", "*", "vi", "*", RowBox[{"(", RowBox[{"vi", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vi"}], ")"}]}], "-", "w0"}]}], " ", "&&", " ", RowBox[{"wi", " ", "==", " ", RowBox[{ RowBox[{"(", RowBox[{"vi", "-", "v0"}], ")"}], "/", "\[Gamma]"}]}]}], ",", " ", RowBox[{"{", RowBox[{"vi", ",", "wi"}], "}"}], ",", " ", "Reals"}], "]"}]}], ";", "\n", RowBox[{"initialline", " ", "=", " ", RowBox[{"Solve", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"wj", " ", "==", " ", RowBox[{ RowBox[{"A", "*", "vj", "*", RowBox[{"(", RowBox[{"vj", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vj"}], ")"}]}], "-", "w0"}]}], " ", "&&", " ", RowBox[{"wj", " ", "==", " ", "wi"}]}], "/.", RowBox[{"initial", "[", RowBox[{"[", "1", "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"vj", ",", "wj"}], "}"}], ",", "Reals"}], "]"}]}], ";", "\n", RowBox[{"localmax", " ", "=", " ", RowBox[{ RowBox[{ RowBox[{"FindMaxValue", "[", RowBox[{ RowBox[{ RowBox[{"A", "*", "vi", "*", RowBox[{"(", RowBox[{"vi", "-", "\[Alpha]"}], ")"}], "*", RowBox[{"(", RowBox[{"1", "-", "vi"}], ")"}]}], "-", "w0"}], ",", " ", RowBox[{"{", RowBox[{"vi", ",", RowBox[{"vj", "/.", RowBox[{"initialline", "[", RowBox[{"[", "3", "]"}], "]"}]}]}], "}"}]}], "]"}], "-", "wi"}], "/.", RowBox[{"initial", "[", RowBox[{"[", "1", "]"}], "]"}]}]}], ";", "\n", "\n", RowBox[{"kickleftN", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "-", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\n", RowBox[{"kickrightN", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "+", "3"}], ")"}], "/", "2"}], "]"}]}], ";", "\t", "\n", RowBox[{"kickcellN", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"n", "+", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\n", "\n", RowBox[{"kickleftM", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "-", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\n", RowBox[{"kickrightM", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "+", "3"}], ")"}], "/", "2"}], "]"}]}], ";", "\t", "\n", RowBox[{"kickcellM", " ", "=", " ", RowBox[{"Floor", "[", RowBox[{ RowBox[{"(", RowBox[{"m", "+", "1"}], ")"}], "/", "2"}], "]"}]}], ";", "\n", "\n", RowBox[{"maxw1", " ", "=", " ", "0"}], ";", "\n", "\[IndentingNewLine]", RowBox[{"minscale", "=", RowBox[{"-", "0.25"}]}], ";", "\n", RowBox[{"maxscale", "=", "1.2"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Set", " ", "up", " ", "connections"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"RRh", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", "n", "}"}], ",", RowBox[{"{", RowBox[{"m", "+", "1"}], "}"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"n", "+", "1"}], "}"}], ",", RowBox[{"{", "m", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Kmean", " ", "=", RowBox[{"Mean", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Flatten", "[", "RRh", "]"}], ",", RowBox[{"Flatten", "[", "RRv", "]"}]}], "]"}], "]"}]}], ";", "\n", "\[IndentingNewLine]", RowBox[{"RRh", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRh", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", RowBox[{"1", "|", RowBox[{"m", "+", "1"}]}]}], "}"}], "->", "0"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRv", ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "|", RowBox[{"n", "+", "1"}]}], ",", "_"}], "}"}], "->", "0"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Connections", " ", "around", " ", "central", " ", "cell", " ", "are", " ", "not", " ", "zero"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{ RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], "}"}], "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"RRh", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", "n", "}"}], ",", RowBox[{"{", RowBox[{"m", "+", "1"}], "}"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"n", "+", "1"}], "}"}], ",", RowBox[{"{", "m", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Kmean", " ", "=", RowBox[{"Mean", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Flatten", "[", "RRh", "]"}], ",", RowBox[{"Flatten", "[", "RRv", "]"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\n", RowBox[{"RRh", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRh", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", RowBox[{"1", "|", RowBox[{"m", "+", "1"}]}]}], "}"}], "->", "0"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRv", ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "|", RowBox[{"n", "+", "1"}]}], ",", "_"}], "}"}], "->", "0"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"First", " ", "iteration"}], " ", "-", " ", RowBox[{"are", " ", "connections", " ", "appropriate"}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"fitz", " ", "=", " ", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"Join", "[", StyleBox["\[IndentingNewLine]", FontSize->14], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", RowBox[{"i", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], ",", "\n", "\t\t\t", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", 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[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", RowBox[{"i", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "==", " ", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "j"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"j", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "==", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{"\[Gamma]", "*", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], "-", "v0"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "kickleftN"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "kickrightN", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "kickleftM"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "kickrightM", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "[", "0", "]"}], "==", RowBox[{"kick", "+", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}]}], "}"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", "\n", "\t\t\t", RowBox[{"{", RowBox[{"t", ",", "0", ",", "T"}], "}"}], ",", " ", RowBox[{"MaxSteps", "->", "100000"}]}], "]"}]}], ";", "\[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"}], "}"}], ",", 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"}], "}"}]}], "}"}]}]}], "]"}], "\n", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Numberexcited", " ", "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", "CC", "]"}], "]"}], ",", "True"}], "]"}]}], ";", "\n", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"No", " ", "excitation"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"While", "[", RowBox[{ RowBox[{"Numberexcited", ">", RowBox[{ RowBox[{"(", RowBox[{"10", "/", "100"}], ")"}], "*", "n", " ", "n"}]}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"RRh", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", "n", "}"}], ",", RowBox[{"{", RowBox[{"m", "+", "1"}], "}"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"n", "+", "1"}], "}"}], ",", RowBox[{"{", "m", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Kmean", " ", "=", RowBox[{"Mean", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Flatten", "[", "RRh", "]"}], ",", RowBox[{"Flatten", "[", "RRv", "]"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\n", RowBox[{"RRh", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRh", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", RowBox[{"1", "|", RowBox[{"m", "+", "1"}]}]}], "}"}], "->", "0"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRv", ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "|", RowBox[{"n", "+", "1"}]}], ",", "_"}], "}"}], "->", "0"}]}], "]"}]}], ";", "\n", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "\[Equal]", "0"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"RRh", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", "n", "}"}], ",", RowBox[{"{", RowBox[{"m", "+", "1"}], "}"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"RandomChoice", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "-", "prob"}], ",", "prob"}], "}"}], "->", RowBox[{"{", RowBox[{"0", ",", RowBox[{"RandomReal", "[", RowBox[{"{", RowBox[{"0.5", ",", "10"}], "}"}], "]"}]}], "}"}]}], "]"}], ",", RowBox[{"{", RowBox[{"n", "+", "1"}], "}"}], ",", RowBox[{"{", "m", "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Kmean", " ", "=", RowBox[{"Mean", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Flatten", "[", "RRh", "]"}], ",", RowBox[{"Flatten", "[", "RRv", "]"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\n", RowBox[{"RRh", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRh", ",", RowBox[{ RowBox[{"{", RowBox[{"_", ",", RowBox[{"1", "|", RowBox[{"m", "+", "1"}]}]}], "}"}], "->", "0"}]}], "]"}]}], ";", "\n", RowBox[{"RRv", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"RRv", ",", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"1", "|", RowBox[{"n", "+", "1"}]}], ",", "_"}], "}"}], "->", "0"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], "}"}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Closed", " ", "Boundary", " ", "Conditions"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "\n", RowBox[{"fitz", " ", "=", " ", RowBox[{"NDSolve", "[", RowBox[{ RowBox[{"Join", "[", StyleBox["\[IndentingNewLine]", FontSize->14], RowBox[{ RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "i"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "i"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "i"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", RowBox[{"i", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], ",", "\n", "\t\t\t", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"2", ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"1", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", RowBox[{"[", RowBox[{"i", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "2"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "2"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "1"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "1"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "i"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", 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[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", RowBox[{"i", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "'"}], "[", "t", "]"}], "==", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "m"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"n", "-", "1"}], ",", "m"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"n", ",", "m"}], "]"}], "[", "t", "]"}]}], ")"}]}]}]}], "}"}], ",", "\n", "\[IndentingNewLine]", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "==", " ", 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", "]"}], "-", "w0"}], ")"}], "/", "\[Epsilon]"}], ")"}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRv", "[", 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[{"RRh", "[", 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[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "j"}], "]"}], "]"}], "*", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{ RowBox[{"i", "+", "1"}], ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], ")"}]}], "\[IndentingNewLine]", "+", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"i", ",", RowBox[{"j", "+", "1"}]}], "]"}], "]"}], "*", 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"}]}], "}"}]}], "]"}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "'"}], "[", "t", "]"}], "==", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}], "-", RowBox[{"\[Gamma]", "*", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "t", "]"}]}], "-", "v0"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "kickleftN"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "kickrightN", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "kickleftM"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"j", ",", "kickrightM", ",", "m"}], "}"}]}], "]"}], "]"}], ",", "\n", "\t\t\t", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"v", "[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "[", "0", "]"}], "==", RowBox[{"kick", "+", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "1", ",", "2"}], "]"}], "]"}], "]"}]}]}], "}"}], ",", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], "[", "0", "]"}], "==", RowBox[{"Evaluate", "[", RowBox[{"initial", "[", RowBox[{"[", RowBox[{"1", ",", "2", ",", "2"}], "]"}], "]"}], "]"}]}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], "]"}]}], "]"}], ",", "\n", "\n", "\t\t\t", RowBox[{"Flatten", "[", RowBox[{"Join", "[", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"v", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}], ",", RowBox[{"Table", "[", RowBox[{ RowBox[{"w", "[", RowBox[{"i", ",", "j"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], "]"}], "]"}], ",", "\[IndentingNewLine]", "\n", "\t\t\t", RowBox[{"{", RowBox[{"t", ",", "0", ",", "T"}], "}"}], ",", " ", RowBox[{"MaxSteps", "->", "100000"}]}], "]"}]}], ";", "\[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"}], "}"}], ",", 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"}], "}"}]}], "}"}]}]}], "]"}], "\n", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Numberexcited", " ", "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", "CC", "]"}], "]"}], ",", "True"}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"end", " ", "of", " ", "while", " ", "loop"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "calculated", " ", "the", " ", "connections", " ", "per", " ", "generation"}], " ", "*)"}], "\[IndentingNewLine]", "\n", RowBox[{"Locationmatrix", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", "j"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Generations", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"Total", "[", RowBox[{"Abs", "[", RowBox[{ RowBox[{"Locationmatrix", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", RowBox[{"Locationmatrix", "[", RowBox[{"[", RowBox[{"i", ",", "j"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "m"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Gaverage", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"NumberExcited", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"ExciteRatio", "=", RowBox[{"Table", "[", RowBox[{"i", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], " ", "=", " ", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Surrounding", " ", "kicked", " ", "cell"}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"GenerationCoordinates", "=", RowBox[{"Position", "[", RowBox[{"Generations", ",", "1"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD1", "=", RowBox[{"{", "1", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"s", "=", "1"}], ",", RowBox[{"s", "\[LessEqual]", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], ",", RowBox[{"s", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"i", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD1", "=", RowBox[{"Append", "[", RowBox[{"DD1", ",", 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"}], "}"}], ",", 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"}], "}"}]}], "}"}]}]}], "]"}], "\n", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", "1", "]"}], "]"}], "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", RowBox[{"Delete", "[", RowBox[{"DD1", ",", "1"}], "]"}], "]"}], "]"}], ",", "True"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"ExciteRatio", "[", RowBox[{"[", "1", "]"}], "]"}], "=", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", "1", "]"}], "]"}], "/", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Gaverage", "[", RowBox[{"[", "1", "]"}], "]"}], " ", "=", " ", RowBox[{"{", RowBox[{"1", ",", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], "}"}], "]"}], ",", RowBox[{"ExciteRatio", "[", RowBox[{"[", "1", "]"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Surrounding", " ", "kicked", " ", "cell"}], " ", "-", " ", RowBox[{"Correlation", " ", "Function"}]}], "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "-", "1"}], ",", "kickcellM"}], "]"}], "]"}], " ", "=", " ", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "-", "1"}]}], "]"}], "]"}], " ", "=", " ", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], " ", "=", " ", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}], " ", "=", " ", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Corr", "[", RowBox[{"[", "1", "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "-", "1"}], ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "-", "1"}]}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", RowBox[{"kickcellM", "+", "1"}]}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"kickcellN", "+", "1"}], ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Middle", " ", "Generations"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"ii", "=", "2"}], ",", RowBox[{"ii", "\[LessEqual]", RowBox[{"n", "-", "2"}]}], ",", RowBox[{"ii", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"GenerationCoordinates", "=", RowBox[{"Position", "[", RowBox[{"Generations", ",", "ii"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"valuestore", "=", RowBox[{"{", "1", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"GG", "=", "1"}], ",", RowBox[{"GG", "\[LessEqual]", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], ",", RowBox[{"GG", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "<", "0"}], ",", "\[IndentingNewLine]", RowBox[{"valuestore", "=", RowBox[{"Append", "[", RowBox[{"valuestore", ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], ">", "0"}], ",", "\[IndentingNewLine]", RowBox[{"valuestore", "=", RowBox[{"Append", "[", RowBox[{"valuestore", ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellN"}], "<", "0"}], ",", "\[IndentingNewLine]", RowBox[{"valuestore", " ", "=", " ", RowBox[{"Append", "[", RowBox[{"valuestore", ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "+", "1"}]}], "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellN"}], ">", "0"}], ",", "\[IndentingNewLine]", RowBox[{"valuestore", "=", RowBox[{"Append", "[", RowBox[{"valuestore", ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "<", "0"}], ")"}], " ", "&&", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], "\[Equal]", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], ">", "0"}], ")"}], " ", "&&", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], "\[Equal]", " ", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "\[Equal]", " ", "0"}], ")"}], " ", "&&", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], "<", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "\[Equal]", " ", "0"}], ")"}], " ", "&&", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], ">", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "+", "1"}]}], "]"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "<", "0"}], ")"}], " ", "&&", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], "<", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "+", "1"}]}], "]"}], "]"}]}], "}"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], ">", "0"}], ")"}], " ", "&&", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], "<", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "+", "1"}]}], "]"}], "]"}]}], "}"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], "<", "0"}], ")"}], " ", "&&", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], ">", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "+", "1"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}], "}"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], "-", "kickcellN"}], ">", "0"}], " ", ")"}], "&&", " ", RowBox[{"(", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}], "-", "kickcellM"}], " ", ">", "0"}], ")"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}]}], "}"}], "]"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Middle", " ", "generations"}], " ", "-", " ", RowBox[{"correlation", " ", "function"}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Corr", "[", RowBox[{"[", "ii", "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "1"}], "]"}], "]"}], ",", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"GG", ",", "2"}], "]"}], "]"}]}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{"{", RowBox[{"GG", ",", "1", ",", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], "}"}]}], "]"}], "]"}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD2", "=", RowBox[{"{", "1", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"s", "=", "1"}], ",", RowBox[{"s", "\[LessEqual]", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], ",", RowBox[{"s", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"i", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD2", "=", RowBox[{"Append", "[", RowBox[{"DD2", ",", 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"}], "}"}], ",", 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"}], "}"}]}], "}"}]}]}], "]"}], "\n", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", "ii", "]"}], "]"}], "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", RowBox[{"Delete", "[", RowBox[{"DD2", ",", "1"}], "]"}], "]"}], "]"}], ",", "True"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"ExciteRatio", "[", RowBox[{"[", "ii", "]"}], "]"}], "=", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", "ii", "]"}], "]"}], "/", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Gaverage", "[", RowBox[{"[", "ii", "]"}], "]"}], "=", RowBox[{"{", RowBox[{"ii", ",", RowBox[{"Mean", "[", RowBox[{"Flatten", "[", RowBox[{"Delete", "[", RowBox[{"valuestore", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"ExciteRatio", "[", RowBox[{"[", "ii", "]"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", RowBox[{"Dealing", " ", "with", " ", "corners"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"corneraverage", "=", RowBox[{"{", "1", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"GenerationCoordinates", "=", RowBox[{"Position", "[", RowBox[{"Generations", ",", RowBox[{"n", "-", "1"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"GG", "=", "1"}], ",", RowBox[{"GG", "\[LessEqual]", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], ",", RowBox[{"GG", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", "GG", "]"}], "]"}], "\[Equal]", RowBox[{"{", RowBox[{"1", ",", "1"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"corneraverage", " ", "=", RowBox[{"Append", "[", RowBox[{"corneraverage", ",", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", "GG", "]"}], "]"}], "\[Equal]", " ", RowBox[{"{", RowBox[{"n", ",", "1"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"corneraverage", " ", "=", RowBox[{"Append", "[", RowBox[{"corneraverage", ",", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "2"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", "GG", "]"}], "]"}], "\[Equal]", " ", RowBox[{"{", RowBox[{"1", ",", "n"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"corneraverage", " ", "=", RowBox[{"Append", "[", RowBox[{"corneraverage", ",", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "n"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "n"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"GenerationCoordinates", "[", RowBox[{"[", "GG", "]"}], "]"}], "\[Equal]", RowBox[{"{", RowBox[{"n", ",", "n"}], "}"}]}], ",", "\[IndentingNewLine]", RowBox[{"corneraverage", " ", "=", RowBox[{"Append", "[", RowBox[{"corneraverage", ",", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}]}], "}"}]}], "]"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD3", "=", RowBox[{"{", "1", "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"s", "=", "1"}], ",", RowBox[{"s", "\[LessEqual]", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}], ",", RowBox[{"s", "++"}], ",", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"i", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "1"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"j", "=", RowBox[{"GenerationCoordinates", "[", RowBox[{"[", RowBox[{"s", ",", "2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"DD3", "=", RowBox[{"Append", "[", RowBox[{"DD3", ",", 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"}], "}"}], ",", 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"}], "}"}]}], "}"}]}]}], "]"}], "\n", ",", "_Line", ",", "Infinity"}], "]"}], ",", RowBox[{"{", RowBox[{"-", "2"}], "}"}]}], "]"}]}], "]"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}], "=", RowBox[{"Count", "[", RowBox[{ RowBox[{"Positive", "[", RowBox[{"Flatten", "[", RowBox[{"Delete", "[", RowBox[{"DD3", ",", "1"}], "]"}], "]"}], "]"}], ",", "True"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"ExciteRatio", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}], "=", RowBox[{ RowBox[{"NumberExcited", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}], "/", RowBox[{"Length", "[", "GenerationCoordinates", "]"}]}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Gaverage", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}], "=", RowBox[{"{", RowBox[{ RowBox[{"n", "-", "1"}], ",", RowBox[{"Mean", "[", RowBox[{"Flatten", "[", RowBox[{"Delete", "[", RowBox[{"corneraverage", ",", "1"}], "]"}], "]"}], "]"}], ",", RowBox[{"ExciteRatio", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}]}], "}"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "2"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"1", ",", "n"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"1", ",", "n"}], "]"}], "]"}], ",", RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"2", ",", "n"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}], "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{"RRv", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}], ",", RowBox[{"RRh", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Corners", " ", "-", " ", RowBox[{"correlation", " ", "function"}]}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"Corr", "[", RowBox[{"[", RowBox[{"n", "-", "1"}], "]"}], "]"}], " ", "=", RowBox[{"Mean", "[", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"n", ",", "1"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"1", ",", "n"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"kickcellN", ",", "kickcellM"}], "]"}], "]"}], "-", "Kmean"}], ")"}], RowBox[{"(", RowBox[{ RowBox[{"K", "[", RowBox[{"[", RowBox[{"n", ",", "n"}], "]"}], "]"}], "-", "Kmean"}], ")"}]}]}], "}"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Gaverage", "=", RowBox[{"Prepend", "[", RowBox[{"Gaverage", ",", RowBox[{"{", RowBox[{ "\"\\"", ",", "\"\\"", ",", "\"\\""}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Duplicate", " ", "Connections"}], " ", "-", " ", RowBox[{"for", " ", "network", " ", "diagram"}]}], " ", "*)"}], "\n", "\[IndentingNewLine]", RowBox[{"RRh2", "=", "RRh"}], ";", "\[IndentingNewLine]", RowBox[{"RRv2", "=", "RRv"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "n"}], ",", RowBox[{"i", "\[GreaterEqual]", "2"}], ",", RowBox[{"i", "--"}], ",", "\[IndentingNewLine]", RowBox[{"RRh2", "=", RowBox[{"Transpose", "[", RowBox[{"Insert", "[", RowBox[{ RowBox[{"Transpose", "[", "RRh2", "]"}], ",", RowBox[{ RowBox[{"Transpose", "[", "RRh", "]"}], "[", RowBox[{"[", "i", "]"}], "]"}], ",", "i"}], "]"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "n"}], ",", RowBox[{"i", "\[GreaterEqual]", "2"}], ",", RowBox[{"i", "--"}], ",", "\[IndentingNewLine]", RowBox[{"RRv2", "=", RowBox[{"Insert", "[", RowBox[{"RRv2", ",", RowBox[{"RRv", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "i"}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Horizontal", " ", "Connections"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"RRhcoord", " ", "=", " ", RowBox[{"Partition", "[", RowBox[{ RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{"2", "j"}]}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}], "]"}], ",", "2"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRhmatrix", "=", RowBox[{"Insert", "[", RowBox[{"RRh2", ",", RowBox[{"-", "1"}], ",", "RRhcoord"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRhcoord2", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "i", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "+", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ZeroVector", " ", "=", " ", RowBox[{"Flatten", "[", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "0", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"3", "n"}]}], "}"}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRhmatrix2", " ", "=", " ", RowBox[{"Insert", "[", RowBox[{"RRhmatrix", ",", "ZeroVector", ",", "RRhcoord2"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"RRhcoord3", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"2", "i"}], "+", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRhmatrix3", "=", RowBox[{"Insert", "[", RowBox[{"RRhmatrix2", ",", "ZeroVector", ",", "RRhcoord3"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Vertical", " ", "Connections"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"RRvcoord", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"2", "i"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"NegCoordValue", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRvmatrix", "=", RowBox[{"Insert", "[", RowBox[{"RRv2", ",", "NegCoordValue", ",", "RRvcoord"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ZeroVector2", "=", RowBox[{"Table", "[", RowBox[{"0", ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"3", "n"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRvcoord2", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", "i", "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "+", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRvmatrix2", " ", "=", " ", RowBox[{"Transpose", "[", RowBox[{"Insert", "[", RowBox[{ RowBox[{"Transpose", "[", "RRvmatrix", "]"}], ",", "ZeroVector2", ",", "RRvcoord2"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRvcoord3", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"2", "i"}], "+", "1"}], "}"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"RRvmatrix3", "=", RowBox[{"Transpose", "[", RowBox[{"Insert", "[", RowBox[{ RowBox[{"Transpose", "[", "RRvmatrix2", "]"}], ",", "ZeroVector2", ",", "RRvcoord3"}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Sum", " ", "the", " ", "two", " ", "matrices"}], " ", "*)"}], "\n", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"RRhmatrix3", "+", "RRvmatrix3"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"NegVector", " ", "=", " ", RowBox[{"Table", "[", RowBox[{ RowBox[{"-", "1"}], ",", RowBox[{"{", RowBox[{"i", ",", "1", ",", RowBox[{"3", "n"}]}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"{", "1", "}"}], "\[Rule]", "NegVector"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"{", RowBox[{"3", "n"}], "}"}], "\[Rule]", "NegVector"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "2"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{"3", "n"}]}], ",", RowBox[{"i", "=", RowBox[{"i", "+", "1"}]}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"ConnectionsMatrix", "=", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"{", RowBox[{"i", ",", "1"}], "}"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", "=", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{"3", "n"}]}], "}"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "3"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{"3", "n"}]}], ",", RowBox[{"i", "=", RowBox[{"i", "+", "3"}]}], ",", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{"3", "j"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "4"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{ RowBox[{"3", "n"}], "+", "1"}]}], ",", RowBox[{"i", "=", RowBox[{"i", "+", "3"}]}], ",", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{"3", "j"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "3"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{"3", "n"}]}], ",", RowBox[{"i", "=", RowBox[{"i", "+", "3"}]}], ",", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{"3", "j"}], "+", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"For", "[", RowBox[{ RowBox[{"i", "=", "4"}], ",", RowBox[{"i", "\[LessEqual]", RowBox[{ RowBox[{"3", "n"}], "+", "1"}]}], ",", RowBox[{"i", "=", RowBox[{"i", "+", "3"}]}], ",", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"Table", "[", RowBox[{ RowBox[{"{", RowBox[{"i", ",", RowBox[{ RowBox[{"3", "j"}], "+", "1"}]}], "}"}], ",", RowBox[{"{", RowBox[{"j", ",", "1", ",", "n"}], "}"}]}], "]"}], "\[Rule]", RowBox[{"-", "1"}]}]}], "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"ConnectionsMatrix", " ", "=", " ", RowBox[{"ReplacePart", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{ RowBox[{"{", " ", RowBox[{ RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"3", "n"}], "+", "1"}], ")"}], "/", "2"}], ",", RowBox[{ RowBox[{"(", RowBox[{ RowBox[{"3", "n"}], "+", "1"}], ")"}], "/", "2"}]}], "}"}], "\[Rule]", RowBox[{"-", "3"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{ RowBox[{"CorrelationFunc", "[", RowBox[{"[", "ee", "]"}], "]"}], "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"Corr", "[", RowBox[{"[", "ii", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"ii", ",", "1", ",", RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}]}]}], "]"}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"CorrTable", "=", RowBox[{"Table", "[", RowBox[{ RowBox[{"CorrelationFunc", "[", RowBox[{"[", "ee", "]"}], "]"}], ",", RowBox[{"{", RowBox[{"ee", ",", "1", ",", "50"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Exports", " ", "the", " ", "correlation", " ", "information"}], " ", "*)"}], "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"Export", "[", RowBox[{ RowBox[{ "\"\\"", "<>", RowBox[{"ToString", "[", "prob", "]"}], "<>", "\"\<.xls\>\""}], ",", "CorrTable"}], "]"}]}]}], "\[IndentingNewLine]", "\[IndentingNewLine]", "\[IndentingNewLine]", "]"}], ",", "Numberexcited"}], "]"}], ",", "ee"}], "]"}], ",", "kick"}], "]"}], ",", "prob"}], "]"}], "\[IndentingNewLine]"}]], "Input", CellChangeTimes->{{3.532606864785928*^9, 3.532606882168932*^9}, { 3.5326120717791023`*^9, 3.53261208989428*^9}, {3.532612183753501*^9, 3.5326122148930893`*^9}, {3.532612261523888*^9, 3.532612322791523*^9}, { 3.5326137218490543`*^9, 3.53261378719409*^9}, {3.532615615934325*^9, 3.5326156202040043`*^9}, {3.5326157883747797`*^9, 3.532615850763818*^9}, { 3.532682692725692*^9, 3.5326829782490597`*^9}, {3.532683090143605*^9, 3.532683100232452*^9}, {3.532683424818034*^9, 3.5326834263293247`*^9}, { 3.532683486398925*^9, 3.5326834868677073`*^9}, {3.532683652450959*^9, 3.532683672997684*^9}, {3.532683793370749*^9, 3.53268379393113*^9}, { 3.532683851097702*^9, 3.532683883616993*^9}, {3.532684355907588*^9, 3.532684389700838*^9}, {3.532684429926792*^9, 3.532684445466216*^9}, { 3.53268457750484*^9, 3.532684789324682*^9}, {3.53268482962416*^9, 3.532684845351305*^9}, {3.5326849023198833`*^9, 3.532684911398129*^9}, { 3.5326850541130257`*^9, 3.532685201271964*^9}, {3.532685666583823*^9, 3.532685688248933*^9}, {3.532685786469277*^9, 3.532685804724216*^9}, { 3.532685857817605*^9, 3.532685941162455*^9}, {3.53276078349255*^9, 3.532760793004826*^9}, {3.532769172068709*^9, 3.532769193054927*^9}, { 3.5327692287037907`*^9, 3.532769295044729*^9}, {3.532769374135459*^9, 3.532769428074271*^9}, {3.532769534021637*^9, 3.532769551773013*^9}, { 3.5327699111274223`*^9, 3.532769998176772*^9}, 3.532770046551955*^9, { 3.5327700838524837`*^9, 3.532770093704132*^9}, {3.532770174617778*^9, 3.5327702594120626`*^9}, {3.532770295710794*^9, 3.5327703164755383`*^9}, { 3.5327704534495487`*^9, 3.532770456234541*^9}, {3.532844336952189*^9, 3.5328443471468687`*^9}, {3.532845297633594*^9, 3.532845299360591*^9}, { 3.532845728389729*^9, 3.532845729513698*^9}, {3.532847071964898*^9, 3.532847074794471*^9}, {3.532847425965845*^9, 3.532847437878367*^9}, { 3.532847671003903*^9, 3.532847671179577*^9}, {3.532847731677341*^9, 3.5328477318859377`*^9}, {3.5328484082400713`*^9, 3.532848414625639*^9}, { 3.532850571663954*^9, 3.5328506065522213`*^9}, {3.532850686263096*^9, 3.532850687037674*^9}, {3.53483868662658*^9, 3.534838712230386*^9}, { 3.53484173175797*^9, 3.534841736112151*^9}, {3.5348418752426577`*^9, 3.534842061868259*^9}, {3.5348421184094954`*^9, 3.534842347148363*^9}, { 3.534843068806739*^9, 3.534843071373981*^9}, {3.534843138227895*^9, 3.5348431461707563`*^9}, {3.534843327748958*^9, 3.5348433279253883`*^9}, { 3.534843411278064*^9, 3.534843431459527*^9}, {3.534843486323204*^9, 3.534843501149116*^9}, 3.5348448949283867`*^9, {3.534846234932992*^9, 3.534846260797937*^9}, {3.5348464793888483`*^9, 3.5348465004326973`*^9}, { 3.537630474623178*^9, 3.537630666530549*^9}, {3.5376307063269672`*^9, 3.5376307267729607`*^9}, {3.5376307669929934`*^9, 3.537630888395961*^9}, { 3.537630938805624*^9, 3.537630940114752*^9}, {3.53763098026544*^9, 3.537630984302267*^9}, {3.538120337845372*^9, 3.538120339712873*^9}, { 3.5381203754170713`*^9, 3.538120460802527*^9}, 3.538120499975071*^9, { 3.538120533267537*^9, 3.538120553146269*^9}, {3.5381205968974123`*^9, 3.53812063556221*^9}, {3.5381206731761293`*^9, 3.538120679573641*^9}, { 3.538126692362749*^9, 3.5381266978544683`*^9}, {3.538126747718544*^9, 3.538126883751924*^9}, {3.538126999484828*^9, 3.5381270907226048`*^9}, { 3.5381271633060207`*^9, 3.538127330463004*^9}, {3.538197911054138*^9, 3.538197911380657*^9}, {3.538209543643197*^9, 3.538209588782267*^9}, { 3.538212760347987*^9, 3.538212803612235*^9}, {3.53821585297188*^9, 3.538215866399321*^9}, {3.538216800952414*^9, 3.538216801371394*^9}, { 3.538217439153715*^9, 3.538217440518195*^9}, {3.538229859847953*^9, 3.538229880164544*^9}, {3.538287236041144*^9, 3.5382872462283792`*^9}, { 3.538298204358006*^9, 3.538298225593841*^9}, {3.53837544277357*^9, 3.538375454330882*^9}, {3.538388219396018*^9, 3.538388229657449*^9}, { 3.53846765766399*^9, 3.53846766404914*^9}, {3.538474612851554*^9, 3.538474633646576*^9}, {3.5384746823942633`*^9, 3.53847474456892*^9}, 3.538474783605525*^9, 3.538474824943138*^9, 3.538474988601432*^9, { 3.5384750325354633`*^9, 3.5384750466319313`*^9}, {3.538475421678732*^9, 3.538475435773162*^9}, {3.538475899878191*^9, 3.538475900940062*^9}, { 3.53867763147766*^9, 3.538677634913357*^9}, {3.538677684126116*^9, 3.53867770182693*^9}, {3.538679137707127*^9, 3.538679139607435*^9}, 3.5387233610872927`*^9, {3.538738462455194*^9, 3.5387385468818817`*^9}, { 3.538738585192383*^9, 3.538738655337925*^9}, {3.5387392980415707`*^9, 3.538739300507572*^9}, {3.538739349824559*^9, 3.538739349990919*^9}, { 3.5387482317661037`*^9, 3.538748234426935*^9}, {3.538814622819821*^9, 3.5388146406348124`*^9}, {3.538814675470208*^9, 3.5388148764774733`*^9}, { 3.538827989785778*^9, 3.538827990652678*^9}, {3.538851551350605*^9, 3.538851551703082*^9}, {3.5389113386706553`*^9, 3.538911338787636*^9}, { 3.538925890376957*^9, 3.538925986027272*^9}, {3.538998058577771*^9, 3.5389980591915617`*^9}, {3.538998111389963*^9, 3.538998194348056*^9}, { 3.53899825250804*^9, 3.538998313382351*^9}, {3.538999623252901*^9, 3.538999631040188*^9}, {3.5390711642162037`*^9, 3.539071175321067*^9}, { 3.5390758235178957`*^9, 3.539075824953673*^9}, {3.539080959892076*^9, 3.5390809674568996`*^9}, {3.5390810139120483`*^9, 3.5390810149301167`*^9}, {3.539238062886858*^9, 3.5392380994885902`*^9}, { 3.539239310235322*^9, 3.53923931445253*^9}, {3.5393314754931507`*^9, 3.5393315123313723`*^9}, 3.539331554030561*^9, 3.5394252153660383`*^9, 3.539425250398868*^9, {3.539425316204238*^9, 3.539425443155208*^9}, { 3.5394255817779913`*^9, 3.5394256281108418`*^9}, {3.539426495281459*^9, 3.539426610306405*^9}, {3.539426644515367*^9, 3.539426710847992*^9}, { 3.539426740906198*^9, 3.539426773239936*^9}, {3.539427059276597*^9, 3.539427093504696*^9}, {3.539515500341571*^9, 3.5395155375671577`*^9}, { 3.539616464088415*^9, 3.539616487926779*^9}, {3.539670403166953*^9, 3.539670464150799*^9}, {3.539670500953927*^9, 3.539670507346815*^9}, { 3.5481471565353107`*^9, 3.5481471944730997`*^9}, {3.548147230042407*^9, 3.548147244695425*^9}, {3.5481477496985683`*^9, 3.5481478027208357`*^9}, { 3.548148310801464*^9, 3.548148311685224*^9}, {3.54848460795864*^9, 3.5484846254394484`*^9}, {3.549086657497126*^9, 3.5490866610982847`*^9}, { 3.560758941622624*^9, 3.560758958850376*^9}, {3.560758990997991*^9, 3.560759002001153*^9}, {3.560759315544669*^9, 3.560759325411408*^9}, { 3.560759397362455*^9, 3.560759424338458*^9}, {3.560768880121932*^9, 3.560768964632924*^9}, {3.5607697131883307`*^9, 3.560770012973217*^9}, { 3.560770048304431*^9, 3.560770195898653*^9}, {3.5607702330338087`*^9, 3.560770363828699*^9}, {3.5607709393929863`*^9, 3.56077094092467*^9}, { 3.560770992791106*^9, 3.560771022542253*^9}, {3.560771058928689*^9, 3.560771099731422*^9}, {3.560771910648651*^9, 3.560771914115003*^9}, { 3.560771979361847*^9, 3.560771997986713*^9}, {3.560772066901334*^9, 3.5607720687171783`*^9}, {3.560846035340934*^9, 3.5608460548703623`*^9}, { 3.561113414212513*^9, 3.561113500318898*^9}, {3.561113646488562*^9, 3.561113702894988*^9}, {3.561113775951569*^9, 3.561113831406784*^9}, { 3.56111423988494*^9, 3.5611142521879253`*^9}, {3.561114365556638*^9, 3.561114393805148*^9}, {3.561114504362121*^9, 3.561114533628491*^9}, { 3.561114937381171*^9, 3.561114938074915*^9}, {3.561114991037462*^9, 3.561114993667945*^9}, {3.561115131666616*^9, 3.56111513184874*^9}, { 3.561115167073344*^9, 3.561115565608416*^9}, {3.561115598214867*^9, 3.561115645982843*^9}, {3.561115697285351*^9, 3.5611156989087877`*^9}, { 3.561115735938019*^9, 3.561115985976391*^9}, {3.561116092562921*^9, 3.5611161385924377`*^9}, {3.56111617182408*^9, 3.561116200941956*^9}, { 3.561116245250243*^9, 3.5611162608151827`*^9}, {3.5611163275256577`*^9, 3.5611163553193817`*^9}, {3.5611163964385777`*^9, 3.561116440388575*^9}, { 3.561116492745207*^9, 3.561116523921542*^9}, {3.5611165597144814`*^9, 3.561116567649485*^9}, {3.561116663904161*^9, 3.5611167520382566`*^9}, { 3.561116824896825*^9, 3.561116899629264*^9}, 3.561117074883214*^9, { 3.5611171166508417`*^9, 3.561117176840796*^9}, {3.561117483474621*^9, 3.5611174906661367`*^9}, {3.561117710247404*^9, 3.561117957367427*^9}, { 3.561118008265441*^9, 3.561118009668408*^9}, {3.561118130884516*^9, 3.561118161696343*^9}, {3.561118198298542*^9, 3.561118364905397*^9}, 3.561118423501408*^9, {3.56111880129158*^9, 3.561118815927989*^9}, { 3.561187023562702*^9, 3.5611870262624598`*^9}, {3.56119796384277*^9, 3.5611979683877363`*^9}, {3.561198207314464*^9, 3.5611982093981867`*^9}, { 3.561279901709257*^9, 3.5612799328482924`*^9}, {3.561279967687543*^9, 3.5612799691662407`*^9}, {3.561287084230709*^9, 3.561287085070229*^9}, { 3.561371695421484*^9, 3.561371702745679*^9}, {3.561371744758996*^9, 3.56137188106717*^9}, {3.561371987237445*^9, 3.561371997009467*^9}, { 3.561372039269755*^9, 3.561372056583322*^9}, {3.5617258517120743`*^9, 3.561725977004381*^9}, {3.561791871467239*^9, 3.561791895073552*^9}, { 3.561791963197163*^9, 3.5617920026534986`*^9}, 3.561793163465549*^9, 3.5617932023464527`*^9, {3.5619677629789867`*^9, 3.56196791758988*^9}, { 3.561980180437142*^9, 3.561980278797269*^9}, {3.561980367298827*^9, 3.561980498615037*^9}, {3.561983342632639*^9, 3.561983382765757*^9}, 3.561983475083476*^9, {3.561984820995071*^9, 3.561984830574854*^9}, { 3.561984891771109*^9, 3.561984934963114*^9}, {3.5619851218828793`*^9, 3.5619852108566227`*^9}, {3.561985242220208*^9, 3.561985284607856*^9}, { 3.56198531720511*^9, 3.561985366202977*^9}, {3.56198545548705*^9, 3.561985462304566*^9}, {3.562058371933385*^9, 3.562058432722149*^9}, { 3.562058529169588*^9, 3.562058700625773*^9}, {3.562058805268936*^9, 3.562058806085659*^9}, {3.562059000089539*^9, 3.562059036601365*^9}, { 3.562059316614893*^9, 3.562059411208189*^9}, {3.5620594824032173`*^9, 3.562059515357442*^9}, {3.5620595871755753`*^9, 3.56205962608902*^9}, 3.562061422005947*^9, {3.562061719170013*^9, 3.5620617198066063`*^9}, { 3.5620626084343357`*^9, 3.562062608973905*^9}, {3.562062805791251*^9, 3.562062809001927*^9}, 3.562063133962594*^9, {3.562069212687392*^9, 3.562069215225285*^9}, {3.56207164979604*^9, 3.562071653105784*^9}, { 3.562071737541245*^9, 3.562071799025017*^9}, {3.562134660778462*^9, 3.5621346678462276`*^9}, {3.563026114595285*^9, 3.5630261218093777`*^9}, { 3.563026151993432*^9, 3.563026160092087*^9}, {3.563026345155093*^9, 3.56302634777949*^9}, {3.5630845816225224`*^9, 3.563084586124102*^9}, { 3.5635357280862017`*^9, 3.56353578691358*^9}, {3.563536011081293*^9, 3.563536011346593*^9}, {3.563536498797988*^9, 3.563536511044479*^9}, { 3.5635386848665743`*^9, 3.563538696979354*^9}, {3.563538789736701*^9, 3.56353879648324*^9}, 3.5636334618457203`*^9, 3.563634235624382*^9, { 3.5636360891853733`*^9, 3.563636107261009*^9}, {3.5636373069146214`*^9, 3.563637318974244*^9}, {3.56363740428057*^9, 3.563637426596882*^9}, { 3.563637511640793*^9, 3.5636375228862257`*^9}, {3.563637553254551*^9, 3.56363761737368*^9}, {3.563637655584276*^9, 3.563637677915472*^9}, { 3.563638579584442*^9, 3.563638589108593*^9}, {3.563638622342634*^9, 3.5636386345132713`*^9}, {3.563638668158905*^9, 3.563638801297983*^9}, { 3.563639270700634*^9, 3.563639311345429*^9}, {3.5636404534290752`*^9, 3.563640623422236*^9}, {3.5636416633938723`*^9, 3.5636416685617933`*^9}, { 3.563642889674189*^9, 3.56364290838444*^9}, {3.563643720252366*^9, 3.5636439928124533`*^9}, {3.563644457170746*^9, 3.563644459160777*^9}, { 3.5636449720113287`*^9, 3.563645084744841*^9}, {3.563645120511661*^9, 3.563645170521413*^9}, {3.563645461169043*^9, 3.563645696079245*^9}, { 3.563645741223525*^9, 3.563645755827722*^9}, {3.5636458596161137`*^9, 3.56364586470747*^9}, {3.563645961212978*^9, 3.563645976476158*^9}, { 3.563646076931303*^9, 3.5636460777718477`*^9}, {3.563646129804225*^9, 3.563646131255837*^9}, 3.563646325104356*^9, {3.563646367929195*^9, 3.563646374194231*^9}, {3.563646579305818*^9, 3.5636465978219*^9}, { 3.563646630135355*^9, 3.563646836709178*^9}, {3.563646915209839*^9, 3.563647045591424*^9}, {3.563647086089974*^9, 3.5636472606204863`*^9}, { 3.5636473275084467`*^9, 3.56364733168832*^9}, {3.563647381093403*^9, 3.563647433037149*^9}, {3.563647470902328*^9, 3.5636474866504602`*^9}, { 3.563647560293541*^9, 3.563647586211488*^9}, {3.56364774876693*^9, 3.56364776628657*^9}, {3.563648019102564*^9, 3.563648176136965*^9}, { 3.563648351485734*^9, 3.563648398608365*^9}, {3.563648437899145*^9, 3.563648764666092*^9}, {3.563648805676744*^9, 3.56364885592098*^9}, { 3.5636489066753063`*^9, 3.563648942462294*^9}, {3.563648995879595*^9, 3.563648998964966*^9}, 3.563649052692835*^9, {3.563649125941481*^9, 3.563649163180612*^9}, {3.563689381233583*^9, 3.5636893845085077`*^9}, 3.5636894251921663`*^9, {3.563689621931302*^9, 3.563689752795823*^9}, { 3.563690031235115*^9, 3.563690089350759*^9}, {3.5636901914470587`*^9, 3.563690213842814*^9}, {3.563690349649724*^9, 3.5636904246240053`*^9}, { 3.563690454900667*^9, 3.563690455556549*^9}, {3.5636907361366253`*^9, 3.563690739918581*^9}, {3.563690915766169*^9, 3.563690924172773*^9}, { 3.563692366909137*^9, 3.563692391221518*^9}, {3.56369244149568*^9, 3.5636924441995697`*^9}, {3.5636985084003572`*^9, 3.5636985203776417`*^9}, {3.5636985743802023`*^9, 3.563698574591876*^9}, { 3.563698617167647*^9, 3.563698641526875*^9}, {3.563698796109995*^9, 3.56369879858676*^9}, {3.563704151027534*^9, 3.563704193499002*^9}, { 3.5641360879467382`*^9, 3.5641362253215437`*^9}, {3.5641364405382223`*^9, 3.5641364645217*^9}, {3.564136740491827*^9, 3.564136754727602*^9}, { 3.5641368510028057`*^9, 3.564136890356477*^9}, {3.5641369248020687`*^9, 3.564136929558791*^9}, {3.564136975866506*^9, 3.5641369769739237`*^9}, { 3.564137407418931*^9, 3.56413741034729*^9}, {3.5641383993191137`*^9, 3.564138400398861*^9}, {3.564141993490779*^9, 3.564142036224354*^9}, { 3.5642122229356747`*^9, 3.564212256082918*^9}, {3.5642129366674*^9, 3.5642129620750217`*^9}, {3.564213346820854*^9, 3.5642133606014767`*^9}, { 3.56421379427092*^9, 3.564214131501031*^9}, {3.564214397049252*^9, 3.5642144105870943`*^9}, {3.564214577259954*^9, 3.564214578064028*^9}, { 3.5642149558605957`*^9, 3.564214985658452*^9}, {3.564215017296464*^9, 3.564215178098351*^9}, {3.564215964807899*^9, 3.564216103712523*^9}, { 3.564220032825275*^9, 3.564220033363365*^9}, {3.5642214340444736`*^9, 3.5642214346133327`*^9}, {3.564221494447307*^9, 3.5642215061295433`*^9}, { 3.564222264193201*^9, 3.5642222912296963`*^9}, {3.564223818002722*^9, 3.5642238188349648`*^9}, {3.564224081251141*^9, 3.564224087907385*^9}, { 3.5642246693644867`*^9, 3.5642246714062223`*^9}, {3.5642250712490396`*^9, 3.5642250715853367`*^9}, {3.5642257381899347`*^9, 3.564225738560454*^9}, { 3.564225782971307*^9, 3.5642257892911587`*^9}, {3.564225826042252*^9, 3.5642258310415382`*^9}, {3.564225913630271*^9, 3.564225914222105*^9}, { 3.564225999999013*^9, 3.564226112518437*^9}, {3.564226499596509*^9, 3.564226502246529*^9}, 3.564226718403852*^9, {3.564226952765646*^9, 3.564226974390863*^9}, {3.5642275782710857`*^9, 3.564227582249898*^9}, { 3.564827146336337*^9, 3.5648272906012907`*^9}, {3.56482733673063*^9, 3.564827358409871*^9}, 3.5648273929117937`*^9, {3.564827444476025*^9, 3.564827550626041*^9}, {3.564831032183448*^9, 3.564831036876658*^9}, { 3.564833062903061*^9, 3.564833063723159*^9}, {3.566405001191009*^9, 3.56640514940345*^9}, {3.566405203641655*^9, 3.5664052078595448`*^9}, { 3.566405850432082*^9, 3.566405873637988*^9}, {3.5664060311846027`*^9, 3.566406032784728*^9}, {3.566629642920073*^9, 3.566629675468237*^9}, { 3.566629717612544*^9, 3.566629718063212*^9}, {3.566632420764349*^9, 3.56663244226862*^9}, {3.566632476696794*^9, 3.566632484614431*^9}, { 3.566645016864997*^9, 3.566645048453177*^9}, {3.567160621712014*^9, 3.5671606356955557`*^9}, {3.5671606842914047`*^9, 3.567160745314373*^9}, { 3.567161659177753*^9, 3.5671616739920473`*^9}, {3.5671629894013643`*^9, 3.567162991192577*^9}, {3.567248903731147*^9, 3.567248905529821*^9}, { 3.5672489855263777`*^9, 3.567248991118919*^9}, {3.577175609254038*^9, 3.577175674061367*^9}, {3.577175840348692*^9, 3.5771758870114937`*^9}, { 3.5771759258772306`*^9, 3.577175926663718*^9}, {3.577176020835486*^9, 3.5771761157473793`*^9}, {3.5771762619304533`*^9, 3.57717626720749*^9}, { 3.5771767465891314`*^9, 3.57717676121045*^9}, {3.577209910482332*^9, 3.577209925522439*^9}, {3.631816771410915*^9, 3.6318169840202827`*^9}}], Cell[BoxData["$Aborted"], "Output", CellChangeTimes->{{3.577175859630262*^9, 3.5771758806553926`*^9}, 3.5771762574982853`*^9, 3.5771767423513517`*^9}] }, Open ]], Cell[BoxData[ RowBox[{"(*", " ", RowBox[{ RowBox[{"Connection", " ", "matrix", " ", "images"}], ",", " ", RowBox[{"if", " ", "required"}]}], " ", "*)"}]], "Input", CellChangeTimes->{{3.631816784145726*^9, 3.631816789651793*^9}}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"(*", RowBox[{"FinalConnectionMatrixImage", "=", " ", RowBox[{"MatrixPlot", "[", RowBox[{"ConnectionsMatrix", ",", RowBox[{"ColorRules", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "3"}], "\[Rule]", "White"}], ",", RowBox[{ RowBox[{"-", "2"}], "\[Rule]", RowBox[{"Darker", "[", "Black", "]"}]}], ",", RowBox[{ RowBox[{"-", "1"}], "\[Rule]", RowBox[{"Lighter", "[", "Gray", "]"}]}], ",", RowBox[{"0", "\[Rule]", RowBox[{"Lighter", "[", "Gray", "]"}]}]}], "}"}]}], ",", RowBox[{"ColorFunction", "->", RowBox[{"(", RowBox[{ RowBox[{"Blend", "[", RowBox[{ RowBox[{"{", RowBox[{"White", ",", RowBox[{"Darker", "[", "Gray", "]"}]}], "}"}], ",", "#"}], "]"}], "&"}], ")"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "1"}]}], "]"}]}], "*)"}]], "Input", CellChangeTimes->{{3.564829149959362*^9, 3.564829244530341*^9}, { 3.564830005520727*^9, 3.564830064432*^9}, {3.564830094530552*^9, 3.564830095014868*^9}, {3.564830663452902*^9, 3.564830691127857*^9}, 3.566405154072838*^9, 3.5671606399275293`*^9, 3.577175588732856*^9}], Cell[BoxData[ GraphicsBox[ RasterBox[SparseArray[ Automatic, {75, 75}, 0.6666666666666666, {1, {CompressedData[" 1:eJwlzL1KggEAheHX+rT8KasxWgSXhhYdchEUCgJtaW+xyYaCDAchWmopL8BZ tySaLAicwgLHlsDBG6ggXAJx6IUOPNM5nFTl9O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M9l1Fmj+Yvm4l2x/DhQZtxw66Z//+7VcNszv3/2/bX6x rh1rtJquIjmB8N3UJvW+dFlGoKJ8EuPzQmNInIBAReelHTl6fd9LIYGKztM9 1P+kza8iAvnymaJjRrHXS3uZlEBu+eJFWeU+s4oIhDdp3Cq6pIOEQPg7WRGp MTFyAuHdLuwKi2wtJJB7nf/reWtgA/8n/wu4JXph "]}], {{0, 0}, {75, 75}}, {0, 1}], AspectRatio->1, Frame->True, FrameLabel->{None, None}, FrameTicks->{{{{74.5, FormBox["1", TraditionalForm]}, {55.5, FormBox["20", TraditionalForm]}, {35.5, FormBox["40", TraditionalForm]}, {15.5, FormBox["60", TraditionalForm]}, {0.5, FormBox["75", TraditionalForm]}}, {{74.5, FormBox["1", TraditionalForm]}, {55.5, FormBox["20", TraditionalForm]}, {35.5, FormBox["40", TraditionalForm]}, {15.5, FormBox["60", TraditionalForm]}, {0.5, FormBox["75", TraditionalForm]}}}, {{{0.5, FormBox["1", TraditionalForm]}, {19.5, FormBox["20", TraditionalForm]}, {39.5, FormBox["40", TraditionalForm]}, {59.5, FormBox["60", TraditionalForm]}, {74.5, FormBox["75", TraditionalForm]}}, {{0.5, FormBox["1", TraditionalForm]}, {19.5, FormBox["20", TraditionalForm]}, {39.5, FormBox["40", TraditionalForm]}, {59.5, FormBox["60", TraditionalForm]}, {74.5, FormBox["75", TraditionalForm]}}}}]], "Output", CellChangeTimes->{3.5671614305477247`*^9, 3.567161904036591*^9, 3.567162750861822*^9, 3.56716303844242*^9, 3.567163134242455*^9, 3.567248917529635*^9}] }, Open ]], Cell[BoxData[ RowBox[{"(*", RowBox[{ RowBox[{"TruncatedMatrix", " ", "=", " ", RowBox[{"ConnectionsMatrix", "[", RowBox[{"[", RowBox[{ RowBox[{ RowBox[{"3", "*", RowBox[{"(", RowBox[{"kickcellN", "-", "6"}], ")"}]}], ";;", RowBox[{"3", "*", RowBox[{"(", RowBox[{"kickcellN", "+", "6"}], ")"}]}]}], ",", RowBox[{ RowBox[{"3", "*", RowBox[{"(", RowBox[{"kickcellM", "-", "6"}], ")"}]}], ";;", RowBox[{"3", "*", RowBox[{"(", RowBox[{"kickcellM", "+", "6"}], ")"}]}]}]}], "]"}], "]"}]}], ";"}], "*)"}]], "Input", CellChangeTimes->{{3.5648312782251*^9, 3.564831281507188*^9}, { 3.564832676680789*^9, 3.5648327353106823`*^9}, {3.5648330972764883`*^9, 3.5648331950875177`*^9}, 3.566405194311061*^9, 3.567161555038845*^9, 3.577175592227667*^9}], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"(*", RowBox[{"TruncatedConnectionMatrixImage", "=", " ", RowBox[{"MatrixPlot", "[", RowBox[{"TruncatedMatrix", ",", RowBox[{"ColorRules", "\[Rule]", RowBox[{"{", RowBox[{ RowBox[{ RowBox[{"-", "3"}], "\[Rule]", "White"}], ",", RowBox[{ RowBox[{"-", "2"}], "\[Rule]", RowBox[{"Darker", "[", "Black", "]"}]}], ",", RowBox[{ RowBox[{"-", "1"}], "\[Rule]", RowBox[{"Lighter", "[", "Gray", "]"}]}], ",", RowBox[{"0", "\[Rule]", RowBox[{"Lighter", "[", "Gray", "]"}]}]}], "}"}]}], ",", RowBox[{"ColorFunction", "->", RowBox[{"(", RowBox[{ RowBox[{"Blend", "[", RowBox[{ RowBox[{"{", RowBox[{"White", ",", RowBox[{"Darker", "[", "Gray", "]"}]}], "}"}], ",", "#"}], "]"}], "&"}], ")"}]}], ",", RowBox[{"AspectRatio", "\[Rule]", "1"}]}], "]"}]}], "*)"}]], "Input", CellChangeTimes->{{3.564833106735026*^9, 3.5648331224284143`*^9}, 3.566405196967668*^9, 3.567161557959979*^9, 3.577175595868321*^9}], Cell[BoxData[ GraphicsBox[ RasterBox[SparseArray[ Automatic, {37, 37}, 0.6666666666666666, { 1, {{0, 32, 51, 82, 113, 146, 175, 204, 232, 264, 296, 325, 355, 385, 416, 448, 480, 506, 538, 570, 599, 630, 661, 688, 723, 758, 785, 817, 849, 870, 903, 936, 965, 1000, 1035, 1064, 1097, 1130}, CompressedData[" 1:eJyNU0sWgjAMLBT5qCigfBRF+V3II7B04/13QmlJipS66nudzGQyTcvu8+pM QsjbIsToT8Ok1sZxt7u9fzgG4ekcJ2l2uea3++NZ1U1LbW/EojjrL4uyaQ3T 2tiO29/7hxmjrGo93DcUokEYTXDB8FGeGwI6Fl8BqWi9Z9IZyGJXbE65bavH 6QAj0wuWR5BzJWk1yi2ziFFYIM3exwN6DHwx8zouEpHky2a0xZ9p1hqGWsMh bW5eZLJkO0mB/BfMUuEjDY2RsI3jXI5MWzILPVewFfurxiFuDogvMyWFF1fe oJUCir7M1PN3SXCFYo+UJdJzoiXXxFLocuEFX5eeVrw= "]}, CompressedData[" 1:eJztmXtQVNcdxxdFBUFSHlFQs8KWJOIrGHk1Pn6GKCggCk1UdFMIa4gSCTAq CAoCTSwQRAQEMYDYcRFkVURJqgORWl5iMCCvfb/RCIjrZkdRkbaT9Led3pOd 69rpTAdz//nMfs69595zzpdzDvc6hUcHf2zCYDAiTRmMD346+gG5/dTQKj8v PlA9HbN/W2uxMVhFePbNIDP7SwLa67XpYW8mlZDnhZV+vW0XX0H4eaWCcxea 5UY/p03uDC/pQpH+N8PA8c5ZBSPVXgxI9Han4zRlNXxAGrqeety4ympMmqYG pKHzltWbZw5+T7aXysglLO6q3F7CNz7MlK3Vqo3uFyr9N629M1FD9q/X17Md +l3EhH/r5CdHcxbQPzfD6cB76feEL/xc47Xd3w06VA1WSfTEPNw2N5fdL1EC kpqXB4JqZmedGpDouc5Do6x4JSDROx7pNOc5SAFJra9uWkaDTK4AJPrTnEEn 3edqQKI/tae6Zc8RFSDR50/wmvqn2F5Aoo97jbk1plwBSPRtdTsX549K/+vx K86c5FllY/y8sFJx4GLMIDn/VFXebQ/KM76+uOxnfVYD9LkY7+2c21v+efOP PXrieLutrVp5oUwESPQ+hb1Vn9xSAVI/L8rytPOClICk5vbLzx6NtZ5RAvKX Z9d/HyNPb+WuK+8BJHremWfM6FYJINFX1Lh81V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PtrLgvI+rctzF3ac4Nsh0eP951alsRg O37tl59/R0bt08yfItSTmqs3nNnsw5tEgKSW/4V9z8bHXwBIanmB2S3dpGEJ INF/+I7LwAaOHJCG/p7STfdLV++SARK9nf+R0QsXlYBEf2pvdUf0AfK9aPoC i5mm9eT80HGi/wFfbPx4F2//Q6RJPf3+ke+t/TZyPfk8vPcj8k/6kNfHTAhK nxBP7gOobCzk/vF4iOF8v+ztp+bIsTT0i0NhfYBEv/8BN7U1RgxIQznEI26X oGPPEikg0fdyy54wTPiApKuHH+bLmT7B+Pcgw8rLKXNayXkjgNO2l7WYHN8T iVXsfTvp79MtDGH5R5PjdPZVK92hVvr98Mhfj/L8o37hu5p10vzwQtLvz+53 XDfX+NyN934wlJf2lIlnW36nAiT6qcHWEttEBSDRu5ZfL7CZpwQk+siP8l5P K+oDJPqUhBrFHWsJINHfuXHes4MhByT1uZxnrXC2eE0FSPTMd0+bdFsrAYl+ WUTMQE0Xue9z7OR4NhXT7wfXeAaG+2aR/Vj2+MvVbx4jxye5RBG1yY/04b4C NltMzjNpT68mZ5+kz8kq94t/g7+T9YYlBggyd5E+sKDBY/nbpN8ti00OzDL8 PfvXfvn5N+ZHs3lykU+oGJDodfX89dxaBSDRd9skDcO0XkCiT5detp/1XS8g 9efPNlNbVPzz/H+RmvfdnlP32kbzAUktt1/3WGiWJQUktdyyp6U9QNsHSPSL XJMnicXk+8Ou38T0DfDI/knxPLpdeNL4797VTcuUW2zp123eQJTv+UHy/UJB SZygPoTM49i1kokiCTnv7r3uWiaaTXrHp/V2baHP/332Ze2HfwAnZoJn "]}], {{0, 0}, { 37, 37}}, {0, 1}], AspectRatio->1, Frame->True, FrameLabel->{None, None}, FrameTicks->{{{{36.5, FormBox["1", TraditionalForm]}, {27.5, FormBox["10", TraditionalForm]}, {17.5, FormBox["20", TraditionalForm]}, {7.5, FormBox["30", TraditionalForm]}, {0.5, FormBox["37", TraditionalForm]}}, {{36.5, FormBox["1", TraditionalForm]}, {27.5, FormBox["10", TraditionalForm]}, {17.5, FormBox["20", TraditionalForm]}, {7.5, FormBox["30", TraditionalForm]}, {0.5, FormBox["37", TraditionalForm]}}}, {{{0.5, FormBox["1", TraditionalForm]}, {9.5, FormBox["10", TraditionalForm]}, {19.5, FormBox["20", TraditionalForm]}, {29.5, FormBox["30", TraditionalForm]}, {36.5, FormBox["37", TraditionalForm]}}, {{0.5, FormBox["1", TraditionalForm]}, {9.5, FormBox["10", TraditionalForm]}, {19.5, FormBox["20", TraditionalForm]}, {29.5, FormBox["30", TraditionalForm]}, {36.5, FormBox["37", TraditionalForm]}}}}]], "Output", CellChangeTimes->{3.567161561652248*^9, 3.567161904171102*^9, 3.567162750955187*^9, 3.567163038564867*^9, 3.5671631343848886`*^9, 3.567248917685705*^9}] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ RowBox[{"(*", RowBox[{"Export", "[", RowBox[{ "\"\\"", ",", "TruncatedConnectionMatrixImage"}], "]"}], "*)"}]], "Input", CellChangeTimes->{{3.5666323765770082`*^9, 3.566632393785363*^9}, 3.56714806107725*^9, 3.567160654516141*^9, {3.567162577786614*^9, 3.567162677910001*^9}, {3.567162923980915*^9, 3.567162972616968*^9}, { 3.567248882499988*^9, 3.5672488878078213`*^9}, {3.567248963696018*^9, 3.5672489749873533`*^9}}], Cell[BoxData["\<\"/Users/Rachel/Documents/MOAC/PhD/Modelling/FHN Model/Global \ Network Diagrams/UniformDistribution_NoExcitation_Prob_0.6.jpg\"\>"], "Output",\ CellChangeTimes->{3.567248966906941*^9}] }, Open ]] }, WindowSize->{1280, 693}, WindowMargins->{{0, Automatic}, {Automatic, 0}}, PrivateNotebookOptions->{"VersionedStylesheet"->{"Default.nb"[8.] -> False}}, ShowSelection->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, 348, 9, 28, "Input"], Cell[CellGroupData[{ Cell[930, 33, 193214, 4157, 8384, "Input"], Cell[194147, 4192, 155, 2, 28, "Output"] }, Open ]], Cell[194317, 4197, 240, 5, 28, "Input"], Cell[CellGroupData[{ Cell[194582, 4206, 1272, 31, 46, "Input"], Cell[195857, 4239, 12628, 219, 379, "Output"] }, Open ]], Cell[208500, 4461, 909, 25, 28, "Input"], Cell[CellGroupData[{ Cell[209434, 4490, 1131, 29, 46, "Input"], Cell[210568, 4521, 4644, 86, 379, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[215249, 4612, 594, 11, 46, "Input"], Cell[215846, 4625, 203, 3, 28, "Output"] }, Open ]] } ] *) (* End of internal cache information *)