#Plot of the electric field. That's where It beginns to be diffiult... I would like to use ListVectorPlotListVectorPlot, but I do not get the desired result. I define a list:
{{x,y},{totalElectricFieldComponent[x],toatalElectricFieldComponent[y]}}
{{x,y}, {totalElectricFieldComponent[x], toatalElectricFieldComponent[y]}}
Where {x,y}: Point location in 2D Space
and {totalElectricFieldComponent[x],toatalElectricFieldComponent[y] toatalElectricFieldComponent[y]}: Electric field vector at point {x,y}.
I would like to have the electric field vectors corresponding totto the chosen points in space to start at those points. --> But the result is not like an electric field of a charged semi-cirle But the result is not like an electric field of a charged semi-circle.
Definition of constants
ϵ=8.8541878176*10^−12; q=5;
n=20; (* Number of point charges *)
aStep=Pi/(2n); ( Angle Step Every n angle there is a point charge *)
R=1; (* Radius of half circle *)
Defintion of geometry:
rX = Table[R*Sin[Pi/2 - a], {a, -Pi/2, Pi/2, aStep}];
rY = Table[R*(1 + Cos[Pi/2 - a]), {a, -Pi/2, Pi/2, aStep}];
r = Transpose[{rX, rY}];
geometry = PlotRange -> {{0, R}, {0, R*2}}]

ϵ = 8.8541878176*10^−12; q = 5; n = 20; (* Number of point charges *) aStep = Pi/(2*n); (* Angle Step Every n angle there is a point charge *) R = 1; (* Radius of half circle *) rX = Table[R*Sin[Pi/2 - a], {a, -Pi/2, Pi/2, aStep}]; rY = Table[R*(1 + Cos[Pi/2 - a]), {a, -Pi/2, Pi/2, aStep}]; r = Transpose[{rX, rY}]; geometry = PlotRange -> {{0, R}, {0, R*2}}]
Calculation of the electric field at every point {x,y} in 2D space:
Subscript[r, i]$r_i$ is the vector of the point charge rcharge; $r$ is the vector to the point in 2D (or also 3D) space where we want to calculate the electric field.
Clear[x, y, i] (local variables)
np = 5; (Number of points to evaluate the electric field)
eX[x_] := 1/(4Pi[Epsilon])q Table[(x - rX[[m]])/(Norm[x - rX[[m]] ])^3, {m, 1, n}];
eY[y_] := 1/(4Pi[Epsilon])q Table[(y - rY[[m]])/(Norm[y - rY[[m]] ])^3, {m, 1, n}];
Clear[x, y, i] (*local variables*) np = 5; (*Number of points to evaluate the electric field*) eX[x_] := 1/(4*Pi*ϵ)*q*Table[(x - rX[[m]])/(Norm[x - rX[[m]] ])^3, {m, 1, n}]; eY[y_] := 1/(4*Pi*ϵ)*q*Table[(y - rY[[m]])/(Norm[y - rY[[m]] ])^3, {m, 1, n}];
The x- and y component of the electric fields produced by each point charge q at (The x- and y component of the electric fields produced by each
point charge q at (rX,rY), at point (x,y)in 2D space, are put into a
listrX,rY), at point (x,y)in 2D space, are put into a list.
totalElectricFieldComponentX[x_] := N[Sum[Part[eX[x], i], {i, 1, n}]];
totalElectricFieldComponentY[y_] := N[Sum[Part[eY[y], i], {i, 1, n}]];
totalElectricFieldComponentX[x_] := N[Sum[Part[eX[x], i], {i, 1, n}]]; totalElectricFieldComponentY[y_] := N[Sum[Part[eY[y], i], {i, 1, n}]];
(*Sum Sum of the Electric fields produced by each point charge at point
point (x,y) *).
pointsX = {0.01, 0.2, 0.5, 0.7, 0.8};
pointsY = {0.01, 0.5, 1, 1.5, 1.7};
pointsX = {0.01, 0.2, 0.5, 0.7, 0.8}; pointsY = {0.01, 0.5, 1, 1.5, 1.7};
(Points where the electric field should be evealuated [Rule]
Choosen by hand for now) Points where the electric field should be evealuated; Chosen by hand for now.
dataVectorPlot = Table[{{pointsX[[i]], pointsY[[i]]}, {totalElectricFieldComponentX[i], totalElectricFieldComponentY[i]}}, {i, 1, np}];
dataVectorPlot = Table[{{pointsX[[i]], pointsY[[i]]}, {totalElectricFieldComponentX[i], totalElectricFieldComponentY[i]}}, {i, 1, np}];
({{x,y},{totalElectricField[x],toatalElectricField[y]}}) Finally, this generates the plot and highlights the problem:
Show[geometry, ListVectorPlot[dataVectorPlot]] (* HERE IS THE PROBLEM !! *)
Show[geometry, ListVectorPlot[dataVectorPlot]]
[
