Wolfram 语言

立体可视化

静电势

带相反电荷的两点之间的静电势产生的力矢量场.

显示完整的 Wolfram 语言输入
In[1]:=
Click for copyable input
ElectroStaticPotential[ql_, pl_, r_] := Sum[ ql[[i]]/Norm[r - pl[[i]]], {i, Length[ql]}]
In[2]:=
Click for copyable input
v = Simplify[ ElectroStaticPotential[{1, -1}, {{-1, -1, 0}, {1, 1, 0}}, {x, y, z}], {x, y, z} \[Element] Reals];
In[3]:=
Click for copyable input
field = -Grad[v, {x, y, z}];
In[4]:=
Click for copyable input
SliceVectorPlot3D[Clip[field], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}, PlotTheme -> "Scientific", ImageSize -> 500]
Out[4]=

看一下等势面附近的场,可以看出点之间的场更强.

In[5]:=
Click for copyable input
SliceVectorPlot3D[ Clip[field], {v == -0.5, v == 0.5}, {x, -2.5, 2.5}, {y, -2.5, 2.5}, {z, -2.5, 2.5}, PlotTheme -> "Scientific", ImageSize -> 500]
Out[5]=

相关范例

de en es fr ja ko pt-br ru