Hi everyone, I have a small problem with this short computation. I want to plot the electrostatic field from a plate: isolines+field. The function I want to plot is:
y := 0; Q = 1; \[Epsilon] = 1; R = 1; r := Sqrt[
x^2 + y^2]; p := Sqrt[(r + R)^2 + z^2]; n := (
4 r R)/(r + R)^2; m := (4 r R)/p^2; Ud :=
2/p (p^2*EllipticE[m] - (r^2 - R^2)*EllipticK[m] -
z^2*(r - R)/(r + R) EllipticPi[n, m] ); Ui :=
Piecewise[{{-2 \[Pi]*Abs[z], r \[LessSlantEqual] R}, {0,
r > R}}]; \[Phi] :=
1/(4 \[Pi] \[Epsilon])*Q/(\[Pi] R^2) (Ud + Ui);
GradientFieldPlot is not fully plotting in an area. It is completely white between -1<x<1 despite exclusions options.
GradientFieldPlot[-\[Phi], {x, -2, 2}, {z, -2, 2},
Exclusions -> {Abs[x] == 1}, PlotPoints -> 50, Contours -> 20,
ColorFunction -> (ColorData["RedBlueTones"][1 - #] &),
ContourStyle -> White, Frame -> True, FrameLabel -> {"x", "z"},
ClippingStyle -> Automatic, Axes -> False, StreamStyle -> Orange,
Epilog -> {Thickness[0.006], Line[{{-1, 0}, {1, 0}}]}]
But ContourPlot is working perfectly.
ContourPlot[\[Phi], {x, -2, 2}, {z, -2, 2},
Exclusions -> {Abs[x] == 1}, Contours -> 30,
ColorFunction -> (ColorData["RedBlueTones"][1 - #] &),
PlotPoints -> 200,
Epilog -> {Thickness[0.006], Line[{{-1, 0}, {1, 0}}]},
FrameLabel -> {x, z}]
I don't understand the differences and how I can fix this issue in the gradientfieldplot. Thanks in advance for the support.