8
$\begingroup$

I am a Mathematica V8 user.

I found a very beautiful 3D vector plot on the Internet. I don't think it was created in Mathematica, but I'd like to reproduce it with Mathematica.

enter image description here

How to do that?


EDIT

This image originates from an article by FZ Jülich with further details available in Nature and depicts a skyrmion. In particular, the explicit parametrization of the spins is given by

{x, y, z} ==
  {
    Cos[m ϕ + γ] Sin[θ[r]],
    Sin[m ϕ + γ] Sin[θ[r]],
    Cos[θ[r]]
  }

where r and ϕ are polar coordinates and θ[r] is the polar angle of the spin as a function of radial coordinate. θ[r] is further parametrized as

θ[r] == Pi + ArcSin@Tanh[(r - c)/w] + ArcSin@Tanh[(r + c)/w]

where c and w are magnetic field dependent parameters (see the supplementary materials in the linked article for details).


For Example, this vector function is a good example,

k := {kx, ky}
d := 4
R1 := {1/Sqrt[3], 0}
R2 := {-1/(2*Sqrt[3]), 1/2}
R3 := {-1/(2*Sqrt[3]), -1/2}
f := Exp[I*k.R1] + Exp[I*k.R2] + Exp[I*k.R3]
Spin = Normalize@{(2*(-Sqrt[d^2/4 + Abs[f]^2] - d/2))/(Abs[f]^2 + (Sqrt[d^2/4 + Abs[f]^2] + d/2)^2) Re[f], (2*(Sqrt[d^2/4 + Abs[f]^2] + d/2))/(Abs[f]^2 + (Sqrt[d^2/4 + Abs[f]^2] + d/2)^2) Im[f], 1};

But if we code simply, the 3D vector plot is not so cool.

VectorPlot3D[Spin, {kx, -2 Pi, 2 Pi}, {ky, -2 Pi, 2 Pi}, {kz, -Pi,Pi},
VectorPoints -> {18, 18, 3}, VectorScale -> 0.05,
VectorColorFunction->Function[{kx, ky, kz, vx, vy, vz, n},
ColorData["ThermometerColors"][vz]],
RegionFunction -> ((-.1 < #3 < .1) &),
Boxed -> False,
Axes -> None]

How should we do?

enter image description here

$\endgroup$
  • 3
    $\begingroup$ "I found very beautiful 3d vector plot on the Internet." - then, link to it, please. $\endgroup$ – J. M. will be back soon Sep 20 '17 at 6:36
  • 2
    $\begingroup$ To J.M. here is the link. learnabouttravelmaps.info/pics/g/germanene-zandvliet.html $\endgroup$ – Sakurai.JJ Sep 20 '17 at 7:36
  • 2
    $\begingroup$ @J.M. with some google-fu I found that this is a representation of a skyrmion from FZ Jülich and published in Nature. Some reading through the article can give us the proper parametrization of the spins. $\endgroup$ – LLlAMnYP Sep 20 '17 at 11:45
  • 1
    $\begingroup$ Thank you for finding and including the link, @LLlAMnYP. I hope the OP would do this him/herself for his/her future questions. $\endgroup$ – J. M. will be back soon Sep 20 '17 at 12:37
  • 1
    $\begingroup$ @J.M in this case it requires relevant domain knowledge plus access to Nature. That's why strangers from the internet are necessary :-) $\endgroup$ – LLlAMnYP Sep 20 '17 at 13:06
26
$\begingroup$

Nice "inverse problem". The angle distribution looks to me like a Gaussian.

ϕ[x_, y_, z_] := (Pi Exp[-Dot[{x, y}, {x, y}]/2] - Pi/2);
V[x_, y_, z_] := Evaluate[Simplify[ComplexExpand[-RotationMatrix[ϕ[x, y, z], {y, -x, 0}].{x, y, 0}/Sqrt[{x, y}.{x, y}]]]];
V[0, 0, z_] := {0, 0, -1};
R = Pi; 
P = Select[Flatten[Table[Table[{x, y, 0}, {y, -R, R, R/20}],{x, -R, R, R/20}], 1], X \[Function] -R <= X[[1]] - X[[2]] <= R];
P = Transpose[{{1, -1/2, 0}, {0, Sqrt[3]/2, 0}, {0, 0, 1}}.Transpose[P]];
colfun[x_, y_, z_] := Evaluate[Simplify[ColorData["TemperatureMap"][(Pi/2 - ϕ[x, y, z])/Pi]]];
arrow[p1_, p2_] := {EdgeForm[], FaceForm[colfun @@ p1], Cone[{p1, p2}, 1/24]};
Show[
 Graphics3D[{arrow @@@ Transpose[{P, P + 1/4 V @@@ P}]}],
 PlotRange -> All,
 Lighting -> "Neutral",
 Boxed -> False
 ]

enter image description here

$\endgroup$
  • $\begingroup$ From here we can find the radial profile theta, where Cos[theta] is the z-component of the spin to be Pi + ArcSin@Tanh[(r - c)/w] + ArcSin@Tanh[(r + c)/w] where c and w are magnetic-field dependent parameters. $\endgroup$ – LLlAMnYP Sep 20 '17 at 12:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.