(* Content-type: application/vnd.wolfram.mathematica *) (*** Wolfram Notebook File ***) (* http://www.wolfram.com/nb *) (* CreatedBy='Mathematica 12.0' *) (*CacheID: 234*) (* Internal cache information: NotebookFileLineBreakTest NotebookFileLineBreakTest NotebookDataPosition[ 158, 7] NotebookDataLength[ 17468, 390] NotebookOptionsPosition[ 17105, 373] NotebookOutlinePosition[ 17450, 388] CellTagsIndexPosition[ 17407, 385] WindowFrame->Normal*) (* Beginning of Notebook Content *) Notebook[{ Cell[CellGroupData[{ Cell[TextData[StyleBox["Generating data from ellipse garland", FontColor->RGBColor[1, 0, 0]]], "Subsubsection", CellChangeTimes->{{3.6799959272424545`*^9, 3.6799959714925165`*^9}, { 3.680187880725844*^9, 3.6801878813658447`*^9}, {3.6801879133558893`*^9, 3.6801879169258947`*^9}, {3.680188161286237*^9, 3.6801881618662376`*^9}, { 3.680188252966365*^9, 3.6801882616863775`*^9}, {3.6801883076464415`*^9, 3.680188367706526*^9}, {3.68018854232677*^9, 3.680188555186788*^9}, { 3.680188645956915*^9, 3.6801887056379986`*^9}, {3.6801889273883095`*^9, 3.680188930058313*^9}, {3.680189244018752*^9, 3.6801892847288094`*^9}, { 3.6801893580589123`*^9, 3.680189359168914*^9}, {3.680189420118999*^9, 3.6801894397690268`*^9}, {3.6801894730990734`*^9, 3.6801895437291718`*^9}, {3.6801900734149265`*^9, 3.680190086304945*^9}, { 3.6801901868050857`*^9, 3.6801903182252693`*^9}, {3.6801903981653814`*^9, 3.6801904303854265`*^9}, {3.680190477125492*^9, 3.6801906342057123`*^9}, { 3.680190665865756*^9, 3.6801906674757586`*^9}, {3.680191007020167*^9, 3.680191145620361*^9}, {3.680191176980405*^9, 3.6801912085004487`*^9}, { 3.680191325810613*^9, 3.680191412160734*^9}, {3.680191481260831*^9, 3.6801914918608456`*^9}, {3.6801915407409143`*^9, 3.6801916609210825`*^9}, {3.680191718901163*^9, 3.680191724661172*^9}, { 3.680191798661275*^9, 3.6801918474213433`*^9}, {3.6801920336116037`*^9, 3.680192064282647*^9}, {3.680192966581046*^9, 3.680193025731129*^9}, { 3.680193071341193*^9, 3.680193073591196*^9}, {3.6801931694413304`*^9, 3.6801931716413336`*^9}, {3.680193204341379*^9, 3.680193221921404*^9}, { 3.6801932521514463`*^9, 3.680193327011551*^9}, {3.6801934502717237`*^9, 3.680193456331732*^9}, {3.6801935486538625`*^9, 3.68019367538404*^9}, { 3.6802229763031774`*^9, 3.6802230363632617`*^9}, {3.6802233314036746`*^9, 3.680223369553728*^9}, {3.6802234540458508`*^9, 3.6802234659658675`*^9}, { 3.680223573446018*^9, 3.6802236119760723`*^9}, 3.6802245810804358`*^9, { 3.680224788350726*^9, 3.680224788880727*^9}, {3.68022576742412*^9, 3.68022578184414*^9}, 3.680225916668332*^9, {3.6802259495283785`*^9, 3.680225953498384*^9}, {3.680226611300305*^9, 3.6802266283203287`*^9}, 3.6807540138389945`*^9, {3.81062018635697*^9, 3.8106202074909267`*^9}, { 3.8222736699285183`*^9, 3.8222736732804747`*^9}, 3.822276130701008*^9, 3.8222764463652487`*^9, 3.8222767096541057`*^9, 3.8222774859769135`*^9}, ExpressionUUID -> "99b3be41-1c7d-4efb-9c0f-b7e6646fae69"], Cell[BoxData[{ RowBox[{ RowBox[{ StyleBox["Input", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"ellipse", " ", "garland", " ", RowBox[{"{", RowBox[{"x", " ", "\[Element]", " ", RowBox[{ SuperscriptBox["\[DoubleStruckCapitalR]", "2"], ":", " ", RowBox[{"0.8", "\[LessEqual]", " ", RowBox[{ SubscriptBox["d", "m"], RowBox[{"(", RowBox[{"C", ",", "x", ",", "\[CapitalSigma]"}], ")"}]}], "\[LessEqual]", " ", "1"}]}]}], "}"}], " ", "with", " ", "center", " ", "C", " ", "and", " ", "covariance", " ", "matrix", " ", "\[CapitalSigma]"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[";", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ RowBox[{ StyleBox["Output", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"data", " ", "set"}], FontColor->RGBColor[0, 0, 1]]}], StyleBox[";", FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]", RowBox[{ StyleBox["Submodules", FontColor->RGBColor[1, 0, 0]], StyleBox[":", FontColor->RGBColor[1, 0, 0]], StyleBox[" ", FontColor->RGBColor[0, 0, 1]], StyleBox[ RowBox[{"dm", "[", "]"}], FontColor->RGBColor[0, 0, 1]]}], "\[IndentingNewLine]"}], "Text", CellChangeTimes->{{3.6799959272424545`*^9, 3.6799959714925165`*^9}, { 3.680187880725844*^9, 3.6801878813658447`*^9}, {3.6801879133558893`*^9, 3.6801879169258947`*^9}, {3.680188161286237*^9, 3.6801881618662376`*^9}, { 3.680188252966365*^9, 3.6801882616863775`*^9}, {3.6801883076464415`*^9, 3.680188367706526*^9}, {3.68018854232677*^9, 3.680188555186788*^9}, { 3.680188645956915*^9, 3.6801887056379986`*^9}, {3.6801889273883095`*^9, 3.680188930058313*^9}, {3.680189244018752*^9, 3.6801892847288094`*^9}, { 3.6801893580589123`*^9, 3.680189359168914*^9}, {3.680189420118999*^9, 3.6801894397690268`*^9}, {3.6801894730990734`*^9, 3.6801895437291718`*^9}, {3.6801900734149265`*^9, 3.680190086304945*^9}, { 3.6801901868050857`*^9, 3.6801903182252693`*^9}, {3.6801903981653814`*^9, 3.6801904303854265`*^9}, {3.680190477125492*^9, 3.6801906342057123`*^9}, { 3.680190665865756*^9, 3.6801906674757586`*^9}, {3.680191007020167*^9, 3.680191145620361*^9}, {3.680191176980405*^9, 3.6801912085004487`*^9}, { 3.680191325810613*^9, 3.680191412160734*^9}, {3.680191481260831*^9, 3.6801914918608456`*^9}, {3.6801915407409143`*^9, 3.6801916609210825`*^9}, {3.680191718901163*^9, 3.680191724661172*^9}, { 3.680191798661275*^9, 3.6801918474213433`*^9}, {3.6801920336116037`*^9, 3.680192064282647*^9}, {3.680192966581046*^9, 3.680193025731129*^9}, { 3.680193071341193*^9, 3.680193073591196*^9}, {3.6801931694413304`*^9, 3.6801931716413336`*^9}, {3.680193204341379*^9, 3.680193221921404*^9}, { 3.6801932521514463`*^9, 3.680193327011551*^9}, {3.6801934502717237`*^9, 3.680193456331732*^9}, {3.6801935486538625`*^9, 3.68019367538404*^9}, { 3.6802229763031774`*^9, 3.6802230363632617`*^9}, {3.6802233314036746`*^9, 3.680223369553728*^9}, {3.6802234540458508`*^9, 3.6802234659658675`*^9}, { 3.680223573446018*^9, 3.6802236119760723`*^9}, 3.6802245810804358`*^9, { 3.680224788350726*^9, 3.680224788880727*^9}, {3.68022576742412*^9, 3.68022578184414*^9}, 3.680225916668332*^9, {3.6802259495283785`*^9, 3.680225953498384*^9}, {3.680226611300305*^9, 3.6802266249203243`*^9}, { 3.6803192562639866`*^9, 3.680319259459597*^9}, {3.680323526767522*^9, 3.680323532564666*^9}, {3.681178043042704*^9, 3.6811780432927375`*^9}, { 3.8106202118283577`*^9, 3.8106202163739934`*^9}, {3.81062025582215*^9, 3.8106203134258823`*^9}, {3.810620365714431*^9, 3.8106203716352015`*^9}, { 3.8106204076250334`*^9, 3.810620442976353*^9}, 3.810643826124235*^9, 3.8222751549967785`*^9, {3.8222752111379347`*^9, 3.8222752149997272`*^9}, { 3.8222752635631237`*^9, 3.822275367832741*^9}, {3.8222754003841553`*^9, 3.822275401952034*^9}, {3.822275445902254*^9, 3.8222755044187336`*^9}, { 3.8222761666858826`*^9, 3.8222762290907154`*^9}, {3.8222762614196243`*^9, 3.822276334277472*^9}, {3.822276384690976*^9, 3.822276431989893*^9}, { 3.822276739714549*^9, 3.822276741430117*^9}, {3.822276998678588*^9, 3.822277092659856*^9}, {3.822277513514802*^9, 3.822277666539774*^9}, { 3.822305192876966*^9, 3.822305198076398*^9}, 3.822305259294031*^9}, FontSize->12, ExpressionUUID -> "cd705a8e-6091-464f-8c7d-77623549b419"], Cell[BoxData[ RowBox[{ RowBox[{"DataEllipseGarland", "[", RowBox[{ "S_", ",", "a_", ",", "b_", ",", "al_", ",", "np_", ",", "sigma_", ",", "nr_", ",", RowBox[{"Ind_:", "0"}]}], "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{"pi", ",", "pod", ",", "Del", ",", "A", ",", "Q", ",", "Nr"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"Del", "=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", "10"}], "}"}]}], "}"}]}], ";", RowBox[{"pi", "=", RowBox[{ RowBox[{"{", "}"}], "=", RowBox[{"pod", "=", RowBox[{"{", "}"}]}]}]}], ";", "\[IndentingNewLine]", RowBox[{ RowBox[{"Q", "[", "th_", "]"}], ":=", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Cos", "[", "th", "]"}], ",", RowBox[{"-", RowBox[{"Sin", "[", "th", "]"}]}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Sin", "[", "th", "]"}], ",", RowBox[{"Cos", "[", "th", "]"}]}], "}"}]}], "}"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"S", ":", " ", "center"}], ";", "\[IndentingNewLine]", "a"}], ",", " ", RowBox[{ RowBox[{"b", " ", "half", " ", "axes"}], ";", " ", "\[IndentingNewLine]", RowBox[{"np", ":", " ", RowBox[{ "number", " ", "of", " ", "points", " ", "per", " ", "unit", " ", "square"}]}], ";", "\[IndentingNewLine]", RowBox[{"sigma", ":", " ", RowBox[{ "parameter", " ", "from", " ", "the", " ", "normaln", " ", "distribution"}]}], ";", "\[IndentingNewLine]", RowBox[{"nr", ":", " ", RowBox[{ "number", " ", "of", " ", "points", " ", "generated", " ", "from", " ", "a", " ", "normal", " ", "distribution", " ", "in", " ", "the", " ", "neighborhood", " ", "of", " ", "each", " ", "data", " ", "point", " ", RowBox[{"pod", "[", RowBox[{"[", "i", "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"Ind", ":", " ", RowBox[{ RowBox[{"If", " ", "Ind"}], " ", "\[NotEqual]", " ", "0"}]}]}], ",", " ", RowBox[{ "the", " ", "results", " ", "and", " ", "the", " ", "Figure", " ", "are", " ", RowBox[{"listed", "."}]}]}], "\[IndentingNewLine]", "*)"}], " ", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"Defining", " ", "of", " ", "basic", " ", "points"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Nr", "=", RowBox[{"Floor", "[", RowBox[{"np", " ", RowBox[{"Area", "[", RowBox[{"Rectangle", "[", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Del", "[", RowBox[{"[", RowBox[{"1", ",", "1"}], "]"}], "]"}], ",", RowBox[{"Del", "[", RowBox[{"[", RowBox[{"2", ",", "1"}], "]"}], "]"}]}], "}"}], ",", RowBox[{"{", RowBox[{ RowBox[{"Del", "[", RowBox[{"[", RowBox[{"1", ",", "2"}], "]"}], "]"}], ",", RowBox[{"Del", "[", RowBox[{"[", RowBox[{"2", ",", "2"}], "]"}], "]"}]}], "}"}]}], "]"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"data", "=", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"UniformDistribution", "[", "Del", "]"}], ",", "Nr"}], "]"}]}], ";", "\[IndentingNewLine]", " ", RowBox[{"A", "=", RowBox[{ RowBox[{"Q", "[", "al", "]"}], ".", RowBox[{"{", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"a", "^", "2"}], ",", "0"}], "}"}], ",", RowBox[{"{", RowBox[{"0", ",", RowBox[{"b", "^", "2"}]}], "}"}]}], "}"}], ".", RowBox[{"Transpose", "[", RowBox[{"Q", "[", "al", "]"}], "]"}]}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{"Defining", " ", "[", "pod", "]"}], " ", "inside", " ", "of", " ", "a", " ", "circle", " ", "with", " ", "radius", " ", "r"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{".8", "^", "2"}], "\[LessEqual]", " ", RowBox[{"dm", "[", RowBox[{ RowBox[{"data", "[", RowBox[{"[", "i", "]"}], "]"}], ",", "S", ",", "A"}], "]"}], "\[LessEqual]", " ", "1"}], ",", RowBox[{"pod", "=", RowBox[{"AppendTo", "[", RowBox[{"pod", ",", RowBox[{"data", "[", RowBox[{"[", "i", "]"}], "]"}]}], "]"}]}]}], "\[IndentingNewLine]", "]"}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"i", ",", "Nr"}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{"To", " ", "each", " ", RowBox[{"pod", "[", RowBox[{"[", "i", "]"}], "]"}], " ", "nr", " ", "points", " ", "generated", " ", "from", " ", "a", " ", "normal", " ", "distribution", " ", "are", " ", "added"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"Do", "[", "\[IndentingNewLine]", RowBox[{ RowBox[{"pi", "=", RowBox[{"AppendTo", "[", RowBox[{"pi", ",", RowBox[{"RandomVariate", "[", RowBox[{ RowBox[{"MultinormalDistribution", "[", RowBox[{ RowBox[{"pod", "[", RowBox[{"[", "j", "]"}], "]"}], ",", RowBox[{"sigma", " ", RowBox[{"IdentityMatrix", "[", "2", "]"}]}]}], "]"}], ",", "nr"}], "]"}]}], "]"}]}], "\[IndentingNewLine]", ",", RowBox[{"{", RowBox[{"j", ",", RowBox[{"Length", "[", "pod", "]"}]}], "}"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"Pod", "=", RowBox[{"Union", "[", RowBox[{"pod", ",", RowBox[{"Flatten", "[", RowBox[{"pi", ",", "1"}], "]"}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", "Figure", " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"Ind", "\[NotEqual]", "0"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"slPod", "=", RowBox[{"ListPlot", "[", RowBox[{"Pod", ",", RowBox[{"PlotStyle", "\[Rule]", RowBox[{"{", RowBox[{"PointSize", "[", ".005", "]"}], "}"}]}]}], "]"}]}], ";", "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"Show", "[", RowBox[{"slPod", ",", RowBox[{"PlotRange", "\[Rule]", "Del"}], ",", RowBox[{"AspectRatio", "\[Rule]", "Automatic"}], ",", RowBox[{"Frame", "\[Rule]", "True"}], ",", RowBox[{"GridLines", "\[Rule]", "Automatic"}], ",", RowBox[{"ImageSize", "\[Rule]", "Small"}]}], "]"}], "]"}], ";"}]}], "\[IndentingNewLine]", "]"}], ";", "\[IndentingNewLine]", RowBox[{"Print", "[", RowBox[{"\"\\"", ",", RowBox[{"{", RowBox[{"S", ",", "A"}], "}"}], ",", "\"\<; Delta=\>\"", ",", "Del", ",", " ", "\"\<; |Pod|= \>\"", ",", RowBox[{"Length", "[", "Pod", "]"}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"{", "Pod", "}"}]}]}], "\[IndentingNewLine]", "]"}]}]], "Input", CellChangeTimes->{{3.8034741973219137`*^9, 3.8034748686234045`*^9}, 3.803474969583545*^9, {3.803475121933424*^9, 3.803475142349815*^9}, { 3.803475249225938*^9, 3.803475249624898*^9}, {3.8034754813321304`*^9, 3.803475718914487*^9}, {3.8034757530272493`*^9, 3.803475756244643*^9}, { 3.8034758150034738`*^9, 3.803475838184081*^9}, {3.803475959987104*^9, 3.8034760204649353`*^9}, {3.8034760975053515`*^9, 3.803476120261479*^9}, { 3.803476192159752*^9, 3.80347622743464*^9}, {3.8034762608203793`*^9, 3.8034762868816333`*^9}, {3.803476355568011*^9, 3.803476408799664*^9}, 3.803476706028537*^9, {3.8034768531227026`*^9, 3.803476895166424*^9}, 3.8036131691199603`*^9, {3.8051841419343033`*^9, 3.805184146828647*^9}, { 3.8051842069315166`*^9, 3.805184287195281*^9}, 3.8051843207450304`*^9, { 3.805193594270339*^9, 3.8051937057901516`*^9}, {3.805193764582541*^9, 3.8051938385328827`*^9}, {3.805193888282097*^9, 3.805193888929679*^9}, { 3.8051939593170605`*^9, 3.8051940055344667`*^9}, {3.805194050288586*^9, 3.8051940530615034`*^9}, {3.8051942955128593`*^9, 3.805194298902223*^9}, { 3.8054664645273275`*^9, 3.805466494384779*^9}, 3.805466796806663*^9, { 3.8222771335379515`*^9, 3.822277153067177*^9}, {3.822277184749099*^9, 3.822277267768239*^9}, {3.822277341743*^9, 3.8222773874364796`*^9}, { 3.822277419636607*^9, 3.82227747289847*^9}}, ExpressionUUID -> "44f2bc75-2ee0-4047-a7aa-a3c1984cd211"] }, Open ]] }, WindowSize->{771, 337}, WindowMargins->{{0, Automatic}, {Automatic, 3}}, FrontEndVersion->"11.0 for Microsoft Windows (64-bit) (September 21, 2016)", StyleDefinitions->"Default.nb" ] (* End of Notebook Content *) (* Internal cache information *) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[580, 22, 2540, 34, 39, "Subsubsection"], Cell[3123, 58, 4699, 92, 87, "Text"], Cell[7825, 152, 9264, 218, 715, "Input"] }, Open ]] } ] *)