電荷エネルギー挿絵のポテンシャル

関数の定義

r[x_,y_]:=(Sqrt[(x^2)+(y^2)]);

単一電荷のポテンシャル

Clear[x,y,h];h=1.5;q=0.1;reg=5;
v[x_,y_]:=-(q/(r[x+h,y]));
Vx = D[v[x,y], x];Vy = D[v[x,y], y];

contorpoints=Table[n,{n,-2,2,0.05}];
w6=ContourPlot[v[x,y],{x,-reg, reg}, {y, -reg, reg},
Frame->False,
Contours->contorpoints,
PlotRange->{-0.3,0.3},
MaxRecursion->3,
ContourShading->None,
ContourStyle->{{RGBColor[0,0,153/256],Thickness[0.001]}}
]

複数電荷のポテンシャル

Clear[x,y,h];h=1.5;q=0.1;reg=5;
v[x_,y_]:=((1.5 q)/(r[x-h,y-h/1.8]))-(q/(r[x+h,y]));
Vx = D[v[x,y], x];Vy = D[v[x,y], y];

contorpoints=Table[n,{n,-2,2,0.05}];
w6=ContourPlot[v[x,y],{x,-reg, reg}, {y, -reg, reg},
Frame->False,
Contours->contorpoints,
PlotRange->{-0.3,0.3},
MaxRecursion->3,
ContourShading->None,
ContourStyle->{{RGBColor[0,0,153/256],Thickness[0.001]}}
]