Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ContourPlot[Im[Sqrt[(Tanh[x + I*y] - Tanh[2 x + I*2 y])^2 + (Tanh[x + I*y]
- Tanh[2 x + I*2 y] + 1)^2-1 - 2 ((Tanh[x + I*2 y])^2)((Tanh[x + I*y])^2) ]],
- {x, -10, 10}, {y, -10, 10}, AxesLabel -> Automatic,ContourShading -> Automatic,
- ColorFunction -> "Rainbow", Contours -> 20]
- ContourPlot[Re[Sqrt[(Tanh[x + I*y] - Tanh[2 x + I*2 y])^2 + (Tanh[x + I*y]Tanh[2 x + I*2 y] + 1)^2 - 1 - 2 ((Tanh[x + I*2 y])^2) ((Tanh[x + I*y])^2) ]],
- {x, -10, 10}, {y, -10, 10}, AxesLabel -> Automatic,
- ContourShading -> Automatic, ColorFunction -> "Rainbow", Contours -> 20]
- expr = Sqrt[(Tanh[z]-Tanh[2z])^2+(Tanh[z] Tanh[2z]+1)^2-1-2 Tanh[z]^2Tanh[2z]^2];
- pts = ComplexAnalysis`BranchPoints[expr, z]
- Simplify[pts, C[1] ∈ Integers]
- ComplexAnalysis`BranchCuts[expr, z]
- With[{z = x + I y},
- expr = (Tanh[z] - Tanh[2 z])^2 + (Tanh[z] Tanh[2 z] + 1)^2 - 1 - 2 ((Tanh[2 z])^2) ((Tanh[z])^2);
- branchCutRegion[x_, y_, __] = Re[expr] <= 0;
- ];
- bpvals = Union[{x, y} /. Solve[(expr == 0 || 1/Together[TrigToExp[expr]] == 0) && -10 < x < 10 && -10 < y < 10, {x, y}]];
- ContourPlot[Im[expr] == 0, {x, -10, 10}, {y, -10, 10},
- RegionFunction -> branchCutRegion, PlotPoints -> 100,
- Epilog -> {Red, Point[bpvals]}
- ]
- binnedabs = Compile[{{z, _Complex}},
- Module[{f, abs, rnd, sgn, val},
- f = (Tanh[z] - Tanh[2 z])^2 + (Tanh[z] Tanh[2 z] + 1)^2 - 1 - 2 Tanh[2 z]^2 Tanh[z]^2;
- abs = Abs[f];
- rnd = Round[abs, .2];
- val = If[rnd == 0, f, rnd Sign[f]];
- {
- Divide[Mod[Arg[val], 2π], 2π],
- Power[1 + 0.3*Log[Abs[val] + 1], -1],
- Power[1 + 0.5*Log[Abs[val] + 1], -1]
- }
- ],
- CompilationTarget -> "C",
- Parallelization -> True,
- RuntimeAttributes -> {Listable},
- RuntimeOptions -> "Speed"
- ];
- lattice = Array[List, {2048, 2048}, {{-10., 10.}, {-10., 10.}}].{I, 1};
- raster = Raster[binnedabs[lattice], {{-10, -10}, {10, 10}}, ColorFunction -> Hue];
- cutplot = ContourPlot[Im[expr] == 0, {x, -10, 10}, {y, -10, 10},
- RegionFunction -> branchCutRegion, PlotPoints -> 100, ContourStyle -> Black];
- Show[
- cutplot,
- ImageSize -> 800,
- Prolog -> raster,
- Epilog -> {EdgeForm[Black], GrayLevel[.8], Disk[#, Scaled[.0045]] & /@ bpvals}
- ]
- exprz = (Tanh[z] - Tanh[2 z])^2 + (Tanh[z] Tanh[2 z] + 1)^2 - 1 - 2 ((Tanh[2 z])^2) ((Tanh[z])^2);
- exprxy = exprz /. z -> x + I y;
- branchCutRegion[x_, y_, __] = Re[exprxy] <= 0;
- bpvals = Union[{x, y} /. Solve[(expr == 0 || 1/Together[TrigToExp[expr]] == 0) && -10 < x < 10 && -10 < y < 10, {x, y}]];
- domaincoloring = ComplexPlot[exprz, {z, -10 - 10 I, 10 + 10 I},
- ColorFunction -> "CyclicLogAbsArg", ImageSize -> 800];
- cutplot = ContourPlot[Im[exprxy] == 0, {x, -10, 10}, {y, -10, 10},
- RegionFunction -> branchCutRegion, PlotPoints -> 100, ContourStyle -> Black];
- Show[
- domaincoloring,
- cutplot,
- Epilog -> {EdgeForm[Black], GrayLevel[.8], Disk[#, Scaled[.0045]] & /@ bpvals}
- ]
- domaincoloring = ComplexPlot[exprz, {z, -10 - 10 I, 10 + 10 I},
- ColorFunction -> {Hue[Divide[Mod[#8, 2π], 2π],
- Power[1 + 0.3*Log[#7 + 1], -1],
- Power[1 + 0.5*Log[#7 + 1], -1]] &, None},
- ColorFunctionScaling -> False,
- Exclusions -> None,
- ImageSize -> 800
- ];
- myexp = Together[
- TrigToExp[
- FullSimplify[(Tanh[z] - Tanh[2 z])^2 + (Tanh[z] Tanh[2 z] + 1)^2 -
- 1 - 2 Tanh[z]^2 Tanh[2 z]^2]
- ]]
- Expand[Numerator[
- Together[TrigToExp[
- FullSimplify[(Tanh[z] - Tanh[2 z])^2 + (Tanh[z] Tanh[2 z] +
- 1)^2 - 1 - 2 Tanh[z]^2 Tanh[2 z]^2]
- ]]]]
- mySol = z /.
- Solve[1 + 2 z^2 + 3 z^4 - 12 z^6 + 3 z^8 + 2 z^10 + z^12 == 0, z];
- p1 = Show[
- Graphics[{Red,
- Point @@ {{Re[#], Im[#]} & /@ (N[Log[#]] & /@ mySol)}}],
- Axes -> True, PlotRange -> 5];
- p2 = Show[
- Graphics[{Blue,
- Point @@ {{Re[#], Im[#]} & /@ (N[(Log[#] + 2 [Pi] I)] & /@
- mySol)}}], Axes -> True, PlotRange -> 15];
- p3 = Show[
- Graphics[{Green // Darker,
- Point @@ {{Re[#], Im[#]} & /@ (N[(Log[#] - 2 [Pi] I)] & /@
- mySol)}}], Axes -> True, PlotRange -> 15];
- Show[{p1, p2, p3}, PlotRange -> 15]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement