diff --git a/README.md b/README.md index f2eb140..307f468 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ # Cavefish2017 Scripts and data from "The Importance of Selection in the Evolution of Blindness in Cavefish" +## Cavefish.nb + +Mathematica notebook verifying the analysis of our deterministic model. + ## Figures This directory contains `R` scripts used to analyze the model in the paper and create descriptive figures. diff --git a/cavefish.nb b/cavefish.nb new file mode 100644 index 0000000..a72e7b1 --- /dev/null +++ b/cavefish.nb @@ -0,0 +1,3152 @@ +(* Content-type: application/vnd.wolfram.mathematica *) + +(*** Wolfram Notebook File ***) +(* http://www.wolfram.com/nb *) + +(* CreatedBy='Mathematica 10.1' *) + +(*CacheID: 234*) +(* Internal cache information: +NotebookFileLineBreakTest +NotebookFileLineBreakTest +NotebookDataPosition[ 158, 7] +NotebookDataLength[ 118441, 3143] +NotebookOptionsPosition[ 112899, 2966] +NotebookOutlinePosition[ 113236, 2981] +CellTagsIndexPosition[ 113193, 2978] +WindowFrame->Normal*) + +(* Beginning of Notebook Content *) +Notebook[{ + +Cell[CellGroupData[{ +Cell["Main Model", "Section", + CellChangeTimes->{{3.686976409565504*^9, 3.686976413990726*^9}}], + +Cell[BoxData[{ + RowBox[{"w11", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"w12", " ", ":=", " ", + RowBox[{"1", "+", + RowBox[{"h", " ", "s"}]}]}], "\[IndentingNewLine]", + RowBox[{"w22", " ", ":=", " ", + RowBox[{"1", "+", "s"}]}], "\[IndentingNewLine]", + RowBox[{"qj", " ", ":=", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], " ", "2"}], " ", "+", " ", + RowBox[{"w11", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}]}]}], "\[IndentingNewLine]", + RowBox[{"qa", " ", ":=", " ", + RowBox[{ + RowBox[{"qj", " ", + RowBox[{"(", + RowBox[{"1", "-", "m"}], ")"}]}], " ", "+", " ", + RowBox[{"m", " ", "Q"}]}]}], "\[IndentingNewLine]", + RowBox[{"qq", " ", ":=", " ", + RowBox[{"qa", " ", "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "-", "qa"}], ")"}], " ", "u"}]}]}], "\[IndentingNewLine]", + RowBox[{"dq", " ", ":=", " ", + RowBox[{"qq", "-", "q"}]}]}], "Input", + CellChangeTimes->{{3.686976466118677*^9, 3.6869764666688347`*^9}}], + +Cell[CellGroupData[{ + +Cell["q-prime", "Subsection", + CellChangeTimes->{{3.686976496219228*^9, 3.686976529824329*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{"FullSimplify", "[", "qq", "]"}]], "Input"], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{"m", " ", "Q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "-", "u", "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}], " ", "s"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "+", "u", "-", + RowBox[{"h", " ", "s", " ", + RowBox[{"(", + RowBox[{"1", "+", "u"}], ")"}]}]}], ")"}]}], "+", + RowBox[{ + SuperscriptBox["q", "2"], " ", "s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{"1", "+", "u", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}], "+", "u", "-", + RowBox[{"2", " ", "Q", " ", "u"}]}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "-", "q"}], ")"}], " ", "q", + " ", "s"}]}]]], "Output", + CellChangeTimes->{3.686976548180551*^9, 3.687020221977133*^9, + 3.687027354451239*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["delta - q", "Subsection", + CellChangeTimes->{{3.686976580575251*^9, 3.686976587373122*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"FullSimplify", "[", "dq", "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqn", " ", "=", " ", + RowBox[{"-", + RowBox[{"Numerator", "[", + RowBox[{"Together", "[", "dq", "]"}], "]"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{"dqn", ",", " ", "q"}], "]"}], "]"}], " ", "//", " ", + "MatrixForm"}]}], "Input", + CellChangeTimes->{{3.686976594597291*^9, 3.686976595937175*^9}, { + 3.686976731635996*^9, 3.68697676792887*^9}, {3.686977529503952*^9, + 3.686977530478991*^9}, {3.6869815120419283`*^9, 3.6869815153066473`*^9}}], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", + RowBox[{"(", + RowBox[{"q", "-", "Q", "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"q", "-", + RowBox[{"q", " ", "Q"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}]}]}], ")"}], " ", "s"}]}], ")"}], + " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", + RowBox[{"(", + RowBox[{"u", "+", + RowBox[{"q", " ", "s", " ", + RowBox[{"(", + RowBox[{"q", "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "q"}], "+", "u"}], ")"}]}]}], ")"}]}]}], + ")"}]}]}], + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "-", "q"}], ")"}], " ", "q", + " ", "s"}]}]]], "Output", + CellChangeTimes->{3.6869765994042263`*^9, 3.686976734687005*^9, + 3.686976768530661*^9, 3.686977531913039*^9, 3.6869815163989983`*^9, + 3.687020226371913*^9, 3.687027357479218*^9}], + +Cell[BoxData[ + TagBox[ + RowBox[{"(", "\[NoBreak]", + TagBox[GridBox[{ + { + RowBox[{"u", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{"Q", "-", + RowBox[{"Q", " ", "u"}]}], ")"}]}]}]}, + { + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}], " ", "s"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "-", "u", "+", + RowBox[{"h", " ", "s", " ", + RowBox[{"(", + RowBox[{"1", "+", "u"}], ")"}]}]}]}, + { + RowBox[{"s", " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "3"}], "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "-", "u"}], ")"}]}], + "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q", "+", "u", "-", + RowBox[{"Q", " ", "u"}]}], ")"}]}]}], ")"}]}]}, + { + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "h"}]}], ")"}], " ", "s"}]} + }, + GridBoxAlignment->{ + "Columns" -> {{Center}}, "ColumnsIndexed" -> {}, "Rows" -> {{Baseline}}, + "RowsIndexed" -> {}}, + GridBoxSpacings->{"Columns" -> { + Offset[0.27999999999999997`], { + Offset[0.5599999999999999]}, + Offset[0.27999999999999997`]}, "ColumnsIndexed" -> {}, "Rows" -> { + Offset[0.2], { + Offset[0.4]}, + Offset[0.2]}, "RowsIndexed" -> {}}], + Column], "\[NoBreak]", ")"}], + Function[BoxForm`e$, + MatrixForm[BoxForm`e$]]]], "Output", + CellChangeTimes->{3.6869765994042263`*^9, 3.686976734687005*^9, + 3.686976768530661*^9, 3.686977531913039*^9, 3.6869815163989983`*^9, + 3.687020226371913*^9, 3.687027357611916*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["First Derivatives", "Subsection", + CellChangeTimes->{{3.6869780695102053`*^9, 3.68697808210343*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "s"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "<", " ", "0"}], " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", "1"}], "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "u"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "<", " ", "0"}], " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", "1"}], "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "h"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "<", " ", "0"}], " ", "&&", " ", + RowBox[{"0", " ", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"Sqrt", "[", + RowBox[{"1", "+", "s"}], "]"}]}], ")"}], "^", + RowBox[{"(", + RowBox[{"-", "1"}], ")"}]}]}], "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "h"}], "]"}], "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", ">", " ", "0"}], " ", "&&", " ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"Sqrt", "[", + RowBox[{"1", "+", "s"}], "]"}]}], ")"}], "^", + RowBox[{"(", + RowBox[{"-", "1"}], ")"}]}], " ", "\[LessEqual]", " ", "q", " ", + "\[LessEqual]", " ", "1"}], "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"dMig", " ", "=", " ", + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "m"}], "]"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dMigTh", " ", "=", " ", + FractionBox[ + RowBox[{"2", " ", "Q"}], + RowBox[{"1", "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"2", " ", "Q", " ", "s"}]}], ")"}]}], "+", + SqrtBox[ + RowBox[{"1", "+", + RowBox[{"s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "h", " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "Q"}]}], ")"}], "2"]}], "-", + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}], " ", "Q"}], "+", + RowBox[{ + SuperscriptBox["h", "2"], " ", + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "Q"}]}], ")"}], "2"], " ", "s"}]}], + ")"}]}]}]]}]]}], ";"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"dMig", " ", "<", " ", "0"}], " ", "&&", " ", + RowBox[{ + "0", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", "dMigTh"}], "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"dMig", " ", ">", " ", "0"}], " ", "&&", " ", + RowBox[{ + "dMigTh", " ", "\[LessEqual]", "q", " ", "\[LessEqual]", " ", "1"}], "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"D", "[", + RowBox[{"dq", ",", "Q"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "<", " ", "0"}], " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", "1"}], "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.6869781070796633`*^9, 3.686978283617752*^9}, { + 3.686978329103561*^9, 3.6869788263248663`*^9}, {3.686979118559863*^9, + 3.6869791919181213`*^9}, {3.6869792241472178`*^9, 3.6869792734744997`*^9}, { + 3.68697933455507*^9, 3.686979352159769*^9}, {3.686979400872135*^9, + 3.686979471883732*^9}, {3.686980723705517*^9, 3.686980736212473*^9}, { + 3.6870202323942623`*^9, 3.687020243897773*^9}}], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "q"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "q"}]}], ")"}]}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "+", "q"}], ")"}], " ", + "s"}]}], ")"}], "2"]]], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027364616478*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027364653224*^9}], + +Cell[BoxData[ + RowBox[{"1", "-", + RowBox[{"m", " ", "Q"}], "+", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", "q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "s"}], "-", + RowBox[{"q", " ", "s"}]}], ")"}]}], + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "-", "q"}], ")"}], " ", + "q", " ", "s"}]}]]}]], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.6870273651144657`*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.6870273652272787`*^9}], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "q", " ", "s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"2", "+", + RowBox[{"q", " ", "s"}]}], ")"}]}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "+", "q"}], ")"}], " ", + "s"}]}], ")"}], "2"]]], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027365305088*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027365348342*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.6870273654038677`*^9}], + +Cell[BoxData[ + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{"q", "-", "Q", "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"q", "-", + RowBox[{"q", " ", "Q"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}]}]}], ")"}], " ", "s"}]}], ")"}], + " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}]}], "-", "q"}], ")"}], " ", + "q", " ", "s"}]}]]}]], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027365495932*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027439141336*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.6870275371514587`*^9}], + +Cell[BoxData[ + RowBox[{"m", "-", + RowBox[{"m", " ", "u"}]}]], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027537189906*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686978126498879*^9, 3.6869781365761843`*^9}, { + 3.686978181092409*^9, 3.6869782508186703`*^9}, 3.686978284016904*^9, { + 3.686978346196954*^9, 3.686978446957789*^9}, {3.6869784921255913`*^9, + 3.686978520762932*^9}, 3.686978557114833*^9, 3.686978601881971*^9, + 3.686978634903933*^9, 3.686978726726246*^9, {3.6869787700093813`*^9, + 3.6869788272823153`*^9}, {3.68697915691094*^9, 3.686979193132182*^9}, { + 3.68697925828664*^9, 3.686979274652314*^9}, 3.6869793531269493`*^9, + 3.6869794723455153`*^9, 3.686980726978855*^9, 3.687027537199464*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Proposition 1", "Subsection", + CellChangeTimes->{{3.686977090976157*^9, 3.686977109419232*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[ + RowBox[{ + RowBox[{"(*", " ", + RowBox[{"Case", " ", "1"}], " ", "*)"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"dq", " ", "\[Equal]", " ", "0"}], " ", "/.", " ", + RowBox[{"s", "\[Rule]", "0"}]}], ",", "q"}], "]"}], ";"}], + "\[IndentingNewLine]", + RowBox[{"qHatLow", " ", "=", " ", + RowBox[{"q", " ", "/.", " ", + RowBox[{"%", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"dq", " ", "\[LessEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", " ", "<=", " ", "q", " ", "<", " ", "qHatLow"}], " ", "&&", + " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Case", " ", "2"}], " ", "*)"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dq", " ", "\[Equal]", " ", "0"}], " ", "/.", " ", + RowBox[{"{", + RowBox[{ + RowBox[{"u", "\[Rule]", "0"}], ",", + RowBox[{"m", "\[Rule]", "0"}], ",", + RowBox[{"q", "\[Rule]", "0"}]}], "}"}]}]}]}]], "Input", + CellChangeTimes->{ + 3.6869771110204067`*^9, {3.686977151913946*^9, 3.686977164870007*^9}, { + 3.6869772167181377`*^9, 3.68697725637109*^9}, {3.686977349162932*^9, + 3.68697739447325*^9}, {3.686977460059569*^9, 3.686977460945956*^9}, { + 3.686977500304953*^9, 3.686977523964099*^9}, {3.686977655897653*^9, + 3.6869776831815653`*^9}, {3.686977720853648*^9, 3.686977738404339*^9}, + 3.68702025271824*^9}], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", "Q"}], "-", "u", "+", + RowBox[{"m", " ", "Q", " ", "u"}]}], + RowBox[{ + RowBox[{"-", "m"}], "-", "u", "+", + RowBox[{"m", " ", "u"}]}]]], "Output", + CellChangeTimes->{ + 3.686977165380378*^9, 3.6869772568311033`*^9, 3.686977394935594*^9, + 3.6869774640317497`*^9, {3.6869775138336573`*^9, 3.686977535323773*^9}, + 3.6869776836672163`*^9, 3.6869777388768187`*^9, 3.6870202536950893`*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{ + 3.686977165380378*^9, 3.6869772568311033`*^9, 3.686977394935594*^9, + 3.6869774640317497`*^9, {3.6869775138336573`*^9, 3.686977535323773*^9}, + 3.6869776836672163`*^9, 3.6869777388768187`*^9, 3.687020254361992*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{ + 3.686977165380378*^9, 3.6869772568311033`*^9, 3.686977394935594*^9, + 3.6869774640317497`*^9, {3.6869775138336573`*^9, 3.686977535323773*^9}, + 3.6869776836672163`*^9, 3.6869777388768187`*^9, 3.687020254363573*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Proposition 2", "Subsection", + CellChangeTimes->{{3.686977756241053*^9, 3.6869777642330503`*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"(", + RowBox[{"dq", " ", "/.", " ", + RowBox[{"h", "\[Rule]", "0"}]}], ")"}], " ", ",", " ", + RowBox[{"s", "\[Rule]", "Infinity"}]}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", " ", + RowBox[{ + RowBox[{"%", " ", "\[Equal]", " ", "0"}], ",", " ", "q"}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{"qHatHigh", " ", "=", " ", + RowBox[{"q", " ", "/.", " ", + RowBox[{"%", "[", + RowBox[{"[", "1", "]"}], "]"}]}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"dq", " ", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"qHatHigh", " ", "<", " ", "q", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Tighter", " ", "Bound"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"(", "dq", ")"}], " ", ",", " ", + RowBox[{"s", "\[Rule]", "Infinity"}]}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{"Solve", "[", " ", + RowBox[{ + RowBox[{"%", " ", "\[Equal]", " ", "0"}], ",", " ", "q"}], "]"}]}], "Input",\ + + CellChangeTimes->{{3.686977779937478*^9, 3.6869778789145393`*^9}, { + 3.686977919296755*^9, 3.68697798666787*^9}, 3.6870202579909887`*^9}], + +Cell[BoxData[ + RowBox[{"1", "-", "m", "+", + RowBox[{"m", " ", "Q"}], "+", + RowBox[{"m", " ", "u"}], "-", + RowBox[{"m", " ", "Q", " ", "u"}]}]], "Output", + CellChangeTimes->{{3.686977808152689*^9, 3.686977828245172*^9}, { + 3.686977863677445*^9, 3.686977879322866*^9}, 3.6869779464071608`*^9, { + 3.686977979681126*^9, 3.686977987087685*^9}, 3.6870275373910847`*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686977808152689*^9, 3.686977828245172*^9}, { + 3.686977863677445*^9, 3.686977879322866*^9}, 3.6869779464071608`*^9, { + 3.686977979681126*^9, 3.686977987087685*^9}, 3.687027537948642*^9}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{"1", "-", + RowBox[{"3", " ", "h"}], "-", "m", "+", + RowBox[{"h", " ", "m"}], "+", + RowBox[{"m", " ", "Q"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "-", + RowBox[{"h", " ", "u"}], "+", + RowBox[{"m", " ", "u"}], "-", + RowBox[{"h", " ", "m", " ", "u"}], "-", + RowBox[{"m", " ", "Q", " ", "u"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}], "-", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"3", " ", "h"}], "+", "m", "-", + RowBox[{"h", " ", "m"}], "-", + RowBox[{"m", " ", "Q"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "+", + RowBox[{"h", " ", "u"}], "-", + RowBox[{"m", " ", "u"}], "+", + RowBox[{"h", " ", "m", " ", "u"}], "+", + RowBox[{"m", " ", "Q", " ", "u"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}]}], ")"}], + "2"], "-", + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "h"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "h"}], "+", + RowBox[{"h", " ", "m"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "-", + RowBox[{"h", " ", "u"}], "-", + RowBox[{"h", " ", "m", " ", "u"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}]}], + ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "h"}]}], ")"}]}]]}], "}"}], ",", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{"1", "-", + RowBox[{"3", " ", "h"}], "-", "m", "+", + RowBox[{"h", " ", "m"}], "+", + RowBox[{"m", " ", "Q"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "-", + RowBox[{"h", " ", "u"}], "+", + RowBox[{"m", " ", "u"}], "-", + RowBox[{"h", " ", "m", " ", "u"}], "-", + RowBox[{"m", " ", "Q", " ", "u"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}], "+", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"3", " ", "h"}], "+", "m", "-", + RowBox[{"h", " ", "m"}], "-", + RowBox[{"m", " ", "Q"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "+", + RowBox[{"h", " ", "u"}], "-", + RowBox[{"m", " ", "u"}], "+", + RowBox[{"h", " ", "m", " ", "u"}], "+", + RowBox[{"m", " ", "Q", " ", "u"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}]}], ")"}], + "2"], "-", + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "h"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "h"}], "+", + RowBox[{"h", " ", "m"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "-", + RowBox[{"h", " ", "u"}], "-", + RowBox[{"h", " ", "m", " ", "u"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}]}], + ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"2", " ", "h"}]}], ")"}]}]]}], "}"}]}], "}"}]], "Output", + CellChangeTimes->{{3.686977808152689*^9, 3.686977828245172*^9}, { + 3.686977863677445*^9, 3.686977879322866*^9}, 3.6869779464071608`*^9, { + 3.686977979681126*^9, 3.686977987087685*^9}, 3.687027538047998*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Protected Polymorphism", "Subsection", + CellChangeTimes->{{3.6869807945086107`*^9, 3.686980809721476*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"cond", " ", "=", " ", + RowBox[{ + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "\[LessEqual]", " ", "1"}], + " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{ + "0", "\[LessEqual]", " ", "u", " ", "\[LessEqual]", " ", "1"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"dq", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "0"}]}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "<=", " ", "0"}], "&&", " ", "cond"}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"%", ",", "cond"}], "]"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"dq", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "1"}]}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", ">=", " ", "0"}], "&&", " ", "cond"}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"%", ",", "cond"}], "]"}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.68698092504207*^9, 3.6869810928720837`*^9}, { + 3.6869811235066967`*^9, 3.6869811602315063`*^9}, {3.686981195355632*^9, + 3.686981208603101*^9}}], + +Cell[BoxData[ + RowBox[{"u", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{"Q", "-", + RowBox[{"Q", " ", "u"}]}], ")"}]}]}]], "Output", + CellChangeTimes->{{3.686980933686296*^9, 3.686980968243895*^9}, + 3.6869810001267157`*^9, {3.686981058187025*^9, 3.6869810732840853`*^9}, + 3.686981132262104*^9, 3.686981164567697*^9, {3.686981201177979*^9, + 3.686981208915598*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"u", "\[Equal]", "0"}], "&&", + RowBox[{"(", + RowBox[{ + RowBox[{"m", "\[LessEqual]", "0"}], "||", + RowBox[{"Q", "\[LessEqual]", "0"}]}], ")"}]}]], "Output", + CellChangeTimes->{{3.686980933686296*^9, 3.686980968243895*^9}, + 3.6869810001267157`*^9, {3.686981058187025*^9, 3.6869810732840853`*^9}, + 3.686981132262104*^9, 3.686981164567697*^9, {3.686981201177979*^9, + 3.686981208917293*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", "m"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}]], "Output", + CellChangeTimes->{{3.686980933686296*^9, 3.686980968243895*^9}, + 3.6869810001267157`*^9, {3.686981058187025*^9, 3.6869810732840853`*^9}, + 3.686981132262104*^9, 3.686981164567697*^9, {3.686981201177979*^9, + 3.686981208918738*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"u", "\[GreaterEqual]", "1"}], "||", + RowBox[{"m", "\[LessEqual]", "0"}], "||", + RowBox[{"Q", "\[GreaterEqual]", "1"}]}]], "Output", + CellChangeTimes->{{3.686980933686296*^9, 3.686980968243895*^9}, + 3.6869810001267157`*^9, {3.686981058187025*^9, 3.6869810732840853`*^9}, + 3.686981132262104*^9, 3.686981164567697*^9, {3.686981201177979*^9, + 3.686981208927791*^9}}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Proposition 3", "Subsection", + CellChangeTimes->{{3.686981293068239*^9, 3.686981301785645*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"cond", " ", "=", " ", + RowBox[{ + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", ">", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "<", " ", "m", " ", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "<", " ", "u", " ", "\[LessEqual]", " ", "1"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqn1", " ", "=", " ", + RowBox[{"dqn", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "1"}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqn0", " ", "=", " ", + RowBox[{"dqn", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "0"}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnP", " ", "=", " ", + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"dqn", "/", + RowBox[{"Abs", "[", + RowBox[{"q", "^", "3"}], "]"}]}], ",", " ", + RowBox[{"q", "\[Rule]", "Infinity"}]}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"dqnN", " ", "=", " ", + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"dqn", "/", + RowBox[{"Abs", "[", + RowBox[{"q", "^", "3"}], "]"}]}], ",", " ", + RowBox[{"q", "\[Rule]", + RowBox[{"-", "Infinity"}]}]}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"1", " ", "root", " ", "or", " ", "3", " ", "roots"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"dqn1", " ", ">=", " ", "dqn0"}], " ", "&&", " ", "cond"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"dqn1", " ", ">", " ", "0"}], " ", "&&", " ", "cond"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"dqn0", " ", "<", " ", "0"}], " ", "&&", " ", "cond"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Case", " ", "1"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"dqnP", " ", "<", " ", "0"}], " ", "&&", " ", "cond", " ", "&&", + " ", + RowBox[{ + RowBox[{"1", "/", "2"}], " ", "<", "h", " ", "\[LessEqual]", " ", + "1"}]}], "]"}]}], " "}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"dqnN", " ", ">", " ", "0"}], " ", "&&", " ", "cond", " ", "&&", + " ", + RowBox[{ + RowBox[{"1", "/", "2"}], " ", "<", "h", " ", "\[LessEqual]", " ", + "1"}]}], "]"}]}], " ", "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Case", " ", "2"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"Exponent", "[", + RowBox[{ + RowBox[{"dqn", " ", "/.", " ", + RowBox[{"h", "\[Rule]", + RowBox[{"1", "/", "2"}]}]}], ",", "q"}], "]"}], " ", "\[Equal]", " ", + "2"}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Case", " ", "3"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"D", "[", + RowBox[{"dqn", ",", + RowBox[{"{", + RowBox[{"q", ",", "2"}], "}"}]}], "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", ">", " ", "0"}], " ", "&&", " ", "cond", " ", "&&", + " ", + RowBox[{ + RowBox[{"1", "/", "3"}], " ", "\[LessEqual]", " ", "h", " ", "<", " ", + RowBox[{"1", "/", "2"}]}], " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "q", " ", "\[LessEqual]", " ", "1"}]}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Case", " ", "4"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"cond4", " ", "=", " ", + RowBox[{"cond", " ", "&&", " ", + RowBox[{"0", " ", "\[LessEqual]", " ", "h", " ", "<", " ", + RowBox[{"1", "/", "3"}]}], " ", "&&", " ", + RowBox[{"s", " ", ">", " ", + FractionBox[ + RowBox[{ + RowBox[{"-", "m"}], "-", "u", "+", + RowBox[{"m", " ", "u"}]}], + RowBox[{ + RowBox[{"-", "h"}], "+", + RowBox[{"h", " ", "m"}], "-", + RowBox[{"2", " ", "h", " ", "m", " ", "Q"}], "-", + RowBox[{"h", " ", "u"}], "-", + RowBox[{"h", " ", "m", " ", "u"}], "+", + RowBox[{"2", " ", "h", " ", "m", " ", "Q", " ", "u"}]}]]}]}]}], " ", + ";"}], " "}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnD", " ", "=", " ", + RowBox[{"D", "[", + RowBox[{"dqn", ",", " ", + RowBox[{"{", + RowBox[{"q", ",", "1"}], "}"}]}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"dqnD", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "0"}]}], ")"}], " ", "<", " ", "0"}], " ", "&&", + " ", "cond4"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"dqnD", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "1"}]}], ")"}], " ", ">", " ", "0"}], " ", "&&", + " ", "cond4"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"dqnD", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "1"}]}], ")"}], " ", ">=", " ", + RowBox[{"(", + RowBox[{"dqnD", " ", "/.", " ", + RowBox[{"q", "\[Rule]", "0"}]}], ")"}]}], " ", "&&", " ", "cond4"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"dqnD", "/", + RowBox[{"Abs", "[", + RowBox[{"q", "^", "2"}], "]"}]}], ",", " ", + RowBox[{"q", "\[Rule]", + RowBox[{"-", "Infinity"}]}]}], "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"%", " ", "\[GreaterEqual]", " ", "0"}], " ", "&&", " ", + "cond4"}], "]"}]}]}], "Input", + CellChangeTimes->{ + 3.686981329155285*^9, {3.686981360355268*^9, 3.686981449157415*^9}, { + 3.6869814842296247`*^9, 3.686981484851083*^9}, {3.686981523364765*^9, + 3.68698158424057*^9}, {3.686981630398357*^9, 3.686981743750939*^9}, { + 3.686981874818376*^9, 3.686981894849207*^9}, {3.686982003657371*^9, + 3.686982275792894*^9}, {3.686982354983827*^9, 3.686982373026258*^9}, { + 3.686982452531569*^9, 3.686982568346077*^9}, {3.68698263531459*^9, + 3.686983002649053*^9}, 3.686983035419578*^9, {3.6870202726317472`*^9, + 3.687020286613782*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.68702028746566*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287482946*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.6870202874877567`*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287488295*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287488801*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287489325*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287560752*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020287597851*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020288558188*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020288607293*^9}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.686981366843379*^9, 3.6869813727192793`*^9}, + 3.686981449524766*^9, 3.686981485373911*^9, {3.686981525743499*^9, + 3.686981584730777*^9}, 3.6869817440602837`*^9, 3.6869818763178473`*^9, + 3.686982021385213*^9, {3.6869820725512238`*^9, 3.6869822305273046`*^9}, + 3.686982265839563*^9, {3.6869823611742897`*^9, 3.6869823648144197`*^9}, + 3.6869825003202553`*^9, {3.686982537485106*^9, 3.686982563116351*^9}, + 3.686982661529451*^9, 3.686982706178834*^9, 3.686982743308065*^9, { + 3.686982842820068*^9, 3.686982881462084*^9}, {3.6869829146826344`*^9, + 3.686982963871262*^9}, 3.686983003045539*^9, 3.687020288644981*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["S_q(m,h,u,Q) ", "Subsection", + CellChangeTimes->{{3.686982146824072*^9, 3.686982148058524*^9}, { + 3.686983092906186*^9, 3.686983102750554*^9}, {3.686983298637348*^9, + 3.686983299853297*^9}, {3.686983510300518*^9, 3.686983541699988*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"s", " ", "/.", " ", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dqn", " ", "\[Equal]", " ", "0"}], ",", "s"}], "]"}], "[", + RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{"sStar", " ", "=", " ", + RowBox[{"FullSimplify", "[", "%", "]"}]}], "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"sStar", " ", "\[Equal]", " ", "0"}], ",", " ", "m"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{ + RowBox[{"1", "/", "sStar"}], " ", "\[Equal]", "0"}], ",", "m"}], + "]"}]}], "Input", + CellChangeTimes->{{3.686983111777383*^9, 3.6869831822606983`*^9}, { + 3.686983304083509*^9, 3.686983308084674*^9}, {3.686983369383651*^9, + 3.686983446444483*^9}}], + +Cell[BoxData[ + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", + RowBox[{"(", + RowBox[{"q", "-", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "u"}]}], + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"q", "-", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"q", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}]}], ")"}]}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "q"}], "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "Q"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}], "-", "u"}], ")"}]}]}], + ")"}]}]]], "Output", + CellChangeTimes->{{3.686983125653784*^9, 3.686983149727272*^9}, + 3.686983305999345*^9, {3.686983377355318*^9, 3.686983422754099*^9}, + 3.687020308262148*^9}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"m", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "u"}], + RowBox[{ + RowBox[{"(", + RowBox[{"q", "-", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}]]}], "}"}], "}"}]], "Output", + CellChangeTimes->{{3.686983125653784*^9, 3.686983149727272*^9}, + 3.686983305999345*^9, {3.686983377355318*^9, 3.686983422754099*^9}, + 3.68702030827631*^9}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"m", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "h"}], "-", "q", "+", + RowBox[{"2", " ", "h", " ", "q"}], "-", + RowBox[{"h", " ", "u"}]}], ")"}]}], + RowBox[{ + RowBox[{"(", + RowBox[{"h", "+", "q", "-", + RowBox[{"h", " ", "q"}], "-", + RowBox[{"2", " ", "h", " ", "Q"}], "-", + RowBox[{"q", " ", "Q"}], "+", + RowBox[{"2", " ", "h", " ", "q", " ", "Q"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}]]}]}], "}"}], "}"}]], "Output",\ + + CellChangeTimes->{{3.686983125653784*^9, 3.686983149727272*^9}, + 3.686983305999345*^9, {3.686983377355318*^9, 3.686983422754099*^9}, + 3.687020308280072*^9}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["s*/m", "Subsection", + CellChangeTimes->{{3.687020333093964*^9, 3.6870203492737226`*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"sStar", "/", "m"}], ")"}], " ", "/.", " ", + RowBox[{"u", "\[Rule]", "0"}]}], ",", + RowBox[{"m", "\[Rule]", "0"}]}], "]"}], "\[IndentingNewLine]", + RowBox[{"dqApprox", " ", "=", " ", + RowBox[{"FullSimplify", "[", + RowBox[{"Normal", "[", + RowBox[{"Series", "[", + RowBox[{ + RowBox[{"dq", " ", "/.", " ", + RowBox[{"u", "\[Rule]", "0"}]}], ",", + RowBox[{"{", + RowBox[{"q", ",", "0", ",", "2"}], "}"}]}], "]"}], "]"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"Discriminant", "[", + RowBox[{"dqApprox", ",", " ", "q"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"%", " ", "\[Equal]", " ", "0"}], ",", " ", "s"}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Limit", "[", " ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"s", " ", "/.", " ", + RowBox[{"%", "[", + RowBox[{"[", "1", "]"}], "]"}]}], ")"}], " ", "/", "m"}], ",", " ", + RowBox[{"m", "\[Rule]", "0"}]}], "]"}], + " "}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.6870203536780453`*^9, 3.687020505608234*^9}, { + 3.687020550901959*^9, 3.6870206464251328`*^9}, {3.687020735384631*^9, + 3.687020736143704*^9}, {3.687020772705173*^9, 3.687020833430386*^9}, { + 3.687020923487506*^9, 3.687020956966423*^9}, {3.687021409513053*^9, + 3.687021530373785*^9}, {3.687021563476758*^9, 3.687021569811249*^9}, { + 3.68702184243789*^9, 3.6870218570024*^9}, {3.687021908094797*^9, + 3.687021929619803*^9}, {3.687021988558558*^9, 3.687022046511394*^9}, { + 3.6870220909596977`*^9, 3.687022091598583*^9}, {3.687022130359174*^9, + 3.6870221849850883`*^9}, 3.68702227280591*^9, {3.687022377280458*^9, + 3.687022422805375*^9}, {3.68702246490384*^9, 3.6870224896716146`*^9}}], + +Cell[BoxData[ + FractionBox[ + RowBox[{"q", "-", "Q"}], + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "q"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "q"}]}], ")"}]}]}], ")"}]}]]], "Output", + CellChangeTimes->{{3.6870203617383757`*^9, 3.687020506808896*^9}, { + 3.687020624115834*^9, 3.687020646779931*^9}, 3.687020737484624*^9, { + 3.687020776802518*^9, 3.6870208340530853`*^9}, 3.687020957476671*^9, { + 3.687021426958802*^9, 3.687021487723351*^9}, 3.687021530943637*^9, + 3.687021570514339*^9, {3.6870218440582952`*^9, 3.687021857472954*^9}, { + 3.687021911078191*^9, 3.6870219300374517`*^9}, {3.687022033191334*^9, + 3.6870220469141417`*^9}, 3.687022092181674*^9, 3.687022131291172*^9, { + 3.687022161512231*^9, 3.687022185493281*^9}, 3.687022273328517*^9, { + 3.687022416046344*^9, 3.6870224233779573`*^9}, {3.6870224653073606`*^9, + 3.687022490081438*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"m", " ", "Q"}], "-", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"m", "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", "s"}]}], ")"}]}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", + SuperscriptBox["q", "2"], " ", "s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{"3", "+", + RowBox[{"2", " ", "h", " ", "s"}]}], ")"}]}]}], ")"}]}]}]], "Output", + CellChangeTimes->{{3.6870203617383757`*^9, 3.687020506808896*^9}, { + 3.687020624115834*^9, 3.687020646779931*^9}, 3.687020737484624*^9, { + 3.687020776802518*^9, 3.6870208340530853`*^9}, 3.687020957476671*^9, { + 3.687021426958802*^9, 3.687021487723351*^9}, 3.687021530943637*^9, + 3.687021570514339*^9, {3.6870218440582952`*^9, 3.687021857472954*^9}, { + 3.687021911078191*^9, 3.6870219300374517`*^9}, {3.687022033191334*^9, + 3.6870220469141417`*^9}, 3.687022092181674*^9, 3.687022131291172*^9, { + 3.687022161512231*^9, 3.687022185493281*^9}, 3.687022273328517*^9, { + 3.687022416046344*^9, 3.6870224233779573`*^9}, {3.6870224653073606`*^9, + 3.6870224900839357`*^9}}], + +Cell[BoxData[ + RowBox[{ + SuperscriptBox["m", "2"], "-", + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", "m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "Q"}], "+", + RowBox[{"h", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"6", " ", "Q"}]}], ")"}]}]}], ")"}], " ", "s"}], "-", + RowBox[{ + SuperscriptBox["h", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"8", " ", "Q"}]}], ")"}]}]}], ")"}], " ", + SuperscriptBox["s", "2"]}]}]], "Output", + CellChangeTimes->{{3.6870203617383757`*^9, 3.687020506808896*^9}, { + 3.687020624115834*^9, 3.687020646779931*^9}, 3.687020737484624*^9, { + 3.687020776802518*^9, 3.6870208340530853`*^9}, 3.687020957476671*^9, { + 3.687021426958802*^9, 3.687021487723351*^9}, 3.687021530943637*^9, + 3.687021570514339*^9, {3.6870218440582952`*^9, 3.687021857472954*^9}, { + 3.687021911078191*^9, 3.6870219300374517`*^9}, {3.687022033191334*^9, + 3.6870220469141417`*^9}, 3.687022092181674*^9, 3.687022131291172*^9, { + 3.687022161512231*^9, 3.687022185493281*^9}, 3.687022273328517*^9, { + 3.687022416046344*^9, 3.6870224233779573`*^9}, {3.6870224653073606`*^9, + 3.687022490085985*^9}}], + +Cell[BoxData[ + FractionBox[ + RowBox[{"h", "+", + RowBox[{"2", " ", "Q"}], "-", + RowBox[{"6", " ", "h", " ", "Q"}], "-", + RowBox[{"2", " ", + SqrtBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"3", " ", "h"}]}], ")"}], " ", "Q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "h"}], "-", "Q", "+", + RowBox[{"3", " ", "h", " ", "Q"}]}], ")"}]}]]}]}], + SuperscriptBox["h", "2"]]], "Output", + CellChangeTimes->{{3.6870203617383757`*^9, 3.687020506808896*^9}, { + 3.687020624115834*^9, 3.687020646779931*^9}, 3.687020737484624*^9, { + 3.687020776802518*^9, 3.6870208340530853`*^9}, 3.687020957476671*^9, { + 3.687021426958802*^9, 3.687021487723351*^9}, 3.687021530943637*^9, + 3.687021570514339*^9, {3.6870218440582952`*^9, 3.687021857472954*^9}, { + 3.687021911078191*^9, 3.6870219300374517`*^9}, {3.687022033191334*^9, + 3.6870220469141417`*^9}, 3.687022092181674*^9, 3.687022131291172*^9, { + 3.687022161512231*^9, 3.687022185493281*^9}, 3.687022273328517*^9, { + 3.687022416046344*^9, 3.6870224233779573`*^9}, {3.6870224653073606`*^9, + 3.6870224900879602`*^9}}] +}, Open ]] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Neutral Mutation", "Section", + CellChangeTimes->{{3.687022528984695*^9, 3.687022543816608*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"w11", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"w12", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"w22", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"qj", " ", ":=", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], " ", "2"}], " ", "+", " ", + RowBox[{"w11", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}]}]}], "\[IndentingNewLine]", + RowBox[{"qa", " ", ":=", " ", + RowBox[{ + RowBox[{"qj", " ", + RowBox[{"(", + RowBox[{"1", "-", "m"}], ")"}]}], " ", "+", " ", + RowBox[{"m", " ", "Q"}]}]}], "\[IndentingNewLine]", + RowBox[{"qq", " ", ":=", " ", + RowBox[{"qa", " ", "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "-", "qa"}], ")"}], " ", "u"}]}]}], "\[IndentingNewLine]", + RowBox[{"dq", " ", ":=", " ", + RowBox[{"qq", "-", "q"}]}], "\[IndentingNewLine]", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dq", " ", "\[Equal]", " ", "0"}], ",", "q"}], + "]"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dq", " ", "\[Equal]", " ", "0"}], ",", "m"}], "]"}], + "]"}]}], "Input", + CellChangeTimes->{{3.687022570488954*^9, 3.687022639151326*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", "Q"}], "-", "u", "+", + RowBox[{"m", " ", "Q", " ", "u"}]}], + RowBox[{ + RowBox[{"-", "m"}], "-", "u", "+", + RowBox[{"m", " ", "u"}]}]]}], "}"}], "}"}]], "Output", + CellChangeTimes->{{3.6870225853669653`*^9, 3.687022596489684*^9}, { + 3.6870226271997833`*^9, 3.6870226396430273`*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{"{", + RowBox[{"m", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "u"}], + RowBox[{ + RowBox[{"(", + RowBox[{"q", "-", "Q"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "u"}], ")"}]}]]}], "}"}], "}"}]], "Output", + CellChangeTimes->{{3.6870225853669653`*^9, 3.687022596489684*^9}, { + 3.6870226271997833`*^9, 3.6870226396454287`*^9}}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Recessive Blindness", "Section", + CellChangeTimes->{{3.687022651241527*^9, 3.6870226676918*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"w11", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"w12", " ", ":=", " ", "1"}], "\[IndentingNewLine]", + RowBox[{"w22", " ", ":=", " ", + RowBox[{"1", "+", "s"}]}], "\[IndentingNewLine]", + RowBox[{"qj", " ", ":=", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}], "/", + RowBox[{"(", + RowBox[{ + RowBox[{"w22", " ", "q", " ", "q"}], " ", "+", " ", + RowBox[{"w12", " ", "q", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], " ", "2"}], " ", "+", " ", + RowBox[{"w11", " ", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}], + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}]}], ")"}]}]}], "\[IndentingNewLine]", + RowBox[{"qa", " ", ":=", " ", + RowBox[{ + RowBox[{"qj", " ", + RowBox[{"(", + RowBox[{"1", "-", "m"}], ")"}]}], " ", "+", " ", + RowBox[{"m", " ", "Q"}]}]}], "\[IndentingNewLine]", + RowBox[{"qq", " ", ":=", " ", + RowBox[{"qa", " ", "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "-", "qa"}], ")"}], " ", "u"}]}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dq", " ", ":=", " ", + RowBox[{"qq", "-", "q"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Simplification", " ", "Functions"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{"Clear", "[", + RowBox[{"fSimp", ",", "gSimp"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"fSimp", " ", "[", + RowBox[{"a_", ",", "b_"}], "]"}], ":=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"!", + RowBox[{"NumericQ", "[", "a", "]"}]}], "||", " ", + RowBox[{"a", " ", "\[NotEqual]", " ", "0"}]}], ",", " ", + RowBox[{"{", + RowBox[{"a", ",", "0"}], "}"}], ",", + RowBox[{"{", + RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"gSimp", "[", + RowBox[{"a_", ",", "b_"}], "]"}], " ", ":=", " ", + RowBox[{"Map", "[", + RowBox[{ + RowBox[{ + RowBox[{"FromDigits", "[", + RowBox[{ + RowBox[{"Reverse", "[", "#", "]"}], ",", "b"}], "]"}], " ", "&"}], + ",", " ", "a", ",", " ", + RowBox[{"{", + RowBox[{ + RowBox[{"ArrayDepth", "[", "a", "]"}], "-", "1"}], "}"}]}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Coefficients", " ", "of", " ", "dqn"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqn", " ", "=", " ", + RowBox[{"Numerator", "[", + RowBox[{"Together", "[", "dq", "]"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Simplify", " ", "dqn"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnVars", " ", "=", " ", + RowBox[{"{", + RowBox[{"s", ",", "m", ",", "q", ",", "Q", ",", "u"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnCL", " ", "=", " ", + RowBox[{"CoefficientList", "[", + RowBox[{"dqn", ",", "dqnVars"}], " ", "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"fSimp", ",", "dqnCL", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"ArrayDepth", "[", "dqnCL", "]"}], "-", "1"}], "}"}]}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnA", " ", "=", " ", + RowBox[{"Fold", "[", + RowBox[{"gSimp", ",", "%", ",", " ", + RowBox[{"Reverse", "[", "dqnVars", "]"}]}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{"dqnA", ",", "q"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{"dqnA", ",", "s"}], "]"}], "]"}], "\[IndentingNewLine]"}], "Input",\ + + CellChangeTimes->{{3.687022671545472*^9, 3.687022673120515*^9}, { + 3.687022833368341*^9, 3.687022863745061*^9}, {3.687023135755259*^9, + 3.687023148891361*^9}, {3.687025858698791*^9, 3.687025860190325*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{ + RowBox[{"-", "m"}], " ", "q"}], "+", + RowBox[{"m", " ", "Q"}], "+", + RowBox[{ + SuperscriptBox["q", "2"], " ", "s"}], "-", + RowBox[{"m", " ", + SuperscriptBox["q", "2"], " ", "s"}], "-", + RowBox[{ + SuperscriptBox["q", "3"], " ", "s"}], "+", + RowBox[{"m", " ", + SuperscriptBox["q", "2"], " ", "Q", " ", "s"}], "+", "u", "-", + RowBox[{"q", " ", "u"}], "+", + RowBox[{"m", " ", "q", " ", "u"}], "-", + RowBox[{"m", " ", "Q", " ", "u"}], "+", + RowBox[{"m", " ", + SuperscriptBox["q", "2"], " ", "s", " ", "u"}], "-", + RowBox[{"m", " ", + SuperscriptBox["q", "2"], " ", "Q", " ", "s", " ", "u"}]}]], "Output", + CellChangeTimes->{3.687022865548497*^9, 3.687023151687389*^9, + 3.6870233807107964`*^9, 3.6870249602227697`*^9, 3.687025697500803*^9, + 3.687025860824238*^9}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ",", + RowBox[{ + RowBox[{"-", "m"}], "-", "u"}], ",", + RowBox[{"s", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}], " ", "s"}]}], ",", + RowBox[{"-", "s"}]}], "}"}]], "Output", + CellChangeTimes->{3.687022865548497*^9, 3.687023151687389*^9, + 3.6870233807107964`*^9, 3.6870249602227697`*^9, 3.687025697500803*^9, + 3.6870258608263063`*^9}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "q"}], "+", "Q"}], ")"}]}], "+", "u", "-", + RowBox[{"q", " ", "u"}]}], ",", + RowBox[{ + RowBox[{"-", + SuperscriptBox["q", "2"]}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m", "+", "q", "-", + RowBox[{"m", " ", "Q"}]}], ")"}]}]}], "}"}]], "Output", + CellChangeTimes->{3.687022865548497*^9, 3.687023151687389*^9, + 3.6870233807107964`*^9, 3.6870249602227697`*^9, 3.687025697500803*^9, + 3.687025860828059*^9}] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Weak Selection", "Subsection", + CellChangeTimes->{{3.687023170371295*^9, 3.687023181702499*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"dqnWeak", " ", "=", " ", + RowBox[{"FullSimplify", "[", + RowBox[{"Normal", "[", + RowBox[{"Series", "[", + RowBox[{"dqnA", ",", " ", + RowBox[{"{", + RowBox[{"q", ",", "0", ",", "2"}], "}"}]}], "]"}], "]"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Simplify", " ", "dqnWeak"}], " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnVars", " ", "=", " ", + RowBox[{"{", + RowBox[{"s", ",", "m", ",", "q", ",", "Q"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnCL", " ", "=", " ", + RowBox[{"CoefficientList", "[", + RowBox[{"dqnWeak", ",", "dqnVars"}], " ", "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"fSimp", ",", "dqnCL", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"ArrayDepth", "[", "dqnCL", "]"}], "-", "1"}], "}"}]}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnWeakA", " ", "=", " ", + RowBox[{"Fold", "[", + RowBox[{"gSimp", ",", "%", ",", " ", + RowBox[{"Reverse", "[", "dqnVars", "]"}]}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{"dqnWeakA", ",", "q"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"(*", " ", "Equilibria", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnWeakRoots", " ", "=", " ", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dqnWeakA", "\[Equal]", "0"}], ",", "q"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", "Roots", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"cond", " ", "=", " ", + RowBox[{ + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", ">", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "\[LessEqual]", " ", "m", " ", "<", " ", "1"}], " ", "&&", + " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "<", " ", "u", " ", "\[LessEqual]", " ", "1"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Discriminant", "[", + RowBox[{"dqnWeakA", ",", "q"}], "]"}], " ", ">", " ", "0"}], " ", "&&", + " ", "cond"}], ",", " ", "s"}], "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"%", ",", "cond"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnWeakDeriv", " ", "=", " ", + RowBox[{"D", "[", + RowBox[{"dqnWeakA", ",", "q"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"lower", " ", "root", " ", "is", " ", "stable"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnWeakDeriv", " ", "/.", " ", + RowBox[{"dqnWeakRoots", "[", + RowBox[{"[", "1", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"%", " ", ">", " ", "0"}], " ", "||", " ", + RowBox[{"%", " ", "<", " ", + RowBox[{"-", "2"}]}]}], ")"}], " ", "&&", " ", "cond"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"upper", " ", "root", " ", "is", " ", "unstable"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnWeakDeriv", " ", "/.", " ", + RowBox[{"dqnWeakRoots", "[", + RowBox[{"[", "2", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"(", + RowBox[{"%", " ", "<", " ", "0"}], ")"}], " ", "&&", " ", "cond"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", "Validity", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"dqnA", " ", "-", " ", "dqnWeakA"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"%", " ", ">", "0"}], " ", "&&", " ", "cond", " ", "&&", " ", + RowBox[{"Q", " ", "<", " ", "q", " ", "<", " ", "1"}]}], "]"}]}], + "\[IndentingNewLine]", + "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.6870231930885*^9, 3.6870232180486927`*^9}, { + 3.687023269586052*^9, 3.687023539860037*^9}, {3.687023580116832*^9, + 3.687023601425371*^9}, {3.687023645509098*^9, 3.6870236614533863`*^9}, { + 3.68702370438834*^9, 3.687023978301749*^9}, {3.6870248871867647`*^9, + 3.687024929842593*^9}, 3.6870249636829576`*^9, {3.687025068956224*^9, + 3.687025069451096*^9}, 3.687025452325583*^9, {3.687025490519702*^9, + 3.687025548790772*^9}, {3.687025598919208*^9, 3.6870256300906897`*^9}, { + 3.6870256799431458`*^9, 3.687025685341745*^9}, {3.687026116985394*^9, + 3.68702611755527*^9}, {3.687026150281733*^9, 3.6870261601763763`*^9}, { + 3.687026210130315*^9, 3.687026330010765*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", + RowBox[{ + SuperscriptBox["q", "2"], " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}]}]}], ")"}], " ", "s"}], "+", + "u", "-", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"m", "+", "u"}], ")"}]}]}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.6870263306241007`*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ",", + RowBox[{ + RowBox[{"-", "m"}], "-", "u"}], ",", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}]}]}], "}"}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330629836*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{"m", "+", "u", "-", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "m"}], "-", "u"}], ")"}], "2"], "-", + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}]}], ")"}]}]]}], "}"}], ",", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{"m", "+", "u", "+", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "m"}], "-", "u"}], ")"}], "2"], "-", + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}]}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}]}], ")"}]}]]}], "}"}]}], "}"}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330635778*^9}}], + +Cell[BoxData[ + RowBox[{"s", "<", + RowBox[{"-", + FractionBox[ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"m", "+", "u"}], ")"}], "2"], + RowBox[{"4", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m"}], ")"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}]]}]}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330684057*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", "m"}], "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"2", " ", "q"}], "-", + RowBox[{"2", " ", "m", " ", "q"}]}], ")"}], " ", "s"}], "-", + "u"}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330688964*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330847661*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330916202*^9}}], + +Cell[BoxData[ + RowBox[{ + SuperscriptBox["q", "2"], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "q"}], "+", + RowBox[{"m", " ", "Q"}]}], ")"}], " ", "s"}]], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.6870263309190598`*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.6870232044901543`*^9, 3.687023218587186*^9}, { + 3.6870232807703238`*^9, 3.687023351453848*^9}, {3.687023389906191*^9, + 3.68702339683549*^9}, {3.687023447785618*^9, 3.687023496715839*^9}, + 3.687023540299451*^9, {3.687023585039599*^9, 3.6870236017821007`*^9}, { + 3.6870236539562197`*^9, 3.6870236621057177`*^9}, 3.6870237132643948`*^9, { + 3.687023749058284*^9, 3.687023831487413*^9}, {3.687023863869203*^9, + 3.687023919043807*^9}, {3.687023964698894*^9, 3.687023979050488*^9}, { + 3.687024916743319*^9, 3.687024930217163*^9}, 3.687024964270958*^9, + 3.6870250700756893`*^9, 3.687025132587706*^9, 3.687025453582305*^9, { + 3.687025495863962*^9, 3.6870255492595997`*^9}, {3.687025603995265*^9, + 3.6870256305430403`*^9}, {3.687025686682846*^9, 3.6870257042209253`*^9}, + 3.687026160601946*^9, {3.68702621951199*^9, 3.687026243480709*^9}, { + 3.687026289309284*^9, 3.687026330921342*^9}}] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Strong Selection", "Subsection", + CellChangeTimes->{{3.687024033164554*^9, 3.6870240400192423`*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"dqnStrongA", " ", "=", " ", + RowBox[{ + RowBox[{"-", "q"}], " ", + RowBox[{"(", + RowBox[{ + RowBox[{"q", " ", "q"}], " ", "-", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"m", + RowBox[{"(", + RowBox[{"1", "-", "Q"}], ")"}]}]}], ")"}], "q"}], "+", + RowBox[{"m", "/", "s"}]}], ")"}]}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", "Equilibria", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnStrongRoots", " ", "=", " ", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dqnStrongA", "\[Equal]", " ", "0"}], ",", "q"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", "Roots", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"cond", " ", "=", " ", + RowBox[{ + RowBox[{"0", "\[LessEqual]", " ", "h", "\[LessEqual]", " ", "1"}], " ", "&&", + " ", + RowBox[{"s", ">", " ", "0"}], " ", "&&", " ", + RowBox[{"0", "<", " ", "m", " ", "<", " ", "1"}], " ", "&&", " ", + RowBox[{ + "0", " ", "\[LessEqual]", " ", "Q", " ", "\[LessEqual]", " ", "1"}], " ", + "&&", " ", + RowBox[{"0", "<", " ", "u", " ", "\[LessEqual]", " ", "1"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{ + RowBox[{ + RowBox[{"Discriminant", "[", + RowBox[{"dqnStrongA", ",", "q"}], "]"}], " ", ">", " ", "0"}], " ", "&&", + " ", "cond"}], ",", " ", "s"}], "]"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"%", ",", "cond"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnStrongDeriv", " ", "=", " ", + RowBox[{"D", "[", + RowBox[{"dqnStrongA", ",", "q"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{ + RowBox[{"upper", " ", "non"}], "-", + RowBox[{"zero", " ", "root", " ", "is", " ", "stable"}]}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnStrongDeriv", " ", "/.", " ", + RowBox[{"dqnStrongRoots", "[", + RowBox[{"[", "3", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"%", " ", ">", " ", "0"}], " ", "||", " ", + RowBox[{"%", " ", "<", " ", + RowBox[{"-", "2"}]}]}], ")"}], " ", "&&", " ", "cond"}], "]"}]}], + "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{ + RowBox[{"lower", " ", "non"}], "-", + RowBox[{"zero", " ", "root", " ", "is", " ", "unstable"}]}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnStrongDeriv", " ", "/.", " ", + RowBox[{"dqnStrongRoots", "[", + RowBox[{"[", "2", "]"}], "]"}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", + RowBox[{ + RowBox[{"(", + RowBox[{"%", " ", "<", " ", "0"}], ")"}], " ", "&&", " ", "cond"}], + "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", "Validity", " ", "*)"}]}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", + RowBox[{"dqnA", " ", "-", " ", + RowBox[{"s", " ", "dqnStrongA"}]}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"%", " ", "<", "0"}], " ", "&&", " ", "cond", " ", "&&", " ", + RowBox[{"Q", " ", "<", " ", "q", " ", "<", " ", "1"}]}], "]"}]}], + "\[IndentingNewLine]", + "\[IndentingNewLine]"}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.6870240955320673`*^9, 3.687024217694623*^9}, { + 3.6870242612158813`*^9, 3.687024266142213*^9}, {3.687024296807289*^9, + 3.687024439362309*^9}, {3.687024486393772*^9, 3.687024546233898*^9}, { + 3.687024615445036*^9, 3.687024636321938*^9}, {3.687024667611672*^9, + 3.6870248286745872`*^9}, {3.687026355993616*^9, 3.6870263913141317`*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", "q"}], " ", + RowBox[{"(", + RowBox[{ + SuperscriptBox["q", "2"], "-", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{"1", "-", "Q"}], ")"}]}]}], ")"}]}], "+", + FractionBox["m", "s"]}], ")"}]}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.687026391825225*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"q", "\[Rule]", "0"}], "}"}], ",", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + RowBox[{ + FractionBox["1", "2"], " ", + RowBox[{"(", + RowBox[{"1", "-", "m", "+", + RowBox[{"m", " ", "Q"}], "-", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m", "-", + RowBox[{"m", " ", "Q"}]}], ")"}], "2"], "-", + FractionBox[ + RowBox[{"4", " ", "m"}], "s"]}]]}], ")"}]}]}], "}"}], ",", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + RowBox[{ + FractionBox["1", "2"], " ", + RowBox[{"(", + RowBox[{"1", "-", "m", "+", + RowBox[{"m", " ", "Q"}], "+", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m", "-", + RowBox[{"m", " ", "Q"}]}], ")"}], "2"], "-", + FractionBox[ + RowBox[{"4", " ", "m"}], "s"]}]]}], ")"}]}]}], "}"}]}], + "}"}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.687026391829748*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"0", "\[LessEqual]", "h", "\[LessEqual]", "1"}], "&&", + RowBox[{"0", "<", "u", "\[LessEqual]", "1"}], "&&", + RowBox[{"0", "\[LessEqual]", "Q", "\[LessEqual]", "1"}], "&&", + RowBox[{"0", "<", "m", "<", "1"}], "&&", + RowBox[{"s", ">", + FractionBox[ + RowBox[{"4", " ", "m"}], + RowBox[{"1", "-", + RowBox[{"2", " ", "m"}], "+", + SuperscriptBox["m", "2"], "+", + RowBox[{"2", " ", "m", " ", "Q"}], "-", + RowBox[{"2", " ", + SuperscriptBox["m", "2"], " ", "Q"}], "+", + RowBox[{ + SuperscriptBox["m", "2"], " ", + SuperscriptBox["Q", "2"]}]}]]}]}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.6870263918339043`*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "Q"}], ")"}]}]}], ")"}], "2"], " ", "s"}], + ">", + RowBox[{"4", " ", "m"}]}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.687026391837687*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"-", + SuperscriptBox["q", "2"]}], "+", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{"1", "-", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{"1", "-", "Q"}], ")"}]}]}], ")"}]}], "-", + RowBox[{"q", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "q"}], "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{"1", "-", "Q"}], ")"}]}]}], ")"}]}], "-", + FractionBox["m", "s"]}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.687026391841484*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.68702639210562*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.6870263922091208`*^9}}], + +Cell[BoxData[ + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u", "-", + RowBox[{"q", " ", "u"}]}]], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.687026392214395*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{{3.687024129598325*^9, 3.687024218018499*^9}, { + 3.687024261914444*^9, 3.6870242664826736`*^9}, 3.687024297436846*^9, + 3.687024364429243*^9, {3.6870243957007303`*^9, 3.68702441277851*^9}, + 3.687024457814045*^9, {3.687024492936532*^9, 3.687024546650157*^9}, { + 3.687024618760395*^9, 3.6870246370381413`*^9}, {3.687024673125637*^9, + 3.687024702844543*^9}, {3.687024766256741*^9, 3.687024815156732*^9}, { + 3.687026362829824*^9, 3.6870263922177763`*^9}}] +}, Open ]] +}, Open ]] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["Additive Blindness with Multiple Alleles", "Section", + CellChangeTimes->{{3.6870265534930887`*^9, 3.68702656455051*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{"Clear", "[", + RowBox[{"fSimp", ",", "gSimp"}], "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"fSimp", " ", "[", + RowBox[{"a_", ",", "b_"}], "]"}], ":=", " ", + RowBox[{"If", "[", + RowBox[{ + RowBox[{ + RowBox[{"!", + RowBox[{"NumericQ", "[", "a", "]"}]}], "||", " ", + RowBox[{"a", " ", "\[NotEqual]", " ", "0"}]}], ",", " ", + RowBox[{"{", + RowBox[{"a", ",", "0"}], "}"}], ",", + RowBox[{"{", + RowBox[{"a", ",", "b"}], "}"}]}], "]"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{ + RowBox[{"gSimp", "[", + RowBox[{"a_", ",", "b_"}], "]"}], " ", ":=", " ", + RowBox[{"Map", "[", + RowBox[{ + RowBox[{ + RowBox[{"FromDigits", "[", + RowBox[{ + RowBox[{"Reverse", "[", "#", "]"}], ",", "b"}], "]"}], " ", "&"}], + ",", " ", "a", ",", " ", + RowBox[{"{", + RowBox[{ + RowBox[{"ArrayDepth", "[", "a", "]"}], "-", "1"}], "}"}]}], "]"}]}], + "\[IndentingNewLine]"}], "\[IndentingNewLine]", + RowBox[{"z", " ", ":=", " ", + RowBox[{"s", "/", + RowBox[{"(", + RowBox[{"2", " ", "k"}], ")"}]}]}], "\[IndentingNewLine]", + RowBox[{"qj", " ", ":=", " ", + RowBox[{"q", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"z", + RowBox[{"(", + RowBox[{"1", "-", "q"}], ")"}]}], "+", " ", + RowBox[{"2", " ", "k", " ", "q", " ", "z"}]}], ")"}], "/", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{"2", " ", "k", " ", "q", " ", "z"}]}], + ")"}]}]}]}], "\[IndentingNewLine]", + RowBox[{"qa", " ", ":=", " ", + RowBox[{ + RowBox[{"qj", " ", + RowBox[{"(", + RowBox[{"1", "-", "m"}], ")"}]}], " ", "+", " ", + RowBox[{"m", " ", "Q"}]}]}], "\[IndentingNewLine]", + RowBox[{"qq", " ", ":=", " ", + RowBox[{"qa", " ", "+", " ", + RowBox[{ + RowBox[{"(", + RowBox[{"1", "-", "qa"}], ")"}], " ", "u"}]}]}], "\[IndentingNewLine]", + RowBox[{"dq", " ", ":=", " ", + RowBox[{"qq", "-", "q"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqn", " ", ":=", " ", + RowBox[{"Numerator", "[", + RowBox[{"Together", "[", "dq", "]"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Coefficients", " ", "of", " ", "dqn"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnVars", " ", "=", " ", + RowBox[{"{", + RowBox[{"s", ",", "m", ",", "q", ",", "Q", ",", "u"}], "}"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnCL", " ", "=", " ", + RowBox[{"CoefficientList", "[", + RowBox[{"dqn", ",", "dqnVars"}], " ", "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"Apply", "[", + RowBox[{"fSimp", ",", "dqnCL", ",", + RowBox[{"{", + RowBox[{ + RowBox[{"ArrayDepth", "[", "dqnCL", "]"}], "-", "1"}], "}"}]}], "]"}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnA", " ", "=", " ", + RowBox[{"Fold", "[", + RowBox[{"gSimp", ",", "%", ",", " ", + RowBox[{"Reverse", "[", "dqnVars", "]"}]}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{"CoefficientList", "[", + RowBox[{"dqnA", ",", "q"}], "]"}], "]"}], "\[IndentingNewLine]", + RowBox[{"(*", " ", + RowBox[{"Calculate", " ", "Equilibrium", " ", "Frequency"}], " ", + "*)"}]}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"dqnRoots", " ", "=", " ", + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dqnA", " ", "\[Equal]", " ", "0"}], ",", " ", "q"}], "]"}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"FullSimplify", "[", "%", "]"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"cond", " ", "=", " ", + RowBox[{ + RowBox[{"0", "<=", "u", "<=", "1"}], " ", "&&", " ", + RowBox[{"0", "<=", "m", "<=", "1"}], " ", "&&", " ", + RowBox[{"0", "<", "s"}], " ", "&&", " ", + RowBox[{"0", "<=", "Q", " ", "<=", " ", "1"}], " ", "&&", " ", + RowBox[{"k", " ", "\[GreaterEqual]", " ", "1"}]}]}], + ";"}], "\[IndentingNewLine]", + RowBox[{"!", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"q", " ", "/.", " ", + RowBox[{"dqnRoots", "[", + RowBox[{"[", "1", "]"}], "]"}]}], ")"}], " ", "<", " ", "0"}], " ", + "||", " ", + RowBox[{"1", " ", "<", + RowBox[{"(", + RowBox[{"q", " ", "/.", " ", + RowBox[{"dqnRoots", "[", + RowBox[{"[", "1", "]"}], "]"}]}], ")"}]}]}], ")"}], " ", "&&", " ", + "cond"}], "]"}]}], "\[IndentingNewLine]", + RowBox[{"Reduce", "[", " ", + RowBox[{ + RowBox[{ + RowBox[{"(", + RowBox[{"q", " ", "/.", " ", + RowBox[{"dqnRoots", "[", + RowBox[{"[", "2", "]"}], "]"}]}], ")"}], " ", ">", " ", "0"}], " ", "&&", + " ", "cond"}], "]"}], "\[IndentingNewLine]"}], "Input", + CellChangeTimes->{{3.6870266395225277`*^9, 3.6870267064775867`*^9}, { + 3.6870267637555637`*^9, 3.687026792414061*^9}, {3.68702682304375*^9, + 3.687027086366377*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"2", " ", "k", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}], ",", + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "k", " ", "m"}], "+", "s", "+", + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "k", " ", "Q"}]}], ")"}], " ", "s"}], "-", + RowBox[{"2", " ", "k", " ", "u"}]}], ",", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "m", "-", + RowBox[{"2", " ", "k", " ", "m"}]}], ")"}], " ", "s"}]}], + "}"}]], "Output", + CellChangeTimes->{ + 3.687026583007267*^9, 3.6870267071721983`*^9, 3.68702679974951*^9, { + 3.68702688625464*^9, 3.687026931688525*^9}, {3.687027005403181*^9, + 3.6870270744623213`*^9}}], + +Cell[BoxData[ + RowBox[{"{", + RowBox[{ + RowBox[{"{", + RowBox[{"q", "\[Rule]", + FractionBox[ + RowBox[{ + RowBox[{ + RowBox[{"-", "2"}], " ", "k", " ", "m"}], "+", "s", "-", + RowBox[{"m", " ", "s"}], "+", + RowBox[{"2", " ", "k", " ", "m", " ", "Q", " ", "s"}], "-", + RowBox[{"2", " ", "k", " ", "u"}], "+", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}], "+", + RowBox[{"2", " ", "k", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"Q", " ", "s"}]}], ")"}]}], "-", "u"}], ")"}]}]}], + ")"}], "2"], "+", + RowBox[{"8", " ", "k", " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "k"}]}], ")"}], " ", "m"}]}], ")"}], " ", + "s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "k"}]}], ")"}], " ", "m"}]}], ")"}], " ", + "s"}]]}], "}"}], ",", + RowBox[{"{", + RowBox[{"q", "\[Rule]", + RowBox[{"-", + FractionBox[ + RowBox[{ + RowBox[{"2", " ", "k", " ", "m"}], "-", "s", "+", + RowBox[{"m", " ", "s"}], "-", + RowBox[{"2", " ", "k", " ", "m", " ", "Q", " ", "s"}], "+", + RowBox[{"2", " ", "k", " ", "u"}], "+", + SqrtBox[ + RowBox[{ + SuperscriptBox[ + RowBox[{"(", + RowBox[{"s", "-", + RowBox[{"m", " ", "s"}], "+", + RowBox[{"2", " ", "k", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"Q", " ", "s"}]}], ")"}]}], "-", "u"}], ")"}]}]}], + ")"}], "2"], "+", + RowBox[{"8", " ", "k", " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "k"}]}], ")"}], " ", "m"}]}], ")"}], " ", + "s", " ", + RowBox[{"(", + RowBox[{ + RowBox[{"m", " ", "Q"}], "+", "u"}], ")"}]}]}]]}], + RowBox[{"2", " ", + RowBox[{"(", + RowBox[{"1", "+", + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", + RowBox[{"2", " ", "k"}]}], ")"}], " ", "m"}]}], ")"}], " ", + "s"}]]}]}], "}"}]}], "}"}]], "Output", + CellChangeTimes->{ + 3.687026583007267*^9, 3.6870267071721983`*^9, 3.68702679974951*^9, { + 3.68702688625464*^9, 3.687026931688525*^9}, {3.687027005403181*^9, + 3.6870270744672527`*^9}}], + +Cell[BoxData["True"], "Output", + CellChangeTimes->{ + 3.687026583007267*^9, 3.6870267071721983`*^9, 3.68702679974951*^9, { + 3.68702688625464*^9, 3.687026931688525*^9}, {3.687027005403181*^9, + 3.687027076380454*^9}}], + +Cell[BoxData["False"], "Output", + CellChangeTimes->{ + 3.687026583007267*^9, 3.6870267071721983`*^9, 3.68702679974951*^9, { + 3.68702688625464*^9, 3.687026931688525*^9}, {3.687027005403181*^9, + 3.6870270771393337`*^9}}] +}, Open ]], + +Cell[CellGroupData[{ + +Cell["S*/m", "Subsection", + CellChangeTimes->{{3.687027107202038*^9, 3.68702712245788*^9}}], + +Cell[CellGroupData[{ + +Cell[BoxData[{ + RowBox[{ + RowBox[{"sStar", " ", "=", " ", + RowBox[{"s", " ", "/.", " ", + RowBox[{ + RowBox[{"Solve", "[", + RowBox[{ + RowBox[{"dq", " ", "\[Equal]", " ", "0"}], ",", "s"}], "]"}], "[", + RowBox[{"[", "1", "]"}], "]"}]}]}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", "sStar", "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{ + RowBox[{"FullSimplify", "[", + RowBox[{"sStar", " ", "/.", " ", + RowBox[{"u", "\[Rule]", "0"}]}], "]"}], ";"}], "\[IndentingNewLine]", + RowBox[{"Limit", "[", + RowBox[{ + RowBox[{"%", "/", "m"}], ",", " ", + RowBox[{"m", "\[Rule]", "0"}]}], "]"}]}], "Input", + CellChangeTimes->{{3.687027134038084*^9, 3.687027137012314*^9}}], + +Cell[BoxData[ + RowBox[{"-", + FractionBox[ + RowBox[{"2", " ", "k", " ", + RowBox[{"(", + RowBox[{"q", "-", "Q"}], ")"}]}], + RowBox[{ + RowBox[{"(", + RowBox[{ + RowBox[{"-", "1"}], "+", "q"}], ")"}], " ", "q"}]]}]], "Output", + CellChangeTimes->{{3.6870271286912003`*^9, 3.68702713814662*^9}}] +}, Open ]] +}, Open ]] +}, Open ]] +}, +WindowSize->{1920, 1016}, +WindowMargins->{{Automatic, -1}, {Automatic, -1}}, +FrontEndVersion->"10.1 for Linux x86 (64-bit) (March 23, 2015)", +StyleDefinitions->"Default.nb" +] +(* End of Notebook Content *) + +(* Internal cache information *) +(*CellTagsOutline +CellTagsIndex->{} +*) +(*CellTagsIndex +CellTagsIndex->{} +*) +(*NotebookFileOutline +Notebook[{ +Cell[CellGroupData[{ +Cell[580, 22, 95, 1, 71, "Section"], +Cell[678, 25, 1420, 39, 133, "Input"], +Cell[CellGroupData[{ +Cell[2123, 68, 95, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[2243, 73, 66, 1, 30, "Input"], +Cell[2312, 76, 1775, 59, 56, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[4136, 141, 97, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[4258, 146, 647, 15, 66, "Input"], +Cell[4908, 163, 1472, 49, 54, "Output"], +Cell[6383, 214, 2392, 72, 101, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[8824, 292, 106, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[8955, 297, 7412, 186, 327, "Input"], +Cell[16370, 485, 1418, 39, 54, "Output"], +Cell[17791, 526, 611, 8, 28, "Output"], +Cell[18405, 536, 1283, 33, 87, "Output"], +Cell[19691, 571, 613, 8, 28, "Output"], +Cell[20307, 581, 1404, 38, 54, "Output"], +Cell[21714, 621, 611, 8, 28, "Output"], +Cell[22328, 631, 613, 8, 28, "Output"], +Cell[22944, 641, 1459, 39, 54, "Output"], +Cell[24406, 682, 611, 8, 28, "Output"], +Cell[25020, 692, 613, 8, 28, "Output"], +Cell[25636, 702, 653, 10, 28, "Output"], +Cell[26292, 714, 611, 8, 28, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[26952, 728, 101, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[27078, 733, 2003, 48, 114, "Input"], +Cell[29084, 783, 478, 12, 50, "Output"], +Cell[29565, 797, 272, 4, 28, "Output"], +Cell[29840, 803, 272, 4, 28, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[30161, 813, 103, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[30289, 818, 1842, 48, 137, "Input"], +Cell[32134, 868, 373, 7, 28, "Output"], +Cell[32510, 877, 243, 3, 28, "Output"], +Cell[32756, 882, 3849, 97, 121, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[36654, 985, 112, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[36791, 990, 1478, 37, 152, "Input"], +Cell[38272, 1029, 388, 9, 28, "Output"], +Cell[38663, 1040, 441, 10, 28, "Output"], +Cell[39107, 1052, 452, 12, 28, "Output"], +Cell[39562, 1066, 410, 8, 28, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[40021, 1080, 101, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[40147, 1085, 6576, 184, 473, "Input"], +Cell[46726, 1271, 686, 9, 28, "Output"], +Cell[47415, 1282, 687, 9, 28, "Output"], +Cell[48105, 1293, 689, 9, 28, "Output"], +Cell[48797, 1304, 687, 9, 28, "Output"], +Cell[49487, 1315, 687, 9, 28, "Output"], +Cell[50177, 1326, 687, 9, 28, "Output"], +Cell[50867, 1337, 687, 9, 28, "Output"], +Cell[51557, 1348, 687, 9, 28, "Output"], +Cell[52247, 1359, 687, 9, 28, "Output"], +Cell[52937, 1370, 687, 9, 28, "Output"], +Cell[53627, 1381, 687, 9, 28, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[54363, 1396, 245, 3, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[54633, 1403, 794, 21, 81, "Input"], +Cell[55430, 1426, 1383, 46, 54, "Output"], +Cell[56816, 1474, 554, 17, 54, "Output"], +Cell[57373, 1493, 950, 28, 54, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[58372, 1527, 94, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[58491, 1532, 1920, 45, 119, "Input"], +Cell[60414, 1579, 1062, 24, 53, "Output"], +Cell[61479, 1605, 1284, 31, 32, "Output"], +Cell[62766, 1638, 1468, 38, 32, "Output"], +Cell[64237, 1678, 1169, 26, 56, "Output"] +}, Open ]] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[65467, 1711, 101, 1, 71, "Section"], +Cell[CellGroupData[{ +Cell[65593, 1716, 1643, 45, 168, "Input"], +Cell[67239, 1763, 455, 13, 50, "Output"], +Cell[67697, 1778, 512, 16, 54, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[68258, 1800, 102, 1, 71, "Section"], +Cell[CellGroupData[{ +Cell[68385, 1805, 4015, 112, 384, "Input"], +Cell[72403, 1919, 834, 22, 32, "Output"], +Cell[73240, 1943, 504, 15, 28, "Output"], +Cell[73747, 1960, 586, 18, 36, "Output"] +}, Open ]], +Cell[CellGroupData[{ +Cell[74370, 1983, 102, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[74497, 1988, 4889, 125, 471, "Input"], +Cell[79389, 2115, 1312, 27, 32, "Output"], +Cell[80704, 2144, 1155, 21, 28, "Output"], +Cell[81862, 2167, 2263, 57, 63, "Output"], +Cell[84128, 2226, 1291, 26, 56, "Output"], +Cell[85422, 2254, 1145, 21, 28, "Output"], +Cell[86570, 2277, 961, 13, 28, "Output"], +Cell[87534, 2292, 961, 13, 28, "Output"], +Cell[88498, 2307, 1108, 19, 32, "Output"], +Cell[89609, 2328, 961, 13, 28, "Output"] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[90619, 2347, 106, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[90750, 2352, 3780, 99, 362, "Input"], +Cell[94533, 2453, 822, 19, 47, "Output"], +Cell[95358, 2474, 1602, 44, 63, "Output"], +Cell[96963, 2520, 1126, 24, 53, "Output"], +Cell[98092, 2546, 767, 18, 32, "Output"], +Cell[98862, 2566, 980, 25, 48, "Output"], +Cell[99845, 2593, 513, 7, 28, "Output"], +Cell[100361, 2602, 516, 7, 28, "Output"], +Cell[100880, 2611, 589, 10, 28, "Output"], +Cell[101472, 2623, 516, 7, 28, "Output"] +}, Open ]] +}, Open ]] +}, Open ]], +Cell[CellGroupData[{ +Cell[102049, 2637, 126, 1, 71, "Section"], +Cell[CellGroupData[{ +Cell[102200, 2642, 4926, 141, 418, "Input"], +Cell[107129, 2785, 817, 25, 28, "Output"], +Cell[107949, 2812, 3259, 96, 121, "Output"], +Cell[111211, 2910, 220, 4, 28, "Output"], +Cell[111434, 2916, 223, 4, 28, "Output"] +}, Open ]], +Cell[CellGroupData[{ +Cell[111694, 2925, 91, 1, 49, "Subsection"], +Cell[CellGroupData[{ +Cell[111810, 2930, 731, 19, 83, "Input"], +Cell[112544, 2951, 315, 10, 87, "Output"] +}, Open ]] +}, Open ]] +}, Open ]] +} +] +*) + +(* End of internal cache information *)