I want to plot transition dipole moment vectors at their respective positions. For example, given a transition dipole moment with position vector R
, I want to draw a vector at the coordinates of R
, which represents the transition dipole moment itself.
I want to create a structure which looks like the figure shown here.
For the simplest case I tried a situation in which all the dipole vectors are parallel along the z-axis. The vectors are positioned in a cylindrical structure. This cylinder is made of 20 rings or stack and each stack has 4 transition dipole moment.
This structure resembles the structure of a Chlorosome which some bacteria use to harvest light energy and do photosynthesis. The positions of these transition dipole moments I'm interested in are the positions for bacterichlorophylls I'd like to visualize.
I tried the following code to generate a plot:
teta = 0;
fi = 0;
\[Mu][i_, j_] :=
Evaluate[Chop[
N[Sqrt[30.0]*{Sin[teta]*Cos[fi], Sin[teta]*Sin[fi], Cos[teta]}],
10^-6]];(*Transition dipole moments*)
R[i_, j_] := ({26.82 Cos[(2 Pi)/4.0 i], 26.82 Sin[(2 Pi)/4.0 i],
10 j})(*Position vector of each transition dipole moment*)
dataset =
Flatten[Table[{R[i, j], \[Mu][i, j]}, {i, 1, 4}, {j, 1, 20}], 1];
dataset // Dimensions
{80, 2, 3}
ListVectorPlot3D[dataset]
It returns:
I think this may be because my Dataset
has points like:
{{0, 26.82, 10}, {0, 0, 5.477225575051661}}
which have one zero element. How can I represent those vectors at the positions determined? I'm using Mathematica 9.
Edit
I also tried to mimic what documentation provide as an example:
vectors =
Table[{{x, y, z}, {Sin[x], Cos[y], Sin[z]}}, {x, 1.0, 2,
1}, {y, -1.0, 0, 1}, {z, -1.0, 0, 1}];
returns:
Two points:
1- I could not export the image in jpeg format. I used PDF format.
2- I have no idea why there are so many vectors in the image while the number of positions and vectors are few in the vectors
Then I changed the code a little bit:
vectors =
Table[{{x, y, x+y}, {Sin[x], Cos[y], Sin[z]}}, {x, 1.0, 2,
1}, {y, -1.0, 0, 1}, {z, -1.0, 0, 1}];
I changed z
to x+y
. If I plot this it returns an empty cube.
Does anybody know the cause of this?
ListVectorPlot3D
isn't working right, you can do 2 things: first, file a bug report at Wolfram Tech support (and maybe point out thatListVectorPlot3D[RandomReal[{0, 1}, {10, 2, 3}]]
doesn't work, even though the documentation says it should), and second, you can create your own version of the plot you want usingGraphics3D
primitives, by assembling a bunch ofArrow
objects. Are you familiar enough with Mathematica graphics to do this? If not, then I can help show you how to do this. $\endgroup$dataset
should be a three dimensional array of vector field values, i.e.dataset //Dimensions
should be like{l,m,n,3}
. No bug here in my opinion, thought the documentation could be better. $\endgroup$