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

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

(* CreatedBy='Mathematica 9.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     27157,        554]
NotebookOptionsPosition[     26804,        537]
NotebookOutlinePosition[     27139,        552]
CellTagsIndexPosition[     27096,        549]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell[BoxData[{
 RowBox[{
  RowBox[{
   RowBox[{"numRegion", "[", 
    RowBox[{"expr_", ",", 
     RowBox[{"var_Symbol:", "x"}], ",", 
     RowBox[{"range", ":", 
      RowBox[{"{", 
       RowBox[{"xmin_", ",", "xmax_"}], "}"}], ":", 
      RowBox[{"{", 
       RowBox[{"0", ",", "0"}], "}"}]}], ",", 
     RowBox[{"opts", ":", 
      RowBox[{"OptionsPattern", "[", "]"}]}]}], "]"}], ":=", 
   RowBox[{"Module", "[", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
       RowBox[{"le", "=", 
        RowBox[{"LogicalExpand", "[", 
         RowBox[{"Reduce", "[", 
          RowBox[{"expr", ",", "var", ",", "Reals"}], "]"}], "]"}]}], ",", 
       "y", ",", "opendots", ",", "closeddots", ",", "max", ",", "min", ",", 
       "len"}], "}"}], ",", 
     RowBox[{
      RowBox[{"opendots", "=", 
       RowBox[{"Cases", "[", 
        RowBox[{
         RowBox[{"Flatten", "[", 
          RowBox[{"le", "/.", 
           RowBox[{
            RowBox[{"And", "|", "Or"}], "\[Rule]", "List"}]}], "]"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{"n_", "<", "var"}], "|", 
           RowBox[{"n_", ">", "var"}], "|", 
           RowBox[{"var", "<", "n_"}], "|", 
           RowBox[{"var", ">", "n_"}]}], "\[RuleDelayed]", "n"}]}], "]"}]}], 
      ";", "\[IndentingNewLine]", 
      RowBox[{"closeddots", "=", 
       RowBox[{"Cases", "[", 
        RowBox[{
         RowBox[{"Flatten", "[", 
          RowBox[{"le", "/.", 
           RowBox[{
            RowBox[{"And", "|", "Or"}], "\[Rule]", "List"}]}], "]"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{"n_", "\[LessEqual]", "var"}], "|", 
           RowBox[{"n_", "\[GreaterEqual]", "var"}], "|", 
           RowBox[{"var", "\[LessEqual]", "n_"}], "|", 
           RowBox[{"var", "\[GreaterEqual]", "n_"}]}], "\[RuleDelayed]", 
          "n"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{
       RowBox[{"{", 
        RowBox[{"max", ",", "min"}], "}"}], "=", 
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{"TrueQ", "[", 
          RowBox[{"xmin", "<", "xmax"}], "]"}], ",", 
         RowBox[{"{", 
          RowBox[{"xmin", ",", "xmax"}], "}"}], ",", 
         RowBox[{
          RowBox[{
           RowBox[{"{", 
            RowBox[{"Max", ",", "Min"}], "}"}], "@", 
           RowBox[{"Cases", "[", 
            RowBox[{"le", ",", 
             RowBox[{"_", "?", "NumericQ"}], ",", "Infinity"}], "]"}]}], "//",
           "Through"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"len", "=", 
       RowBox[{"max", "-", "min"}]}], ";", "\[IndentingNewLine]", 
      RowBox[{"RegionPlot", "[", 
       RowBox[{
        RowBox[{"le", "&&", 
         RowBox[{
          RowBox[{"-", "1"}], "<", "y", "<", "1"}]}], ",", 
        RowBox[{"{", 
         RowBox[{"var", ",", 
          RowBox[{"min", "-", 
           RowBox[{"len", "/", "10"}]}], ",", 
          RowBox[{"max", "+", 
           RowBox[{"len", "/", "10"}]}]}], "}"}], ",", 
        RowBox[{"{", 
         RowBox[{"y", ",", 
          RowBox[{"-", "1"}], ",", "1"}], "}"}], ",", 
        RowBox[{"Epilog", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{"Thick", ",", "Red", ",", 
           RowBox[{
            RowBox[{
             RowBox[{"Line", "[", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"{", 
                 RowBox[{"#", ",", "1"}], "}"}], ",", 
                RowBox[{"{", 
                 RowBox[{"#", ",", 
                  RowBox[{"-", "1"}]}], "}"}]}], "}"}], "]"}], "&"}], "/@", 
            "closeddots"}], ",", "Dotted", ",", 
           RowBox[{
            RowBox[{
             RowBox[{"Line", "[", 
              RowBox[{"{", 
               RowBox[{
                RowBox[{"{", 
                 RowBox[{"#", ",", "1"}], "}"}], ",", 
                RowBox[{"{", 
                 RowBox[{"#", ",", 
                  RowBox[{"-", "1"}]}], "}"}]}], "}"}], "]"}], "&"}], "/@", 
            "opendots"}]}], "}"}]}], ",", 
        RowBox[{"Axes", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{"True", ",", "False"}], "}"}]}], ",", 
        RowBox[{"Frame", "\[Rule]", "False"}], ",", 
        RowBox[{"AspectRatio", "\[Rule]", ".05"}], ",", 
        RowBox[{"Ticks", "\[Rule]", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{
             RowBox[{"{", 
              RowBox[{"1.1", ",", 
               RowBox[{"Subscript", "[", 
                RowBox[{
                 RowBox[{"-", "r"}], ",", "B"}], "]"}]}], "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"1.2", ",", 
               RowBox[{
                RowBox[{"Subscript", "[", 
                 RowBox[{
                  RowBox[{"-", "r"}], ",", "B"}], "]"}], "+", "\[Delta]"}]}], 
              "}"}], ",", 
             RowBox[{"{", 
              RowBox[{"1.84", ",", 
               RowBox[{
                RowBox[{"Subscript", "[", 
                 RowBox[{
                  RowBox[{"-", "r"}], ",", "0"}], "]"}], "-", "\[Delta]"}]}], 
              "}"}]}], "}"}], ",", 
           RowBox[{"{", "}"}]}], "}"}]}], ",", 
        RowBox[{"AxesLabel", " ", "\[Rule]", " ", 
         RowBox[{
          RowBox[{"{", 
           RowBox[{"u", ",", "0"}], "}"}], "opts"}]}]}], "]"}]}]}], "]"}]}], 
  "\[IndentingNewLine]"}], "\[IndentingNewLine]", 
 RowBox[{"numRegion", "[", 
  RowBox[{
   RowBox[{
    RowBox[{"y", "<", "1.15"}], "||", 
    RowBox[{"1.2", "\[LessEqual]", "y", "\[LessEqual]", "1.84"}]}], ",", 
   "y"}], "]"}]}], "Input",
 CellChangeTimes->{{3.607864493952816*^9, 3.6078645195720043`*^9}, {
   3.607864741471542*^9, 3.607864954598319*^9}, {3.6078653018184013`*^9, 
   3.607865524345045*^9}, {3.607866192063891*^9, 3.6078664178646917`*^9}, {
   3.607866552998549*^9, 3.607866961321631*^9}, {3.6078671025077963`*^9, 
   3.6078671119299593`*^9}, {3.607867159099209*^9, 3.607867180264756*^9}, {
   3.607867243678753*^9, 3.607867347050746*^9}, {3.607867379075852*^9, 
   3.607867576859871*^9}, {3.6078676111678953`*^9, 3.607867655732607*^9}, {
   3.607867695812258*^9, 3.607867783472434*^9}, {3.607868544578424*^9, 
   3.607868835322131*^9}, {3.6081272239303923`*^9, 3.608127302476953*^9}, {
   3.608127337780991*^9, 3.6081276408879547`*^9}, {3.608803251850823*^9, 
   3.6088032770723543`*^9}, {3.608803329830451*^9, 3.608803360057716*^9}, {
   3.608803392425502*^9, 3.6088034128570557`*^9}, 3.608803445621389*^9, {
   3.608846619478655*^9, 3.608846619771644*^9}}],

Cell[BoxData[
 GraphicsBox[GraphicsComplexBox[CompressedData["
1:eJxlmntwVdUVhyPgCEgUFXlJACVCCKAMkAzi49gGkNGU0hR5iQmCoBi0ykMN
[encoded data, 5246 characters]
d/FB6wf++7vu7veqp3/p+531F7HXf5z/Ag+Y5bQ=
   "], {{
     {RGBColor[0.798413061722744, 0.824719615472648, 0.968322270542458], 
      EdgeForm[None], GraphicsGroupBox[{PolygonBox[CompressedData["
1:eJxVmnkcllMWx597n1RKe6m0077v+x6tkpRMQiNC+6ailBbtKSWEaUWUqLFl
[encoded data, 7259 characters]
oG0XtSceI813473hw+hvDuvVjjeTCxN/U6qQ+HvDB9Hf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XNE3VFE3WpOBZoAkar3EaG/r/bPgH6Z9xNQ==
      "]]}}],
  AspectRatio->0.05,
  Axes->{True, False},
  AxesLabel->{
    FormBox["u", TraditionalForm], 
    FormBox["0", TraditionalForm]},
  Epilog->{
    Thickness[Large], 
    RGBColor[1, 0, 0], {
     LineBox[{{1.2, 1}, {1.2, -1}}], 
     LineBox[{{1.84, 1}, {1.84, -1}}]}, 
    Dashing[{0, Small}], {
     LineBox[{{1.15, 1}, {1.15, -1}}]}},
  Method->{"TransparentPolygonMesh" -> True, "AxesInFront" -> True},
  PlotRange->{{1.081, 1.909}, {-1, 1}},
  PlotRangeClipping->True,
  PlotRangePadding->{
    Scaled[0.02], 
    Scaled[0.02]},
  Ticks->{{{1.1, 
      FormBox[
       SubscriptBox[
        RowBox[{"-", "r"}], "B"], TraditionalForm]}, {1.2, 
      FormBox[
       RowBox[{
         SubscriptBox[
          RowBox[{"-", "r"}], "B"], "+", "\[Delta]"}], TraditionalForm]}, {
     1.84, 
      FormBox[
       RowBox[{
         SubscriptBox[
          RowBox[{"-", "r"}], "0"], "-", "\[Delta]"}], 
       TraditionalForm]}}, {}}]], "Output",
 CellChangeTimes->{
  3.607867749227479*^9, 3.607867786585499*^9, 3.607868587378818*^9, {
   3.607868639064415*^9, 3.607868696806839*^9}, 3.607868746769415*^9, {
   3.607868794963891*^9, 3.6078688389460506`*^9}, 3.608127268025208*^9, 
   3.608127305438632*^9, 3.608127341226541*^9, 3.6081273750819073`*^9, {
   3.60812741126084*^9, 3.608127446917796*^9}, {3.60812748164819*^9, 
   3.608127643565487*^9}, 3.608803418665922*^9, 3.608803450065078*^9, {
   3.608846656545684*^9, 
   3.608846666514297*^9}},ImageCache->GraphicsData["CompressedBitmap", "\<\
eJylVwswnFcUvvu0xJJEWK+EVZ1oq1WMKZ02M4lOajw7045ppp16bYJBJF4R
1CvEVNqkpRMVEpQhhpYlqXZWJKLoQ5t6TJOhTJDIEq10rdeydM+9/8rSn6Wd
2Xv/e+4953znnnv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nT
3PYAUzpkTr6guwPEDFeePFlvu2W7ZADpYT6e4a0OqXnTjUGgoGUFHz0F3/1f
NXbb1YrvVBF1gu9u3d91s30MUweh17CX/WFmZiaMzB8+fAi3lNW/TA5My7qE
unrnVDcm9LTmyRd3kLk7nVJVPAAfW9jw7V3f83k1GUfDkvZelww8hmlNaOHQ
0JCvWCyGHNg7MjKiHfrwtcIG/5+rq5krSqUaenpJX38VWrmK8bJ2ZfmFjR+U
lZVhjnVu3ray/r+sbB/NmJpqxtuMQk+PRtlzpDRCujR6e3tDFl4ODg4GL8Cd
xNCKNa3Q098oPuix4I6Eg3br6OiAXAssKSkRSKVS7VjyeV299VgbeJxgceAk
bxw6dAgoqHBFIpGIKsvIBl5qiGVtrRqqxkwmgrcanlOpR1ipoYpSwhRzVYJH
4gUuN7jQoLAPCYVC5sbWc4n1WDWMoO0kcwculUreqamp2cKxU96DigR394HW
1la4fH91dHS0GRwc3MR7m+AP/LnvGalcINCMlDXp8xT/ebIKUQH1WuOhsN3w
+M9JMrP189euzKOhQHzkh8pKzfTdYOvalb1SWtnq0dTUtO30hesxK/jYKU1l
g48thRMyY+MtHMpaZXAupyOiM2zETb8jM9zTFki1zxy+qf0RXSR8Ll9WfW9/
9esuTImgpwGAfwzwssGvGzPcP7WMpgD43ayvRxcJH7wj/KurqzElgl4TADH+
AbIbr4U=\
\>"]]
}, Open  ]]
},
WindowSize->{740, 623},
WindowMargins->{{Automatic, 9}, {34, Automatic}},
FrontEndVersion->"9.0 for Linux x86 (64-bit) (February 7, 2013)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 6450, 163, 455, "Input"],
Cell[7032, 187, 19756, 347, 75, 17236, 304, "CachedBoxData", "BoxData", \
"Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
