Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* Content-type: application/vnd.wolfram.cdf.text *)
- (*** Wolfram CDF File ***)
- (* http://www.wolfram.com/cdf *)
- (* CreatedBy='Mathematica 9.0' *)
- (*************************************************************************)
- (* *)
- (* The Mathematica License under which this file was created prohibits *)
- (* restricting third parties in receipt of this file from republishing *)
- (* or redistributing it by any means, including but not limited to *)
- (* rights management or terms of use, without the express consent of *)
- (* Wolfram Research, Inc. For additional information concerning CDF *)
- (* licensing and redistribution see: *)
- (* *)
- (* www.wolfram.com/cdf/adopting-cdf/licensing-options.html *)
- (* *)
- (*************************************************************************)
- (*CacheID: 234*)
- (* Internal cache information:
- NotebookFileLineBreakTest
- NotebookFileLineBreakTest
- NotebookDataPosition[ 1063, 20]
- NotebookDataLength[ 3895, 123]
- NotebookOptionsPosition[ 4556, 123]
- NotebookOutlinePosition[ 4901, 138]
- CellTagsIndexPosition[ 4858, 135]
- WindowFrame->Normal*)
- (* Beginning of Notebook Content *)
- Notebook[{
- Cell[BoxData[
- RowBox[{"Manipulate", "[", "\[IndentingNewLine]",
- RowBox[{
- RowBox[{
- RowBox[{"pts", "=",
- RowBox[{
- RowBox[{
- RowBox[{"{",
- RowBox[{
- RowBox[{"Re", "@", "#"}], ",",
- RowBox[{"Im", "@", "#"}]}], "}"}], "&"}], "/@",
- RowBox[{"Table", "[",
- RowBox[{
- RowBox[{"E", "^",
- RowBox[{"(",
- RowBox[{"2", "I", " ", "Pi", " ",
- RowBox[{"r", "/", "n"}]}], ")"}]}], ",",
- RowBox[{"{",
- RowBox[{"r", ",", "0", ",",
- RowBox[{"n", "-", "1"}]}], "}"}]}], "]"}]}]}], ";",
- "\[IndentingNewLine]",
- RowBox[{"f", "[",
- RowBox[{"iters", ",",
- RowBox[{"{",
- RowBox[{"{",
- RowBox[{"0", ",", "0"}], "}"}], "}"}], ",", "r", ",", "pts"}], "]"}],
- ";", "\[IndentingNewLine]",
- RowBox[{"Column", "@",
- RowBox[{"{",
- RowBox[{
- RowBox[{"Text", "[",
- RowBox[{"\"\<n = \>\"", "<>", " ",
- RowBox[{"ToString", "@", "n"}]}], "]"}], ",",
- RowBox[{"Text", "[",
- RowBox[{"\"\<r = \>\"", "<>", " ",
- RowBox[{"ToString", "@", "r"}]}], "]"}], ",",
- RowBox[{"Text", "[",
- RowBox[{"\"\<Iters = \>\"", "<>", " ",
- RowBox[{"ToString", "@", "iters"}]}], "]"}], ",",
- RowBox[{"Graphics", "[",
- RowBox[{
- RowBox[{"{",
- RowBox[{
- RowBox[{"AbsolutePointSize", "[", "1", "]"}], ",",
- RowBox[{"Point", "@", "k"}]}], "}"}], ",",
- RowBox[{"ImageSize", "\[Rule]", "600"}]}], "]"}]}], "}"}]}]}], ",",
- "\[IndentingNewLine]",
- RowBox[{"{",
- RowBox[{
- RowBox[{"{",
- RowBox[{"n", ",", "3"}], "}"}], ",", "3", ",", "8", ",", "1"}], "}"}],
- ",", "\[IndentingNewLine]",
- RowBox[{"{",
- RowBox[{
- RowBox[{"{",
- RowBox[{"r", ",", ".5"}], "}"}], ",", "0", ",", "1"}], "}"}], ",",
- "\[IndentingNewLine]",
- RowBox[{"{",
- RowBox[{
- RowBox[{"{",
- RowBox[{"iters", ",", "1000"}], "}"}], ",", "1000", ",", "20000"}],
- "}"}], ",", "\[IndentingNewLine]",
- RowBox[{"TrackedSymbols", "\[Rule]",
- RowBox[{"{",
- RowBox[{"n", ",", "r", ",", "iters"}], "}"}]}], ",",
- "\[IndentingNewLine]",
- RowBox[{"Initialization", "\[RuleDelayed]",
- RowBox[{"(", "\[IndentingNewLine]",
- RowBox[{
- RowBox[{"f", "[",
- RowBox[{"n_", ",", "s_", ",", "r_", ",", "p_"}], "]"}], ":=",
- RowBox[{"(",
- RowBox[{
- RowBox[{"k", "=", "s"}], ";", "\[IndentingNewLine]",
- RowBox[{"Do", "[",
- RowBox[{
- RowBox[{"AppendTo", "[",
- RowBox[{"k", ",",
- RowBox[{
- RowBox[{
- RowBox[{"k", "[",
- RowBox[{"[",
- RowBox[{"-", "1"}], "]"}], "]"}], " ",
- RowBox[{"(",
- RowBox[{"1", "-", "r"}], ")"}]}], " ", "+", " ",
- RowBox[{"r", " ",
- RowBox[{"RandomChoice", "@", "p"}]}]}]}], "]"}], ",",
- RowBox[{"{", "n", "}"}]}], "]"}]}], ")"}]}], ")"}]}]}],
- "\[IndentingNewLine]", "]"}]], "Input"]
- },
- WindowSize->{851, 655},
- WindowMargins->{{168, Automatic}, {Automatic, 60}},
- FrontEndVersion->"9.0 for Microsoft Windows (32-bit) (January 25, 2013)",
- StyleDefinitions->"Default.nb"
- ]
- (* End of Notebook Content *)
- (* Internal cache information *)
- (*CellTagsOutline
- CellTagsIndex->{}
- *)
- (*CellTagsIndex
- CellTagsIndex->{}
- *)
- (*NotebookFileOutline
- Notebook[{
- Cell[1463, 33, 3089, 88, 292, "Input"]
- }
- ]
- *)
- (* End of internal cache information *)
- (* NotebookSignature 3uTy#CsucPn1EBwGswVJLU40 *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement