5
$\begingroup$

How I can wrap the 3D vectors around the sphere surface like this one. enter image description here

My angles are

θ[x_, y_] := π (1 - Exp[-((x^2 + y^2)/R^2)]); 
ϕ[x_, y_ ] := ArcTan[x, y] - Pi/2;

With

{Cos[ϕ[x, y ]] Sin[θ[x, y]], Sin[ϕ[x, y ]] Sin[θ[x, y]], Cos[θ[x, y]]}.
$\endgroup$
  • 1
    $\begingroup$ What about a 3D vector field wherein that is the outer most orientation of the vectors then do a 3D sphere insert via Epilog or something similar? $\endgroup$ – CA Trevillian Feb 20 at 3:56
8
$\begingroup$

Create a mesh

mesh[θ_,n_]:=Table[{Cos[ϕ] Sin[θ],Sin[ϕ] Sin[θ],Cos[θ]},{ϕ,π/n,2 π,(2 π)/n}];
p={{0,1},{π/6,6},{2π/6,9},{3π/6,12},{4π/6,9},{5π/6,6},{π,1}};
points=Join[Flatten[mesh[#[[1]],#[[2]]]&/@p,1]];
  • There are 7 θ-slices: {0, π/6, 2π/6, 3π/6, 4π/6, 5π/6, π}. The number of ϕ-points in each slice is different for esthetic reasons.

  • p contains data of the form {θ,n}: how many ϕ-points is needed for each θ value.

  • points is a combined list of points where the vector field is plotted.


Define a field

field[x_,y_,z_]:=Module[{θ,ϕ},ϕ=If[x^2+y^2>0,ArcTan[x,y],0];θ=ArcTan[z,Sqrt[x^2+y^2]];
{-Sin[ϕ]Sin[θ],Cos[ϕ]Sin[θ],Cos[θ]}]

We will be plotting a skyrmion with winding number 1, as requested in the OP. Other customizations are possible. For instance one can consider higher-order skyrmions, or skyrmions with opposite topological charge---antiskyrmions.

Combine vector plot and a sphere

g1=VectorPlot3D[field[x,y,z],{x,-1,1},{y,-1,1},{z,-1,1},VectorPoints->points,VectorStyle->"Arrow3D",VectorColorFunction->Function[{x,y,z,vx,vy,vz,n},ColorData["Rainbow"][z]],Axes->False];
g2=Graphics3D[Sphere[{0,0,0},0.9]];
Show[{g1,g2},Boxed->False,ImageSize->Large]

enter image description here

Some interesting reading is here.

| improve this answer | |
$\endgroup$
  • 1
    $\begingroup$ Thank you for your answer. Also, thank you for sharing that link. $\endgroup$ – physicsu83 Feb 21 at 17:24
6
$\begingroup$

You can actually use a built-in function called SliceVectorPlot3D:

SliceVectorPlot3D[{y, -x, z}, "CenterSphere", {x, -2, 2}, {y, -2, 2}, {z, -2, 2}]

to get:

enter image description here

| improve this answer | |
$\endgroup$

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.