Bug introduced in 7.0, persisting through 13.2.
So i am trying to plot the magnetic vector field surrounding a "flat conducting cable" (don't know the proper english expression).
This is the "code" (there are some constants in the analytic formulas, which I have excluded for the sake of clarity):
VectorPlot[{Piecewise[{{ArcTan[y/(x + 3)] - (Pi - ArcTan[y/(x - 3)]),
Abs[x] < 3}},
ArcTan[y/(x + 3)] - ArcTan[y/(x - 3)]],
Log[Sqrt[(y^2 + (x + 3)^2)]/Sqrt[(y^2 + (x - 3)^2)]]},
{x, -10, 10}, {y, -10, 10}]
The error message I get is the following:
Part::partw: Part 1 of {} does not exist. >>
I am not sure whether Piecewise can be used with VectorPlot at all since I haven't managed to find a syntactic, so that is probably where the problem lies. (I have managed to plot the separate functions, basically I am experiencing problems implementing Piecewise into the code.)
Thank you very much!