I'm trying to use NDSolve to get a notion of the electric field around a uniform torus of density 1 (for simplicity) using Maxwell's equations. I'm running into some trouble.
R = 3;
r = 1;
densityDist[x_, y_, z_] := If[(R - Sqrt[x^2 + y^2])^2 + z^2 < r^2, 1, 0];
Ef[x_, y_, z_] =
Module[{Ef},
Ef[x_, y_, z_] := {Ex[x, y, z], Ey[x, y, z], Ez[x, y, z]};
Ef[x, y, z] /.
NDSolve[
{Div[Ef[x, y, z], {x, y, z}] == densityDist[x, y, z],
Ef[0, 0, 0] == {0, 0, 0}},
Ef[x, y, z],
{x, -6, 6}, {y, -6, 6}, {z, -6, 6}]]
But I get
NDSolve::underdet: There are more dependent variables, {Ex[x, y, z], Ey[x, y, z], Ez[x, y, z]}, than equations, so the system is underdetermined.
Any clues of what other conditions I can put in?