I tired visualizing the field lines of the electric field of two point charges (one positive, one negative) but whenever I try to do a ParametricPlot I just receive an empty plot as output (no errors). When I execute the same program on the PC of a friend it works without problems and did the plot like it was supposed to do. Does anybody have an idea why this happens and how it can be solved?
The field line is plotted from a given point parametrized over its own length and calculated with NDSolve and when I checked the output tables it was filled with values that seemed to be correct, just the plotting doesn't work.
Here's my code:
phi1[x_, y_, z_] := (1/Sqrt[(x - 1)^2 + (y - 1)^2 + z^2]) - (1/
Sqrt[(x + 1)^2 + (y + 1)^2 + z^2]);
f1[x_, y_, z_] = Grad[phi1[x, y, z], {x, y, z}];
g1[x_, y_, z_] = f1[x, y, z]/Norm[f1[x, y, z]];
FieldLineFW[f_, r0_ , smax_] := NDSolve[{
rx'[s] == f[rx[s], ry[s], rz[s]][[1]],
ry'[s] == f[rx[s], ry[s], rz[s]][[2]],
rz'[s] == f[rx[s], ry[s], rz[s]][[3]] ,
rx[0] == r0[[1]],
ry[0] == r0[[2]],
rz[0] == r0[[3]]},
{rx, ry, rz}, {s, 0, smax}, AccuracyGoal -> 2];
FieldLineBW[f_, r0_ , smax_] := NDSolve[{
rx'[s] == -f[rx[s], ry[s], rz[s]][[1]],
ry'[s] == -f[rx[s], ry[s], rz[s]][[2]],
rz'[s] == -f[rx[s], ry[s], rz[s]][[3]] ,
rx[0] == r0[[1]],
ry[0] == r0[[2]],
rz[0] == r0[[3]]},
{rx, ry, rz}, {s, 0, smax}, AccuracyGoal -> 2];
maxT=6;
ParametricPlot3D[
Evaluate[
Join[ParallelTable[
{rx[t], ry[t], rz[t]} /.
FieldLineFW[g1, {x , y , z }, maxT], {x, {-3, -1, 0, 1,
3}}, {y, {-0.5, 0, 0.1, 0.5, 2}}, {z, {-0.5, 0.1, 0.5, 2}}
], ParallelTable[
{rx[t], ry[t], rz[t]} /.
FieldLineBW[g1, {x , y , z }, maxT], {x, {-3, -1, 0, 1,
3}}, {y, {-0.5, 0, 0.1, 0.5, 2}}, {z, {-0.5, 0.1, 0.5, 2}}
]]
], {t, 0, maxT}, AxesLabel -> {"x/[m]", "y/[m]", "z/[m]"}]
The error also occurred when I used Table instead of ParallelTable but it did not occur when I just used a single point to plot the field line (but a plot with just one field line is not very helpful). I hope somebody had a similar problem and could solve it or anybody knows why this issue appears on my machine but not on others.
I am using the Student Edition of Mathematica 11.2.0 and I work with macOS 10.13.2 High Sierra and Ubuntu 17.10 (neither Mac nor Ubuntu worked, I also tried evaluating it on Windows in a virtual machine, didn't work either). As said in the beginning it did work on a friend's PC (Windows 10) and also at the PCs at university (Debian 8) it worked.
Thanks in advance!